1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-19 13:44:20 +03:00

libsmb: Convert SMBC_getatr() to NTSTATUS

This avoids a few calls 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 21:15:06 +01:00
committed by Jeremy Allison
parent 0b351cda24
commit d4f8fdd69a
5 changed files with 29 additions and 27 deletions

View File

@@ -985,10 +985,12 @@ SMBC_opendir_ctx(SMBCCTX *context,
*/
path[path_len] = '\0'; /* restore original path */
if (SMBC_getatr(context,
srv,
path,
&sb) &&
status = SMBC_getatr(
context,
srv,
path,
&sb);
if (NT_STATUS_IS_OK(status) &&
!S_ISDIR(sb.st_mode)) {
/* It is. Correct the error value */
@@ -2255,14 +2257,13 @@ SMBC_unlink_ctx(SMBCCTX *context,
int saverr = errno;
struct stat sb = {0};
bool ok;
ok = SMBC_getatr(context, srv, path, &sb);
if (!ok) {
status = SMBC_getatr(context, srv, path, &sb);
if (!NT_STATUS_IS_OK(status)) {
/* Hmmm, bad error ... What? */
errno = SMBC_errno(context, targetcli);
TALLOC_FREE(frame);
errno = cli_status_to_errno(status);
return -1;
}