X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Funix.c;fp=etc%2Fafpd%2Funix.c;h=a42a6ab9093fde4f923e43510474d52ad58334b4;hp=7c90462874cd0cceec47f3c9836f42319e6a1937;hb=ab6e6f8ed24667ced438afe4df5997469a2ff53b;hpb=471d63120ea3d21bd9d6eb3b220d1e3eec419f68 diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 7c904628..a42a6ab9 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -229,18 +229,22 @@ int setdirunixmode(const struct vol *vol, char *name, mode_t mode) LOG(log_debug, logtype_afpd, "setdirunixmode('%s', mode:%04o) {v_dperm:%04o}", fullpathname(name), mode, vol->v_dperm); - mode |= vol->v_dperm; + mode |= (vol->v_dperm | DIRBITS) & ~vol->v_umask; if (dir_rx_set(mode)) { /* extending right? dir first then .AppleDouble in rf_setdirmode */ - if (chmod_acl(name, (DIRBITS | mode) & ~vol->v_umask) < 0 ) + if (ochmod(name, mode, NULL, + vol_syml_opt(vol) | vol_chmod_opt(vol) + ) < 0) return -1; } if (vol->vfs->vfs_setdirunixmode(vol, name, mode, NULL) < 0) { return -1 ; } if (!dir_rx_set(mode)) { - if (chmod_acl(name, (DIRBITS | mode) & ~vol->v_umask) < 0 ) + if (ochmod(name, mode, NULL, + vol_syml_opt(vol) | vol_chmod_opt(vol) + ) < 0) return -1; } return 0;