From 4904f9397856080402008010191502cd1869471b Mon Sep 17 00:00:00 2001 From: didg Date: Wed, 16 May 2007 18:35:58 +0000 Subject: [PATCH] remove a spurious error msg if noadouble option is set --- etc/afpd/auth.c | 6 ++++-- etc/afpd/unix.c | 8 +++++--- etc/afpd/vfs_adouble.c | 28 ++++++++++++++-------------- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index 9349468d..5ae5246d 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -1,5 +1,5 @@ /* - * $Id: auth.c,v 1.48 2005-04-28 20:49:40 bfernhomberg Exp $ + * $Id: auth.c,v 1.49 2007-05-16 18:35:58 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -76,7 +76,8 @@ static struct afp_versions afp_versions[] = { { "AFP2.2", 22 }, #ifdef AFP3x { "AFPX03", 30 }, - { "AFP3.1", 31 } + { "AFP3.1", 31 }, + { "AFP3.2", 32 } #endif }; @@ -186,6 +187,7 @@ static int set_auth_switch(int expired) else { afp_switch = postauth_switch; switch (afp_version) { + case 32: case 31: uam_afpserver_action(AFP_ENUMERATE_EXT2, UAM_AFPSERVER_POSTAUTH, afp_enumerate_ext2, NULL); case 30: diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 03be7703..5fd15f1c 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -1,5 +1,5 @@ /* - * $Id: unix.c,v 1.48 2005-06-02 12:32:18 didg Exp $ + * $Id: unix.c,v 1.49 2007-05-16 18:35:58 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -270,7 +270,7 @@ const int dropbox; #ifdef DROPKLUDGE /* Turn on the sticky bit if this is a drop box, also turn off the setgid bit */ - if (dropbox) { + if ((dropbox & AFPVOL_DROPBOX)) { int uid; if ( ( (mode & S_IWOTH) && !(mode & S_IROTH)) || @@ -297,7 +297,9 @@ 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) & ~default_options.umask ) < 0) && errno != EPERM) { + if ( (chmod( name, (DIRBITS | mode) & ~default_options.umask ) < 0) && errno != EPERM && + !(errno == ENOENT && (dropbox & AFPVOL_NOADOUBLE)) ) + { LOG(log_error, logtype_afpd, "stickydirmode: chmod \"%s\": %s", fullpathname(name), strerror(errno) ); retval = -1; } diff --git a/etc/afpd/vfs_adouble.c b/etc/afpd/vfs_adouble.c index 57ce312b..8e9768c6 100644 --- a/etc/afpd/vfs_adouble.c +++ b/etc/afpd/vfs_adouble.c @@ -214,18 +214,18 @@ static int RF_setdirunixmode_ads(const struct vol *vol, const char * name, mode_ { char *adouble = vol->vfs->ad_path( name, ADFLAGS_DIR ); char ad_p[ MAXPATHLEN + 1]; - int dropbox = (vol->v_flags & AFPVOL_DROPBOX); + int dropbox = vol->v_flags; strlcpy(ad_p,ad_dir(adouble), MAXPATHLEN + 1); if (dir_rx_set(mode)) { /* .AppleDouble */ - if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, dropbox) < 0) return -1; /* .AppleDouble/.Parent */ - if (stickydirmode(ad_p, DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_p, DIRBITS | mode, dropbox) < 0) return -1; } @@ -233,9 +233,9 @@ static int RF_setdirunixmode_ads(const struct vol *vol, const char * name, mode_ return -1; if (!dir_rx_set(mode)) { - if (stickydirmode(ad_p, DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_p, DIRBITS | mode, dropbox) < 0) return -1 ; - if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, dropbox) < 0) return -1; } return 0; @@ -282,13 +282,13 @@ static int RF_setdirmode_ads(const struct vol *vol, const char * name, mode_t mo struct dir_mode param; param.mode = mode; - param.dropbox = (vol->v_flags & AFPVOL_DROPBOX); + param.dropbox = vol->v_flags; strlcpy(ad_p,ad_dir(adouble), sizeof(ad_p)); if (dir_rx_set(mode)) { /* .AppleDouble */ - if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, param.dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, param.dropbox) < 0) return -1; } @@ -296,7 +296,7 @@ static int RF_setdirmode_ads(const struct vol *vol, const char * name, mode_t mo return -1; if (!dir_rx_set(mode)) { - if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, param.dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(ad_p), DIRBITS | mode, param.dropbox) < 0 ) return -1; } return 0; @@ -496,10 +496,10 @@ static int RF_setfilmode_adouble(const struct vol *vol, const char * name, mode_ static int RF_setdirunixmode_adouble(const struct vol *vol, const char * name, mode_t mode, struct stat *st) { char *adouble = vol->vfs->ad_path( name, ADFLAGS_DIR ); - int dropbox = (vol->v_flags & AFPVOL_DROPBOX); + int dropbox = vol->v_flags; if (dir_rx_set(mode)) { - if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0 ) return -1; } @@ -507,7 +507,7 @@ static int RF_setdirunixmode_adouble(const struct vol *vol, const char * name, m return -1; if (!dir_rx_set(mode)) { - if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0 ) return -1 ; } return 0; @@ -534,13 +534,13 @@ static int setdirmode_adouble_loop(struct dirent *de _U_, char *name, void *data static int RF_setdirmode_adouble(const struct vol *vol, const char * name, mode_t mode, struct stat *st _U_) { - int dropbox = (vol->v_flags & AFPVOL_DROPBOX); + int dropbox = vol->v_flags; mode_t hf_mode = ad_hf_mode(mode); char *adouble = vol->vfs->ad_path( name, ADFLAGS_DIR ); char *adouble_p = ad_dir(adouble); if (dir_rx_set(mode)) { - if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0) return -1; } @@ -548,7 +548,7 @@ static int RF_setdirmode_adouble(const struct vol *vol, const char * name, mode_ return -1; if (!dir_rx_set(mode)) { - if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0 && !vol_noadouble(vol)) + if (stickydirmode(ad_dir(adouble), DIRBITS | mode, dropbox) < 0) return -1 ; } return 0; -- 2.39.2