2 Unix SMB/CIFS implementation.
4 Winbind status program.
6 Copyright (C) Tim Potter 2000-2003
7 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2003-2004
8 Copyright (C) Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it> 2000
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include "dynconfig.h"
27 #include "system/passwd.h"
28 #include "lib/cmdline/popt_common.h"
29 #include "auth/auth.h"
33 #define DBGC_CLASS DBGC_WINBIND
35 #define SQUID_BUFFER_SIZE 2010
37 enum stdio_helper_mode {
48 #define NTLM_AUTH_FLAG_USER_SESSION_KEY 0x0004
49 #define NTLM_AUTH_FLAG_LMKEY 0x0008
52 typedef void (*stdio_helper_function)(enum stdio_helper_mode stdio_helper_mode,
53 char *buf, int length, void **private,
56 static void manage_squid_basic_request (enum stdio_helper_mode stdio_helper_mode,
57 char *buf, int length, void **private,
60 static void manage_gensec_request (enum stdio_helper_mode stdio_helper_mode,
61 char *buf, int length, void **private,
64 static void manage_ntlm_server_1_request (enum stdio_helper_mode stdio_helper_mode,
65 char *buf, int length, void **private,
68 static void manage_squid_request(enum stdio_helper_mode helper_mode,
69 stdio_helper_function fn);
72 enum stdio_helper_mode mode;
74 stdio_helper_function fn;
75 } stdio_helper_protocols[] = {
76 { SQUID_2_4_BASIC, "squid-2.4-basic", manage_squid_basic_request},
77 { SQUID_2_5_BASIC, "squid-2.5-basic", manage_squid_basic_request},
78 { SQUID_2_5_NTLMSSP, "squid-2.5-ntlmssp", manage_gensec_request},
79 { GSS_SPNEGO_CLIENT, "gss-spnego-client", manage_gensec_request},
80 { GSS_SPNEGO_SERVER, "gss-spnego", manage_gensec_request},
81 { NTLMSSP_CLIENT_1, "ntlmssp-client-1", manage_gensec_request},
82 { NTLM_SERVER_1, "ntlm-server-1", manage_ntlm_server_1_request},
83 { NUM_HELPER_MODES, NULL, NULL}
86 extern int winbindd_fd;
88 const char *opt_username;
89 const char *opt_domain;
90 const char *opt_workstation;
91 const char *opt_password;
95 static void mux_printf(unsigned int mux_id, const char *format, ...) PRINTF_ATTRIBUTE(2, 3);
97 static void mux_printf(unsigned int mux_id, const char *format, ...)
102 x_fprintf(x_stdout, "%d ", mux_id);
105 va_start(ap, format);
106 x_vfprintf(x_stdout, format, ap);
112 /* Copy of parse_domain_user from winbindd_util.c. Parse a string of the
113 form DOMAIN/user into a domain and a user */
115 static BOOL parse_ntlm_auth_domain_user(const char *domuser, fstring domain,
119 char *p = strchr(domuser,*lp_winbind_separator());
126 fstrcpy(domain, domuser);
127 domain[PTR_DIFF(p, domuser)] = 0;
132 /* Authenticate a user with a plaintext password */
134 static BOOL check_plaintext_auth(const char *user, const char *pass,
135 BOOL stdout_diagnostics)
137 return (strcmp(pass, opt_password) == 0);
140 /* authenticate a user with an encrypted username/password */
142 static NTSTATUS local_pw_check_specified(const char *username,
144 const char *workstation,
145 const DATA_BLOB *challenge,
146 const DATA_BLOB *lm_response,
147 const DATA_BLOB *nt_response,
149 DATA_BLOB *lm_session_key,
150 DATA_BLOB *user_session_key,
155 uint8_t lm_pw[16], nt_pw[16];
156 uint8_t *lm_pwd, *nt_pwd;
157 TALLOC_CTX *mem_ctx = talloc_init("local_pw_check_specified");
159 nt_status = NT_STATUS_NO_MEMORY;
162 E_md4hash(opt_password, nt_pw);
163 if (E_deshash(opt_password, lm_pw)) {
171 nt_status = ntlm_password_check(mem_ctx,
179 lm_pwd, nt_pwd, user_session_key, lm_session_key);
181 if (NT_STATUS_IS_OK(nt_status)) {
185 *lp_winbind_separator(),
189 DEBUG(3, ("Login for user [%s]\\[%s]@[%s] failed due to [%s]\n",
190 domain, username, workstation,
191 nt_errstr(nt_status)));
193 talloc_destroy(mem_ctx);
196 *error_string = strdup(nt_errstr(nt_status));
203 static void manage_squid_basic_request(enum stdio_helper_mode stdio_helper_mode,
204 char *buf, int length, void **private,
210 pass=memchr(buf,' ',length);
212 DEBUG(2, ("Password not found. Denying access\n"));
213 mux_printf(mux_id, "ERR\n");
219 if (stdio_helper_mode == SQUID_2_5_BASIC) {
220 rfc1738_unescape(user);
221 rfc1738_unescape(pass);
224 if (check_plaintext_auth(user, pass, False)) {
225 mux_printf(mux_id, "OK\n");
227 mux_printf(mux_id, "ERR\n");
231 /* This is a bit hairy, but the basic idea is to do a password callback
232 to the calling application. The callback comes from within gensec */
234 static void manage_gensec_get_pw_request(enum stdio_helper_mode stdio_helper_mode,
235 char *buf, int length, void **private,
239 struct gensec_security **gensec_state = (struct gensec_security **)private;
240 if (strlen(buf) < 2) {
241 DEBUG(1, ("query [%s] invalid", buf));
242 mux_printf(mux_id, "BH\n");
246 if (strlen(buf) > 3) {
247 in = base64_decode_data_blob(buf + 3);
249 in = data_blob(NULL, 0);
252 if (strncmp(buf, "PW ", 3) == 0) {
254 (*gensec_state)->password_callback_private = talloc_strndup((*gensec_state),
255 (const char *)in.data, in.length);
257 if ((*gensec_state)->password_callback_private == NULL) {
258 DEBUG(1, ("Out of memory\n"));
259 mux_printf(mux_id, "BH\n");
264 mux_printf(mux_id, "OK\n");
268 DEBUG(1, ("Asked for (and expected) a password\n"));
269 mux_printf(mux_id, "BH\n");
274 * Callback for gensec, to ask the calling application for a password. Uses the above function
275 * for the stdio part of this.
278 static NTSTATUS get_password(struct gensec_security *gensec_security,
284 /* Ask for a password */
285 mux_printf((unsigned int)gensec_security->password_callback_private, "PW\n");
286 gensec_security->password_callback_private = NULL;
288 manage_squid_request(NUM_HELPER_MODES /* bogus */, manage_gensec_get_pw_request);
289 *password = (char *)gensec_security->password_callback_private;
293 return NT_STATUS_INVALID_PARAMETER;
297 static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode,
298 char *buf, int length, void **private,
302 DATA_BLOB out = data_blob(NULL, 0);
303 char *out_base64 = NULL;
304 const char *reply_arg = NULL;
305 struct gensec_security **gensec_state = (struct gensec_security **)private;
308 const char *reply_code;
310 if (strlen(buf) < 2) {
311 DEBUG(1, ("query [%s] invalid", buf));
312 mux_printf(mux_id, "BH\n");
316 if (strlen(buf) > 3) {
317 in = base64_decode_data_blob(buf + 3);
319 in = data_blob(NULL, 0);
322 if (strncmp(buf, "YR", 2) == 0) {
323 if (gensec_state && *gensec_state) {
324 gensec_end(gensec_state);
325 *gensec_state = NULL;
327 } else if ( (strncmp(buf, "OK", 2) == 0)) {
331 } else if ( (strncmp(buf, "TT ", 3) != 0) &&
332 (strncmp(buf, "KK ", 3) != 0) &&
333 (strncmp(buf, "AF ", 3) != 0) &&
334 (strncmp(buf, "NA ", 3) != 0) &&
335 (strncmp(buf, "UG", 2) != 0) &&
336 (strncmp(buf, "PW ", 3) != 0)) {
337 DEBUG(1, ("SPNEGO request [%s] invalid\n", buf));
338 mux_printf(mux_id, "BH\n");
344 if (!(gensec_state && *gensec_state)) {
345 switch (stdio_helper_mode) {
346 case GSS_SPNEGO_CLIENT:
347 case NTLMSSP_CLIENT_1:
348 /* setup the client side */
350 if (!NT_STATUS_IS_OK(gensec_client_start(NULL, gensec_state))) {
353 gensec_set_username(*gensec_state, opt_username);
354 gensec_set_domain(*gensec_state, opt_domain);
356 if (!NT_STATUS_IS_OK(gensec_set_password(*gensec_state, opt_password))) {
357 DEBUG(1, ("Out of memory\n"));
358 mux_printf(mux_id, "BH\n");
363 gensec_set_password_callback(*gensec_state, get_password, (void*)mux_id);
367 case GSS_SPNEGO_SERVER:
368 case SQUID_2_5_NTLMSSP:
369 if (!NT_STATUS_IS_OK(gensec_server_start(NULL, gensec_state))) {
377 switch (stdio_helper_mode) {
378 case GSS_SPNEGO_CLIENT:
379 case GSS_SPNEGO_SERVER:
380 nt_status = gensec_start_mech_by_oid(*gensec_state, OID_SPNEGO);
385 case NTLMSSP_CLIENT_1:
389 case SQUID_2_5_NTLMSSP:
390 nt_status = gensec_start_mech_by_oid(*gensec_state, OID_NTLMSSP);
396 if (!NT_STATUS_IS_OK(nt_status)) {
397 DEBUG(1, ("SPENGO login failed to initialise: %s\n", nt_errstr(nt_status)));
398 mux_printf(mux_id, "BH\n");
403 if (strncmp(buf, "PW ", 3) == 0) {
405 if (!NT_STATUS_IS_OK(gensec_set_password(*gensec_state,
406 talloc_strndup((*gensec_state),
407 (const char *)in.data,
409 DEBUG(1, ("gensec_set_password failed: %s\n", nt_errstr(nt_status)));
410 mux_printf(mux_id, "BH %s\n", nt_errstr(nt_status));
415 mux_printf(mux_id, "OK\n");
420 if (strncmp(buf, "UG", 2) == 0) {
422 char *grouplist = NULL;
423 struct auth_session_info *session_info;
425 if (!NT_STATUS_IS_OK(gensec_session_info(*gensec_state, &session_info))) {
426 DEBUG(1, ("gensec_session_info failed: %s\n", nt_errstr(nt_status)));
427 mux_printf(mux_id, "BH %s\n", nt_errstr(nt_status));
432 /* get the string onto the context */
433 grouplist = talloc_strdup(session_info, "");
435 for (i=0; i< session_info->nt_user_token->num_sids; i++) {
436 grouplist = talloc_asprintf_append(grouplist, "%s,",
437 dom_sid_string(session_info,
438 session_info->nt_user_token->user_sids[i]));
441 mux_printf(mux_id, "GL %s\n", grouplist);
442 free_session_info(&session_info);
449 nt_status = gensec_update(*gensec_state, NULL, in, &out);
451 /* don't leak 'bad password'/'no such user' info to the network client */
452 nt_status = nt_status_squash(nt_status);
455 out_base64 = base64_encode_data_blob(out);
459 if (NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
463 } else if ((*gensec_state)->gensec_role == GENSEC_CLIENT) {
465 } else if ((*gensec_state)->gensec_role == GENSEC_SERVER) {
472 } else if (NT_STATUS_EQUAL(nt_status, NT_STATUS_ACCESS_DENIED)) {
474 reply_arg = nt_errstr(nt_status);
475 DEBUG(1, ("GENSEC login failed: %s\n", nt_errstr(nt_status)));
476 } else if (NT_STATUS_EQUAL(nt_status, NT_STATUS_UNSUCCESSFUL)) {
478 reply_arg = nt_errstr(nt_status);
479 DEBUG(1, ("GENSEC login failed: %s\n", nt_errstr(nt_status)));
480 } else if (!NT_STATUS_IS_OK(nt_status)) {
482 reply_arg = nt_errstr(nt_status);
483 DEBUG(1, ("GENSEC login failed: %s\n", nt_errstr(nt_status)));
484 } else if /* OK */ ((*gensec_state)->gensec_role == GENSEC_SERVER) {
485 struct auth_session_info *session_info;
487 nt_status = gensec_session_info(*gensec_state, &session_info);
488 if (!NT_STATUS_IS_OK(nt_status)) {
490 reply_arg = nt_errstr(nt_status);
491 DEBUG(1, ("GENSEC failed to retreive the session info: %s\n", nt_errstr(nt_status)));
495 reply_arg = talloc_asprintf(*gensec_state,
496 "%s%s%s", session_info->server_info->domain,
497 lp_winbind_separator(), session_info->server_info->account_name);
498 talloc_free(session_info);
500 } else if ((*gensec_state)->gensec_role == GENSEC_CLIENT) {
507 switch (stdio_helper_mode) {
508 case GSS_SPNEGO_SERVER:
509 mux_printf(mux_id, "%s %s %s\n", reply_code,
510 out_base64 ? out_base64 : "*",
511 reply_arg ? reply_arg : "*");
515 mux_printf(mux_id, "%s %s\n", reply_code, out_base64);
516 } else if (reply_arg) {
517 mux_printf(mux_id, "%s %s\n", reply_code, reply_arg);
519 mux_printf(mux_id, "%s\n", reply_code);
523 SAFE_FREE(out_base64);
527 static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mode,
528 char *buf, int length, void **private,
531 char *request, *parameter;
532 static DATA_BLOB challenge;
533 static DATA_BLOB lm_response;
534 static DATA_BLOB nt_response;
535 static char *full_username;
536 static char *username;
538 static char *plaintext_password;
539 static BOOL ntlm_server_1_user_session_key;
540 static BOOL ntlm_server_1_lm_session_key;
542 if (strequal(buf, ".")) {
543 if (!full_username && !username) {
544 mux_printf(mux_id, "Error: No username supplied!\n");
545 } else if (plaintext_password) {
546 /* handle this request as plaintext */
547 if (!full_username) {
548 if (asprintf(&full_username, "%s%c%s", domain, *lp_winbind_separator(), username) == -1) {
549 mux_printf(mux_id, "Error: Out of memory in asprintf!\n.\n");
553 if (check_plaintext_auth(full_username, plaintext_password, False)) {
554 mux_printf(mux_id, "Authenticated: Yes\n");
556 mux_printf(mux_id, "Authenticated: No\n");
558 } else if (!lm_response.data && !nt_response.data) {
559 mux_printf(mux_id, "Error: No password supplied!\n");
560 } else if (!challenge.data) {
561 mux_printf(mux_id, "Error: No lanman-challenge supplied!\n");
563 char *error_string = NULL;
565 DATA_BLOB user_session_key;
568 if (full_username && !username) {
572 if (!parse_ntlm_auth_domain_user(full_username, fstr_user, fstr_domain)) {
573 /* username might be 'tainted', don't print into our new-line deleimianted stream */
574 mux_printf(mux_id, "Error: Could not parse into domain and username\n");
578 username = smb_xstrdup(fstr_user);
579 domain = smb_xstrdup(fstr_domain);
583 domain = smb_xstrdup(lp_workgroup());
586 if (ntlm_server_1_lm_session_key)
587 flags |= NTLM_AUTH_FLAG_LMKEY;
589 if (ntlm_server_1_user_session_key)
590 flags |= NTLM_AUTH_FLAG_USER_SESSION_KEY;
592 if (!NT_STATUS_IS_OK(
593 local_pw_check_specified(username,
605 mux_printf(mux_id, "Authenticated: No\n");
606 mux_printf(mux_id, "Authentication-Error: %s\n.\n", error_string);
607 SAFE_FREE(error_string);
609 static char zeros[16];
611 char *hex_user_session_key;
613 mux_printf(mux_id, "Authenticated: Yes\n");
615 if (ntlm_server_1_lm_session_key
617 && (memcmp(zeros, lm_key.data,
618 lm_key.length) != 0)) {
619 hex_encode(lm_key.data,
622 mux_printf(mux_id, "LANMAN-Session-Key: %s\n", hex_lm_key);
623 SAFE_FREE(hex_lm_key);
626 if (ntlm_server_1_user_session_key
627 && user_session_key.length
628 && (memcmp(zeros, user_session_key.data,
629 user_session_key.length) != 0)) {
630 hex_encode(user_session_key.data,
631 user_session_key.length,
632 &hex_user_session_key);
633 mux_printf(mux_id, "User-Session-Key: %s\n", hex_user_session_key);
634 SAFE_FREE(hex_user_session_key);
638 /* clear out the state */
639 challenge = data_blob(NULL, 0);
640 nt_response = data_blob(NULL, 0);
641 lm_response = data_blob(NULL, 0);
642 SAFE_FREE(full_username);
645 SAFE_FREE(plaintext_password);
646 ntlm_server_1_user_session_key = False;
647 ntlm_server_1_lm_session_key = False;
648 mux_printf(mux_id, ".\n");
655 /* Indicates a base64 encoded structure */
656 parameter = strstr(request, ":: ");
658 parameter = strstr(request, ": ");
661 DEBUG(0, ("Parameter not found!\n"));
662 mux_printf(mux_id, "Error: Parameter not found!\n.\n");
679 base64_decode_inplace(parameter);
682 if (strequal(request, "LANMAN-Challenge")) {
683 challenge = strhex_to_data_blob(parameter);
684 if (challenge.length != 8) {
685 mux_printf(mux_id, "Error: hex decode of %s failed! (got %d bytes, expected 8)\n.\n",
687 (int)challenge.length);
688 challenge = data_blob(NULL, 0);
690 } else if (strequal(request, "NT-Response")) {
691 nt_response = strhex_to_data_blob(parameter);
692 if (nt_response.length < 24) {
693 mux_printf(mux_id, "Error: hex decode of %s failed! (only got %d bytes, needed at least 24)\n.\n",
695 (int)nt_response.length);
696 nt_response = data_blob(NULL, 0);
698 } else if (strequal(request, "LANMAN-Response")) {
699 lm_response = strhex_to_data_blob(parameter);
700 if (lm_response.length != 24) {
701 mux_printf(mux_id, "Error: hex decode of %s failed! (got %d bytes, expected 24)\n.\n",
703 (int)lm_response.length);
704 lm_response = data_blob(NULL, 0);
706 } else if (strequal(request, "Password")) {
707 plaintext_password = smb_xstrdup(parameter);
708 } else if (strequal(request, "NT-Domain")) {
709 domain = smb_xstrdup(parameter);
710 } else if (strequal(request, "Username")) {
711 username = smb_xstrdup(parameter);
712 } else if (strequal(request, "Full-Username")) {
713 full_username = smb_xstrdup(parameter);
714 } else if (strequal(request, "Request-User-Session-Key")) {
715 ntlm_server_1_user_session_key = strequal(parameter, "Yes");
716 } else if (strequal(request, "Request-LanMan-Session-Key")) {
717 ntlm_server_1_lm_session_key = strequal(parameter, "Yes");
719 mux_printf(mux_id, "Error: Unknown request %s\n.\n", request);
723 static void manage_squid_request(enum stdio_helper_mode helper_mode,
724 stdio_helper_function fn)
726 char buf[SQUID_BUFFER_SIZE+1];
732 unsigned int max_mux;
733 void **private_pointers;
736 static struct mux_private *mux_private;
737 static void *normal_private;
740 /* this is not a typo - x_fgets doesn't work too well under squid */
741 if (fgets(buf, sizeof(buf)-1, stdin) == NULL) {
743 DEBUG(1, ("fgets() failed! dying..... errno=%d (%s)\n", ferror(stdin),
744 strerror(ferror(stdin))));
746 exit(1); /* BIIG buffer */
751 c=memchr(buf,'\n',sizeof(buf)-1);
760 DEBUG(0, ("Oversized message\n"));
761 x_fprintf(x_stdout, "ERR\n");
766 DEBUG(10, ("Got '%s' from squid (length: %d).\n",buf,length));
768 if (buf[0] == '\0') {
769 DEBUG(0, ("Invalid Request (empty)\n"));
770 x_fprintf(x_stdout, "ERR\n");
775 if (sscanf(buf, "%u ", &mux_id) != 1) {
776 DEBUG(0, ("Invalid Request - no multiplex id\n"));
777 x_fprintf(x_stdout, "ERR\n");
781 mux_private = talloc_p(NULL, struct mux_private);
782 mux_private->max_mux = 0;
783 mux_private->private_pointers = NULL;
786 c=memchr(buf,' ',sizeof(buf)-1);
788 if (mux_id >= mux_private->max_mux) {
789 unsigned int prev_max = mux_private->max_mux;
790 mux_private->max_mux = mux_id + 1;
791 mux_private->private_pointers
792 = talloc_realloc_p(mux_private,
793 mux_private->private_pointers,
794 void *, mux_private->max_mux);
795 memset(&mux_private->private_pointers[prev_max], '\0',
796 (sizeof(*mux_private->private_pointers) * (mux_private->max_mux - prev_max)));
799 private = &mux_private->private_pointers[mux_id];
802 private = &normal_private;
805 fn(helper_mode, c, length, private, mux_id);
808 static void squid_stream(enum stdio_helper_mode stdio_mode,
809 stdio_helper_function fn) {
810 /* initialize FDescs */
811 x_setbuf(x_stdout, NULL);
812 x_setbuf(x_stderr, NULL);
814 manage_squid_request(stdio_mode, fn);
831 OPT_USER_SESSION_KEY,
833 OPT_REQUIRE_MEMBERSHIP,
837 int main(int argc, const char **argv)
839 static const char *helper_protocol;
844 /* NOTE: DO NOT change this interface without considering the implications!
845 This is an external interface, which other programs will use to interact
849 /* We do not use single-letter command abbreviations, because they harm future
850 interface stability. */
852 struct poptOption long_options[] = {
854 { "helper-protocol", 0, POPT_ARG_STRING, &helper_protocol, OPT_DOMAIN, "operate as a stdio-based helper", "helper protocol to use"},
855 { "domain", 0, POPT_ARG_STRING, &opt_domain, OPT_DOMAIN, "domain name"},
856 { "workstation", 0, POPT_ARG_STRING, &opt_workstation, OPT_WORKSTATION, "workstation"},
857 { "username", 0, POPT_ARG_STRING, &opt_username, OPT_PASSWORD, "Username"},
858 { "password", 0, POPT_ARG_STRING, &opt_password, OPT_PASSWORD, "User's plaintext password"},
859 { "multiplex", 0, POPT_ARG_NONE, &opt_multiplex, OPT_MULTIPLEX, "Multiplex Mode"},
864 /* Samba client initialisation */
866 setup_logging("ntlm_auth", DEBUG_STDERR);
868 if (!lp_load(dyn_CONFIGFILE, True, False, False)) {
869 d_fprintf(stderr, "wbinfo: error opening config file %s. Error was %s\n",
870 dyn_CONFIGFILE, strerror(errno));
876 pc = poptGetContext("ntlm_auth", argc, argv, long_options, 0);
878 /* Parse command line options */
881 poptPrintHelp(pc, stderr, 0);
885 pc = poptGetContext(NULL, argc, (const char **)argv, long_options,
886 POPT_CONTEXT_KEEP_FIRST);
888 while((opt = poptGetNextOpt(pc)) != -1) {
894 fprintf(stderr, "%s: %s\n",
895 poptBadOption(pc, POPT_BADOPTION_NOALIAS),
900 ntlm_auth_init_subsystems;
903 if (opt_domain == NULL) {
904 opt_domain = lp_workgroup();
907 if (helper_protocol) {
909 for (i=0; i<NUM_HELPER_MODES; i++) {
910 if (strcmp(helper_protocol, stdio_helper_protocols[i].name) == 0) {
911 squid_stream(stdio_helper_protocols[i].mode, stdio_helper_protocols[i].fn);
915 x_fprintf(x_stderr, "unknown helper protocol [%s]\n\nValid helper protools:\n\n", helper_protocol);
917 for (i=0; i<NUM_HELPER_MODES; i++) {
918 x_fprintf(x_stderr, "%s\n", stdio_helper_protocols[i].name);
925 x_fprintf(x_stderr, "username must be specified!\n\n");
926 poptPrintHelp(pc, stderr, 0);
930 if (opt_workstation == NULL) {
931 opt_workstation = lp_netbios_name();
935 opt_password = getpass("password: ");
941 asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(), opt_username);
942 if (!check_plaintext_auth(user, opt_password, True)) {