s3: passdb: ret doesn't seem to be needed at all
authorNoel Power <noel.power@suse.com>
Fri, 27 Sep 2019 07:07:24 +0000 (08:07 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 1 Oct 2019 00:28:44 +0000 (00:28 +0000)
I was looking at the wrong hunk when examining this, ret seems redundant
and the existing status can cover things

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct  1 00:28:44 UTC 2019 on sn-devel-184

source3/passdb/pdb_ldap.c

index aefd770ad3170adfa0c6e6b488a5d31cea0d730e..e9b01e57c6c8af0c482044b28e7eff5ae02bdb5d 100644 (file)
@@ -2119,7 +2119,6 @@ static NTSTATUS ldapsam_rename_sam_account(struct pdb_methods *my_methods,
 
 static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, struct samu * newpwd)
 {
-       NTSTATUS ret = NT_STATUS_UNSUCCESSFUL;
        struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
        int rc;
        LDAPMessage     *result = NULL;
@@ -2338,8 +2337,8 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, struct s
                        break;
        }
 
-       ret = ldapsam_modify_entry(my_methods,newpwd,dn,mods,ldap_op, pdb_element_is_set_or_changed);
-       if (!NT_STATUS_IS_OK(ret)) {
+       status = ldapsam_modify_entry(my_methods,newpwd,dn,mods,ldap_op, pdb_element_is_set_or_changed);
+       if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("ldapsam_add_sam_account: failed to modify/add user with uid = %s (dn = %s)\n",
                         pdb_get_username(newpwd),dn));
                ldap_mods_free(mods, true);