2 Unix SMB/CIFS implementation.
4 Winbind status program.
6 Copyright (C) Tim Potter 2000-2003
7 Copyright (C) Andrew Bartlett 2002
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #define DBGC_CLASS DBGC_WINBIND
31 extern int winbindd_fd;
33 static char winbind_separator(void)
35 struct winbindd_response response;
42 ZERO_STRUCT(response);
44 /* Send off request */
46 if (winbindd_request(WINBINDD_INFO, NULL, &response) !=
48 d_printf("could not obtain winbind separator!\n");
49 /* HACK: (this module should not call lp_ funtions) */
50 return *lp_winbind_separator();
53 sep = response.data.info.winbind_separator;
57 d_printf("winbind separator was NULL!\n");
58 /* HACK: (this module should not call lp_ funtions) */
59 sep = *lp_winbind_separator();
65 static const char *get_winbind_domain(void)
67 struct winbindd_response response;
68 static fstring winbind_domain;
70 ZERO_STRUCT(response);
72 /* Send off request */
74 if (winbindd_request(WINBINDD_DOMAIN_NAME, NULL, &response) !=
76 d_printf("could not obtain winbind domain name!\n");
78 /* HACK: (this module should not call lp_ funtions) */
79 return lp_workgroup();
82 fstrcpy(winbind_domain, response.data.domain_name);
84 return winbind_domain;
88 /* Copy of parse_domain_user from winbindd_util.c. Parse a string of the
89 form DOMAIN/user into a domain and a user */
91 static BOOL parse_wbinfo_domain_user(const char *domuser, fstring domain,
95 char *p = strchr(domuser,winbind_separator());
98 fstrcpy(user, domuser);
99 fstrcpy(domain, get_winbind_domain());
104 fstrcpy(domain, domuser);
105 domain[PTR_DIFF(p, domuser)] = 0;
111 /* List groups a user is a member of */
113 static BOOL wbinfo_get_usergroups(char *user)
115 struct winbindd_request request;
116 struct winbindd_response response;
120 ZERO_STRUCT(response);
124 fstrcpy(request.data.username, user);
126 result = winbindd_request(WINBINDD_GETGROUPS, &request, &response);
128 if (result != NSS_STATUS_SUCCESS)
131 for (i = 0; i < response.data.num_entries; i++)
132 d_printf("%d\n", (int)((gid_t *)response.extra_data)[i]);
134 SAFE_FREE(response.extra_data);
140 /* List group SIDs a user SID is a member of */
141 static BOOL wbinfo_get_usersids(char *user_sid)
143 struct winbindd_request request;
144 struct winbindd_response response;
149 ZERO_STRUCT(response);
152 fstrcpy(request.data.sid, user_sid);
154 result = winbindd_request(WINBINDD_GETUSERSIDS, &request, &response);
156 if (result != NSS_STATUS_SUCCESS)
159 s = response.extra_data;
160 for (i = 0; i < response.data.num_entries; i++) {
165 SAFE_FREE(response.extra_data);
170 /* Convert NetBIOS name to IP */
172 static BOOL wbinfo_wins_byname(char *name)
174 struct winbindd_request request;
175 struct winbindd_response response;
177 ZERO_STRUCT(request);
178 ZERO_STRUCT(response);
182 fstrcpy(request.data.winsreq, name);
184 if (winbindd_request(WINBINDD_WINS_BYNAME, &request, &response) !=
185 NSS_STATUS_SUCCESS) {
189 /* Display response */
191 printf("%s\n", response.data.winsresp);
196 /* Convert IP to NetBIOS name */
198 static BOOL wbinfo_wins_byip(char *ip)
200 struct winbindd_request request;
201 struct winbindd_response response;
203 ZERO_STRUCT(request);
204 ZERO_STRUCT(response);
208 fstrcpy(request.data.winsreq, ip);
210 if (winbindd_request(WINBINDD_WINS_BYIP, &request, &response) !=
211 NSS_STATUS_SUCCESS) {
215 /* Display response */
217 printf("%s\n", response.data.winsresp);
222 /* List trusted domains */
224 static BOOL wbinfo_list_domains(void)
226 struct winbindd_response response;
229 ZERO_STRUCT(response);
233 if (winbindd_request(WINBINDD_LIST_TRUSTDOM, NULL, &response) !=
237 /* Display response */
239 if (response.extra_data) {
240 const char *extra_data = (char *)response.extra_data;
242 while(next_token(&extra_data, name, ",", sizeof(fstring)))
243 d_printf("%s\n", name);
245 SAFE_FREE(response.extra_data);
252 /* show sequence numbers */
253 static BOOL wbinfo_show_sequence(const char *domain)
255 struct winbindd_request request;
256 struct winbindd_response response;
258 ZERO_STRUCT(response);
259 ZERO_STRUCT(request);
262 fstrcpy( request.domain_name, domain );
266 if (winbindd_request(WINBINDD_SHOW_SEQUENCE, &request, &response) !=
270 /* Display response */
272 if (response.extra_data) {
273 char *extra_data = (char *)response.extra_data;
274 d_printf("%s", extra_data);
275 SAFE_FREE(response.extra_data);
281 /* Show domain info */
283 static BOOL wbinfo_domain_info(const char *domain_name)
285 struct winbindd_request request;
286 struct winbindd_response response;
288 ZERO_STRUCT(request);
289 ZERO_STRUCT(response);
291 fstrcpy(request.domain_name, domain_name);
295 if (winbindd_request(WINBINDD_DOMAIN_INFO, &request, &response) !=
299 /* Display response */
301 d_printf("Name : %s\n", response.data.domain_info.name);
302 d_printf("Alt_Name : %s\n", response.data.domain_info.alt_name);
304 d_printf("SID : %s\n", response.data.domain_info.sid);
306 d_printf("Active Directory : %s\n",
307 response.data.domain_info.active_directory ? "Yes" : "No");
308 d_printf("Native : %s\n",
309 response.data.domain_info.native_mode ? "Yes" : "No");
311 d_printf("Primary : %s\n",
312 response.data.domain_info.primary ? "Yes" : "No");
314 d_printf("Sequence : %d\n", response.data.domain_info.sequence_number);
319 /* Check trust account password */
321 static BOOL wbinfo_check_secret(void)
323 struct winbindd_response response;
326 ZERO_STRUCT(response);
328 result = winbindd_request(WINBINDD_CHECK_MACHACC, NULL, &response);
330 d_printf("checking the trust secret via RPC calls %s\n",
331 (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed");
333 if (result != NSS_STATUS_SUCCESS)
334 d_printf("error code was %s (0x%x)\n",
335 response.data.auth.nt_status_string,
336 response.data.auth.nt_status);
338 return result == NSS_STATUS_SUCCESS;
341 /* Convert uid to sid */
343 static BOOL wbinfo_uid_to_sid(uid_t uid)
345 struct winbindd_request request;
346 struct winbindd_response response;
348 ZERO_STRUCT(request);
349 ZERO_STRUCT(response);
353 request.data.uid = uid;
355 if (winbindd_request(WINBINDD_UID_TO_SID, &request, &response) !=
359 /* Display response */
361 d_printf("%s\n", response.data.sid.sid);
366 /* Convert gid to sid */
368 static BOOL wbinfo_gid_to_sid(gid_t gid)
370 struct winbindd_request request;
371 struct winbindd_response response;
373 ZERO_STRUCT(request);
374 ZERO_STRUCT(response);
378 request.data.gid = gid;
380 if (winbindd_request(WINBINDD_GID_TO_SID, &request, &response) !=
384 /* Display response */
386 d_printf("%s\n", response.data.sid.sid);
391 /* Convert sid to uid */
393 static BOOL wbinfo_sid_to_uid(char *sid)
395 struct winbindd_request request;
396 struct winbindd_response response;
398 ZERO_STRUCT(request);
399 ZERO_STRUCT(response);
403 fstrcpy(request.data.sid, sid);
405 if (winbindd_request(WINBINDD_SID_TO_UID, &request, &response) !=
409 /* Display response */
411 d_printf("%d\n", (int)response.data.uid);
416 static BOOL wbinfo_sid_to_gid(char *sid)
418 struct winbindd_request request;
419 struct winbindd_response response;
421 ZERO_STRUCT(request);
422 ZERO_STRUCT(response);
426 fstrcpy(request.data.sid, sid);
428 if (winbindd_request(WINBINDD_SID_TO_GID, &request, &response) !=
432 /* Display response */
434 d_printf("%d\n", (int)response.data.gid);
439 static BOOL wbinfo_allocate_rid(void)
443 if (!winbind_allocate_rid(&rid))
446 d_printf("New rid: %d\n", rid);
451 /* Convert sid to string */
453 static BOOL wbinfo_lookupsid(char *sid)
455 struct winbindd_request request;
456 struct winbindd_response response;
458 ZERO_STRUCT(request);
459 ZERO_STRUCT(response);
461 /* Send off request */
463 fstrcpy(request.data.sid, sid);
465 if (winbindd_request(WINBINDD_LOOKUPSID, &request, &response) !=
469 /* Display response */
471 d_printf("%s%c%s %d\n", response.data.name.dom_name,
472 winbind_separator(), response.data.name.name,
473 response.data.name.type);
478 /* Convert string to sid */
480 static BOOL wbinfo_lookupname(char *name)
482 struct winbindd_request request;
483 struct winbindd_response response;
485 /* Send off request */
487 ZERO_STRUCT(request);
488 ZERO_STRUCT(response);
490 parse_wbinfo_domain_user(name, request.data.name.dom_name,
491 request.data.name.name);
493 if (winbindd_request(WINBINDD_LOOKUPNAME, &request, &response) !=
497 /* Display response */
499 d_printf("%s %s (%d)\n", response.data.sid.sid, sid_type_lookup(response.data.sid.type), response.data.sid.type);
504 /* Authenticate a user with a plaintext password */
506 static BOOL wbinfo_auth(char *username)
508 struct winbindd_request request;
509 struct winbindd_response response;
513 /* Send off request */
515 ZERO_STRUCT(request);
516 ZERO_STRUCT(response);
518 p = strchr(username, '%');
522 fstrcpy(request.data.auth.user, username);
523 fstrcpy(request.data.auth.pass, p + 1);
526 fstrcpy(request.data.auth.user, username);
528 result = winbindd_request(WINBINDD_PAM_AUTH, &request, &response);
530 /* Display response */
532 d_printf("plaintext password authentication %s\n",
533 (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed");
535 if (response.data.auth.nt_status)
536 d_printf("error code was %s (0x%x)\nerror messsage was: %s\n",
537 response.data.auth.nt_status_string,
538 response.data.auth.nt_status,
539 response.data.auth.error_string);
541 return result == NSS_STATUS_SUCCESS;
544 /* Authenticate a user with a challenge/response */
546 static BOOL wbinfo_auth_crap(char *username)
548 struct winbindd_request request;
549 struct winbindd_response response;
556 /* Send off request */
558 ZERO_STRUCT(request);
559 ZERO_STRUCT(response);
561 p = strchr(username, '%');
565 fstrcpy(pass, p + 1);
568 parse_wbinfo_domain_user(username, name_domain, name_user);
570 fstrcpy(request.data.auth_crap.user, name_user);
572 fstrcpy(request.data.auth_crap.domain,
575 generate_random_buffer(request.data.auth_crap.chal, 8);
577 if (lp_client_ntlmv2_auth()) {
578 DATA_BLOB server_chal;
579 DATA_BLOB names_blob;
581 DATA_BLOB lm_response;
582 DATA_BLOB nt_response;
584 server_chal = data_blob(request.data.auth_crap.chal, 8);
586 /* Pretend this is a login to 'us', for blob purposes */
587 names_blob = NTLMv2_generate_names_blob(global_myname(), lp_workgroup());
589 if (!SMBNTLMv2encrypt(name_user, name_domain, pass, &server_chal,
591 &lm_response, &nt_response, NULL)) {
592 data_blob_free(&names_blob);
593 data_blob_free(&server_chal);
596 data_blob_free(&names_blob);
597 data_blob_free(&server_chal);
599 memcpy(request.data.auth_crap.nt_resp, nt_response.data,
600 MIN(nt_response.length,
601 sizeof(request.data.auth_crap.nt_resp)));
602 request.data.auth_crap.nt_resp_len = nt_response.length;
604 memcpy(request.data.auth_crap.lm_resp, lm_response.data,
605 MIN(lm_response.length,
606 sizeof(request.data.auth_crap.lm_resp)));
607 request.data.auth_crap.lm_resp_len = lm_response.length;
609 data_blob_free(&nt_response);
610 data_blob_free(&lm_response);
613 if (lp_client_lanman_auth()
614 && SMBencrypt(pass, request.data.auth_crap.chal,
615 (uchar *)request.data.auth_crap.lm_resp)) {
616 request.data.auth_crap.lm_resp_len = 24;
618 request.data.auth_crap.lm_resp_len = 0;
620 SMBNTencrypt(pass, request.data.auth_crap.chal,
621 (uchar *)request.data.auth_crap.nt_resp);
623 request.data.auth_crap.nt_resp_len = 24;
626 result = winbindd_request(WINBINDD_PAM_AUTH_CRAP, &request, &response);
628 /* Display response */
630 d_printf("challenge/response password authentication %s\n",
631 (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed");
633 if (response.data.auth.nt_status)
634 d_printf("error code was %s (0x%x)\nerror messsage was: %s\n",
635 response.data.auth.nt_status_string,
636 response.data.auth.nt_status,
637 response.data.auth.error_string);
639 return result == NSS_STATUS_SUCCESS;
642 /* Authenticate a user with a plaintext password and set a token */
644 static BOOL wbinfo_klog(char *username)
646 struct winbindd_request request;
647 struct winbindd_response response;
651 /* Send off request */
653 ZERO_STRUCT(request);
654 ZERO_STRUCT(response);
656 p = strchr(username, '%');
660 fstrcpy(request.data.auth.user, username);
661 fstrcpy(request.data.auth.pass, p + 1);
664 fstrcpy(request.data.auth.user, username);
665 fstrcpy(request.data.auth.pass, getpass("Password: "));
668 request.flags |= WBFLAG_PAM_AFS_TOKEN;
670 result = winbindd_request(WINBINDD_PAM_AUTH, &request, &response);
672 /* Display response */
674 d_printf("plaintext password authentication %s\n",
675 (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed");
677 if (response.data.auth.nt_status)
678 d_printf("error code was %s (0x%x)\nerror messsage was: %s\n",
679 response.data.auth.nt_status_string,
680 response.data.auth.nt_status,
681 response.data.auth.error_string);
683 if (result != NSS_STATUS_SUCCESS)
686 if (response.extra_data == NULL) {
687 d_printf("Did not get token data\n");
691 if (!afs_settoken_str((char *)response.extra_data)) {
692 d_printf("Could not set token\n");
696 d_printf("Successfully created AFS token\n");
700 /* Print domain users */
702 static BOOL print_domain_users(const char *domain)
704 struct winbindd_request request;
705 struct winbindd_response response;
706 const char *extra_data;
709 /* Send request to winbind daemon */
711 ZERO_STRUCT(request);
712 ZERO_STRUCT(response);
715 /* '.' is the special sign for our own domwin */
716 if ( strequal(domain, ".") )
717 fstrcpy( request.domain_name, lp_workgroup() );
719 fstrcpy( request.domain_name, domain );
722 if (winbindd_request(WINBINDD_LIST_USERS, &request, &response) !=
726 /* Look through extra data */
728 if (!response.extra_data)
731 extra_data = (const char *)response.extra_data;
733 while(next_token(&extra_data, name, ",", sizeof(fstring)))
734 d_printf("%s\n", name);
736 SAFE_FREE(response.extra_data);
741 /* Print domain groups */
743 static BOOL print_domain_groups(const char *domain)
745 struct winbindd_request request;
746 struct winbindd_response response;
747 const char *extra_data;
750 ZERO_STRUCT(request);
751 ZERO_STRUCT(response);
754 if ( strequal(domain, ".") )
755 fstrcpy( request.domain_name, lp_workgroup() );
757 fstrcpy( request.domain_name, domain );
760 if (winbindd_request(WINBINDD_LIST_GROUPS, &request, &response) !=
764 /* Look through extra data */
766 if (!response.extra_data)
769 extra_data = (const char *)response.extra_data;
771 while(next_token(&extra_data, name, ",", sizeof(fstring)))
772 d_printf("%s\n", name);
774 SAFE_FREE(response.extra_data);
779 /* Set the authorised user for winbindd access in secrets.tdb */
781 static BOOL wbinfo_set_auth_user(char *username)
783 const char *password;
785 fstring user, domain;
787 /* Separate into user and password */
789 parse_wbinfo_domain_user(username, domain, user);
791 p = strchr(user, '%');
797 char *thepass = getpass("Password: ");
804 /* Store or remove DOMAIN\username%password in secrets.tdb */
810 if (!secrets_store(SECRETS_AUTH_USER, user,
812 d_fprintf(stderr, "error storing username\n");
816 /* We always have a domain name added by the
817 parse_wbinfo_domain_user() function. */
819 if (!secrets_store(SECRETS_AUTH_DOMAIN, domain,
820 strlen(domain) + 1)) {
821 d_fprintf(stderr, "error storing domain name\n");
826 secrets_delete(SECRETS_AUTH_USER);
827 secrets_delete(SECRETS_AUTH_DOMAIN);
832 if (!secrets_store(SECRETS_AUTH_PASSWORD, password,
833 strlen(password) + 1)) {
834 d_fprintf(stderr, "error storing password\n");
839 secrets_delete(SECRETS_AUTH_PASSWORD);
844 static void wbinfo_get_auth_user(void)
846 char *user, *domain, *password;
848 /* Lift data from secrets file */
850 secrets_fetch_ipc_userpass(&user, &domain, &password);
852 if ((!user || !*user) && (!domain || !*domain ) && (!password || !*password)){
857 d_printf("No authorised user configured\n");
861 /* Pretty print authorised user info */
863 d_printf("%s%s%s%s%s\n", domain ? domain : "", domain ? lp_winbind_separator(): "",
864 user, password ? "%" : "", password ? password : "");
871 static BOOL wbinfo_ping(void)
875 result = winbindd_request(WINBINDD_PING, NULL, NULL);
877 /* Display response */
879 d_printf("Ping to winbindd %s on fd %d\n",
880 (result == NSS_STATUS_SUCCESS) ? "succeeded" : "failed", winbindd_fd);
882 return result == NSS_STATUS_SUCCESS;
888 OPT_SET_AUTH_USER = 1000,
895 int main(int argc, char **argv)
900 static char *string_arg;
901 static char *opt_domain_name;
905 struct poptOption long_options[] = {
908 /* longName, shortName, argInfo, argPtr, value, descrip,
911 { "domain-users", 'u', POPT_ARG_NONE, 0, 'u', "Lists all domain users", "domain"},
912 { "domain-groups", 'g', POPT_ARG_NONE, 0, 'g', "Lists all domain groups", "domain" },
913 { "WINS-by-name", 'N', POPT_ARG_STRING, &string_arg, 'N', "Converts NetBIOS name to IP", "NETBIOS-NAME" },
914 { "WINS-by-ip", 'I', POPT_ARG_STRING, &string_arg, 'I', "Converts IP address to NetBIOS name", "IP" },
915 { "name-to-sid", 'n', POPT_ARG_STRING, &string_arg, 'n', "Converts name to sid", "NAME" },
916 { "sid-to-name", 's', POPT_ARG_STRING, &string_arg, 's', "Converts sid to name", "SID" },
917 { "uid-to-sid", 'U', POPT_ARG_INT, &int_arg, 'U', "Converts uid to sid" , "UID" },
918 { "gid-to-sid", 'G', POPT_ARG_INT, &int_arg, 'G', "Converts gid to sid", "GID" },
919 { "sid-to-uid", 'S', POPT_ARG_STRING, &string_arg, 'S', "Converts sid to uid", "SID" },
920 { "sid-to-gid", 'Y', POPT_ARG_STRING, &string_arg, 'Y', "Converts sid to gid", "SID" },
921 { "allocate-rid", 'A', POPT_ARG_NONE, 0, 'A', "Get a new RID out of idmap" },
922 { "check-secret", 't', POPT_ARG_NONE, 0, 't', "Check shared secret" },
923 { "trusted-domains", 'm', POPT_ARG_NONE, 0, 'm', "List trusted domains" },
924 { "sequence", 0, POPT_ARG_NONE, 0, OPT_SEQUENCE, "Show sequence numbers of all domains" },
925 { "domain-info", 'D', POPT_ARG_STRING, &string_arg, 'D', "Show most of the info we have about the domain" },
926 { "user-groups", 'r', POPT_ARG_STRING, &string_arg, 'r', "Get user groups", "USER" },
927 { "user-sids", 0, POPT_ARG_STRING, &string_arg, OPT_USERSIDS, "Get user group sids for user SID", "SID" },
928 { "authenticate", 'a', POPT_ARG_STRING, &string_arg, 'a', "authenticate user", "user%password" },
929 { "set-auth-user", 0, POPT_ARG_STRING, &string_arg, OPT_SET_AUTH_USER, "Store user and password used by winbindd (root only)", "user%password" },
930 { "get-auth-user", 0, POPT_ARG_NONE, NULL, OPT_GET_AUTH_USER, "Retrieve user and password used by winbindd (root only)", NULL },
931 { "ping", 'p', POPT_ARG_NONE, 0, 'p', "Ping winbindd to see if it is alive" },
932 { "domain", 0, POPT_ARG_STRING, &opt_domain_name, OPT_DOMAIN_NAME, "Define to the domain to restrict operation", "domain" },
933 #ifdef WITH_FAKE_KASERVER
934 { "klog", 'k', POPT_ARG_STRING, &string_arg, 'k', "set an AFS token from winbind", "user%password" },
940 /* Samba client initialisation */
942 if (!lp_load(dyn_CONFIGFILE, True, False, False)) {
943 d_fprintf(stderr, "wbinfo: error opening config file %s. Error was %s\n",
944 dyn_CONFIGFILE, strerror(errno));
955 pc = poptGetContext("wbinfo", argc, (const char **)argv, long_options, 0);
957 /* Parse command line options */
960 poptPrintHelp(pc, stderr, 0);
964 while((opt = poptGetNextOpt(pc)) != -1) {
965 /* get the generic configuration parameters like --domain */
970 pc = poptGetContext(NULL, argc, (const char **)argv, long_options,
971 POPT_CONTEXT_KEEP_FIRST);
973 while((opt = poptGetNextOpt(pc)) != -1) {
976 if (!print_domain_users(opt_domain_name)) {
977 d_printf("Error looking up domain users\n");
982 if (!print_domain_groups(opt_domain_name)) {
983 d_printf("Error looking up domain groups\n");
988 if (!wbinfo_lookupsid(string_arg)) {
989 d_printf("Could not lookup sid %s\n", string_arg);
994 if (!wbinfo_lookupname(string_arg)) {
995 d_printf("Could not lookup name %s\n", string_arg);
1000 if (!wbinfo_wins_byname(string_arg)) {
1001 d_printf("Could not lookup WINS by name %s\n", string_arg);
1006 if (!wbinfo_wins_byip(string_arg)) {
1007 d_printf("Could not lookup WINS by IP %s\n", string_arg);
1012 if (!wbinfo_uid_to_sid(int_arg)) {
1013 d_printf("Could not convert uid %d to sid\n", int_arg);
1018 if (!wbinfo_gid_to_sid(int_arg)) {
1019 d_printf("Could not convert gid %d to sid\n",
1025 if (!wbinfo_sid_to_uid(string_arg)) {
1026 d_printf("Could not convert sid %s to uid\n",
1032 if (!wbinfo_sid_to_gid(string_arg)) {
1033 d_printf("Could not convert sid %s to gid\n",
1039 if (!wbinfo_allocate_rid()) {
1040 d_printf("Could not allocate a RID\n");
1045 if (!wbinfo_check_secret()) {
1046 d_printf("Could not check secret\n");
1051 if (!wbinfo_list_domains()) {
1052 d_printf("Could not list trusted domains\n");
1057 if (!wbinfo_show_sequence(opt_domain_name)) {
1058 d_printf("Could not show sequence numbers\n");
1063 if (!wbinfo_domain_info(string_arg)) {
1064 d_printf("Could not get domain info\n");
1069 if (!wbinfo_get_usergroups(string_arg)) {
1070 d_printf("Could not get groups for user %s\n",
1076 if (!wbinfo_get_usersids(string_arg)) {
1077 d_printf("Could not get group SIDs for user SID %s\n",
1083 BOOL got_error = False;
1085 if (!wbinfo_auth(string_arg)) {
1086 d_printf("Could not authenticate user %s with "
1087 "plaintext password\n", string_arg);
1091 if (!wbinfo_auth_crap(string_arg)) {
1092 d_printf("Could not authenticate user %s with "
1093 "challenge/response\n", string_arg);
1102 if (!wbinfo_klog(string_arg)) {
1103 d_printf("Could not klog user\n");
1108 if (!wbinfo_ping()) {
1109 d_printf("could not ping winbindd!\n");
1113 case OPT_SET_AUTH_USER:
1114 wbinfo_set_auth_user(string_arg);
1116 case OPT_GET_AUTH_USER:
1117 wbinfo_get_auth_user();
1119 /* generic configuration options */
1120 case OPT_DOMAIN_NAME:
1123 d_fprintf(stderr, "Invalid option\n");
1124 poptPrintHelp(pc, stderr, 0);
1134 poptFreeContext(pc);