1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

smbd: refuse_symlink() - do not fail if the file does not exist

If the file does not exist, it is not a symlink. Current callers
use this function to see if extended attributes can be set / fetched.
Allow them to try and leave the error code at the discretion of the
VFS.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Uri Simchoni 2017-03-02 08:46:44 +02:00 committed by Ralph Boehme
parent f9aaddcdd8
commit abd845082e

View File

@ -75,8 +75,11 @@ static NTSTATUS refuse_symlink(connection_struct *conn,
int ret = vfs_stat_smb_basename(conn,
smb_fname,
&sbuf);
if (ret == -1) {
if (ret == -1 && errno != ENOENT) {
return map_nt_error_from_unix(errno);
} else if (ret == -1) {
/* it's not a symlink.. */
return NT_STATUS_OK;
}
pst = &sbuf;
}