From 488cd72fca4df807617a51925d58e620d0e7400c Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 21 Feb 2014 23:20:18 +0100 Subject: [PATCH] Don't print message "Ignoring ._file" for every ._ file, bug #552 --- NEWS | 2 ++ etc/cnid_dbd/cmd_dbd_scanvol.c | 17 ++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 8c8fa0a3..cce1114b 100644 --- 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 ================ diff --git a/etc/cnid_dbd/cmd_dbd_scanvol.c b/etc/cnid_dbd/cmd_dbd_scanvol.c index ba1cd623..8ce6fbf5 100644 --- a/etc/cnid_dbd/cmd_dbd_scanvol.c +++ b/etc/cnid_dbd/cmd_dbd_scanvol.c @@ -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 */ -- 2.39.2