]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: let net_update_dns_internal() set status before goto done in all cases
authorStefan Metzmacher <metze@samba.org>
Sat, 11 May 2024 00:38:21 +0000 (02:38 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 14 May 2024 10:18:31 +0000 (10:18 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/utils/net_ads_join_dns.c

index 3437f96ee589758de06187a0164cf24ad1770353..97f767aba661c0c1a21e4dba8daf71fd5d78a21b 100644 (file)
@@ -88,6 +88,7 @@ static NTSTATUS net_update_dns_internal(struct net_context *c,
                        ads_status = ads_connect( ads );
                        if ( !ADS_ERR_OK(ads_status) ) {
                                DEBUG(0,("net_update_dns_internal: Failed to connect to our DC!\n"));
+                               status = ads_ntstatus(ads_status);
                                goto done;
                        }
                }
@@ -95,12 +96,14 @@ static NTSTATUS net_update_dns_internal(struct net_context *c,
                ads_status = ads_do_search(ads, "", LDAP_SCOPE_BASE,
                                       "(objectclass=*)", rootname_attrs, &msg);
                if (!ADS_ERR_OK(ads_status)) {
+                       status = ads_ntstatus(ads_status);
                        goto done;
                }
 
                root_dn = ads_pull_string(ads, ctx, msg,  "rootDomainNamingContext");
                if ( !root_dn ) {
                        ads_msgfree( ads, msg );
+                       status = NT_STATUS_INVALID_NETWORK_RESPONSE;
                        goto done;
                }