}
if (!name_status_find(d, 0x1b, 0x20, &pdc_ss, dc_name)) {
- return False;
+ return false;
}
*server_name = SMB_STRDUP(dc_name);
if (!*server_name) {
DEBUG(1,("no server to connect to\n"));
- return False;
+ return false;
}
- return True;
+ return true;
}
bool net_find_pdc(struct sockaddr_storage *server_ss,
name = global_myname();
}
- if(!initialize_password_db(False, NULL)) {
+ if(!initialize_password_db(false, NULL)) {
DEBUG(0, ("WARNING: Could not open passdb - local sid may not reflect passdb\n"
"backend knowledge (such as the sid stored in LDAP)\n"));
}
return 1;
}
- if(!initialize_password_db(False, NULL)) {
+ if(!initialize_password_db(false, NULL)) {
DEBUG(0, ("WARNING: Could not open passdb - domain SID may "
"not reflect passdb\n"
"backend knowledge (such as the SID stored in "
if (search == NULL) {
d_fprintf(stderr, "get_maxrid: Could not search %s\n", type);
- return False;
+ return false;
}
num_entries = pdb_search_entries(search, 0, 0xffffffff, &entries);
for (i=0; i<num_entries; i++)
*max_rid = MAX(*max_rid, entries[i].rid);
pdb_search_destroy(search);
- return True;
+ return true;
}
static uint32 get_maxrid(void)
}
break;
case 'U':
- c->opt_user_specified = True;
+ c->opt_user_specified = true;
c->opt_user_name = SMB_STRDUP(c->opt_user_name);
p = strchr(c->opt_user_name,'%');
if (p) {
{
ADS_STRUCT *ads = NULL;
ADS_STATUS status;
- bool need_password = False;
- bool second_time = False;
+ bool need_password = false;
+ bool second_time = false;
char *cp;
const char *realm = NULL;
- bool tried_closest_dc = False;
+ bool tried_closest_dc = false;
/* lp_realm() should be handled by a command line param,
However, the join requires that realm be set in smb.conf
}
if (c->opt_user_specified) {
- need_password = True;
+ need_password = true;
}
retry:
}
if (!need_password && !second_time && !(auth_flags & ADS_AUTH_NO_BIND)) {
- need_password = True;
- second_time = True;
+ need_password = true;
+ second_time = true;
goto retry;
} else {
ads_destroy(&ads);
if ((only_own_domain || !c->opt_host) && !tried_closest_dc) {
- tried_closest_dc = True; /* avoid loop */
+ tried_closest_dc = true; /* avoid loop */
if (!ads->config.tried_closest_dc) {
}
SAFE_FREE(disp_fields[0]);
SAFE_FREE(disp_fields[1]);
- return True;
+ return true;
}
if (!values) /* must be new field, indicate string field */
- return True;
+ return true;
if (StrCaseCmp(field, "sAMAccountName") == 0) {
disp_fields[0] = SMB_STRDUP((char *) values[0]);
}
if (StrCaseCmp(field, "description") == 0)
disp_fields[1] = SMB_STRDUP((char *) values[0]);
- return True;
+ return true;
}
static int net_ads_user_usage(struct net_context *c, int argc, const char **argv)
struct libnet_JoinCtx *r = NULL;
const char *domain = lp_realm();
WERROR werr = WERR_SETUP_NOT_JOINED;
- bool createupn = False;
+ bool createupn = false;
const char *machineupn = NULL;
const char *create_in_ou = NULL;
int i;
for ( i=0; i<argc; i++ ) {
if ( !StrnCaseCmp(argv[i], "createupn", strlen("createupn")) ) {
- createupn = True;
+ createupn = true;
machineupn = get_string_param(argv[i]);
}
else if ( !StrnCaseCmp(argv[i], "createcomputer", strlen("createcomputer")) ) {
return -1;
}
- status = ads_startup(c, True, &ads);
+ status = ads_startup(c, true, &ads);
if ( !ADS_ERR_OK(status) ) {
DEBUG(1, ("error on ads_startup: %s\n", ads_errstr(status)));
TALLOC_FREE(ctx);
/* Perhaps its the NT group name? */
if (!pdb_getgrnam(&map, input)) {
printf("NT Group %s doesn't exist in mapping DB\n", input);
- return False;
+ return false;
} else {
*sid = map.sid;
}
} else {
if (!string_to_sid(sid, input)) {
printf("converting sid %s from a string failed!\n", input);
- return False;
+ return false;
}
}
- return True;
+ return true;
}
/*********************************************************
static int net_groupmap_list(struct net_context *c, int argc, const char **argv)
{
size_t entries;
- bool long_list = False;
+ bool long_list = false;
size_t i;
fstring ntgroup = "";
fstring sid_string = "";
if (c->opt_verbose || c->opt_long_list_entries)
- long_list = True;
+ long_list = true;
/* get the options */
for ( i=0; i<argc; i++ ) {
if ( !StrCaseCmp(argv[i], "verbose")) {
- long_list = True;
+ long_list = true;
}
else if ( !StrnCaseCmp(argv[i], "ntgroup", strlen("ntgroup")) ) {
fstrcpy( ntgroup, get_string_param( argv[i] ) );
const char *ntgroup = NULL;
struct group *grp = NULL;
GROUP_MAP map;
- bool have_map = False;
+ bool have_map = false;
if ((argc < 1) || (argc > 2)) {
d_printf("Usage: net groupmap set \"NT Group\" "
&alias_rids, &num_alias_rids))) {
d_fprintf(stderr, "Could not list memberships for sid %s\n",
sid_string_tos(member));
- return False;
+ return false;
}
for (i = 0; i < num_alias_rids; i++) {
printf("%s\n", sid_string_tos(&alias));
}
- return True;
+ return true;
}
static int net_groupmap_memberships(struct net_context *c, int argc, const char **argv)
return result;
}
- result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False,
+ result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, false,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&pol);
if (!NT_STATUS_IS_OK(result)) {
const char **argv)
{
POLICY_HND connect_pol, domain_pol, group_pol, user_pol;
- bool group_is_primary = False;
+ bool group_is_primary = false;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32_t group_rid;
struct samr_RidTypeArray *rids = NULL;
d_printf("Group is primary group of %s\n",
info->info21.account_name.string);
}
- group_is_primary = True;
+ group_is_primary = true;
}
rpccli_samr_Close(pipe_hnd, mem_ctx, &user_pol);
goto done;
}
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, False,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, false,
SEC_RIGHTS_MAXIMUM_ALLOWED, &lsa_pol);
if (!NT_STATUS_IS_OK(result)) {
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 start_idx=0, max_entries=250, num_entries, i, loop_count = 0;
struct samr_SamArray *groups = NULL;
- bool global = False;
- bool local = False;
- bool builtin = False;
+ bool global = false;
+ bool local = false;
+ bool builtin = false;
if (argc == 0) {
- global = True;
- local = True;
- builtin = True;
+ global = true;
+ local = true;
+ builtin = true;
}
for (i=0; i<argc; i++) {
if (strequal(argv[i], "global"))
- global = True;
+ global = true;
if (strequal(argv[i], "local"))
- local = True;
+ local = true;
if (strequal(argv[i], "builtin"))
- builtin = True;
+ builtin = true;
}
/* Get sam policy handle */
return result;
}
- result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, True,
+ result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED, &lsa_pol);
if (!NT_STATUS_IS_OK(result)) {
{
if (!cli_send_tconX(cli, netname, "A:", "", 0)) {
d_printf("skipping [%s]: not a file share.\n", netname);
- return False;
+ return false;
}
if (!cli_tdis(cli))
- return False;
+ return false;
- return True;
+ return true;
}
static bool check_share_sanity(struct net_context *c, struct cli_state *cli,
/* only support disk shares */
if (! ( type == STYPE_DISKTREE || type == (STYPE_DISKTREE | STYPE_HIDDEN)) ) {
printf("share [%s] is not a diskshare (type: %x)\n", netname, type);
- return False;
+ return false;
}
/* skip builtin shares */
/* FIXME: should print$ be added too ? */
if (strequal(netname,"IPC$") || strequal(netname,"ADMIN$") ||
strequal(netname,"global"))
- return False;
+ return false;
- if (c->opt_exclude && in_list(netname, c->opt_exclude, False)) {
+ if (c->opt_exclude && in_list(netname, c->opt_exclude, false)) {
printf("excluding [%s]\n", netname);
- return False;
+ return false;
}
return check_share_availability(cli, netname);
mask, &targetcli, &targetpath ) ) {
d_fprintf(stderr, "cli_resolve_path %s failed with error: %s\n",
mask, cli_errstr(cp_clistate->cli_share_src));
- return False;
+ return false;
}
if (cli_list(targetcli, targetpath, cp_clistate->attribute, copy_fn, cp_clistate) == -1) {
d_fprintf(stderr, "listing %s failed with error: %s\n",
mask, cli_errstr(targetcli));
- return False;
+ return false;
}
- return True;
+ return true;
}
if (!NT_STATUS_IS_OK(nt_status)) {
printf("Could handle directory attributes for top level directory of share %s. Error %s\n",
sharename, nt_errstr(nt_status));
- return False;
+ return false;
}
- return True;
+ return true;
}
/**
uint32 i;
uint32 level = 502;
struct copy_clistate cp_clistate;
- bool got_src_share = False;
- bool got_dst_share = False;
+ bool got_src_share = false;
+ bool got_dst_share = false;
const char *mask = "\\*";
char *dst = NULL;
if (!NT_STATUS_IS_OK(nt_status))
goto done;
- got_src_share = True;
+ got_src_share = true;
if (net_mode_share == NET_MODE_SHARE_MIGRATE) {
/* open share destination */
if (!NT_STATUS_IS_OK(nt_status))
goto done;
- got_dst_share = True;
+ got_dst_share = true;
}
if (!copy_top_level_perms(c, &cp_clistate, info502.name)) {
NTSTATUS result;
POLICY_HND lsa_pol;
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&lsa_pol);
if (!NT_STATUS_IS_OK(result))
for (i=0; i<token->num_sids; i++) {
if (sid_compare(sid, &token->user_sids[i]) == 0)
- return True;
+ return true;
}
- return False;
+ return false;
}
static void add_sid_to_token(NT_USER_TOKEN *token, DOM_SID *sid)
for (i=0; i<alias->num_members; i++) {
if (sid_compare(sid, &alias->members[i]) == 0)
- return True;
+ return true;
}
- return False;
+ return false;
}
static void collect_sid_memberships(NT_USER_TOKEN *token, DOM_SID sid)
fstring line;
if (fgets(line, sizeof(line)-1, f) == NULL) {
- return True;
+ return true;
}
if (line[strlen(line)-1] == '\n')
if (token == NULL) {
DEBUG(0, ("File does not begin with username"));
- return False;
+ return false;
}
add_sid_to_token(&token->token, &sid);
*tokens = SMB_REALLOC_ARRAY(*tokens, struct user_token, *num_tokens);
if (*tokens == NULL) {
DEBUG(0, ("Could not realloc tokens\n"));
- return False;
+ return false;
}
token = &((*tokens)[*num_tokens-1]);
continue;
}
- return False;
+ return false;
}
return -1;
}
- nt_status = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, True, SEC_RIGHTS_QUERY_VALUE,
+ nt_status = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, true, SEC_RIGHTS_QUERY_VALUE,
&connect_hnd);
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't open policy handle. Error was %s\n",
return -1;
};
- nt_status = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, False, SEC_RIGHTS_QUERY_VALUE,
+ nt_status = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, false, SEC_RIGHTS_QUERY_VALUE,
&connect_hnd);
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't open policy handle. Error was %s\n",
return -1;
};
- nt_status = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, False, SEC_RIGHTS_QUERY_VALUE,
+ nt_status = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, false, SEC_RIGHTS_QUERY_VALUE,
&connect_hnd);
if (NT_STATUS_IS_ERR(nt_status)) {
DEBUG(0, ("Couldn't open policy handle. Error was %s\n",
bool net_rpc_check(struct net_context *c, unsigned flags)
{
struct cli_state *cli;
- bool ret = False;
+ bool ret = false;
struct sockaddr_storage server_ss;
char *server_name = NULL;
NTSTATUS status;
/* flags (i.e. server type) may depend on command */
if (!net_find_server(c, NULL, flags, &server_ss, &server_name))
- return False;
+ return false;
if ((cli = cli_initialise()) == NULL) {
- return False;
+ return false;
}
status = cli_connect(cli, server_name, &server_ss);
if (cli->protocol < PROTOCOL_NT1)
goto done;
- ret = True;
+ ret = true;
done:
cli_shutdown(cli);
return ret;
}
- CHECK_RPC_ERR(rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ CHECK_RPC_ERR(rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&lsa_pol),
"error opening lsa policy handle");
fstring defaultdatatype = "";
int length=0;
- bool valid = True;
+ bool valid = true;
if (i1 == NULL)
return;
if (strlen(dependentfiles) > 0) {
d_printf ("\tDependentfiles: [%s]\n", dependentfiles);
} else {
- valid = False;
+ valid = false;
}
}
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
int length = 0;
- bool valid = True;
+ bool valid = true;
fstring name = "";
fstring driverpath = "";
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
} else {
- valid = False;
+ valid = false;
}
}
if (!W_ERROR_IS_OK(result)) {
printf("cannot enum printers: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd,
if (W_ERROR_V(result) == W_ERROR_V(WERR_ACCESS_DENIED)) {
d_fprintf(stderr, "no access to printer [%s] on [%s] for user [%s] granted\n",
printername2, servername, username);
- return False;
+ return false;
}
if (!W_ERROR_IS_OK(result)) {
d_fprintf(stderr, "cannot open printer %s on server %s: %s\n",
printername2, servername, dos_errstr(result));
- return False;
+ return false;
}
DEBUG(2,("got printer handle for printer: %s, server: %s\n",
printername2, servername));
- return True;
+ return true;
}
static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd,
if (!W_ERROR_IS_OK(result)) {
printf("cannot get printer-info: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd,
if (!W_ERROR_IS_OK(result)) {
printf("cannot set printer-info: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
if (!W_ERROR_IS_OK(result)) {
printf ("unable to set printerdata: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
if (!W_ERROR_IS_OK(result)) {
printf("enumprinterkey failed: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd,
if (!W_ERROR_IS_OK(result)) {
printf("enumprinterdataex failed: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
if (!W_ERROR_IS_OK(result)) {
printf("could not set printerdataex: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
static bool net_spoolss_enumforms(struct rpc_pipe_client *pipe_hnd,
if (!W_ERROR_IS_OK(result)) {
printf("could not enum forms: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
static bool net_spoolss_enumprinterdrivers (struct rpc_pipe_client *pipe_hnd,
if (!W_ERROR_IS_OK(result)) {
printf("cannot enum drivers: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
static bool net_spoolss_getprinterdriver(struct rpc_pipe_client *pipe_hnd,
W_ERROR_V(result) != W_ERROR_V(WERR_INVALID_ENVIRONMENT)) {
printf("cannot get driver: %s\n", dos_errstr(result));
}
- return False;
+ return false;
}
- return True;
+ return true;
}
/* be more verbose */
if (W_ERROR_V(result) == W_ERROR_V(WERR_ACCESS_DENIED)) {
printf("You are not allowed to add drivers\n");
- return False;
+ return false;
}
if (!W_ERROR_IS_OK(result)) {
printf("cannot add driver: %s\n", dos_errstr(result));
- return False;
+ return false;
}
- return True;
+ return true;
}
/**
if (!net_spoolss_enum_printers(pipe_hnd, mem_ctx, NULL,
PRINTER_ENUM_LOCAL|PRINTER_ENUM_SHARED,
level, num_printers, ctr))
- return False;
+ return false;
goto out;
}
MAXIMUM_ALLOWED_ACCESS,
pipe_hnd->auth->user_name,
&hnd))
- return False;
+ return false;
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, ctr)) {
rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
- return False;
+ return false;
}
rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd);
out:
DEBUG(3,("got %d printers\n", *num_printers));
- return True;
+ return true;
}
char *printername, *sharename;
PRINTER_INFO_CTR ctr, ctr_pub;
POLICY_HND hnd;
- bool got_hnd = False;
+ bool got_hnd = false;
WERROR result;
const char *action_str;
PRINTER_ALL_ACCESS, pipe_hnd->auth->user_name, &hnd))
goto done;
- got_hnd = True;
+ got_hnd = true;
/* check for existing dst printer */
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, &ctr_pub))
char *guid;
PRINTER_INFO_CTR ctr, ctr_pub;
POLICY_HND hnd;
- bool got_hnd = False;
+ bool got_hnd = false;
int state;
if (!get_printer_info(pipe_hnd, mem_ctx, 2, argc, argv, &num_printers, &ctr))
PRINTER_ALL_ACCESS, cli->user_name, &hnd))
goto done;
- got_hnd = True;
+ got_hnd = true;
/* check for existing dst printer */
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd, level, &ctr_pub))
uint32 num_printers;
uint32 level = 2;
char *printername, *sharename;
- bool got_hnd_src = False;
- bool got_hnd_dst = False;
+ bool got_hnd_src = false;
+ bool got_hnd_dst = false;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
POLICY_HND hnd_src, hnd_dst;
PRINTER_INFO_CTR ctr_src, ctr_dst, ctr_enum;
MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
goto done;
- got_hnd_src = True;
+ got_hnd_src = true;
/* open dst printer handle */
if (!net_spoolss_open_printer_ex(pipe_hnd_dst, mem_ctx, sharename,
PRINTER_ALL_ACCESS, cli_dst->user_name, &hnd_dst))
goto done;
- got_hnd_dst = True;
+ got_hnd_dst = true;
/* check for existing dst printer */
if (!net_spoolss_getprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, level, &ctr_dst))
/* close printer handles here */
if (got_hnd_src) {
rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
- got_hnd_src = False;
+ got_hnd_src = false;
}
if (got_hnd_dst) {
rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
- got_hnd_dst = False;
+ got_hnd_dst = false;
}
}
uint32 num_printers;
uint32 level = 1;
char *printername, *sharename;
- bool got_hnd_src = False;
- bool got_hnd_dst = False;
+ bool got_hnd_src = false;
+ bool got_hnd_dst = false;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
POLICY_HND hnd_src, hnd_dst;
PRINTER_INFO_CTR ctr_enum, ctr_dst;
MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
goto done;
- got_hnd_src = True;
+ got_hnd_src = true;
/* open dst printer handle */
PRINTER_ALL_ACCESS, cli->user_name, &hnd_dst))
goto done;
- got_hnd_dst = True;
+ got_hnd_dst = true;
/* check for existing dst printer */
/* close printer handles here */
if (got_hnd_src) {
rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
- got_hnd_src = False;
+ got_hnd_src = false;
}
if (got_hnd_dst) {
rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
- got_hnd_dst = False;
+ got_hnd_dst = false;
}
}
uint32 num_printers;
uint32 level = 3;
char *printername, *sharename;
- bool got_hnd_src = False;
- bool got_hnd_dst = False;
- bool got_src_driver_share = False;
- bool got_dst_driver_share = False;
+ bool got_hnd_src = false;
+ bool got_hnd_dst = false;
+ bool got_src_driver_share = false;
+ bool got_dst_driver_share = false;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
POLICY_HND hnd_src, hnd_dst;
PRINTER_DRIVER_CTR drv_ctr_src, drv_ctr_dst;
if (!NT_STATUS_IS_OK(nt_status))
goto done;
- got_src_driver_share = True;
+ got_src_driver_share = true;
/* open print$-share on the dst server */
if (!NT_STATUS_IS_OK(nt_status))
return nt_status;
- got_dst_driver_share = True;
+ got_dst_driver_share = true;
/* enum src printers */
PRINTER_ALL_ACCESS, cli->user_name, &hnd_dst))
goto done;
- got_hnd_dst = True;
+ got_hnd_dst = true;
/* check for existing dst printer */
if (!net_spoolss_getprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 2, &info_ctr_dst))
&hnd_src))
goto done;
- got_hnd_src = True;
+ got_hnd_src = true;
/* in a first step call getdriver for each shared printer (per arch)
/* close dst */
if (got_hnd_dst) {
rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
- got_hnd_dst = False;
+ got_hnd_dst = false;
}
/* close src */
if (got_hnd_src) {
rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
- got_hnd_src = False;
+ got_hnd_src = false;
}
}
struct cli_state *cli_dst = NULL;
POLICY_HND hnd_dst, hnd_src;
char *printername, *sharename;
- bool got_hnd_src = False;
- bool got_hnd_dst = False;
+ bool got_hnd_src = false;
+ bool got_hnd_dst = false;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
DEBUG(3,("copying printers\n"));
DEBUG(1,("could not open printer: %s\n", sharename));
} else {
- got_hnd_dst = True;
+ got_hnd_dst = true;
}
/* check for existing dst printer */
/* close printer handle here - dst only, not got src yet. */
if (got_hnd_dst) {
rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
- got_hnd_dst = False;
+ got_hnd_dst = false;
}
continue;
}
MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
goto done;
- got_hnd_src = True;
+ got_hnd_src = true;
/* getprinter on the src server */
if (!net_spoolss_getprinter(pipe_hnd, mem_ctx, &hnd_src, level, &ctr_src))
/* close printer handles here */
if (got_hnd_src) {
rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
- got_hnd_src = False;
+ got_hnd_src = false;
}
if (got_hnd_dst) {
rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
- got_hnd_dst = False;
+ got_hnd_dst = false;
}
}
uint32 num_printers, val_needed, data_needed;
uint32 level = 2;
char *printername, *sharename;
- bool got_hnd_src = False;
- bool got_hnd_dst = False;
+ bool got_hnd_src = false;
+ bool got_hnd_dst = false;
struct rpc_pipe_client *pipe_hnd_dst = NULL;
POLICY_HND hnd_src, hnd_dst;
PRINTER_INFO_CTR ctr_enum, ctr_dst, ctr_dst_publish;
MAXIMUM_ALLOWED_ACCESS, cli->user_name, &hnd_src))
goto done;
- got_hnd_src = True;
+ got_hnd_src = true;
/* open dst printer handle */
PRINTER_ALL_ACCESS, cli_dst->user_name, &hnd_dst))
goto done;
- got_hnd_dst = True;
+ got_hnd_dst = true;
/* check for existing dst printer */
ctr_dst_publish.printers_7->action = SPOOL_DS_PUBLISH;
- /* ignore False from setprinter due to WERR_IO_PENDING */
+ /* ignore false from setprinter due to WERR_IO_PENDING */
net_spoolss_setprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, 7, &ctr_dst_publish);
DEBUG(3,("republished printer\n"));
/* close printer handles here */
if (got_hnd_src) {
rpccli_spoolss_close_printer(pipe_hnd, mem_ctx, &hnd_src);
- got_hnd_src = False;
+ got_hnd_src = false;
}
if (got_hnd_dst) {
rpccli_spoolss_close_printer(pipe_hnd_dst, mem_ctx, &hnd_dst);
- got_hnd_dst = False;
+ got_hnd_dst = false;
}
}
SAFE_FREE(regpath);
}
- return True;
+ return true;
}
/********************************************************************
if ( !( subkeys = TALLOC_ZERO_P( infile->mem_ctx, REGSUBKEY_CTR )) ) {
DEBUG(0,("write_registry_tree: talloc() failed!\n"));
- return False;
+ return false;
}
if ( !(values = TALLOC_ZERO_P( subkeys, REGVAL_CTR )) ) {
DEBUG(0,("write_registry_tree: talloc() failed!\n"));
TALLOC_FREE(subkeys);
- return False;
+ return false;
}
/* copy values into the REGVAL_CTR */
d_printf("[%s]\n", path );
TALLOC_FREE(subkeys);
- return True;
+ return true;
}
/********************************************************************
NTSTATUS result;
char **domains = NULL, **names = NULL;
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED, &pol);
if ( !NT_STATUS_IS_OK(result) )
return NT_STATUS_OK;
}
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED, &pol);
if ( !NT_STATUS_IS_OK(result) )
uint16 lang_id_sys = 0;
uint16 lang_id_desc;
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED, &pol);
if ( !NT_STATUS_IS_OK(result) )
if (!NT_STATUS_IS_OK(result))
return result;
- result = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&dom_pol);
if (!NT_STATUS_IS_OK(result))
return result;
- result = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy2(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&dom_pol);
DOM_SID group_sid;
fstring sid_string;
GROUP_MAP map;
- bool insert = True;
+ bool insert = true;
fstrcpy(name, r->group_name.string);
fstrcpy(comment, r->description.string);
if (pdb_getgrsid(&map, group_sid)) {
if ( map.gid != -1 )
grp = getgrgid(map.gid);
- insert = False;
+ insert = false;
}
if (grp == NULL) {
unix_members = grp->gr_mem;
while (*unix_members) {
- bool is_nt_member = False;
+ bool is_nt_member = false;
for (i=0; i < r->num_rids; i++) {
if (nt_members[i] == NULL) {
/* This was a primary group */
}
if (strcmp(*unix_members, nt_members[i]) == 0) {
- is_nt_member = True;
+ is_nt_member = true;
break;
}
}
}
for (i=0; i < r->num_rids; i++) {
- bool is_unix_member = False;
+ bool is_unix_member = false;
if (nt_members[i] == NULL) {
/* This was the primary group */
while (*unix_members) {
if (strcmp(*unix_members, nt_members[i]) == 0) {
- is_unix_member = True;
+ is_unix_member = true;
break;
}
unix_members += 1;
DOM_SID alias_sid;
fstring sid_string;
GROUP_MAP map;
- bool insert = True;
+ bool insert = true;
fstrcpy(name, r->alias_name.string);
fstrcpy(comment, r->description.string);
if (pdb_getgrsid(&map, alias_sid)) {
grp = getgrgid(map.gid);
- insert = False;
+ insert = false;
}
if (grp == NULL) {
va_list ap;
char *value, *p, *base64;
DATA_BLOB base64_blob;
- bool do_base64 = False;
+ bool do_base64 = false;
int res;
va_start(ap, fmt);
for (p=value; *p; p++) {
if (*p & 0x80) {
- do_base64 = True;
+ do_base64 = true;
break;
}
}
if (!do_base64) {
- bool only_whitespace = True;
+ bool only_whitespace = true;
for (p=value; *p; p++) {
/*
* I know that this not multibyte safe, but we break
* on the first non-whitespace character anyway.
*/
if (!isspace(*p)) {
- only_whitespace = False;
+ only_whitespace = false;
break;
}
}
if (only_whitespace) {
- do_base64 = True;
+ do_base64 = true;
}
}
NTSTATUS status;
if (argc == 0) {
- return True;
+ return true;
}
if (ctx == this_ctx) {
new_ctx = this_ctx->parent;
TALLOC_FREE(this_ctx);
this_ctx = new_ctx;
- return True;
+ return true;
}
}
if (strequal(argv[0], "exit") || strequal(argv[0], "quit")) {
- return False;
+ return false;
}
if (strequal(argv[0], "help") || strequal(argv[0], "?")) {
}
d_printf("%-15s %s\n", cmd->name, cmd->help);
}
- return True;
+ return true;
}
for (cmd = ctx->cmds; cmd->name != NULL; cmd++) {
if (cmd->name == NULL) {
/* None found */
d_fprintf(stderr, "%s: unknown cmd\n", argv[0]);
- return True;
+ return true;
}
new_ctx = TALLOC_P(ctx, struct rpc_sh_ctx);
if (new_ctx == NULL) {
d_fprintf(stderr, "talloc failed\n");
- return False;
+ return false;
}
new_ctx->cli = ctx->cli;
new_ctx->whoami = talloc_asprintf(new_ctx, "%s %s",
if (cmd->sub != NULL) {
if (argc == 0) {
this_ctx = new_ctx;
- return True;
+ return true;
}
return net_sh_process(c, new_ctx, argc, argv);
}
nt_errstr(status));
}
- return True;
+ return true;
}
static struct rpc_sh_cmd sh_cmds[6] = {
d_fprintf(stderr, "cmdline invalid: %s\n",
poptStrerror(ret));
SAFE_FREE(line);
- return False;
+ return false;
}
if ((line[0] != '\n') &&
return -1;
}
- while (True) {
+ while (true) {
struct samr_displayentry entry;
if (!search->next_entry(search, &entry)) {
break;
goto failed;
}
- if (!lp_parm_bool(-1, "ldapsam", "trusted", False) ||
- !lp_parm_bool(-1, "ldapsam", "editposix", False)) {
+ if (!lp_parm_bool(-1, "ldapsam", "trusted", false) ||
+ !lp_parm_bool(-1, "ldapsam", "editposix", false)) {
d_fprintf(stderr, "Provisioning works only if ldapsam:trusted"
" and ldapsam:editposix are enabled.\n");
bool parseable;
if (argc == 0) {
- parseable = False;
+ parseable = false;
} else if ((argc == 1) && strequal(argv[0], "parseable")) {
- parseable = True;
+ parseable = true;
} else {
return net_help_status(c, argc, argv);
}
{
struct sessionids *ids = (struct sessionids *)state;
int i;
- bool guest = True;
+ bool guest = true;
if (crec->cnum == -1)
return 0;
for (i=0; i<ids->num_entries; i++) {
struct server_id id = ids->entries[i].pid;
if (procid_equal(&id, &crec->pid)) {
- guest = False;
+ guest = false;
break;
}
}
int num_aces;
char sep_str[2];
enum usershare_err us_err;
- bool guest_ok = False;
+ bool guest_ok = false;
sep_str[0] = *lp_winbind_separator();
sep_str[1] = '\0';
static int net_usershare_info(struct net_context *c, int argc, const char **argv)
{
fstring wcard;
- bool only_ours = True;
+ bool only_ours = true;
int ret = -1;
struct us_priv_info pi;
TALLOC_CTX *ctx;
fstrcpy(wcard, "*");
if (c->opt_long_list_entries) {
- only_ours = False;
+ only_ours = false;
}
switch (argc) {
const char *pacl;
size_t to_write;
uid_t myeuid = geteuid();
- bool guest_ok = False;
+ bool guest_ok = false;
int num_usershares;
us_comment = "";
switch (argv[4][9]) {
case 'y':
case 'Y':
- guest_ok = True;
+ guest_ok = true;
break;
case 'n':
case 'N':
- guest_ok = False;
+ guest_ok = false;
break;
default:
TALLOC_FREE(ctx);
if ((myeuid != 0) && lp_usershare_owner_only() && (myeuid != sbuf.st_uid)) {
d_fprintf(stderr, "net usershare add: cannot share path %s as "
"we are restricted to only sharing directories we own.\n"
- "\tAsk the administrator to add the line \"usershare owner only = False\" \n"
+ "\tAsk the administrator to add the line \"usershare owner only = false\" \n"
"\tto the [global] section of the smb.conf to allow this.\n",
us_path );
TALLOC_FREE(ctx);
const char **argv)
{
fstring wcard;
- bool only_ours = True;
+ bool only_ours = true;
int ret = -1;
struct us_priv_info pi;
TALLOC_CTX *ctx;
fstrcpy(wcard, "*");
if (c->opt_long_list_entries) {
- only_ours = False;
+ only_ours = false;
}
switch (argc) {
return result;
}
- result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, False,
+ result = rpccli_lsa_open_policy(lsa_pipe, mem_ctx, false,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&pol);
if (!NT_STATUS_IS_OK(result)) {
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(2,("create_cs: Connect failed. Error was %s\n", nt_errstr(nt_status)));
- cs->failed_connect = True;
+ cs->failed_connect = true;
cs->err = nt_status;
*perr = nt_status;
return NULL;
if (cs->lsapipe == NULL) {
DEBUG(2,("create_cs: open LSA pipe failed. Error was %s\n", nt_errstr(nt_status)));
- cs->failed_connect = True;
+ cs->failed_connect = true;
cs->err = nt_status;
*perr = nt_status;
return NULL;
}
- nt_status = rpccli_lsa_open_policy(cs->lsapipe, ctx, True,
+ nt_status = rpccli_lsa_open_policy(cs->lsapipe, ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&cs->pol);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(2,("create_cs: rpccli_lsa_open_policy failed. Error was %s\n", nt_errstr(nt_status)));
- cs->failed_connect = True;
+ cs->failed_connect = true;
cs->err = nt_status;
*perr = nt_status;
return NULL;