diff options
Diffstat (limited to 'source4/utils')
-rw-r--r-- | source4/utils/nmblookup.c | 50 | ||||
-rw-r--r-- | source4/utils/ntlm_auth.c | 36 |
2 files changed, 43 insertions, 43 deletions
diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c index affc38e3e7..ada5b839b7 100644 --- a/source4/utils/nmblookup.c +++ b/source4/utils/nmblookup.c @@ -34,12 +34,12 @@ static struct { const char *broadcast_address; const char *unicast_address; - BOOL find_master; - BOOL wins_lookup; - BOOL node_status; - BOOL root_port; - BOOL lookup_by_ip; - BOOL case_sensitive; + bool find_master; + bool wins_lookup; + bool node_status; + bool root_port; + bool lookup_by_ip; + bool case_sensitive; } options; /* @@ -102,7 +102,7 @@ static char *node_status_flags(TALLOC_CTX *mem_ctx, uint16_t flags) } /* do a single node status */ -static BOOL do_node_status(struct nbt_name_socket *nbtsock, +static bool do_node_status(struct nbt_name_socket *nbtsock, const char *addr) { struct nbt_name_status io; @@ -133,10 +133,10 @@ static BOOL do_node_status(struct nbt_name_socket *nbtsock, io.out.status.statistics.unit_id[3], io.out.status.statistics.unit_id[4], io.out.status.statistics.unit_id[5]); - return True; + return true; } - return False; + return false; } /* do a single node query */ @@ -144,7 +144,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock, const char *addr, const char *node_name, enum nbt_name_type node_type, - BOOL broadcast) + bool broadcast) { struct nbt_name_query io; NTSTATUS status; @@ -176,7 +176,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock, } -static BOOL process_one(const char *name) +static bool process_one(const char *name) { TALLOC_CTX *tmp_ctx = talloc_new(NULL); enum nbt_name_type node_type = NBT_NAME_CLIENT; @@ -184,7 +184,7 @@ static BOOL process_one(const char *name) struct socket_address *all_zero_addr; struct nbt_name_socket *nbtsock; NTSTATUS status = NT_STATUS_OK; - BOOL ret = True; + bool ret = true; if (!options.case_sensitive) { name = strupper_talloc(tmp_ctx, name); @@ -214,14 +214,14 @@ static BOOL process_one(const char *name) if (!all_zero_addr) { talloc_free(tmp_ctx); - return False; + return false; } status = socket_listen(nbtsock->sock, all_zero_addr, 0, 0); if (!NT_STATUS_IS_OK(status)) { printf("Failed to bind to local port 137 - %s\n", nt_errstr(status)); talloc_free(tmp_ctx); - return False; + return false; } } @@ -232,22 +232,22 @@ static BOOL process_one(const char *name) } if (options.broadcast_address) { - status = do_node_query(nbtsock, options.broadcast_address, node_name, node_type, True); + status = do_node_query(nbtsock, options.broadcast_address, node_name, node_type, true); } else if (options.unicast_address) { - status = do_node_query(nbtsock, options.unicast_address, node_name, node_type, False); + status = do_node_query(nbtsock, options.unicast_address, node_name, node_type, false); } else { int i, num_interfaces = iface_count(); for (i=0;i<num_interfaces;i++) { const char *bcast = iface_n_bcast(i); if (bcast == NULL) continue; - status = do_node_query(nbtsock, bcast, node_name, node_type, True); + status = do_node_query(nbtsock, bcast, node_name, node_type, true); if (NT_STATUS_IS_OK(status)) break; } } if (!NT_STATUS_IS_OK(status)) { printf("Lookup failed - %s\n", nt_errstr(status)); - ret = False; + ret = false; } talloc_free(tmp_ctx); @@ -259,7 +259,7 @@ static BOOL process_one(const char *name) */ int main(int argc, const char *argv[]) { - BOOL ret = True; + bool ret = true; poptContext pc; int opt; enum { @@ -316,22 +316,22 @@ int main(int argc, const char *argv[]) options.unicast_address = poptGetOptArg(pc); break; case OPT_FIND_MASTER: - options.find_master = True; + options.find_master = true; break; case OPT_WINS_LOOKUP: - options.wins_lookup = True; + options.wins_lookup = true; break; case OPT_NODE_STATUS: - options.node_status = True; + options.node_status = true; break; case OPT_ROOT_PORT: - options.root_port = True; + options.root_port = true; break; case OPT_LOOKUP_BY_IP: - options.lookup_by_ip = True; + options.lookup_by_ip = true; break; case OPT_CASE_SENSITIVE: - options.case_sensitive = True; + options.case_sensitive = true; break; } } diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index 2fa393a9d4..c51b35aa03 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -128,14 +128,14 @@ static bool parse_ntlm_auth_domain_user(const char *domuser, fstring domain, char *p = strchr(domuser,*lp_winbind_separator(global_loadparm)); if (!p) { - return False; + return false; } fstrcpy(user, p+1); fstrcpy(domain, domuser); domain[PTR_DIFF(p, domuser)] = 0; - return True; + return true; } /** @@ -168,8 +168,8 @@ static void base64_decode_inplace(char *s) /* Authenticate a user with a plaintext password */ -static BOOL check_plaintext_auth(const char *user, const char *pass, - BOOL stdout_diagnostics) +static bool check_plaintext_auth(const char *user, const char *pass, + bool stdout_diagnostics) { return (strcmp(pass, opt_password) == 0); } @@ -259,7 +259,7 @@ static void manage_squid_basic_request(enum stdio_helper_mode stdio_helper_mode, rfc1738_unescape(pass); } - if (check_plaintext_auth(user, pass, False)) { + if (check_plaintext_auth(user, pass, false)) { mux_printf(mux_id, "OK\n"); } else { mux_printf(mux_id, "ERR\n"); @@ -345,15 +345,15 @@ static bool in_list(const char *s, const char *list, bool casesensitive) static void gensec_want_feature_list(struct gensec_security *state, char* feature_list) { - if (in_list("NTLMSSP_FEATURE_SESSION_KEY", feature_list, True)) { + if (in_list("NTLMSSP_FEATURE_SESSION_KEY", feature_list, true)) { DEBUG(10, ("want GENSEC_FEATURE_SESSION_KEY\n")); gensec_want_feature(state, GENSEC_FEATURE_SESSION_KEY); } - if (in_list("NTLMSSP_FEATURE_SIGN", feature_list, True)) { + if (in_list("NTLMSSP_FEATURE_SIGN", feature_list, true)) { DEBUG(10, ("want GENSEC_FEATURE_SIGN\n")); gensec_want_feature(state, GENSEC_FEATURE_SIGN); } - if (in_list("NTLMSSP_FEATURE_SEAL", feature_list, True)) { + if (in_list("NTLMSSP_FEATURE_SEAL", feature_list, true)) { DEBUG(10, ("want GENSEC_FEATURE_SEAL\n")); gensec_want_feature(state, GENSEC_FEATURE_SEAL); } @@ -376,7 +376,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, struct messaging_context *msg; NTSTATUS nt_status; - BOOL first = False; + bool first = false; const char *reply_code; struct cli_credentials *creds; @@ -461,7 +461,7 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, if (!ev) { exit(1); } - msg = messaging_client_init(state, global_loadparm, ev); + msg = messaging_client_init(state, lp_messaging_path(state, global_loadparm), ev); if (!msg) { exit(1); } @@ -508,12 +508,12 @@ static void manage_gensec_request(enum stdio_helper_mode stdio_helper_mode, case GSS_SPNEGO_SERVER: nt_status = gensec_start_mech_by_oid(state->gensec_state, GENSEC_OID_SPNEGO); if (!in.length) { - first = True; + first = true; } break; case NTLMSSP_CLIENT_1: if (!in.length) { - first = True; + first = true; } /* fall through */ case SQUID_2_5_NTLMSSP: @@ -701,8 +701,8 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod static char *username; static char *domain; static char *plaintext_password; - static BOOL ntlm_server_1_user_session_key; - static BOOL ntlm_server_1_lm_session_key; + static bool ntlm_server_1_user_session_key; + static bool ntlm_server_1_lm_session_key; if (strequal(buf, ".")) { if (!full_username && !username) { @@ -715,7 +715,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod return; } } - if (check_plaintext_auth(full_username, plaintext_password, False)) { + if (check_plaintext_auth(full_username, plaintext_password, false)) { mux_printf(mux_id, "Authenticated: Yes\n"); } else { mux_printf(mux_id, "Authenticated: No\n"); @@ -808,8 +808,8 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod SAFE_FREE(username); SAFE_FREE(domain); SAFE_FREE(plaintext_password); - ntlm_server_1_user_session_key = False; - ntlm_server_1_lm_session_key = False; + ntlm_server_1_user_session_key = false; + ntlm_server_1_lm_session_key = false; mux_printf(mux_id, ".\n"); return; @@ -1122,7 +1122,7 @@ int main(int argc, const char **argv) char *user; asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(global_loadparm), opt_username); - if (!check_plaintext_auth(user, opt_password, True)) { + if (!check_plaintext_auth(user, opt_password, true)) { return 1; } } |