]> arthur.barton.de Git - netatalk.git/commitdiff
Don't print message "Ignoring ._file" for every ._ file, bug #552
authorRalph Boehme <rb@sernet.de>
Fri, 21 Feb 2014 22:20:18 +0000 (23:20 +0100)
committerRalph Boehme <rb@sernet.de>
Fri, 21 Feb 2014 22:23:49 +0000 (23:23 +0100)
NEWS
etc/cnid_dbd/cmd_dbd_scanvol.c

diff --git a/NEWS b/NEWS
index 8c8fa0a3e0db8c756e8bd778c1d049d7a33b5d44..cce1114b516863e261eba643a86e3ad2410e141e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Changes in 3.1.1
 * NEW: afpd: Automatic conversion of ._ AppleDouble files
        created by OS X. Bug #550.
 * FIX: afpd: Fix a crash in of_closefork(). Bug #551.
+* FIX: dbd: Don't print message "Ignoring ._file" for every ._ file.
+       Bug #552.
 
 Changes in 3.1.0
 ================
index ba1cd623e0b54dd778ccf2b5a80cdfc3df0a72d4..8ce6fbf5d624989308b09269eea25d17da7b8279 100644 (file)
@@ -610,7 +610,7 @@ static cnid_t check_cnid(const char *name, cnid_t did, struct stat *st, int adfi
     return db_cnid;
 }
 
-static void check_orphaned(const char *name)
+static int check_orphaned(const char *name)
 {
     int rc;
     struct stat sb;
@@ -623,7 +623,9 @@ static void check_orphaned(const char *name)
     if (rc != 0 && errno == ENOENT) {
         dbd_log(LOGSTD, "Removing orphaned AppleDouble \"%s/%s\"", cwdbuf, name);
         unlink(name);
+        return 1;
     }
+    return 0;
 }
 
 /*
@@ -734,12 +736,13 @@ static int dbd_readdir(int volroot, cnid_t did)
         **************************************************************************/
 
         /* Check for invalid names and orphaned ._ files */
-        if (S_ISREG(st.st_mode) && (strncmp(ep->d_name, "._", strlen("._")) == 0))
-            check_orphaned(ep->d_name);
-
-        if (!vol->vfs->vfs_validupath(vol, ep->d_name)) {
-            dbd_log(LOGSTD, "Ignoring \"%s/%s\"", cwdbuf, ep->d_name);
-            continue;
+        if (S_ISREG(st.st_mode) && (strncmp(ep->d_name, "._", strlen("._")) == 0)) {
+            if (check_orphaned(ep->d_name))
+                continue;
+            if (vol->vfs->vfs_validupath(vol, ep->d_name)) {
+                dbd_log(LOGSTD, "Bad AppleDouble \"%s/%s\"", cwdbuf, ep->d_name);
+                continue;
+            }
         }
 
         /* Check for appledouble file, create if missing, but only if we have addir */