]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/filedir.c
Merge from branch-2-1
[netatalk.git] / etc / afpd / filedir.c
index c5fbd10595964cef45cf91706f020fefa1ba607d..be7056a796ab9c0729d1b8d4307c54ca5f3818d8 100644 (file)
@@ -461,16 +461,11 @@ 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) {
+            LOG(log_warning, logtype_afpd,"Still cached: \"%s/%s\"", getcwdpath(), upath);
+            (void)dir_remove(vol, cacheddir);
         }
 
         /* fix up the catalog entry */
@@ -611,7 +606,7 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size
             rc = deletefile(vol, -1, upath, 1);
 
             struct dir *cachedfile;
-            if ((cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath)))) {
+            if ((cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath), s_path->st.st_ctime))) {
                 dircache_remove(vol, cachedfile, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX);
                 dir_free(cachedfile);
             }