]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_asp.c
Merge symlink branch
[netatalk.git] / etc / afpd / afp_asp.c
index 23669c642a9444284db5802f1956aac8d26c5f08..ea40e58f8a9e45b027fe52a14a5f4101dbfcf2be 100644 (file)
@@ -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 );