]> arthur.barton.de Git - netatalk.git/commitdiff
unix.c:
authordidg <didg>
Thu, 6 Jun 2002 10:14:26 +0000 (10:14 +0000)
committerdidg <didg>
Thu, 6 Jun 2002 10:14:26 +0000 (10:14 +0000)
dir access right ma_user is a union of all permissions.

volume.c:
Update curdir only when chdir succeeds.
Even if chdir to a new volume fails, but if closing the volume succeeds, still return 0.

submit by Ngo Hoc, hoc.ngo@quantum.com

etc/afpd/unix.c
etc/afpd/volume.c

index 74e450b5ce14c583ef1b60b2f81eedb8bedd6ec7..c5459c1612aa84c95ce9f586cb37d30424e58de3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.34 2002-05-10 21:35:41 jmarcus Exp $
+ * $Id: unix.c,v 1.35 2002-06-06 10:14:26 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -133,13 +133,15 @@ struct maccess    *ma;
 
     ma->ma_owner = utombits( mode );
 
+    /* ma_user is a union of all permissions */
+
     if ( (uuid == stat->st_uid) || (uuid == 0)) {
         ma->ma_user = ma->ma_owner | AR_UOWN;
-    } else if ( gmem( stat->st_gid )) {
-        ma->ma_user = ma->ma_group;
-    } else {
-        ma->ma_user = ma->ma_world;
     }
+    if ( gmem( stat->st_gid )) {
+        ma->ma_user |= ma->ma_group;
+    } 
+    ma->ma_user |= ma->ma_world;
 
     /*
      * There are certain things the mac won't try if you don't have
index 86bf286aeb089e599d8b3df79e7f9bed72eb13db..c7ce2bf1927a046980cd3f8a6b919b25b5df75dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.26 2002-03-24 17:45:29 jmarcus Exp $
+ * $Id: volume.c,v 1.27 2002-06-06 10:14:26 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1181,11 +1181,11 @@ int             ibuflen, *rbuflen;
     bitmap = htons( bitmap );
     memcpy(rbuf, &bitmap, sizeof( bitmap ));
 
-    curdir = volume->v_dir;
     if ( chdir( volume->v_path ) < 0 ) {
         ret = AFPERR_PARAM;
         goto openvol_err;
     }
+    curdir = volume->v_dir;
 
 #ifdef CNID_DB
     if (volume->v_dbpath)
@@ -1235,9 +1235,9 @@ int               ibuflen, *rbuflen;
         }
     }
     if ( ovol != NULL ) {
-        curdir = ovol->v_dir;
-        if ( chdir( ovol->v_path ) < 0 ) {
-            return( AFPERR_PARAM );
+        /* Even if chdir fails, we can't say afp_closevol fails. */
+        if ( chdir( ovol->v_path ) == 0 ) {
+            curdir = ovol->v_dir;
         }
     }