X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Ffiledir.c;h=d3976119444440fbc07a8422b4c4c12c57bf043b;hp=8eb8bb4d8d12ede44f8550bf43207d4656b3416c;hb=5116ed2346ea7ee6e5a9858dee94f3eacdc00d7e;hpb=cc5fb7fd9d648f38a8cb9e22e2c703e657e1ba6a;ds=sidebyside diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index 8eb8bb4d..d3976119 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -50,6 +50,7 @@ char *strchr (), *strrchr (); #include "globals.h" #include "filedir.h" #include "unix.h" +#include "fce_api.h" #ifdef DROPKLUDGE int matchfile2dirperms( @@ -603,8 +604,14 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size if ( path_isadir( s_path) ) { if (*s_path->m_name != '\0' || curdir->d_did == DIRDID_ROOT) rc = AFPERR_ACCESS; - else - rc = deletecurdir( vol); + } else { + /* we have to cache this, the structs are lost in deletcurdir*/ + /* but we need the positive returncode to send our event */ + char dname[256]; + strncpy(dname, curdir->d_u_name, 255 ); + if ((rc = deletecurdir(vol)) == AFP_OK) + fce_register_delete_dir(dname); + } } else if (of_findname(s_path)) { rc = AFPERR_BUSY; } else { @@ -614,9 +621,9 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size */ if (s_path->st_valid && s_path->st_errno == ENOENT) { rc = AFPERR_NOOBJ; - } - else { - rc = deletefile(vol, -1, upath, 1); + } else { + if ((rc = deletefile(vol, -1, upath, 1)) === AFP_OK) + fce_register_delete_file( s_path ); struct dir *cachedfile; if ((cachedfile = dircache_search_by_name(vol, dir, upath, strlen(upath), s_path->st.st_ctime))) {