lib:cmdline: Ignore the return code of cli_credentials_guess()
authorAndreas Schneider <asn@samba.org>
Tue, 27 Apr 2021 14:19:31 +0000 (16:19 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 29 Jun 2021 02:19:35 +0000 (02:19 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/cmdline/cmdline.c

index 11630287a8369420f53d715c448d488402680bca..a0a55f4dcfbb4ff8edc14e39744d8321b70238b8 100644 (file)
@@ -757,8 +757,15 @@ static void popt_common_credentials_callback(poptContext popt_ctx,
                /*
                 * This calls cli_credentials_set_conf() to get the defaults
                 * form smb.conf and set the winbind separator.
+                *
+                * Just warn that we can't read the smb.conf. The might not be
+                * one available or we want to ignore it.
                 */
-               cli_credentials_guess(creds, lp_ctx);
+               ok = cli_credentials_guess(creds, lp_ctx);
+               if (!ok) {
+                       fprintf(stderr,
+                               "Unable to read defaults from smb.conf\n");
+               }
 
                (void)cli_credentials_get_password_and_obtained(creds,
                                                                &password_obtained);