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:
committed by
Jeremy Allison
parent
0b351cda24
commit
d4f8fdd69a
@@ -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;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user