]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Don't set errno in cli_NetServerEnum()
authorVolker Lendecke <vl@samba.org>
Mon, 19 Aug 2024 07:28:45 +0000 (09:28 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 20 Aug 2024 09:34:40 +0000 (09:34 +0000)
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 <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/clirap.c

index cdaca3f8992dc1d163c9301142c5f0c9c1b45812..6d07aca34985add685b0f14086544cdac23fd504 100644 (file)
@@ -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;
        }