exit(1);
}
- if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)==False) {
+ if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)==false) {
DEBUG(0,("ERROR: %s : fcntl lock of file %s failed. Error was %s\n",
name, pidFile, strerror(errno)));
exit(1);
static void setup_signals(void)
{
/* we are never interested in SIGPIPE */
- BlockSignals(True,SIGPIPE);
+ BlockSignals(true,SIGPIPE);
#if defined(SIGFPE)
/* we are never interested in SIGFPE */
- BlockSignals(True,SIGFPE);
+ BlockSignals(true,SIGFPE);
#endif
/* We are no longer interested in USR1 */
- BlockSignals(True, SIGUSR1);
+ BlockSignals(true, SIGUSR1);
#if defined(SIGUSR2)
/* We are no longer interested in USR2 */
- BlockSignals(True,SIGUSR2);
+ BlockSignals(true,SIGUSR2);
#endif
/* POSIX demands that signals are inherited. If the invoking process has
* these signals masked, we will have problems, as we won't recieve them. */
- BlockSignals(False, SIGHUP);
- BlockSignals(False, SIGTERM);
+ BlockSignals(false, SIGHUP);
+ BlockSignals(false, SIGTERM);
CatchSignal(SIGHUP, sig_hup);
CatchSignal(SIGTERM, sig_term);
*/
static void stream_io_handler(struct stream_connection *conn, uint16_t flags)
{
- conn->processing = True;
+ conn->processing = true;
if (flags & EVENT_FD_WRITE) {
conn->ops->send_handler(conn, flags);
} else if (flags & EVENT_FD_READ) {
conn->ops->recv_handler(conn, flags);
}
- conn->processing = False;
+ conn->processing = false;
if (conn->terminate) {
stream_terminate_connection(conn, conn->terminate);
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;
/*
}
/* 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;
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 */
const char *addr,
const char *node_name,
enum nbt_name_type node_type,
- BOOL broadcast)
+ bool broadcast)
{
struct nbt_name_query io;
NTSTATUS status;
}
-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;
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);
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;
}
}
}
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);
*/
int main(int argc, const char *argv[])
{
- BOOL ret = True;
+ bool ret = true;
poptContext pc;
int opt;
enum {
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;
}
}
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;
}
/**
/* 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);
}
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");
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);
}
struct messaging_context *msg;
NTSTATUS nt_status;
- BOOL first = False;
+ bool first = false;
const char *reply_code;
struct cli_credentials *creds;
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);
}
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:
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) {
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");
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;
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;
}
}
http_output_headers(web);
EVENT_FD_NOT_READABLE(web->conn->event.fde);
EVENT_FD_WRITEABLE(web->conn->event.fde);
- web->output.output_pending = True;
+ web->output.output_pending = true;
}
/*
if (web->session) {
SETVAR(ESP_REQUEST_OBJ, "SESSION_ID", web->session->id);
}
- SETVAR(ESP_REQUEST_OBJ, "COOKIE_SUPPORT", web->input.cookie?"True":"False");
+ SETVAR(ESP_REQUEST_OBJ, "COOKIE_SUPPORT", web->input.cookie?"true":"false");
SETVAR(ESP_HEADERS_OBJ, "HTTP_REFERER", web->input.referer);
SETVAR(ESP_HEADERS_OBJ, "HOST", web->input.host);
SETVAR(ESP_SERVER_OBJ, "SERVER_PROTOCOL", tls_enabled(web->conn->socket)?"https":"http");
SETVAR(ESP_SERVER_OBJ, "SERVER_SOFTWARE", "SAMBA");
SETVAR(ESP_SERVER_OBJ, "GATEWAY_INTERFACE", "CGI/1.1");
- SETVAR(ESP_SERVER_OBJ, "TLS_SUPPORT", tls_support(edata->tls_params)?"True":"False");
+ SETVAR(ESP_SERVER_OBJ, "TLS_SUPPORT", tls_support(edata->tls_params)?"true":"false");
}
#if HAVE_SETJMP_H
note that the preauth is run even for static pages such as images
*/
-static BOOL http_preauth(struct esp_state *esp)
+static bool http_preauth(struct esp_state *esp)
{
const char *path = http_local_path(esp->web,
HTTP_PREAUTH_URI,
int i;
if (path == NULL) {
http_error(esp->web, 500, "Internal server error");
- return False;
+ return false;
}
if (!file_exist(path)) {
/* if the preath script is not installed then allow access */
- return True;
+ return true;
}
esp_request(esp, HTTP_PREAUTH_URI);
for (i=0;i<esp->web->output.content.length;i++) {
to be html, so that we can show the login page for
failed access to images */
http_setHeader(esp->web, "Content-Type: text/html", 0);
- return False;
+ return false;
}
}
data_blob_free(&esp->web->output.content);
- return True;
+ return true;
}
const char *key = NULL;
struct esp_data *edata = talloc_get_type(esp->web->task->private, struct esp_data);
struct session_data *s;
- BOOL generated_key = False;
+ bool generated_key = false;
/* look for our session key */
if (cookie && (p = strstr(cookie, session_key)) &&
key = esp->web->input.session_key;
} else if (key == NULL) {
key = generate_random_str_list(esp, 16, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
- generated_key = True;
+ generated_key = true;
}
/* try to find this session in the existing session list */
talloc_set_destructor(s, session_destructor);
if (!generated_key) {
mprSetPropertyValue(&esp->variables[ESP_REQUEST_OBJ],
- "SESSION_EXPIRED", mprCreateStringVar("True", 0));
+ "SESSION_EXPIRED", mprCreateStringVar("true", 0));
}
}
{"txt", "text/plain"},
{"ico", "image/x-icon"},
{"css", "text/css"},
- {"esp", "text/html", True}
+ {"esp", "text/html", true}
};
/*
if (!web->output.output_pending) {
http_output_headers(web);
EVENT_FD_WRITEABLE(web->conn->event.fde);
- web->output.output_pending = True;
+ web->output.output_pending = true;
}
/* copy any application data to long term storage in edata */
NTSTATUS http_parse_header(struct websrv_context *web, const char *line)
{
if (line[0] == 0) {
- web->input.end_of_headers = True;
+ web->input.end_of_headers = true;
} else if (strncasecmp(line,"GET ", 4)==0) {
web->input.url = talloc_strndup(web, &line[4], strcspn(&line[4], " \t"));
} else if (strncasecmp(line,"POST ", 5)==0) {
- web->input.post_request = True;
+ web->input.post_request = true;
web->input.url = talloc_strndup(web, &line[5], strcspn(&line[5], " \t"));
} else if (strchr(line, ':') == NULL) {
http_error(web, 400, "This server only accepts GET and POST requests");
ctx->async.fn = wb_irpc_SamLogon_callback;
ctx->async.private_data = s;
- msg->defer_reply = True;
+ msg->defer_reply = true;
return NT_STATUS_OK;
}
WINBINDD_SAMBA3_SOCKET);
if (!listen_socket->socket_path) goto nomem;
listen_socket->service = service;
- listen_socket->privileged = False;
+ listen_socket->privileged = false;
status = stream_setup_socket(task->event_ctx, model_ops,
&wbsrv_ops, "unix",
listen_socket->socket_path, &port,
WINBINDD_SAMBA3_PRIVILEGED_SOCKET);
if (!listen_socket->socket_path) goto nomem;
listen_socket->service = service;
- listen_socket->privileged = True;
+ listen_socket->privileged = true;
status = stream_setup_socket(task->event_ctx, model_ops,
&wbsrv_ops, "unix",
listen_socket->socket_path, &port,
* as one string.
* TODO: We probably will need to handle other formats later. */
-BOOL wb_samba3_split_username(TALLOC_CTX *mem_ctx, const char *domuser,
+bool wb_samba3_split_username(TALLOC_CTX *mem_ctx, const char *domuser,
char **domain, char **user)
{
char *p = strchr(domuser, *lp_winbind_separator(global_loadparm));