1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3: smbd: filenames - ensure we replace the missing '/' if we error in an intermediate POSIX path.

Previous regression test ensures we still return the correct
error code for POSIX pathname operations.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13803

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Feb 25 09:33:27 CET 2019 on sn-devel-144
This commit is contained in:
Jeremy Allison 2019-02-24 08:15:23 -08:00 committed by Volker Lendecke
parent 632d0db8c4
commit 3f1a13a94a
2 changed files with 18 additions and 1 deletions

View File

@ -9,7 +9,6 @@
^samba3.smbtorture_s3.crypt_server\(nt4_dc\).SMB2-SESSION-REAUTH # expected to give ACCESS_DENIED SMB2.1 doesn't have encryption
^samba3.smbtorture_s3.crypt_server\(nt4_dc\).SMB2-SESSION-RECONNECT # expected to give CONNECTION_DISCONNECTED, we need to fix the test
^samba3.smbtorture_s3.plain.*SMB2-DIR-FSYNC.*\(ad_dc_ntvfs\)
^samba3.smbtorture_s3.*.POSIX-MKDIR
^samba3.smb2.session enc.reconnect # expected to give CONNECTION_DISCONNECTED, we need to fix the test
^samba3.raw.session enc # expected to give ACCESS_DENIED as SMB1 encryption isn't used
^samba3.smbtorture_s3.crypt_server # expected to give ACCESS_DENIED as SMB1 encryption isn't used

View File

@ -937,6 +937,24 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
*
* BUG: https://bugzilla.samba.org/show_bug.cgi?id=13803
*/
if (end != NULL) {
const char *morepath = NULL;
/*
* If this is intermediate we must
* restore the full path.
*/
*end = '/';
/*
* If there are any more components
* after the failed LSTAT we cannot
* continue.
*/
morepath = strchr(end + 1, '/');
if (morepath != NULL) {
status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
goto fail;
}
}
if (errno == ENOENT) {
/* New file or directory. */
goto done;