From e43a05ee3b512f77e524e86e1d41772598ab6a67 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 19 Aug 2024 09:28:45 +0200 Subject: [PATCH] libsmb: Don't set errno in cli_NetServerEnum() No caller looks at it, and if someone should ever want to return a more informative error, we now have NTSTATUS Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- source3/libsmb/clirap.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index cdaca3f8992..6d07aca3498 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -199,8 +199,6 @@ NTSTATUS cli_NetServerEnum( int res; NTSTATUS status; - errno = 0; /* reset */ - /* * This may take more than one transaction, so we should loop until * we no longer get a more data to process or we have all of the @@ -394,7 +392,6 @@ NTSTATUS cli_NetServerEnum( /* If we have more data, but no last entry then error out */ if (!last_entry && (res == ERRmoredata)) { - errno = EINVAL; res = 0; } @@ -408,17 +405,6 @@ NTSTATUS cli_NetServerEnum( TALLOC_FREE(rdata); SAFE_FREE(last_entry); - if (res == -1) { - errno = cli_errno(cli); - } else { - if (!return_cnt) { - /* this is a very special case, when the domain master for the - work group isn't part of the work group itself, there is something - wild going on */ - errno = ENOENT; - } - } - if (return_cnt == 0) { return NT_STATUS_NO_MORE_ENTRIES; } -- 2.47.3