]> arthur.barton.de Git - netatalk.git/blobdiff - bin/ad/ad_rm.c
ad mv nearly done, only updating adouble file missing
[netatalk.git] / bin / ad / ad_rm.c
index 8d25b341d6ab3fc980eb43d369f979f0eccfa3a8..f7f7a5759ec28f016da272356e0beeac9f0cd4df 100644 (file)
@@ -203,7 +203,8 @@ static int rm(const char *path,
     case S_IFLNK:
         if (volume.volinfo.v_path) {
             if ((volume.volinfo.v_adouble == AD_VERSION2)
-                && STRCMP(path, == , ".AppleDouble")) {
+                && (strstr(path, ".AppleDouble") != NULL)) {
+                /* symlink inside adouble dir */
                 if (unlink(path) != 0)
                     badrm = rval = 1;
                 break;
@@ -211,7 +212,7 @@ static int rm(const char *path,
 
             /* Get CNID of Parent and add new childir to CNID database */
             pdid = did;
-            cnid = cnid_for_path(&volume.volinfo, &volume.volume, path, &did);
+            cnid = cnid_for_path(&volume, path, &did);
             if (cnid_delete(volume.volume.v_cdb, cnid) != 0) {
                 SLOG("Error removing CNID %u for %s", ntohl(cnid), path);
                 return -1;
@@ -233,7 +234,8 @@ static int rm(const char *path,
 
         if (volume.volinfo.v_path) {
             if ((volume.volinfo.v_adouble == AD_VERSION2)
-                && STRCMP(path, == , ".AppleDouble")) {
+                && (strstr(path, ".AppleDouble") != NULL)) {
+                /* should be adouble dir itself */
                 if (rmdir(path) != 0) {
                     SLOG("Error removing dir \"%s\": %s", path, strerror(errno));
                     badrm = rval = 1;
@@ -243,7 +245,7 @@ static int rm(const char *path,
             }
 
             /* Get CNID of Parent and add new childir to CNID database */
-            did = cnid_for_path(&volume.volinfo, &volume.volume, path, &pdid);
+            did = cnid_for_path(&volume, path, &pdid);
             if (cnid_delete(volume.volume.v_cdb, did) != 0) {
                 SLOG("Error removing CNID %u for %s", ntohl(did), path);
                 return -1;
@@ -277,7 +279,8 @@ static int rm(const char *path,
     default:
         if (volume.volinfo.v_path) {
             if ((volume.volinfo.v_adouble == AD_VERSION2)
-                && STRCMP(path, == , ".AppleDouble")) {
+                && (strstr(path, ".AppleDouble") != NULL)) {
+                /* file in adouble dir */
                 if (unlink(path) != 0)
                     badrm = rval = 1;
                 break;
@@ -285,7 +288,7 @@ static int rm(const char *path,
 
             /* Get CNID of Parent and add new childir to CNID database */
             pdid = did;
-            cnid = cnid_for_path(&volume.volinfo, &volume.volume, path, &did);
+            cnid = cnid_for_path(&volume, path, &did);
             if (cnid_delete(volume.volume.v_cdb, cnid) != 0) {
                 SLOG("Error removing CNID %u for %s", ntohl(cnid), path);
                 return -1;