X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=bin%2Fad%2Fad_cp.c;h=5cefe9648a30484cb007d99fd834eabd8bacd4bc;hb=22a32e7449133013789f3fc7ff6b32772b0c76cc;hp=ef995ce8cf3f159c6346a5e32a4858e9cfad8948;hpb=a83e8197c7b8af45f8d56acf158920c03698bfc6;p=netatalk.git diff --git a/bin/ad/ad_cp.c b/bin/ad/ad_cp.c index ef995ce8..5cefe964 100644 --- a/bin/ad/ad_cp.c +++ b/bin/ad/ad_cp.c @@ -95,36 +95,14 @@ static volatile sig_atomic_t alarmed; static int badcp, rval; static int ftw_options = FTW_MOUNT | FTW_PHYS | FTW_ACTIONRETVAL; -static char *netatalk_dirs[] = { - ".AppleDouble", - ".AppleDB", - ".AppleDesktop", - NULL -}; - /* Forward declarations */ static int copy(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf); static int ftw_copy_file(const struct FTW *, const char *, const struct stat *, int); static int ftw_copy_link(const struct FTW *, const char *, const struct stat *, int); static int setfile(const struct stat *, int); -static int preserve_dir_acls(const struct stat *, char *, char *); +// static int preserve_dir_acls(const struct stat *, char *, char *); static int preserve_fd_acls(int, int); -/* - Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" - Returns pointer to name or NULL. -*/ -static const char *check_netatalk_dirs(const char *name) -{ - int c; - - for (c=0; netatalk_dirs[c]; c++) { - if ((strcmp(name, netatalk_dirs[c])) == 0) - return netatalk_dirs[c]; - } - return NULL; -} - static void upfunc(void) { did = pdid; @@ -531,7 +509,7 @@ static int copy(const char *path, /* Get CNID of Parent and add new childir to CNID database */ ppdid = pdid; - if ((did = cnid_for_path(&dvolume, to.p_path, &pdid)) == CNID_INVALID) { + if ((did = cnid_for_path(dvolume.vol->v_cdb, dvolume.vol->v_path, to.p_path, &pdid)) == CNID_INVALID) { SLOG("Error resolving CNID for %s", to.p_path); badcp = rval = 1; return -1; @@ -599,7 +577,7 @@ static int copy(const char *path, /* Get CNID of Parent and add new childir to CNID database */ pdid = did; cnid_t cnid; - if ((cnid = cnid_for_path(&dvolume, to.p_path, &did)) == CNID_INVALID) { + if ((cnid = cnid_for_path(dvolume.vol->v_cdb, dvolume.vol->v_path, to.p_path, &did)) == CNID_INVALID) { SLOG("Error resolving CNID for %s", to.p_path); badcp = rval = 1; return -1; @@ -953,9 +931,9 @@ static int preserve_fd_acls(int source_fd, int dest_fd) return (0); } +#if 0 static int preserve_dir_acls(const struct stat *fs, char *source_dir, char *dest_dir) { -#if 0 acl_t (*aclgetf)(const char *, acl_type_t); int (*aclsetf)(const char *, acl_type_t, acl_t); struct acl *aclp; @@ -1037,6 +1015,6 @@ static int preserve_dir_acls(const struct stat *fs, char *source_dir, char *dest return (1); } acl_free(acl); -#endif return (0); } +#endif