#include <atalk/bstrlib.h>
#include <atalk/bstradd.h>
#include <atalk/acl.h>
+#include <atalk/fce_api.h>
#include "directory.h"
#include "dircache.h"
#include "globals.h"
#include "filedir.h"
#include "unix.h"
-#include "fce_api.h"
#ifdef DROPKLUDGE
int matchfile2dirperms(
upath = s_path->u_name;
if ( path_isadir( s_path) ) {
- if (*s_path->m_name != '\0' || curdir->d_did == DIRDID_ROOT)
+ if (*s_path->m_name != '\0' || curdir->d_did == DIRDID_ROOT) {
rc = AFPERR_ACCESS;
- } 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 {
+ /* we have to cache this, the structs are lost in deletcurdir*/
+ /* but we need the positive returncode to send our event */
+ bstring dname;
+ if ((dname = bstrcpy(curdir->d_u_name)) == NULL)
+ return AFPERR_MISC;
+ if ((rc = deletecurdir(vol)) == AFP_OK)
+ fce_register_delete_dir(cfrombstr(dname));
+ bdestroy(dname);
+ }
} else if (of_findname(s_path)) {
rc = AFPERR_BUSY;
} else {
if (s_path->st_valid && s_path->st_errno == ENOENT) {
rc = AFPERR_NOOBJ;
} else {
- if ((rc = deletefile(vol, -1, upath, 1)) === AFP_OK)
+ if ((rc = deletefile(vol, -1, upath, 1)) == AFP_OK)
fce_register_delete_file( s_path );
struct dir *cachedfile;