s3:winbind: Fix regression introduced with bso #12851
authorAndreas Schneider <asn@samba.org>
Wed, 20 Jun 2018 09:38:28 +0000 (11:38 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 20 Jun 2018 23:03:52 +0000 (01:03 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12851

Pair-Programmed-With: Guenther Deschner <gd@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Jun 21 01:03:52 CEST 2018 on sn-devel-144

source3/winbindd/wb_getpwsid.c

index 8e114abf965a37f8377cb5a6c2e3cae5cc2b673e..8dc09eb513d3915be70d912da740a2a0d9c01ddc 100644 (file)
@@ -101,25 +101,17 @@ static void wb_getpwsid_queryuser_done(struct tevent_req *subreq)
                                    info->domain_name,
                                    acct_name,
                                    &mapped_name);
-       if (NT_STATUS_IS_OK(status)) {
-               output_username = fill_domain_username_talloc(state,
-                                    info->domain_name,
-                                    mapped_name, true);
-               if (output_username == NULL) {
-                       tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
-                       return;
-               }
+       if (NT_STATUS_IS_OK(status) ||
+           NT_STATUS_EQUAL(status, NT_STATUS_FILE_RENAMED)) {
                fstrcpy(acct_name, mapped_name);
-       } else if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_RENAMED)) {
-               fstrcpy(acct_name, mapped_name);
-       } else {
-               output_username = fill_domain_username_talloc(state,
-                                    info->domain_name,
-                                    acct_name, true);
-               if (output_username == NULL) {
-                       tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
-                       return;
-               }
+       }
+       output_username = fill_domain_username_talloc(state,
+                                                     info->domain_name,
+                                                     acct_name,
+                                                     true);
+       if (output_username == NULL) {
+               tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+               return;
        }
 
        strlcpy(pw->pw_name, output_username, sizeof(pw->pw_name));