#include <atalk/volume.h>
#include <atalk/ea.h>
#include <atalk/util.h>
+#include <atalk/acl.h>
#include "cmd_dbd.h"
#include "dbif.h"
".AppleDesktop",
NULL
};
+static char *special_dirs[] = {
+ ".zfs",
+ NULL
+};
static struct cnid_dbd_rqst rqst;
static struct cnid_dbd_rply rply;
static jmp_buf jmp;
return NULL;
}
+/*
+ Check for special names
+ Returns pointer to name or NULL.
+*/
+static const char *check_special_dirs(const char *name)
+{
+ int c;
+
+ for (c=0; special_dirs[c]; c++) {
+ if ((strcmp(name, special_dirs[c])) == 0)
+ return special_dirs[c];
+ }
+ return NULL;
+}
+
/*
Check for .AppleDouble file, create if missing
*/
continue;
}
+ /* Check for special folders in volume root e.g. ".zfs" */
+ if (volroot) {
+ if ((name = check_special_dirs(ep->d_name)) != NULL) {
+ dbd_log(LOGSTD, "Ignoring special dir \"%s\"", name);
+ continue;
+ }
+ }
+
/* Skip .AppleDouble dir in this loop */
if (STRCMP(ep->d_name, == , ADv2_DIRNAME))
continue;
if ((ret = lstat(ep->d_name, &st)) < 0) {
- dbd_log( LOGSTD, "Lost file while reading dir '%s/%s', probably removed: %s", cwdbuf, ep->d_name, strerror(errno));
+ dbd_log( LOGSTD, "Lost file while reading dir '%s/%s', probably removed: %s",
+ cwdbuf, ep->d_name, strerror(errno));
continue;
}
/* Start main loop through dbd: get CNID from dbd */
while ((dbif_idwalk(dbd, &dbd_cnid, 0)) == 1) {
+ /* Check if we got a termination signal */
+ if (alarmed)
+ longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */
if (deleted > 50) {
deleted = 0;
dbif_txn_close(dbd, ret);
deleted++;
}
+ /* Check if we got a termination signal */
+ if (alarmed)
+ longjmp(jmp, 1); /* this jumps back to cmd_dbd_scanvol() */
}
return;
} else