From: franklahm Date: Wed, 20 Jan 2010 13:22:13 +0000 (+0000) Subject: More logging X-Git-Tag: branch-dircache-rewrite-start~15 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=42c8cb19e0091eee8cc3cfa2c97205d7a412fb1b More logging --- diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 6880f3a6..d5bde724 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -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)) { diff --git a/libatalk/vfs/unix.c b/libatalk/vfs/unix.c index 789a13ec..b8df2292 100644 --- a/libatalk/vfs/unix.c +++ b/libatalk/vfs/unix.c @@ -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; }