]> arthur.barton.de Git - netatalk.git/commitdiff
Remove noadouble option
authorFrank Lahm <franklahm@googlemail.com>
Thu, 26 Jan 2012 11:22:19 +0000 (12:22 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Thu, 26 Jan 2012 11:22:19 +0000 (12:22 +0100)
etc/afpd/directory.c
etc/afpd/file.c
etc/afpd/unix.c
etc/afpd/volume.c
etc/cnid_dbd/cmd_dbd_scanvol.c
include/atalk/adouble.h
include/atalk/volume.h
libatalk/util/volinfo.c
libatalk/vfs/unix.c
libatalk/vfs/vfs.c

index 4b301649999007687ac9430ad0463776c73c55da..220c96d509cf45a844f345242ade4a45f772431b 100644 (file)
@@ -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<<DIRPBIT_ACCESS)|(1<<DIRPBIT_UNIXPR)|
-                                      (1<<DIRPBIT_UID)|(1<<DIRPBIT_GID)|
-                                      (1<<DIRPBIT_MDATE)|(1<<DIRPBIT_PDINFO)))) {
+        if (d_bitmap & ~((1<<DIRPBIT_ACCESS)
+                         | (1<<DIRPBIT_UNIXPR)
+                         | (1<<DIRPBIT_UID)
+                         | (1<<DIRPBIT_GID)
+                         | (1<<DIRPBIT_MDATE)
+                         | (1<<DIRPBIT_PDINFO))) {
             return AFPERR_ACCESS;
         }
 
@@ -2279,8 +2281,6 @@ int afp_createdir(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_
 
     ad_init(&ad, vol);
     if (ad_open(&ad, ".", ADFLAGS_HF | ADFLAGS_DIR | ADFLAGS_CREATE | ADFLAGS_RDWR, 0777) < 0)  {
-        if (vol_noadouble(vol))
-            goto createdir_done;
         return( AFPERR_ACCESS );
     }
     ad_setname(&ad, s_path->m_name);
index faabbf631dcb68c2fdcded05c2e624c1f1827a70..a283a684cbcd5fff0062bd134d77c430deaba572 100644 (file)
@@ -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<<FILPBIT_MDATE | 1<<FILPBIT_UNIXPR))) {
+        if (f_bitmap & ~(1<<FILPBIT_MDATE | 1<<FILPBIT_UNIXPR)) {
             LOG(log_debug, logtype_afpd, "setfilparams: need adouble access");
             return AFPERR_ACCESS;
         }
index d692b11cbdab2c9d8e83cd6e622a2a8e49d80e2b..e080208a77439e3859d09a684910b76cb462af7b 100644 (file)
@@ -325,7 +325,7 @@ int setdirunixmode(const struct vol *vol, const char *name, mode_t mode)
        if ( stickydirmode(name, DIRBITS | mode, 0, vol->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 ;
     }
 
index 716387925373fb38e0c7d69515318e39505a63b1..35ce7e5a3b1fc5acd2b1c6f25bed005e0515956b 100644 (file)
@@ -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);
index 3c61f920fa888f0218246b584763ae122d221478..be38a52f2275baee2fb19a3e84ed81e36858231c 100644 (file)
@@ -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;
index a417db37c87f0c712f6dc973142b04530032de73..b98a7fb477049cab70c0470aef298808c0a2cb2f 100644 (file)
@@ -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)
index ca2aa87c256f1af4e71a5f7d4f9b8ae5ab10d970..bbc11b477e02396b11df3c95d96e13590762a741 100644 (file)
@@ -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)
index 52360b1ece0330089386c5383f9cc619c74403e3..447696f9dbcd579e514270f03c620335577663b7 100644 (file)
@@ -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 */
index 659cd41162d95a004eaaefbada06432b03147433..c57249b3f28531f6d57fd5c1d5c95f97d3169aaf 100644 (file)
@@ -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;
     }
index fe272407096f19d3888b48883bd0c6e682ad24f6..6cbf1463c79e4ac8cdaa140edd3e594500a3e1ec 100644 (file)
@@ -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;
     }