X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Ffiledir.c;h=356d82104cdadb69d910b651b92ff13632eab369;hb=465246e257d9aff9855e3e35d8fd5983db932b45;hp=c16ba484e34cf3c17e470c08af057a450d4878d5;hpb=59c6ab52684eaeb5915d21c795f4796a72a8160e;p=netatalk.git diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index c16ba484..356d8210 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -40,6 +40,7 @@ char *strchr (), *strrchr (); #include #include #include +#include #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 */