]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:net: make use of c->explicit_credentials in order to check for valid credentials
authorStefan Metzmacher <metze@samba.org>
Thu, 7 Mar 2024 13:47:06 +0000 (14:47 +0100)
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.c
source3/utils/net_ads.c

index 2d9df0a5723d4ed307764a8263e84d28cfa27ef3..7747aff917172b1e6a5cd28dc6c49af5bc9be6f4 100644 (file)
@@ -295,7 +295,7 @@ static int net_setauthuser(struct net_context *c, int argc, const char **argv)
                return 0;
        }
 
-       if (!c->opt_user_specified) {
+       if (!c->explicit_credentials) {
                d_fprintf(stderr, _("Usage:\n"));
                d_fprintf(stderr,
                          _("    net setauthuser -U user[%%password]\n"
index 614de0f0c5fcf5462a9dc37558765e8a3a65307c..6a106af3f89dbbbdf40d7b26df914230bfff20c7 100644 (file)
@@ -2995,7 +2995,7 @@ static int net_ads_keytab_flush(struct net_context *c,
                return -1;
        }
 
-       if (!c->opt_user_specified && c->opt_password == NULL) {
+       if (!c->explicit_credentials) {
                net_use_krb_machine_account(c);
        }
 
@@ -3036,7 +3036,7 @@ static int net_ads_keytab_add(struct net_context *c,
 
        d_printf(_("Processing principals to add...\n"));
 
-       if (!c->opt_user_specified && c->opt_password == NULL) {
+       if (!c->explicit_credentials) {
                net_use_krb_machine_account(c);
        }
 
@@ -3092,7 +3092,7 @@ static int net_ads_keytab_delete(struct net_context *c,
 
        d_printf(_("Processing principals to delete...\n"));
 
-       if (!c->opt_user_specified && c->opt_password == NULL) {
+       if (!c->explicit_credentials) {
                net_use_krb_machine_account(c);
        }
 
@@ -3128,7 +3128,7 @@ static int net_ads_keytab_create(struct net_context *c, int argc, const char **a
 
        net_warn_member_options();
 
-       if (!c->opt_user_specified && c->opt_password == NULL) {
+       if (!c->explicit_credentials) {
                net_use_krb_machine_account(c);
        }