X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=etc%2Fafpd%2Fafp_asp.c;h=ea40e58f8a9e45b027fe52a14a5f4101dbfcf2be;hb=2bf71d3ccf20c072bc67a9d075b6ac8b0798021e;hp=23669c642a9444284db5802f1956aac8d26c5f08;hpb=567ceececbc94d854e94c84bbd61980240777f7a;p=netatalk.git diff --git a/etc/afpd/afp_asp.c b/etc/afpd/afp_asp.c index 23669c64..ea40e58f 100644 --- a/etc/afpd/afp_asp.c +++ b/etc/afpd/afp_asp.c @@ -1,5 +1,5 @@ /* - * $Id: afp_asp.c,v 1.26 2009-10-14 02:24:05 didg Exp $ + * $Id: afp_asp.c,v 1.28 2010-02-10 14:05:37 franklahm Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -51,6 +51,10 @@ static void afp_asp_close(AFPObj *obj) { ASP asp = obj->handle; + if (seteuid( obj->uid ) < 0) { + LOG(log_error, logtype_afpd, "can't seteuid back %s", strerror(errno)); + exit(EXITERR_SYS); + } close_all_vol(); if (obj->options.authprintdir) afp_authprint_remove(obj); @@ -77,7 +81,7 @@ static void afp_authprint_remove(AFPObj *obj) 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 );