From d866596dad28a004b49257502d147651a66fd756 Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Thu, 26 Jan 2012 12:22:19 +0100 Subject: [PATCH] Remove noadouble option --- etc/afpd/directory.c | 12 ++++++------ etc/afpd/file.c | 7 +------ etc/afpd/unix.c | 4 ++-- etc/afpd/volume.c | 4 ---- etc/cnid_dbd/cmd_dbd_scanvol.c | 6 ------ include/atalk/adouble.h | 1 - include/atalk/volume.h | 3 --- libatalk/util/volinfo.c | 1 - libatalk/vfs/unix.c | 4 +--- libatalk/vfs/vfs.c | 7 ++----- 10 files changed, 12 insertions(+), 37 deletions(-) diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 4b301649..220c96d5 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -1923,10 +1923,12 @@ int setdirparams(struct vol *vol, struct path *path, uint16_t d_bitmap, char *bu * if we're using the noadouble option. */ - if (!vol_noadouble(vol) && (d_bitmap & - ~((1<m_name); diff --git a/etc/afpd/file.c b/etc/afpd/file.c index faabbf63..a283a684 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -717,11 +717,6 @@ int afp_createfile(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, } } if ( ad_meta_fileno( &ad ) == -1 ) { /* Hard META / HF */ - /* on noadouble volumes, just creating the data fork is ok */ - if (vol_noadouble(vol)) { - ad_close( &ad, ADFLAGS_DF ); - goto createfile_done; - } /* FIXME with hard create on an existing file, we already * corrupted the data file. */ @@ -971,7 +966,7 @@ int setfilparams(struct vol *vol, * - change of modification date * - UNIX privs (Bug-ID #2863424) */ - if (!vol_noadouble(vol) && (f_bitmap & ~(1<v_umask) < 0 ) return -1; } - if (vol->vfs->vfs_setdirunixmode(vol, name, mode, NULL) < 0 && !vol_noadouble(vol)) { + if (vol->vfs->vfs_setdirunixmode(vol, name, mode, NULL) < 0) { return -1 ; } if (!dir_rx_set(mode)) { @@ -375,7 +375,7 @@ int setdirmode(const struct vol *vol, const char *name, mode_t mode) } closedir( dir ); - if (vol->vfs->vfs_setdirmode(vol, name, mode, NULL) < 0 && !vol_noadouble(vol)) { + if (vol->vfs->vfs_setdirmode(vol, name, mode, NULL) < 0) { return -1 ; } diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 71638792..35ce7e5a 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -411,8 +411,6 @@ static void volset(struct vol_option *options, struct vol_option *save, options[VOLOPT_FLAGS].i_value |= AFPVOL_MSWINDOWS | AFPVOL_USEDOTS; } else if (strcasecmp(p, "crlf") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_CRLF; - else if (strcasecmp(p, "noadouble") == 0) - options[VOLOPT_FLAGS].i_value |= AFPVOL_NOADOUBLE; else if (strcasecmp(p, "ro") == 0) options[VOLOPT_FLAGS].i_value |= AFPVOL_RO; else if (strcasecmp(p, "nohex") == 0) @@ -702,8 +700,6 @@ static int creatvol(AFPObj *obj, struct passwd *pwd, volume->v_ad_options |= ADVOL_UNIXPRIV; if ((volume->v_flags & AFPVOL_INV_DOTS)) volume->v_ad_options |= ADVOL_INVDOTS; - if ((volume->v_flags & AFPVOL_NOADOUBLE)) - volume->v_ad_options |= ADVOL_NOADOUBLE; if (options[VOLOPT_PASSWORD].c_value) volume->v_password = strdup(options[VOLOPT_PASSWORD].c_value); diff --git a/etc/cnid_dbd/cmd_dbd_scanvol.c b/etc/cnid_dbd/cmd_dbd_scanvol.c index 3c61f920..be38a52f 100644 --- a/etc/cnid_dbd/cmd_dbd_scanvol.c +++ b/etc/cnid_dbd/cmd_dbd_scanvol.c @@ -1044,12 +1044,6 @@ static int dbd_readdir(int volroot, cnid_t did) static int scanvol(struct volinfo *vi, dbd_flags_t flags) { - /* Dont scanvol on no-appledouble vols */ - if (vi->v_flags & AFPVOL_NOADOUBLE) { - dbd_log( LOGSTD, "Volume without AppleDouble support: skipping volume scanning."); - return 0; - } - /* Make this stuff accessible from all funcs easily */ myvolinfo = vi; dbd_flags = flags; diff --git a/include/atalk/adouble.h b/include/atalk/adouble.h index a417db37..b98a7fb4 100644 --- a/include/atalk/adouble.h +++ b/include/atalk/adouble.h @@ -246,7 +246,6 @@ struct adouble { #define ADVOL_CACHE (1 << 1) #define ADVOL_UNIXPRIV (1 << 2) /* adouble unix priv */ #define ADVOL_INVDOTS (1 << 3) /* dot files (.DS_Store) are invisible) */ -#define ADVOL_NOADOUBLE (1 << 4) /* lock flags */ #define ADLOCK_CLR (0) diff --git a/include/atalk/volume.h b/include/atalk/volume.h index ca2aa87c..bbc11b47 100644 --- a/include/atalk/volume.h +++ b/include/atalk/volume.h @@ -106,7 +106,6 @@ struct vol { */ #define AFPVOL_A2VOL (1 << 5) /* prodos volume */ #define AFPVOL_CRLF (1 << 6) /* cr/lf translation */ -#define AFPVOL_NOADOUBLE (1 << 7) /* don't create .AppleDouble by default */ #define AFPVOL_RO (1 << 8) /* read-only volume */ #define AFPVOL_MSWINDOWS (1 << 9) /* deal with ms-windows yuckiness. this is going away. */ @@ -191,8 +190,6 @@ int wincheck(const struct vol *vol, const char *path); #define utf8_encoding() (afp_version >= 30) -// TODO: remove AFPVOL_NOADOUBLE -#define vol_noadouble(vol) (((vol)->v_flags & AFPVOL_NOADOUBLE) ? 1 : 0) #define vol_nodev(vol) (((vol)->v_flags & AFPVOL_NODEV) ? 1 : 0) #define vol_unix_priv(vol) (afp_version >= 30 && ((vol)->v_flags & AFPVOL_UNIX_PRIV)) #define vol_inv_dots(vol) (((vol)->v_flags & AFPVOL_INV_DOTS) ? 1 : 0) diff --git a/libatalk/util/volinfo.c b/libatalk/util/volinfo.c index 52360b1e..447696f9 100644 --- a/libatalk/util/volinfo.c +++ b/libatalk/util/volinfo.c @@ -44,7 +44,6 @@ static const vol_opt_name_t vol_opt_names[] = { {AFPVOL_A2VOL, "PRODOS"}, /* prodos volume */ {AFPVOL_CRLF, "CRLF"}, /* cr/lf translation */ - {AFPVOL_NOADOUBLE, "NOADOUBLE"}, /* don't create .AppleDouble by default */ {AFPVOL_RO, "READONLY"}, /* read-only volume */ {AFPVOL_MSWINDOWS, "MSWINDOWS"}, /* deal with ms-windows yuckiness. this is going away. */ {AFPVOL_NOHEX, "NOHEX"}, /* don't do :hex translation */ diff --git a/libatalk/vfs/unix.c b/libatalk/vfs/unix.c index 659cd411..c57249b3 100644 --- a/libatalk/vfs/unix.c +++ b/libatalk/vfs/unix.c @@ -39,9 +39,7 @@ int stickydirmode(const char *name, const mode_t mode, const int dropbox, const * Ignore EPERM errors: We may be dealing with a directory that is * group writable, in which case chmod will fail. */ - if ( (chmod_acl( name, (DIRBITS | mode) & ~v_umask ) < 0) && errno != EPERM && - !(errno == ENOENT && (dropbox & AFPVOL_NOADOUBLE)) ) - { + if ((chmod_acl( name, (DIRBITS | mode) & ~v_umask ) < 0) && errno != EPERM) { LOG(log_error, logtype_afpd, "stickydirmode: chmod \"%s\": %s", fullpathname(name), strerror(errno) ); retval = -1; } diff --git a/libatalk/vfs/vfs.c b/libatalk/vfs/vfs.c index fe272407..6cbf1463 100644 --- a/libatalk/vfs/vfs.c +++ b/libatalk/vfs/vfs.c @@ -223,7 +223,7 @@ static int RF_setdirmode_adouble(VFS_FUNC_ARGS_SETDIRMODE) return -1; } - if (for_each_adouble("setdirmode", adouble_p, setdirmode_adouble_loop, &hf_mode, vol_noadouble(vol), vol->v_umask)) + if (for_each_adouble("setdirmode", adouble_p, setdirmode_adouble_loop, &hf_mode, 0, vol->v_umask)) return -1; if (!dir_rx_set(mode)) { @@ -248,7 +248,6 @@ static int setdirowner_adouble_loop(struct dirent *de _U_, char *name, void *dat static int RF_setdirowner_adouble(VFS_FUNC_ARGS_SETDIROWNER) { - int noadouble = vol_noadouble(vol); char *adouble_p; struct stat st; struct perm owner; @@ -258,15 +257,13 @@ static int RF_setdirowner_adouble(VFS_FUNC_ARGS_SETDIROWNER) adouble_p = ad_dir(vol->ad_path(name, ADFLAGS_DIR )); - if (for_each_adouble("setdirowner", adouble_p, setdirowner_adouble_loop, &owner, noadouble, vol->v_umask)) + if (for_each_adouble("setdirowner", adouble_p, setdirowner_adouble_loop, &owner, 0, vol->v_umask)) return -1; /* * We cheat: we know that chown doesn't do anything. */ if ( stat( ".AppleDouble", &st ) < 0) { - if (errno == ENOENT && noadouble) - return 0; LOG(log_error, logtype_afpd, "setdirowner: stat %s: %s", fullpathname(".AppleDouble"), strerror(errno) ); return -1; } -- 2.39.2