]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/filedir.c
First working IPC reconnect
[netatalk.git] / etc / afpd / filedir.c
index c16ba484e34cf3c17e470c08af057a450d4878d5..356d82104cdadb69d910b651b92ff13632eab369 100644 (file)
@@ -40,6 +40,7 @@ char *strchr (), *strrchr ();
 #include <atalk/bstrlib.h>
 #include <atalk/bstradd.h>
 #include <atalk/acl.h>
+#include <atalk/globals.h>
 
 #include "directory.h"
 #include "dircache.h"
@@ -47,7 +48,6 @@ char *strchr (), *strrchr ();
 #include "volume.h"
 #include "fork.h"
 #include "file.h"
-#include "globals.h"
 #include "filedir.h"
 #include "unix.h"
 
@@ -472,6 +472,13 @@ static int moveandrename(const struct vol *vol,
             (void)dir_remove(vol, cacheddir);
         }
 
+        /* Fixup adouble info */
+        if (!ad_metadata(upath, adflags, adp)) {
+            ad_setid(adp, st->st_dev, st->st_ino, id, curdir->d_did, vol->v_stamp);
+            ad_flush(adp);
+            ad_close_metadata(adp);
+        }
+
         /* fix up the catalog entry */
         cnid_update(vol->v_cdb, id, st, curdir->d_did, upath, strlen(upath));
     }
@@ -612,14 +619,14 @@ 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), s_path->st.st_ctime))) {
+            if ((cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath)))) {
                 dircache_remove(vol, cachedfile, DIRCACHE | DIDNAME_INDEX | QUEUE_INDEX);
                 dir_free(cachedfile);
             }
         }
     }
     if ( rc == AFP_OK ) {
-        curdir->offcnt--;
+        curdir->d_offcnt--;
         setvoltime(obj, vol );
     }
 
@@ -760,8 +767,8 @@ int afp_moveandrename(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U
             rc = AFPERR_PARAM;
             goto exit;
         }
-        curdir->offcnt++;
-        sdir->offcnt--;
+        curdir->d_offcnt++;
+        sdir->d_offcnt--;
 #ifdef DROPKLUDGE
         if (vol->v_flags & AFPVOL_DROPBOX) {
             /* FIXME did is not always the source id */