From 555941383348f0f740ac169da7b3325f225e9261 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 4 Feb 2008 17:25:06 +0100 Subject: Use the proper boolean constants in wbinfo.c . Michael (This used to be commit be57475cd1d5db60481e74000dc7d65002742376) --- source3/nsswitch/wbinfo.c | 146 +++++++++++++++++++++++----------------------- 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c index f2909ca979..106163b1f9 100644 --- a/source3/nsswitch/wbinfo.c +++ b/source3/nsswitch/wbinfo.c @@ -53,7 +53,7 @@ static char winbind_separator_int(bool strict) } sep = response.data.info.winbind_separator; - got_sep = True; + got_sep = true; if (!sep) { d_fprintf(stderr, "winbind separator was NULL!\n"); @@ -69,7 +69,7 @@ static char winbind_separator_int(bool strict) static char winbind_separator(void) { - return winbind_separator_int(False); + return winbind_separator_int(false); } static const char *get_winbind_domain(void) @@ -110,12 +110,12 @@ static bool parse_wbinfo_domain_user(const char *domuser, fstring domain, if ((p = strchr(domuser, '@')) != NULL) { fstrcpy(domain, ""); fstrcpy(user, domuser); - return True; + return true; } fstrcpy(user, domuser); fstrcpy(domain, get_winbind_domain()); - return True; + return true; } fstrcpy(user, p+1); @@ -123,7 +123,7 @@ static bool parse_wbinfo_domain_user(const char *domuser, fstring domain, domain[PTR_DIFF(p, domuser)] = 0; strupper_m(domain); - return True; + return true; } /* pull pwent info for a given user */ @@ -191,14 +191,14 @@ static bool wbinfo_get_groupinfo(char *group) &response); if ( result != NSS_STATUS_SUCCESS) - return False; + return false; d_printf( "%s:%s:%d\n", response.data.gr.gr_name, response.data.gr.gr_passwd, response.data.gr.gr_gid ); - return True; + return true; } /* List groups a user is a member of */ @@ -220,14 +220,14 @@ static bool wbinfo_get_usergroups(char *user) result = winbindd_request_response(WINBINDD_GETGROUPS, &request, &response); if (result != NSS_STATUS_SUCCESS) - return False; + return false; for (i = 0; i < response.data.num_entries; i++) d_printf("%d\n", (int)((gid_t *)response.extra_data.data)[i]); SAFE_FREE(response.extra_data.data); - return True; + return true; } @@ -249,7 +249,7 @@ static bool wbinfo_get_usersids(char *user_sid) result = winbindd_request_response(WINBINDD_GETUSERSIDS, &request, &response); if (result != NSS_STATUS_SUCCESS) - return False; + return false; s = (const char *)response.extra_data.data; for (i = 0; i < response.data.num_entries; i++) { @@ -259,7 +259,7 @@ static bool wbinfo_get_usersids(char *user_sid) SAFE_FREE(response.extra_data.data); - return True; + return true; } static bool wbinfo_get_userdomgroups(const char *user_sid) @@ -278,14 +278,14 @@ static bool wbinfo_get_userdomgroups(const char *user_sid) &response); if (result != NSS_STATUS_SUCCESS) - return False; + return false; if (response.data.num_entries != 0) printf("%s", (char *)response.extra_data.data); SAFE_FREE(response.extra_data.data); - return True; + return true; } /* Convert NetBIOS name to IP */ @@ -304,14 +304,14 @@ static bool wbinfo_wins_byname(char *name) if (winbindd_request_response(WINBINDD_WINS_BYNAME, &request, &response) != NSS_STATUS_SUCCESS) { - return False; + return false; } /* Display response */ d_printf("%s\n", response.data.winsresp); - return True; + return true; } /* Convert IP to NetBIOS name */ @@ -330,14 +330,14 @@ static bool wbinfo_wins_byip(char *ip) if (winbindd_request_response(WINBINDD_WINS_BYIP, &request, &response) != NSS_STATUS_SUCCESS) { - return False; + return false; } /* Display response */ d_printf("%s\n", response.data.winsresp); - return True; + return true; } /* List trusted domains */ @@ -356,7 +356,7 @@ static bool wbinfo_list_domains(bool list_all_domains) if (winbindd_request_response(WINBINDD_LIST_TRUSTDOM, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ @@ -373,7 +373,7 @@ static bool wbinfo_list_domains(bool list_all_domains) extra_data); TALLOC_FREE(frame); SAFE_FREE(response.extra_data.data); - return False; + return false; } *p = 0; d_printf("%s\n", name); @@ -382,7 +382,7 @@ static bool wbinfo_list_domains(bool list_all_domains) SAFE_FREE(response.extra_data.data); } - return True; + return true; } /* List own domain */ @@ -391,7 +391,7 @@ static bool wbinfo_list_own_domain(void) { d_printf("%s\n", get_winbind_domain()); - return True; + return true; } /* show sequence numbers */ @@ -410,7 +410,7 @@ static bool wbinfo_show_sequence(const char *domain) if (winbindd_request_response(WINBINDD_SHOW_SEQUENCE, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ @@ -427,7 +427,7 @@ static bool wbinfo_show_sequence(const char *domain) SAFE_FREE(response.extra_data.data); } - return True; + return true; } /* Show domain info */ @@ -449,7 +449,7 @@ static bool wbinfo_domain_info(const char *domain_name) if (winbindd_request_response(WINBINDD_DOMAIN_INFO, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ @@ -466,7 +466,7 @@ static bool wbinfo_domain_info(const char *domain_name) d_printf("Primary : %s\n", response.data.domain_info.primary ? "Yes" : "No"); - return True; + return true; } /* Get a foreign DC's name */ @@ -485,14 +485,14 @@ static bool wbinfo_getdcname(const char *domain_name) if (winbindd_request_response(WINBINDD_GETDCNAME, &request, &response) != NSS_STATUS_SUCCESS) { d_fprintf(stderr, "Could not get dc name for %s\n", domain_name); - return False; + return false; } /* Display response */ d_printf("%s\n", response.data.dc_name); - return True; + return true; } /* Find a DC */ @@ -514,14 +514,14 @@ static bool wbinfo_dsgetdcname(const char *domain_name, uint32_t flags) if (winbindd_request_response(WINBINDD_DSGETDCNAME, &request, &response) != NSS_STATUS_SUCCESS) { d_fprintf(stderr, "Could not find dc for %s\n", domain_name); - return False; + return false; } /* Display response */ d_printf("%s\n", response.data.dc_name); - return True; + return true; } /* Check trust account password */ @@ -562,13 +562,13 @@ static bool wbinfo_uid_to_sid(uid_t uid) if (winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ d_printf("%s\n", response.data.sid.sid); - return True; + return true; } /* Convert gid to sid */ @@ -587,13 +587,13 @@ static bool wbinfo_gid_to_sid(gid_t gid) if (winbindd_request_response(WINBINDD_GID_TO_SID, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ d_printf("%s\n", response.data.sid.sid); - return True; + return true; } /* Convert sid to uid */ @@ -612,13 +612,13 @@ static bool wbinfo_sid_to_uid(char *sid) if (winbindd_request_response(WINBINDD_SID_TO_UID, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ d_printf("%d\n", (int)response.data.uid); - return True; + return true; } static bool wbinfo_sid_to_gid(char *sid) @@ -635,13 +635,13 @@ static bool wbinfo_sid_to_gid(char *sid) if (winbindd_request_response(WINBINDD_SID_TO_GID, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ d_printf("%d\n", (int)response.data.gid); - return True; + return true; } static bool wbinfo_allocate_uid(void) @@ -649,11 +649,11 @@ static bool wbinfo_allocate_uid(void) uid_t uid; if (!winbind_allocate_uid(&uid)) - return False; + return false; d_printf("New uid: %d\n", uid); - return True; + return true; } static bool wbinfo_allocate_gid(void) @@ -661,11 +661,11 @@ static bool wbinfo_allocate_gid(void) gid_t gid; if (!winbind_allocate_gid(&gid)) - return False; + return false; d_printf("New gid: %d\n", gid); - return True; + return true; } /* Convert sid to string */ @@ -684,7 +684,7 @@ static bool wbinfo_lookupsid(char *sid) if (winbindd_request_response(WINBINDD_LOOKUPSID, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ @@ -692,7 +692,7 @@ static bool wbinfo_lookupsid(char *sid) winbind_separator(), response.data.name.name, response.data.name.type); - return True; + return true; } /* Lookup a list of RIDs */ @@ -725,18 +725,18 @@ static bool wbinfo_lookuprids(char *domain, char *arg) if (winbindd_request_response(WINBINDD_DOMAIN_INFO, &request, &response) != NSS_STATUS_SUCCESS) { d_printf("Could not get domain sid for %s\n", request.domain_name); - return False; + return false; } if (!string_to_sid(&sid, response.data.domain_info.sid)) { d_printf("Could not convert %s to sid\n", response.data.domain_info.sid); - return False; + return false; } mem_ctx = talloc_new(NULL); if (mem_ctx == NULL) { d_printf("talloc_new failed\n"); - return False; + return false; } num_rids = 0; @@ -750,14 +750,14 @@ static bool wbinfo_lookuprids(char *domain, char *arg) if (rids == NULL) { TALLOC_FREE(mem_ctx); - return False; + return false; } if (!winbind_lookup_rids(mem_ctx, &sid, num_rids, rids, &domain_name, &names, &types)) { d_printf("winbind_lookup_rids failed\n"); TALLOC_FREE(mem_ctx); - return False; + return false; } d_printf("Domain: %s\n", domain_name); @@ -768,7 +768,7 @@ static bool wbinfo_lookuprids(char *domain, char *arg) } TALLOC_FREE(mem_ctx); - return True; + return true; } /* Convert string to sid */ @@ -788,13 +788,13 @@ static bool wbinfo_lookupname(char *name) if (winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Display response */ d_printf("%s %s (%d)\n", response.data.sid.sid, sid_type_lookup(response.data.sid.type), response.data.sid.type); - return True; + return true; } /* Authenticate a user with a plaintext password */ @@ -951,7 +951,7 @@ static bool wbinfo_auth_crap(char *username) &lm_response, &nt_response, NULL)) { data_blob_free(&names_blob); data_blob_free(&server_chal); - return False; + return false; } data_blob_free(&names_blob); data_blob_free(&server_chal); @@ -1041,20 +1041,20 @@ static bool wbinfo_klog(char *username) response.data.auth.error_string); if (result != NSS_STATUS_SUCCESS) - return False; + return false; if (response.extra_data.data == NULL) { d_fprintf(stderr, "Did not get token data\n"); - return False; + return false; } if (!afs_settoken_str((char *)response.extra_data.data)) { d_fprintf(stderr, "Could not set token\n"); - return False; + return false; } d_printf("Successfully created AFS token\n"); - return True; + return true; } /* Print domain users */ @@ -1082,12 +1082,12 @@ static bool print_domain_users(const char *domain) if (winbindd_request_response(WINBINDD_LIST_USERS, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Look through extra data */ if (!response.extra_data.data) - return False; + return false; extra_data = (const char *)response.extra_data.data; @@ -1098,7 +1098,7 @@ static bool print_domain_users(const char *domain) SAFE_FREE(response.extra_data.data); - return True; + return true; } /* Print domain groups */ @@ -1123,12 +1123,12 @@ static bool print_domain_groups(const char *domain) if (winbindd_request_response(WINBINDD_LIST_GROUPS, &request, &response) != NSS_STATUS_SUCCESS) - return False; + return false; /* Look through extra data */ if (!response.extra_data.data) - return False; + return false; extra_data = (const char *)response.extra_data.data; @@ -1139,7 +1139,7 @@ static bool print_domain_groups(const char *domain) SAFE_FREE(response.extra_data.data); - return True; + return true; } /* Set the authorised user for winbindd access in secrets.tdb */ @@ -1176,7 +1176,7 @@ static bool wbinfo_set_auth_user(char *username) if (!secrets_store(SECRETS_AUTH_USER, user, strlen(user) + 1)) { d_fprintf(stderr, "error storing username\n"); - return False; + return false; } /* We always have a domain name added by the @@ -1185,7 +1185,7 @@ static bool wbinfo_set_auth_user(char *username) if (!secrets_store(SECRETS_AUTH_DOMAIN, domain, strlen(domain) + 1)) { d_fprintf(stderr, "error storing domain name\n"); - return False; + return false; } } else { @@ -1198,13 +1198,13 @@ static bool wbinfo_set_auth_user(char *username) if (!secrets_store(SECRETS_AUTH_PASSWORD, password, strlen(password) + 1)) { d_fprintf(stderr, "error storing password\n"); - return False; + return false; } } else secrets_delete(SECRETS_AUTH_PASSWORD); - return True; + return true; } static void wbinfo_get_auth_user(void) @@ -1355,7 +1355,7 @@ int main(int argc, char **argv, char **envp) poptFreeContext(pc); - if (!lp_load(get_dyn_CONFIGFILE(), True, False, False, True)) { + if (!lp_load(get_dyn_CONFIGFILE(), true, false, false, true)) { d_fprintf(stderr, "wbinfo: error opening config file %s. Error was %s\n", get_dyn_CONFIGFILE(), strerror(errno)); exit(1); @@ -1459,7 +1459,7 @@ int main(int argc, char **argv, char **envp) } break; case 'm': - if (!wbinfo_list_domains(False)) { + if (!wbinfo_list_domains(false)) { d_fprintf(stderr, "Could not list trusted domains\n"); goto done; } @@ -1519,18 +1519,18 @@ int main(int argc, char **argv, char **envp) } break; case 'a': { - bool got_error = False; + bool got_error = false; if (!wbinfo_auth(string_arg)) { d_fprintf(stderr, "Could not authenticate user %s with " "plaintext password\n", string_arg); - got_error = True; + got_error = true; } if (!wbinfo_auth_crap(string_arg)) { d_fprintf(stderr, "Could not authenticate user %s with " "challenge/response\n", string_arg); - got_error = True; + got_error = true; } if (got_error) @@ -1581,7 +1581,7 @@ int main(int argc, char **argv, char **envp) } break; case OPT_SEPARATOR: { - const char sep = winbind_separator_int(True); + const char sep = winbind_separator_int(true); if ( !sep ) { goto done; } @@ -1589,7 +1589,7 @@ int main(int argc, char **argv, char **envp) break; } case OPT_LIST_ALL_DOMAINS: - if (!wbinfo_list_domains(True)) { + if (!wbinfo_list_domains(true)) { goto done; } break; -- cgit