summaryrefslogtreecommitdiffstats
path: root/source/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-01 04:41:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:39:45 -0500
commit5d9bb91ab7bb080b56b25849e646143ab3ad8252 (patch)
treea05ef4b19ceb58d69d0d352c0be58bfd4f1cfde6 /source/utils
parentc097e107391cd97dd829c19b672b6a7adece504f (diff)
downloadsamba-5d9bb91ab7bb080b56b25849e646143ab3ad8252.tar.gz
samba-5d9bb91ab7bb080b56b25849e646143ab3ad8252.tar.xz
samba-5d9bb91ab7bb080b56b25849e646143ab3ad8252.zip
r17984: Ensure we never indirect a null opt_username if it wasn't
specified. Jeremy.
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/ntlm_auth.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c
index 916763ad212..39b511ca4e7 100644
--- a/source/utils/ntlm_auth.c
+++ b/source/utils/ntlm_auth.c
@@ -811,6 +811,11 @@ static void manage_client_ntlmssp_request(enum stdio_helper_mode stdio_helper_mo
NTSTATUS nt_status;
BOOL first = False;
+ if (!opt_username || !*opt_username) {
+ x_fprintf(x_stderr, "username must be specified!\n\n");
+ exit(1);
+ }
+
if (strlen(buf) < 2) {
DEBUG(1, ("NTLMSSP query [%s] invalid", buf));
x_fprintf(x_stdout, "BH\n");
@@ -1506,6 +1511,11 @@ static void manage_gss_spnego_client_request(enum stdio_helper_mode stdio_helper
SPNEGO_DATA spnego;
ssize_t len;
+ if (!opt_username || !*opt_username) {
+ x_fprintf(x_stderr, "username must be specified!\n\n");
+ exit(1);
+ }
+
if (strlen(buf) <= 3) {
DEBUG(1, ("SPNEGO query [%s] too short\n", buf));
x_fprintf(x_stdout, "BH\n");