]> arthur.barton.de Git - netatalk.git/commitdiff
More logging
authorfranklahm <franklahm>
Wed, 20 Jan 2010 13:22:13 +0000 (13:22 +0000)
committerfranklahm <franklahm>
Wed, 20 Jan 2010 13:22:13 +0000 (13:22 +0000)
etc/afpd/unix.c
libatalk/vfs/unix.c

index 6880f3a650826ece14b1ebf5889ddd1afc68b112..d5bde724b9190ccb062122299ee879b2491575ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.59 2009-10-29 10:04:35 didg Exp $
+ * $Id: unix.c,v 1.60 2010-01-20 13:22:13 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -338,6 +338,10 @@ int setdirunixmode(const struct vol *vol, const char *name, mode_t mode)
 {
 
     int dropbox = (vol->v_flags & AFPVOL_DROPBOX);
+
+    LOG(log_debug, logtype_afpd, "setdirunixmode('%s', mode:%04o) {v_dperm:%04o}",
+        fullpathname(name), mode, vol->v_dperm);
+
     mode |= vol->v_dperm;
 
     if (dir_rx_set(mode)) {
index 789a13ecd10b1e7ab4eba4898fd3de27c8f74046..b8df2292bb3915ef34525f353d2746d365594bae 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.6 2009-10-27 10:24:02 franklahm Exp $
+ * $Id: unix.c,v 1.7 2010-01-20 13:22:13 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -80,6 +80,7 @@ int dir_rx_set(mode_t mode)
 int setfilmode(const char * name, mode_t mode, struct stat *st, mode_t v_umask)
 {
     struct stat sb;
+    mode_t result = mode;
     mode_t mask = S_IRWXU | S_IRWXG | S_IRWXO;  /* rwx for owner group and other, by default */
 
     if (!st) {
@@ -88,7 +89,11 @@ int setfilmode(const char * name, mode_t mode, struct stat *st, mode_t v_umask)
         st = &sb;
     }
 
-    mode |= st->st_mode & ~mask; /* keep other bits from previous mode */
+    result |= st->st_mode & ~mask; /* keep other bits from previous mode */
+
+    LOG(log_debug, logtype_afpd, "setfilmode('%s', mode:%04o, vmask:%04o) {st_mode:%04o, chmod:%04o}",
+        fullpathname(name), mode, v_umask, st->st_mode, result);
+
     if ( chmod( name,  mode & ~v_umask ) < 0 && errno != EPERM ) {
         return -1;
     }