* FIX: Registering with mDNS crashed. Bug #540
* FIX: Saving from applications like Photoshop may fail, because
removing the ressource fork AppleDouble file failed. Bug #542.
+* FIX: dbd: remove orphaned ._ AppleDouble files. Bug #549.
Changes in 3.1.0
================
return db_cnid;
}
+static void check_orphaned(const char *name)
+{
+ int rc;
+ struct stat sb;
+
+ if (strlen(name) < 3)
+ return;
+
+ rc = lstat(&name[2], &sb);
+
+ if (rc != 0 && errno == ENOENT) {
+ dbd_log(LOGSTD, "Removing orphaned AppleDouble \"%s/%s\"", cwdbuf, name);
+ unlink(name);
+ }
+}
+
/*
This is called recursively for all dirs.
volroot=1 means we're in the volume root dir, 0 means we aren't.
Tests
**************************************************************************/
+ /* 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;
+ }
+
/* Check for appledouble file, create if missing, but only if we have addir */
const char *name = NULL;
adfile_ok = -1;