X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=bin%2Fad%2Fad_rm.c;h=e65d6f274ce76230510dccff35cea49891fdf259;hb=84c3a8f52deced7429f9d72276232ee282b3b823;hp=b9ef2c3c2d941d11b8a0c7eba4227e0e4011a047;hpb=df4786e567fddb4b238f658d43e2662f488f73ba;p=netatalk.git diff --git a/bin/ad/ad_rm.c b/bin/ad/ad_rm.c index b9ef2c3c..e65d6f27 100644 --- a/bin/ad/ad_rm.c +++ b/bin/ad/ad_rm.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -201,8 +200,8 @@ static int rm(const char *path, switch (statp->st_mode & S_IFMT) { case S_IFLNK: - if (volume.volinfo.v_path) { - if ((volume.volinfo.v_adouble == AD_VERSION2) + if (volume.vol->v_path) { + if ((volume.vol->v_adouble == AD_VERSION2) && (strstr(path, ".AppleDouble") != NULL)) { /* symlink inside adouble dir */ if (unlink(path) != 0) @@ -216,7 +215,7 @@ static int rm(const char *path, SLOG("Error resolving CNID for %s", path); return -1; } - if (cnid_delete(volume.volume.v_cdb, cnid) != 0) { + if (cnid_delete(volume.vol->v_cdb, cnid) != 0) { SLOG("Error removing CNID %u for %s", ntohl(cnid), path); return -1; } @@ -235,8 +234,8 @@ static int rm(const char *path, return FTW_SKIP_SUBTREE; } - if (volume.volinfo.v_path) { - if ((volume.volinfo.v_adouble == AD_VERSION2) + if (volume.vol->v_path) { + if ((volume.vol->v_adouble == AD_VERSION2) && (strstr(path, ".AppleDouble") != NULL)) { /* should be adouble dir itself */ if (rmdir(path) != 0) { @@ -252,7 +251,7 @@ static int rm(const char *path, SLOG("Error resolving CNID for %s", path); return -1; } - if (cnid_delete(volume.volume.v_cdb, did) != 0) { + if (cnid_delete(volume.vol->v_cdb, did) != 0) { SLOG("Error removing CNID %u for %s", ntohl(did), path); return -1; } @@ -283,8 +282,8 @@ static int rm(const char *path, break; default: - if (volume.volinfo.v_path) { - if ((volume.volinfo.v_adouble == AD_VERSION2) + if (volume.vol->v_path) { + if ((volume.vol->v_adouble == AD_VERSION2) && (strstr(path, ".AppleDouble") != NULL)) { /* file in adouble dir */ if (unlink(path) != 0) @@ -298,13 +297,13 @@ static int rm(const char *path, SLOG("Error resolving CNID for %s", path); return -1; } - if (cnid_delete(volume.volume.v_cdb, cnid) != 0) { + if (cnid_delete(volume.vol->v_cdb, cnid) != 0) { SLOG("Error removing CNID %u for %s", ntohl(cnid), path); return -1; } /* Ignore errors, because with -R adouble stuff is always alread gone */ - volume.volume.vfs->vfs_deletefile(&volume.volume, -1, path); + volume.vol->vfs->vfs_deletefile(volume.vol, -1, path); } if (unlink(path) != 0) {