]> arthur.barton.de Git - netatalk.git/commitdiff
Files in the cache have no fullpath
authorFrank Lahm <franklahm@googlemail.com>
Fri, 29 Oct 2010 16:49:52 +0000 (18:49 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 29 Oct 2010 16:49:52 +0000 (18:49 +0200)
etc/afpd/directory.c
etc/afpd/filedir.c

index fa15e753927c07ca0f77e5292ca3436dd0cd9294..04f386bfa6a4ea4a23a1391f9fce0d905061891b 100644 (file)
@@ -872,7 +872,7 @@ int dir_remove(const struct vol *vol, struct dir *dir)
 
     if (dir->d_flags & DIRF_CACHELOCK || dir->d_ofork) { /* 1 */
         LOG(log_warning, logtype_afpd, "dir_remove(did:%u,'%s'): dir is locked or has opened forks",
-            ntohl(dir->d_did), cfrombstr(dir->d_fullpath));
+            ntohl(dir->d_did), cfrombstr(dir->d_u_name));
         return 0;
     }
 
@@ -883,7 +883,7 @@ int dir_remove(const struct vol *vol, struct dir *dir)
     }
 
     LOG(log_debug, logtype_afpd, "dir_remove(did:%u,'%s'): {removing}",
-        ntohl(dir->d_did), cfrombstr(dir->d_fullpath));
+        ntohl(dir->d_did), cfrombstr(dir->d_u_name));
 
     dircache_remove(vol, dir, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX); /* 3 */
     dir_free(dir);              /* 4 */
index c5fbd10595964cef45cf91706f020fefa1ba607d..16a32ef6af39a39f092c98bcb9ad75e058aafed4 100644 (file)
@@ -461,17 +461,14 @@ static int moveandrename(const struct vol *vol,
             goto exit;
         }
 
-        if (dir_modify(vol,
-                       sdir,
-                       curdir->d_did,
-                       0,
-                       newname,
-                       upath,
-                       S_ISDIR(st->st_mode) ? curdir->d_fullpath : NULL) != 0) {
-            LOG(log_error, logtype_afpd, "moveandrename: dir_modify error: %s -> %s",
-                p, upath);
-            return AFPERR_MISC;
+        /* Remove it from the cache */
+        struct dir *cacheddir = dircache_search_by_did(vol, id);
+        if (cacheddir == NULL) {
+            LOG(log_warning, logtype_afpd,"Not cached: \"%s/%s\"", getcwdpath(), upath);
+            rc = AFPERR_MISC;
+            goto exit;
         }
+        (void)dir_remove(vol, cacheddir);
 
         /* fix up the catalog entry */
         cnid_update(vol->v_cdb, id, st, curdir->d_did, upath, strlen(upath));