]> arthur.barton.de Git - netatalk.git/commitdiff
Removed any special masking of chmod calls. Also fixed a strerror() call.
authorsrittau <srittau>
Tue, 5 Mar 2002 01:41:36 +0000 (01:41 +0000)
committersrittau <srittau>
Tue, 5 Mar 2002 01:41:36 +0000 (01:41 +0000)
etc/afpd/filedir.c
etc/afpd/unix.c

index 84bb49a19604d5b41c99689e893d58146599102b..f47d5f7af64cd9f4c7955e98728109ee34beb530 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: filedir.c,v 1.22 2002-02-28 21:20:39 jmarcus Exp $
+ * $Id: filedir.c,v 1.23 2002-03-05 01:41:36 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -100,7 +100,7 @@ more information */
                     upath, strerror(errno));
                 return (AFPERR_ACCESS);
             }
-            if (chmod(upath,(st.st_mode&0xFFFF&~default_options.umask)| S_IRGRP| S_IROTH) < 0)
+            if (chmod(upath,(st.st_mode&~default_options.umask)| S_IRGRP| S_IROTH) < 0)
             {
                 LOG(log_error, logtype_default,
                     "matchfile2dirperms:  Error adding file read permissions: %s",
@@ -120,7 +120,7 @@ more information */
                     adpath, strerror(errno));
                 return (AFPERR_ACCESS);
             }
-            if (chmod(adpath, (st.st_mode&0xFFFF&~default_options.umask)| S_IRGRP| S_IROTH) < 0)
+            if (chmod(adpath, (st.st_mode&~default_options.umask)| S_IRGRP| S_IROTH) < 0)
             {
                 LOG(log_error, logtype_default,
                     "matchfile2dirperms:  Error adding AD file read permissions: %s",
index 619f706401f62cb4a5c7a3506d3e7de39ba5499c..94da9b74cca7972f7f5e4315647e76a996c7d053 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.30 2002-02-28 21:20:39 jmarcus Exp $
+ * $Id: unix.c,v 1.31 2002-03-05 01:41:36 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -234,8 +234,8 @@ const int dropbox;
                 if ( seteuid(0) < 0) {
                     LOG(log_error, logtype_default, "stickydirmode: unable to seteuid root: %s", strerror(errno));
                 }
-                if ( retval=chmod( name, ( (DIRBITS | mode | S_ISVTX) & 0777 & ~default_options.umask) ) < 0) {
-                    LOG(log_error, logtype_default, "stickydirmode: chmod \"%s\": %s", name, strerror(retval) );
+                if ( retval=chmod( name, ( (DIRBITS | mode | S_ISVTX) & ~default_options.umask) ) < 0) {
+                    LOG(log_error, logtype_default, "stickydirmode: chmod \"%s\": %s", name, strerror(errno) );
                     return(AFPERR_ACCESS);
                 } else {
 #ifdef DEBUG
@@ -251,7 +251,7 @@ const int dropbox;
             *  Ignore EPERM errors:  We may be dealing with a directory that is
             *  group writable, in which case chmod will fail.
             */
-            if ( (chmod( name, (DIRBITS | mode) & 0777 & ~default_options.umask ) < 0) && errno != EPERM)  {
+            if ( (chmod( name, (DIRBITS | mode) & ~default_options.umask ) < 0) && errno != EPERM)  {
                 LOG(log_error, logtype_default, "stickydirmode: chmod \"%s\": %s",
                     name, strerror(errno) );
                 retval = -1;
@@ -310,11 +310,11 @@ const mode_t      mode;
             }
 
             if (S_ISDIR(st.st_mode)) {
-                if ( chmod( modbuf,  (DIRBITS | mode) & 0777 & ~default_options.umask ) < 0 && errno != EPERM ) {
+                if ( chmod( modbuf,  (DIRBITS | mode) & ~default_options.umask ) < 0 && errno != EPERM ) {
                     LOG(log_error, logtype_default, "setdeskmode: chmod %s: %s",
                         modbuf, strerror(errno) );
                 }
-            } else if ( chmod( modbuf,  mode & 0777 & ~default_options.umask ) < 0 && errno != EPERM ) {
+            } else if ( chmod( modbuf,  mode & ~default_options.umask ) < 0 && errno != EPERM ) {
                 LOG(log_error, logtype_default, "setdeskmode: chmod %s: %s",
                     modbuf, strerror(errno) );
             }
@@ -322,7 +322,7 @@ const mode_t        mode;
         }
         closedir( sub );
         /* XXX: need to preserve special modes */
-        if ( chmod( deskp->d_name,  (DIRBITS | mode) & 0777 & ~default_options.umask ) < 0 && errno != EPERM ) {
+        if ( chmod( deskp->d_name,  (DIRBITS | mode) & ~default_options.umask ) < 0 && errno != EPERM ) {
             LOG(log_error, logtype_default, "setdeskmode: chmod %s: %s",
                 deskp->d_name, strerror(errno) );
         }
@@ -333,7 +333,7 @@ const mode_t        mode;
         return -1;
     }
     /* XXX: need to preserve special modes */
-    if ( chmod( ".AppleDesktop",  (DIRBITS | mode) & 0777 & ~default_options.umask ) < 0 && errno != EPERM ) {
+    if ( chmod( ".AppleDesktop",  (DIRBITS | mode) & ~default_options.umask ) < 0 && errno != EPERM ) {
         LOG(log_error, logtype_default, "setdeskmode: chmod .AppleDesktop: %s", strerror(errno) );
     }
     return( 0 );