/*
+ * $Id: afp_asp.c,v 1.6 2001-07-31 19:50:14 srittau Exp $
+ *
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
* modified from main.c. this handles afp over asp.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#ifndef NO_DDP
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <syslog.h>
+#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
#include <netatalk/endian.h>
#include <atalk/atp.h>
while ((reply = asp_getrequest(asp))) {
switch (reply) {
case ASPFUNC_CLOSE :
+ if (obj->options.authprintdir) {
+ char addr_filename[256];
+ struct stat cap_st;
+
+ sprintf(addr_filename, "%s/net%d.%dnode%d", obj->options.authprintdir,
+ ntohs( asp->asp_sat.sat_addr.s_net )/256,
+ ntohs( asp->asp_sat.sat_addr.s_net )%256,
+ asp->asp_sat.sat_addr.s_node );
+
+ if(stat(addr_filename, &cap_st) == 0) {
+ if(unlink(addr_filename) == 0) {
+ syslog(LOG_INFO, "removed %s", addr_filename);
+ } else {
+ syslog(LOG_INFO, "error removing %s: %m", addr_filename);
+ }
+ } else {
+ syslog(LOG_INFO, "error stat'ing %s: %m", addr_filename);
+ }
+ }
+
afp_asp_close(obj);
syslog( LOG_INFO, "done" );
+
if ( obj->options.flags & OPTION_DEBUG ) {
printf( "done\n" );
}
}
writtenfork = NULL;
}
-#endif AFS
+#endif /* AFS */
func = (u_char) asp->commands[0];
if ( obj->options.flags & OPTION_DEBUG ) {
printf( "command: %d\n", func );
if ( obj->options.flags & OPTION_DEBUG ) {
#ifdef notdef
pdesc( stdout );
-#endif notdef
+#endif /* notdef */
of_pforkdesc( stdout );
fflush( stdout );
}