mirror of
https://github.com/samba-team/samba.git
synced 2025-08-31 22:02:58 +03:00
r20720: Fix the chkpath problem, still looking at findfirst.
Jeremy.
(This used to be commit c5be0082ef
)
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
db0ad252a0
commit
1a40a6e08a
@ -147,7 +147,12 @@ NTSTATUS unix_convert(connection_struct *conn,
|
|||||||
|
|
||||||
if (name[0] == '.' && (name[1] == '/' || name[1] == '\0')) {
|
if (name[0] == '.' && (name[1] == '/' || name[1] == '\0')) {
|
||||||
/* Start of pathname can't be "." only. */
|
/* Start of pathname can't be "." only. */
|
||||||
return NT_STATUS_OBJECT_NAME_INVALID;
|
if (name[1] == '\0' || name[2] == '\0') {
|
||||||
|
return NT_STATUS_OBJECT_NAME_INVALID;
|
||||||
|
} else {
|
||||||
|
/* Longer pathname starts with ./ */
|
||||||
|
return NT_STATUS_OBJECT_PATH_NOT_FOUND;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -632,6 +632,13 @@ int reply_chkpth(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
|
|||||||
status = unix_convert(conn, name, False, NULL, &sbuf);
|
status = unix_convert(conn, name, False, NULL, &sbuf);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
END_PROFILE(SMBchkpth);
|
END_PROFILE(SMBchkpth);
|
||||||
|
/* Strange DOS error code semantics only for chkpth... */
|
||||||
|
if (!(SVAL(inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) {
|
||||||
|
if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,status)) {
|
||||||
|
/* We need to map to ERRbadpath */
|
||||||
|
status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
|
||||||
|
}
|
||||||
|
}
|
||||||
return ERROR_NT(status);
|
return ERROR_NT(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user