libads: set proper ads_keytab_flush() return code on error
authorSwen Schillig <swen@linux.ibm.com>
Wed, 21 Nov 2018 09:59:31 +0000 (10:59 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 22 Nov 2018 07:22:18 +0000 (08:22 +0100)
The return code was left on success when the calls to
ads_get_machine_kvno() or ads_clear_service_principal_names()
failed and the processing had to be aborted.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libads/kerberos_keytab.c

index 8eb7b2a7c6baac508284906251fcccbed87a4359..792dc999e6cdec3781f5799885dd3fbb975f45e0 100644 (file)
@@ -453,6 +453,7 @@ int ads_keytab_flush(ADS_STRUCT *ads)
        if (kvno == -1) {
                /* -1 indicates a failure */
                DEBUG(1, (__location__ ": Error determining the kvno.\n"));
+               ret = -1;
                goto out;
        }
 
@@ -473,6 +474,7 @@ int ads_keytab_flush(ADS_STRUCT *ads)
        if (!ADS_ERR_OK(aderr)) {
                DEBUG(1, (__location__ ": Error while clearing service "
                          "principal listings in LDAP.\n"));
+               ret = -1;
                goto out;
        }