/*
- * $Id: afp_asp.c,v 1.27 2009-10-25 07:18:11 didg Exp $
+ * $Id: afp_asp.c,v 1.29 2010-03-09 06:55:12 franklahm Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
#include <atalk/asp.h>
#include <atalk/compat.h>
#include <atalk/util.h>
+#include <atalk/globals.h>
-#include "globals.h"
#include "switch.h"
#include "auth.h"
#include "fork.h"
memset( addr_filename_buff, 0, 256 );
- if(stat(addr_filename, &cap_st) == 0) {
+ if(lstat(addr_filename, &cap_st) == 0) {
if( S_ISREG(cap_st.st_mode) ) {
int len;
int capfd = open( addr_filename, O_RDONLY );
if ((len = read( capfd, addr_filename_buff, 256 )) > 0) {
int file_pid;
char *p_filepid;
- close(capfd);
addr_filename_buff[len] = 0;
if ( (p_filepid = strrchr(addr_filename_buff, ':')) != NULL) {
*p_filepid = '\0';
} else {
LOG(log_info, logtype_afpd, "couldn't read data from %s", addr_filename );
}
+ if (capfd != -1)
+ close(capfd);
} else {
LOG(log_info, logtype_afpd, "%s is not a regular file", addr_filename );
}
int ccnt = 0;
#endif
+ AFPobj = obj;
obj->exit = afp_asp_die;
obj->reply = (int (*)()) asp_cmdreply;
obj->attention = (int (*)(void *, AFPUserBytes)) asp_attention;
afp_asp_die(EXITERR_SYS);
}
+ if (dircache_init(obj->options.dircachesize) != 0) {
+ LOG(log_error, logtype_afpd, "afp_over_asp: dircache_init error");
+ afp_asp_die(EXITERR_SYS);
+ }
+
LOG(log_info, logtype_afpd, "session from %u.%u:%u on %u.%u:%u",
ntohs( asp->asp_sat.sat_addr.s_net ),
asp->asp_sat.sat_addr.s_node, asp->asp_sat.sat_port,