X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Ffiledir.c;h=9a897d1b969759dc838f2278812770894cbc2c13;hb=ff117107526219d5ce89d5ff683eddd414e40293;hp=8f1109c9efea834d53752530d176c83f2988937b;hpb=26c02c0d56d76a5b775e793e8ec1ea10d0040a7b;p=netatalk.git diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index 8f1109c9..9a897d1b 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -113,7 +113,7 @@ int afp_getfildirparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *r *(rbuf + 2 * sizeof( uint16_t )) = (char) FILDIRBIT_ISDIR; } else { if (fbitmap && AFP_OK != (ret = getfilparams(obj, vol, fbitmap, s_path, curdir, - rbuf + 3 * sizeof( uint16_t ), &buflen )) ) { + rbuf + 3 * sizeof( uint16_t ), &buflen, 0)) ) { return( ret ); } /* this is a file */ @@ -203,9 +203,6 @@ int afp_setfildirparams(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf */ int check_name(const struct vol *vol, char *name) { - if ((vol->v_flags & AFPVOL_NOHEX) && strchr(name, '/')) - return AFPERR_PARAM; - if (!vol->vfs->vfs_validupath(vol, name)) { LOG(log_error, logtype_afpd, "check_name: illegal name: '%s'", name); return AFPERR_EXIST; @@ -221,7 +218,7 @@ int check_name(const struct vol *vol, char *name) move and rename sdir:oldname to curdir:newname in volume vol special care is needed for lock */ -static int moveandrename(const struct vol *vol, +static int moveandrename(struct vol *vol, struct dir *sdir, int sdir_fd, char *oldname, @@ -333,7 +330,7 @@ static int moveandrename(const struct vol *vol, goto exit; } - if (stat(upath, st) == 0 || caseenumerate(vol, &path, curdir) == 0) { + if (stat(upath, st) == 0) { if (!stat(oldunixname, &nst) && !(nst.st_dev == st->st_dev && nst.st_ino == st->st_ino) ) { /* not the same file */ rc = AFPERR_EXIST; @@ -341,7 +338,7 @@ static int moveandrename(const struct vol *vol, } errno = 0; } - } else if (stat(upath, st ) == 0 || caseenumerate(vol, &path, curdir) == 0) { + } else if (stat(upath, st ) == 0) { rc = AFPERR_EXIST; goto exit; } @@ -352,7 +349,7 @@ static int moveandrename(const struct vol *vol, if (of_findname(&path)) { rc = AFPERR_EXIST; /* was AFPERR_BUSY; */ } else { - rc = renamefile(vol, sdir_fd, oldunixname, upath, newname, adp ); + rc = renamefile(vol, curdir, sdir_fd, oldunixname, upath, newname, adp ); if (rc == AFP_OK) of_rename(vol, opened, sdir, oldname, curdir, newname); } @@ -528,7 +525,7 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size delcnid = cnid_get(vol->v_cdb, curdir->d_did, upath, strlen(upath)); if (delcnid != CNID_INVALID) cnid_delete(vol->v_cdb, delcnid); - fce_register_delete_dir(upath); + fce_register(FCE_DIR_DELETE, fullpathname(upath), NULL, fce_dir); } else { /* we have to cache this, the structs are lost in deletcurdir*/ /* but we need the positive returncode to send our event */ @@ -536,7 +533,7 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size if ((dname = bstrcpy(curdir->d_u_name)) == NULL) return AFPERR_MISC; if ((rc = deletecurdir(vol)) == AFP_OK) - fce_register_delete_dir(cfrombstr(dname)); + fce_register(FCE_DIR_DELETE, fullpathname(cfrombstr(dname)), NULL, fce_dir); bdestroy(dname); } } else if (of_findname(s_path)) { @@ -550,7 +547,7 @@ int afp_delete(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size rc = AFPERR_NOOBJ; } else { if ((rc = deletefile(vol, -1, upath, 1)) == AFP_OK) { - fce_register_delete_file( s_path ); + fce_register(FCE_FILE_DELETE, fullpathname(upath), NULL, fce_file); if (vol->v_tm_used < s_path->st.st_size) vol->v_tm_used = 0; else