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

libsmb: Avoid a call to SMBC_errno()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-01-21 20:29:34 +01:00 committed by Jeremy Allison
parent c78f0a96a3
commit 3844fe8730

View File

@ -2242,9 +2242,14 @@ SMBC_unlink_ctx(SMBCCTX *context,
}
/*d_printf(">>>unlink: resolved path as %s\n", targetpath);*/
if (!NT_STATUS_IS_OK(cli_unlink(targetcli, targetpath, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
status = cli_unlink(
targetcli,
targetpath,
FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
errno = SMBC_errno(context, targetcli);
if (!NT_STATUS_IS_OK(status)) {
errno = cli_status_to_errno(status);
if (errno == EACCES) { /* Check if the file is a directory */