Directories are always displayed...
*/
-static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
+static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
{
uint32 num = 3;
uint32 i;
}
static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, const char *path,
- BOOL small_query, SMB_BIG_UINT *bsize,
+ bool small_query, SMB_BIG_UINT *bsize,
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
return vfswrap_disk_free(NULL, path, small_query, bsize,
return vfswrap_set_quota(NULL, qtype, id, dq);
}
-static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
+static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
{
return vfswrap_get_shadow_copy_data(NULL, fsp, shadow_copy_data, labels);
}
return vfswrap_ftruncate(NULL, fsp, fd, offset);
}
-static BOOL skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
{
return vfswrap_lock(NULL, fsp, fd, op, offset, count, type);
}
-static BOOL skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
{
return vfswrap_getlock(NULL, fsp, fd, poffset, pcount, ptype, ppid);
}
}
static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, const char *path,
- BOOL small_query, SMB_BIG_UINT *bsize,
+ bool small_query, SMB_BIG_UINT *bsize,
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
{
return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
return SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, dq);
}
-static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
+static int skel_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels)
{
return SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
}
return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset);
}
-static BOOL skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
+static bool skel_lock(vfs_handle_struct *handle, files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
{
return SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type);
}
-static BOOL skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
+static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
{
return SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid);
}
* False otherwise.
**/
-static BOOL check_domain_match(const char *user, const char *domain)
+static bool check_domain_match(const char *user, const char *domain)
{
/*
* If we aren't serving to trusted domains, we must make sure that
return NT_STATUS_OK;
}
-BOOL load_auth_module(struct auth_context *auth_context,
+bool load_auth_module(struct auth_context *auth_context,
const char *module, auth_methods **ret)
{
- static BOOL initialised_static_modules = False;
+ static bool initialised_static_modules = False;
struct auth_init_function_entry *entry;
char *module_name = smb_xstrdup(module);
char *module_params = NULL;
char *p;
- BOOL good = False;
+ bool good = False;
/* Initialise static modules if not done so yet */
if(!initialised_static_modules) {
#include "includes.h"
extern struct auth_context *negprot_global_auth_context;
-extern BOOL global_encrypted_passwords_negotiated;
+extern bool global_encrypted_passwords_negotiated;
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
DATA_BLOB lm_pwd,
DATA_BLOB nt_pwd,
DATA_BLOB plaintext_password,
- BOOL encrypted)
+ bool encrypted)
{
NTSTATUS nt_status;
return True if the password is correct, False otherwise
****************************************************************************/
-BOOL password_ok(char *smb_name, DATA_BLOB password_blob)
+bool password_ok(char *smb_name, DATA_BLOB password_blob)
{
DATA_BLOB null_password = data_blob_null;
- BOOL encrypted = (global_encrypted_passwords_negotiated && (password_blob.length == 24 || password_blob.length > 46));
+ bool encrypted = (global_encrypted_passwords_negotiated && (password_blob.length == 24 || password_blob.length > 46));
if (encrypted) {
/*
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
-extern BOOL global_machine_password_needs_changing;
+extern bool global_machine_password_needs_changing;
/**
* Connect to a remote server for (inter)domain security authenticaion.
const char *dc_name,
struct in_addr dc_ip,
struct rpc_pipe_client **pipe_ret,
- BOOL *retry)
+ bool *retry)
{
NTSTATUS result;
struct rpc_pipe_client *netlogon_pipe = NULL;
struct rpc_pipe_client *netlogon_pipe = NULL;
NTSTATUS nt_status = NT_STATUS_NO_LOGON_SERVERS;
int i;
- BOOL retry = True;
+ bool retry = True;
/*
* At this point, smb_apasswd points to the lanman response to
*
* @return If the effective challenge used by the auth subsystem may be modified
*/
-static BOOL auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_state)
+static bool auth_ntlmssp_may_set_challenge(const struct ntlmssp_state *ntlmssp_state)
{
AUTH_NTLMSSP_STATE *auth_ntlmssp_state =
(AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context;
(AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context;
auth_usersupplied_info *user_info = NULL;
NTSTATUS nt_status;
- BOOL username_was_mapped;
+ bool username_was_mapped;
/* the client has given us its machine name (which we otherwise would not get on port 445).
we need to possibly reload smb.conf if smb.conf includes depend on the machine name */
bitmask.
****************************************************************************/
-static BOOL logon_hours_ok(struct samu *sampass)
+static bool logon_hours_ok(struct samu *sampass)
{
/* In logon hours first bit is Sunday from 12AM to 1AM */
const uint8 *hours;
return NT_STATUS_NO_MEMORY;
if (*workstation_list) {
- BOOL invalid_ws = True;
+ bool invalid_ws = True;
fstring tok;
const char *s = workstation_list;
auth_serversupplied_info **server_info)
{
struct samu *sampass=NULL;
- BOOL ret;
+ bool ret;
NTSTATUS nt_status;
NTSTATUS update_login_attempts_status;
DATA_BLOB user_sess_key = data_blob_null;
DATA_BLOB lm_sess_key = data_blob_null;
- BOOL updated_autolock = False, updated_badpw = False;
+ bool updated_autolock = False, updated_badpw = False;
if (!user_info || !auth_context) {
return NT_STATUS_UNSUCCESSFUL;
const auth_usersupplied_info *user_info,
auth_serversupplied_info **server_info)
{
- BOOL is_local_name, is_my_domain;
+ bool is_local_name, is_my_domain;
if (!user_info || !auth_context) {
return NT_STATUS_LOGON_FAILURE;
struct in_addr dest_ip;
const char *p;
char *pserver;
- BOOL connected_ok = False;
+ bool connected_ok = False;
if (!(cli = cli_initialise()))
return NULL;
Send a 'keepalive' packet down the cli pipe.
****************************************************************************/
-static BOOL send_server_keepalive(const struct timeval *now,
+static bool send_server_keepalive(const struct timeval *now,
void *private_data)
{
struct server_security_state *state = talloc_get_type_abort(
struct cli_state *cli;
static unsigned char badpass[24];
static fstring baduser;
- static BOOL tested_password_server = False;
- static BOOL bad_password_server = False;
+ static bool tested_password_server = False;
+ static bool bad_password_server = False;
NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED;
- BOOL locally_made_cli = False;
+ bool locally_made_cli = False;
cli = (struct cli_state *)my_private_data;
*
* this ugly hack needs to die, but not quite yet, I think people still use it...
**/
-static BOOL update_smbpassword_file(const char *user, const char *password)
+static bool update_smbpassword_file(const char *user, const char *password)
{
struct samu *sampass;
- BOOL ret;
+ bool ret;
if ( !(sampass = samu_new( NULL )) ) {
return False;
DATA_BLOB *lm_pwd, DATA_BLOB *nt_pwd,
DATA_BLOB *lm_interactive_pwd, DATA_BLOB *nt_interactive_pwd,
DATA_BLOB *plaintext,
- BOOL encrypted)
+ bool encrypted)
{
DEBUG(5,("attempting to make a user_info for %s (%s)\n", internal_username, smb_name));
DATA_BLOB *lm_pwd, DATA_BLOB *nt_pwd,
DATA_BLOB *lm_interactive_pwd, DATA_BLOB *nt_interactive_pwd,
DATA_BLOB *plaintext,
- BOOL encrypted)
+ bool encrypted)
{
const char *domain;
NTSTATUS result;
- BOOL was_mapped;
+ bool was_mapped;
fstring internal_username;
fstrcpy(internal_username, smb_name);
was_mapped = map_username(internal_username);
Decrypt and encrypt the passwords.
****************************************************************************/
-BOOL make_user_info_netlogon_network(auth_usersupplied_info **user_info,
+bool make_user_info_netlogon_network(auth_usersupplied_info **user_info,
const char *smb_name,
const char *client_domain,
const char *wksta_name,
const uchar *nt_network_pwd,
int nt_pwd_len)
{
- BOOL ret;
+ bool ret;
NTSTATUS status;
DATA_BLOB lm_blob = data_blob(lm_network_pwd, lm_pwd_len);
DATA_BLOB nt_blob = data_blob(nt_network_pwd, nt_pwd_len);
Decrypt and encrypt the passwords.
****************************************************************************/
-BOOL make_user_info_netlogon_interactive(auth_usersupplied_info **user_info,
+bool make_user_info_netlogon_interactive(auth_usersupplied_info **user_info,
const char *smb_name,
const char *client_domain,
const char *wksta_name,
ZERO_STRUCT(key);
{
- BOOL ret;
+ bool ret;
NTSTATUS nt_status;
DATA_BLOB local_lm_blob;
DATA_BLOB local_nt_blob;
Create an auth_usersupplied_data structure
****************************************************************************/
-BOOL make_user_info_for_reply(auth_usersupplied_info **user_info,
+bool make_user_info_for_reply(auth_usersupplied_info **user_info,
const char *smb_name,
const char *client_domain,
const uint8 chal[8],
Create a guest user_info blob, for anonymous authenticaion.
****************************************************************************/
-BOOL make_user_info_guest(auth_usersupplied_info **user_info)
+bool make_user_info_guest(auth_usersupplied_info **user_info)
{
NTSTATUS nt_status;
*/
NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
- BOOL is_guest,
+ bool is_guest,
uid_t *uid, gid_t *gid,
char **found_username,
struct nt_user_token **token)
}
if (sid_check_is_in_our_domain(&user_sid)) {
- BOOL ret;
+ bool ret;
/* This is a passdb user, so ask passdb */
member of a particular group.
***************************************************************************/
-BOOL user_in_group_sid(const char *username, const DOM_SID *group_sid)
+bool user_in_group_sid(const char *username, const DOM_SID *group_sid)
{
NTSTATUS status;
uid_t uid;
gid_t gid;
char *found_username;
struct nt_user_token *token;
- BOOL result;
+ bool result;
TALLOC_CTX *mem_ctx;
}
-BOOL user_in_group(const char *username, const char *groupname)
+bool user_in_group(const char *username, const char *groupname)
{
TALLOC_CTX *mem_ctx;
DOM_SID group_sid;
- BOOL ret;
+ bool ret;
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
NTSTATUS status;
struct samu *sampass = NULL;
DOM_SID guest_sid;
- BOOL ret;
+ bool ret;
static const char zeros[16] = { 0, };
if ( !(sampass = samu_new( NULL )) ) {
static auth_serversupplied_info *guest_info = NULL;
-BOOL init_guest_info(void)
+bool init_guest_info(void)
{
if (guest_info != NULL)
return True;
return (*server_info != NULL) ? NT_STATUS_OK : NT_STATUS_NO_MEMORY;
}
-BOOL copy_current_user(struct current_user *dst, struct current_user *src)
+bool copy_current_user(struct current_user *dst, struct current_user *src)
{
gid_t *groups;
NT_USER_TOKEN *nt_token;
return True;
}
-BOOL set_current_user_guest(struct current_user *dst)
+bool set_current_user_guest(struct current_user *dst)
{
gid_t *groups;
NT_USER_TOKEN *nt_token;
char **found_username,
uid_t *uid, gid_t *gid,
struct samu *account,
- BOOL *username_was_mapped)
+ bool *username_was_mapped)
{
NTSTATUS nt_status;
fstring dom_user, lower_username;
****************************************************************************/
struct passwd *smb_getpwnam( TALLOC_CTX *mem_ctx, char *domuser,
- fstring save_username, BOOL create )
+ fstring save_username, bool create )
{
struct passwd *pw = NULL;
char *p;
struct samu *sam_account = NULL;
DOM_SID user_sid;
DOM_SID group_sid;
- BOOL username_was_mapped;
+ bool username_was_mapped;
uid_t uid;
gid_t gid;
Make an auth_methods struct
***************************************************************************/
-BOOL make_auth_methods(struct auth_context *auth_context, auth_methods **auth_method)
+bool make_auth_methods(struct auth_context *auth_context, auth_methods **auth_method)
{
if (!auth_context) {
smb_panic("no auth_context supplied to "
* false if otherwise
**/
-BOOL is_trusted_domain(const char* dom_name)
+bool is_trusted_domain(const char* dom_name)
{
DOM_SID trustdom_sid;
- BOOL ret;
+ bool ret;
/* no trusted domains for a standalone server */
PAM error handler.
*********************************************************************/
-static BOOL smb_pam_error_handler(pam_handle_t *pamh, int pam_error, const char *msg, int dbglvl)
+static bool smb_pam_error_handler(pam_handle_t *pamh, int pam_error, const char *msg, int dbglvl)
{
if( pam_error != PAM_SUCCESS) {
failure as sucess.
*********************************************************************/
-static BOOL smb_pam_nt_status_error_handler(pam_handle_t *pamh, int pam_error,
+static bool smb_pam_nt_status_error_handler(pam_handle_t *pamh, int pam_error,
const char *msg, int dbglvl,
NTSTATUS *nt_status)
{
struct smb_pam_userdata *udp = (struct smb_pam_userdata *)appdata_ptr;
struct chat_struct *pw_chat= make_pw_chat(lp_passwd_chat());
struct chat_struct *t;
- BOOL found;
+ bool found;
*resp = NULL;
DEBUG(10,("smb_pam_passchange_conv: starting converstation for %d messages\n", num_msg));
* PAM Closing out cleanup handler
*/
-static BOOL smb_pam_end(pam_handle_t *pamh, struct pam_conv *smb_pam_conv_ptr)
+static bool smb_pam_end(pam_handle_t *pamh, struct pam_conv *smb_pam_conv_ptr)
{
int pam_error;
* Start PAM authentication for specified account
*/
-static BOOL smb_pam_start(pam_handle_t **pamh, const char *user, const char *rhost, struct pam_conv *pconv)
+static bool smb_pam_start(pam_handle_t **pamh, const char *user, const char *rhost, struct pam_conv *pconv)
{
int pam_error;
const char *our_rhost;
/*
* PAM Internal Session Handler
*/
-static BOOL smb_internal_pam_session(pam_handle_t *pamh, const char *user, const char *tty, BOOL flag)
+static bool smb_internal_pam_session(pam_handle_t *pamh, const char *user, const char *tty, bool flag)
{
int pam_error;
* Internal PAM Password Changer.
*/
-static BOOL smb_pam_chauthtok(pam_handle_t *pamh, const char * user)
+static bool smb_pam_chauthtok(pam_handle_t *pamh, const char * user)
{
int pam_error;
* PAM Externally accessible Session handler
*/
-BOOL smb_pam_claim_session(char *user, char *tty, char *rhost)
+bool smb_pam_claim_session(char *user, char *tty, char *rhost)
{
pam_handle_t *pamh = NULL;
struct pam_conv *pconv = NULL;
* PAM Externally accessible Session handler
*/
-BOOL smb_pam_close_session(char *user, char *tty, char *rhost)
+bool smb_pam_close_session(char *user, char *tty, char *rhost)
{
pam_handle_t *pamh = NULL;
struct pam_conv *pconv = NULL;
* PAM Password Change Suite
*/
-BOOL smb_pam_passchange(const char * user, const char * oldpassword, const char * newpassword)
+bool smb_pam_passchange(const char * user, const char * oldpassword, const char * newpassword)
{
/* Appropriate quantities of root should be obtained BEFORE calling this function */
struct pam_conv *pconv = NULL;
}
/* If PAM not used, also no PAM restrictions on sessions. */
-BOOL smb_pam_claim_session(char *user, char *tty, char *rhost)
+bool smb_pam_claim_session(char *user, char *tty, char *rhost)
{
return True;
}
/* If PAM not used, also no PAM restrictions on sessions. */
-BOOL smb_pam_close_session(char *in_user, char *tty, char *rhost)
+bool smb_pam_close_session(char *in_user, char *tty, char *rhost)
{
return True;
}
/*******************************************************************
check on AFS authentication
********************************************************************/
-static BOOL afs_auth(char *user, char *password)
+static bool afs_auth(char *user, char *password)
{
long password_expires = 0;
char *reason;
/*******************************************************************
check on a DCE/DFS authentication
********************************************************************/
-static BOOL dfs_auth(char *user, char *password)
+static bool dfs_auth(char *user, char *password)
{
struct tm *t;
error_status_t err;
return smb_pam_passcheck(this_user, password);
#else
- BOOL ret;
+ bool ret;
#ifdef WITH_AFS
if (afs_auth(this_user, password))
****************************************************************************/
NTSTATUS pass_check(const struct passwd *pass, const char *user, const char *password,
- int pwlen, BOOL (*fn) (const char *, const char *), BOOL run_cracker)
+ int pwlen, bool (*fn) (const char *, const char *), bool run_cracker)
{
pstring pass2;
int level = lp_passwordlevel();
Check for a SID in an NT_USER_TOKEN
****************************************************************************/
-BOOL nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token )
+bool nt_token_check_sid ( const DOM_SID *sid, const NT_USER_TOKEN *token )
{
int i;
return False;
}
-BOOL nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid )
+bool nt_token_check_domain_rid( NT_USER_TOKEN *token, uint32 rid )
{
DOM_SID domain_sid;
fstring root_name;
enum lsa_SidType type;
TALLOC_CTX *ctx;
- BOOL ret;
+ bool ret;
status = pdb_create_builtin_alias( BUILTIN_ALIAS_RID_ADMINS );
if ( !NT_STATUS_IS_OK(status) ) {
struct nt_user_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
const DOM_SID *user_sid,
- BOOL is_guest,
+ bool is_guest,
int num_groupsids,
const DOM_SID *groupsids)
{
#define REGISTER 0
#endif
-extern BOOL AllowDebugChange;
-extern BOOL override_logfile;
+extern bool AllowDebugChange;
+extern bool override_logfile;
extern char tar_type;
-extern BOOL in_client;
+extern bool in_client;
static int port = 0;
pstring cur_dir = "\\";
static pstring cd_path = "";
static pstring desthost;
static pstring username;
static pstring calling_name;
-static BOOL grepable=False;
+static bool grepable=False;
static char *cmdstr = NULL;
static int io_bufsize = 64512;
time_t newer_than = 0;
static int archive_level = 0;
-static BOOL translation = False;
-static BOOL have_ip;
+static bool translation = False;
+static bool have_ip;
/* clitar bits insert */
extern int blocksize;
-extern BOOL tar_inc;
-extern BOOL tar_reset;
+extern bool tar_inc;
+extern bool tar_reset;
/* clitar bits end */
-static BOOL prompt = True;
+static bool prompt = True;
-static BOOL recurse = False;
-static BOOL showacls = False;
-BOOL lowercase = False;
+static bool recurse = False;
+static bool showacls = False;
+bool lowercase = False;
static struct in_addr dest_ip;
#define SEPARATORS " \t\n\r"
-static BOOL abort_mget = True;
+static bool abort_mget = True;
static pstring fileselection = "";
Decide if a file should be operated on.
********************************************************************/
-static BOOL do_this_one(file_info *finfo)
+static bool do_this_one(file_info *finfo)
{
if (finfo->mode & aDIR)
return(True);
}
}
-static BOOL do_list_recurse;
-static BOOL do_list_dirs;
+static bool do_list_recurse;
+static bool do_list_dirs;
static char *do_list_queue = 0;
static long do_list_queue_size = 0;
static long do_list_queue_start = 0;
A wrapper around cli_list that adds recursion.
****************************************************************************/
-void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs)
+void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),bool rec, bool dirs)
{
static int in_do_list = 0;
struct cli_state *targetcli;
Get a file from rname to lname
****************************************************************************/
-static int do_get(char *rname, char *lname, BOOL reget)
+static int do_get(char *rname, char *lname, bool reget)
{
int handle = 0, fnum;
- BOOL newhandle = False;
+ bool newhandle = False;
char *data;
struct timeval tp_start;
int read_size = io_bufsize;
Make a directory of name "name".
****************************************************************************/
-static BOOL do_mkdir(char *name)
+static bool do_mkdir(char *name)
{
struct cli_state *targetcli;
pstring targetname;
Show 8.3 name of a file.
****************************************************************************/
-static BOOL do_altname(char *name)
+static bool do_altname(char *name)
{
pstring altname;
if (!NT_STATUS_IS_OK(cli_qpathinfo_alt_name(cli, name, altname))) {
Put a single file.
****************************************************************************/
-static int do_put(char *rname, char *lname, BOOL reput)
+static int do_put(char *rname, char *lname, bool reput)
{
int fnum;
XFILE *f;
static struct file_list {
struct file_list *prev, *next;
char *file_path;
- BOOL isdir;
+ bool isdir;
} *file_list;
/****************************************************************************
the specified name.
****************************************************************************/
-static BOOL seek_list(struct file_list *list, char *name)
+static bool seek_list(struct file_list *list, char *name)
{
while (list) {
trim_string(list->file_path,"./","\n");
****************************************************************************/
static int file_find(struct file_list **list, const char *directory,
- const char *expression, BOOL match)
+ const char *expression, bool match)
{
SMB_STRUCT_DIR *dir;
struct file_list *entry;
struct stat statbuf;
int ret;
char *path;
- BOOL isdir;
+ bool isdir;
const char *dname;
dir = sys_opendir(directory);
static int cmd_newer(void)
{
pstring buf;
- BOOL ok;
+ bool ok;
SMB_STRUCT_STAT sbuf;
ok = next_token_nr(NULL,buf,NULL,sizeof(buf));
static int cmd_setcase(void)
{
- BOOL orig_case_sensitive = cli_set_case_sensitive(cli, False);
+ bool orig_case_sensitive = cli_set_case_sensitive(cli, False);
cli_set_case_sensitive(cli, !orig_case_sensitive);
DEBUG(2,("filename case sensitivity is now %s\n",!orig_case_sensitive ?
}
}
-static BOOL browse_host_rpc(BOOL sort)
+static bool browse_host_rpc(bool sort)
{
NTSTATUS status;
struct rpc_pipe_client *pipe_hnd;
Try and browse available connections on a host.
****************************************************************************/
-static BOOL browse_host(BOOL sort)
+static bool browse_host(bool sort)
{
int ret;
if (!grepable) {
Try and browse available connections on a host.
****************************************************************************/
-static BOOL list_servers(const char *wk_grp)
+static bool list_servers(const char *wk_grp)
{
fstring state;
pstring base_directory;
int opt;
pstring query_host;
- BOOL message = False;
+ bool message = False;
pstring term_code;
static const char *new_name_resolve_order = NULL;
poptContext pc;
char *p;
int rc = 0;
fstring new_workgroup;
- BOOL tar_opt = False;
- BOOL service_opt = False;
+ bool tar_opt = False;
+ bool service_opt = False;
struct poptOption long_options[] = {
POPT_AUTOHELP
static int tp, ntarf, tbufsiz;
static double ttarf;
/* Incremental mode */
-static BOOL tar_inc=False;
+static bool tar_inc=False;
/* Reset archive bit */
-static BOOL tar_reset=False;
+static bool tar_reset=False;
/* Include / exclude mode (true=include, false=exclude) */
-static BOOL tar_excl=True;
+static bool tar_excl=True;
/* use regular expressions for search on file names */
-static BOOL tar_re_search=False;
+static bool tar_re_search=False;
/* Do not dump anything, just calculate sizes */
-static BOOL dry_run=False;
+static bool dry_run=False;
/* Dump files with System attribute */
-static BOOL tar_system=True;
+static bool tar_system=True;
/* Dump files with Hidden attribute */
-static BOOL tar_hidden=True;
+static bool tar_hidden=True;
/* Be noisy - make a catalogue */
-static BOOL tar_noisy=True;
-static BOOL tar_real_noisy=False; /* Don't want to be really noisy by default */
+static bool tar_noisy=True;
+static bool tar_real_noisy=False; /* Don't want to be really noisy by default */
char tar_type='\0';
static char **cliplist=NULL;
static int clipn=0;
-static BOOL must_free_cliplist = False;
+static bool must_free_cliplist = False;
extern file_info def_finfo;
-extern BOOL lowercase;
+extern bool lowercase;
extern uint16 cnum;
-extern BOOL readbraw_supported;
+extern bool readbraw_supported;
extern int max_xmit;
extern pstring cur_dir;
extern int get_total_time_ms;
static long readtarheader(union hblock *hb, file_info2 *finfo, char *prefix);
static long unoct(char *p, int ndgs);
static void do_tarput(void);
-static void unfixtarname(char *tptr, char *fp, int l, BOOL first);
+static void unfixtarname(char *tptr, char *fp, int l, bool first);
/*
* tar specific utitlities
Ensure a remote path exists (make if necessary)
***************************************************************************/
-static BOOL ensurepath(char *fname)
+static bool ensurepath(char *fname)
{
/* *must* be called with buffer ready malloc'ed */
/* ensures path exists */
SMB_BIG_UINT nread=0;
char ftype;
file_info2 finfo;
- BOOL close_done = False;
- BOOL shallitime=True;
+ bool close_done = False;
+ bool shallitime=True;
char data[65520];
int read_size = 65520;
int datalen=0;
DEBUG(4, ("skipping %s - hidden bit is set\n", finfo.name));
shallitime=0;
} else {
- BOOL wrote_tar_header = False;
+ bool wrote_tar_header = False;
DEBUG(3,("getting file %s of size %.0f bytes as a tar file %s",
finfo.name, (double)finfo.size, lname));
Convert from UNIX to DOS file names
***************************************************************************/
-static void unfixtarname(char *tptr, char *fp, int l, BOOL first)
+static void unfixtarname(char *tptr, char *fp, int l, bool first)
{
/* remove '.' from start of file name, convert from unix /'s to
* dos \'s in path. Kill any absolute path names. But only if first!
int namesize = finfo.size + strlen(cur_dir) + 2;
char *longname = (char *)SMB_MALLOC(namesize);
int offset = 0, left = finfo.size;
- BOOL first = True;
+ bool first = True;
DEBUG(5, ("Restoring a long file name: %s\n", finfo.name));
DEBUG(5, ("Len = %.0f\n", (double)finfo.size));
#define REGISTER 0
#endif
-extern BOOL AllowDebugChange;
-extern BOOL override_logfile;
+extern bool AllowDebugChange;
+extern bool override_logfile;
extern char tar_type;
-extern BOOL in_client;
+extern bool in_client;
static int port = 0;
pstring cur_dir = "/";
static pstring service;
static pstring username;
static pstring workgroup;
static pstring calling_name;
-static BOOL grepable=False;
+static bool grepable=False;
static char *cmdstr = NULL;
static int io_bufsize = 64512;
time_t newer_than = 0;
static int archive_level = 0;
-static BOOL translation = False;
-static BOOL have_ip;
+static bool translation = False;
+static bool have_ip;
/* clitar bits insert */
extern int blocksize;
-extern BOOL tar_inc;
-extern BOOL tar_reset;
+extern bool tar_inc;
+extern bool tar_reset;
/* clitar bits end */
-static BOOL prompt = True;
+static bool prompt = True;
-static BOOL recurse = False;
-BOOL lowercase = False;
+static bool recurse = False;
+bool lowercase = False;
static struct in_addr dest_ip;
#define SEPARATORS " \t\n\r"
-static BOOL abort_mget = True;
+static bool abort_mget = True;
static pstring fileselection = "";
Decide if a file should be operated on.
********************************************************************/
-static BOOL do_this_one(file_info *finfo)
+static bool do_this_one(file_info *finfo)
{
if (finfo->mode & aDIR)
return(True);
}
}
-static BOOL do_list_recurse;
-static BOOL do_list_dirs;
+static bool do_list_recurse;
+static bool do_list_dirs;
static char *do_list_queue = 0;
static long do_list_queue_size = 0;
static long do_list_queue_start = 0;
int tool_list( char *mask,
mode_t mode,
void (*fn)(char *, struct stat *),
- BOOL rec,
- BOOL dirs)
+ bool rec,
+ bool dirs)
{
int dh;
pstring dentname;
A wrapper around cli_list that adds recursion.
****************************************************************************/
-void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs)
+void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),bool rec, bool dirs)
{
static int in_do_list = 0;
struct cli_state *targetcli;
Get a file from rname to lname
****************************************************************************/
-static int do_get(char *rname, char *lname, BOOL reget)
+static int do_get(char *rname, char *lname, bool reget)
{
int handle = 0, fnum;
- BOOL newhandle = False;
+ bool newhandle = False;
char *data;
struct timeval tp_start;
int read_size = io_bufsize;
Make a directory of name "name".
****************************************************************************/
-static BOOL do_mkdir(char *name)
+static bool do_mkdir(char *name)
{
if (smbc_mkdir(name, 755) < 0)
{
Show 8.3 name of a file.
****************************************************************************/
-static BOOL do_altname(char *name)
+static bool do_altname(char *name)
{
pstring altname;
if (!NT_STATUS_IS_OK(cli_qpathinfo_alt_name(cli, name, altname))) {
Put a single file.
****************************************************************************/
-static int do_put(char *rname, char *lname, BOOL reput)
+static int do_put(char *rname, char *lname, bool reput)
{
int fnum;
XFILE *f;
static struct file_list {
struct file_list *prev, *next;
char *file_path;
- BOOL isdir;
+ bool isdir;
} *file_list;
/****************************************************************************
the specified name.
****************************************************************************/
-static BOOL seek_list(struct file_list *list, char *name)
+static bool seek_list(struct file_list *list, char *name)
{
while (list) {
trim_string(list->file_path,"./","\n");
****************************************************************************/
static int file_find(struct file_list **list, const char *directory,
- const char *expression, BOOL match)
+ const char *expression, bool match)
{
DIR *dir;
struct file_list *entry;
struct stat statbuf;
int ret;
char *path;
- BOOL isdir;
+ bool isdir;
const char *dname;
dir = opendir(directory);
static int cmd_newer(void)
{
pstring buf;
- BOOL ok;
+ bool ok;
SMB_STRUCT_STAT sbuf;
ok = next_token_nr(NULL,buf,NULL,sizeof(buf));
static int cmd_setcase(void)
{
- BOOL orig_case_sensitive = cli_set_case_sensitive(cli, False);
+ bool orig_case_sensitive = cli_set_case_sensitive(cli, False);
cli_set_case_sensitive(cli, !orig_case_sensitive);
DEBUG(2,("filename case sensitivity is now %s\n",!orig_case_sensitive ?
Try and browse available connections on a host.
****************************************************************************/
-static BOOL browse_host(BOOL sort)
+static bool browse_host(bool sort)
{
int ret;
if (!grepable) {
Try and browse available connections on a host.
****************************************************************************/
-static BOOL list_servers(const char *wk_grp)
+static bool list_servers(const char *wk_grp)
{
fstring state;
pstring base_directory;
int opt;
pstring query_host;
- BOOL message = False;
+ bool message = False;
pstring term_code;
static const char *new_name_resolve_order = NULL;
poptContext pc;
#include <asm/types.h>
#include <linux/smb_fs.h>
-extern BOOL in_client;
+extern bool in_client;
extern pstring user_socket_options;
extern char *optarg;
extern int optind;
static pstring options;
static struct in_addr dest_ip;
-static BOOL have_ip;
+static bool have_ip;
static int smb_port = 0;
-static BOOL got_user;
-static BOOL got_pass;
+static bool got_user;
+static bool got_pass;
static uid_t mount_uid;
static gid_t mount_gid;
static int mount_ro;
static unsigned mount_fmask;
static unsigned mount_dmask;
-static BOOL use_kerberos;
+static bool use_kerberos;
/* TODO: Add code to detect smbfs version in kernel */
-static BOOL status32_smbfs = False;
-static BOOL smbfs_has_unicode = False;
-static BOOL smbfs_has_lfs = False;
+static bool status32_smbfs = False;
+static bool smbfs_has_unicode = False;
+static bool smbfs_has_lfs = False;
static void usage(void);
{
int fd = -1;
char *p;
- BOOL close_it = False;
+ bool close_it = False;
pstring spec;
char pass[128];
* Globals...
*/
-extern BOOL in_client; /* Boolean for client library */
+extern bool in_client; /* Boolean for client library */
/*
/*
initialise a group mapping backend
*/
-static BOOL init_group_mapping(void)
+static bool init_group_mapping(void)
{
if (backend != NULL) {
/* already initialised */
/* get a domain group from it's SID */
-BOOL get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map)
+bool get_domain_group_from_sid(DOM_SID sid, GROUP_MAP *map)
{
struct group *grp;
- BOOL ret;
+ bool ret;
if(!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods,
const DOM_SID *sid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
- BOOL unix_only)
+ bool unix_only)
{
if (!init_group_mapping()) {
DEBUG(0,("failed to initialize group mapping\n"));
enum lsa_SidType type;
uint32 new_rid;
gid_t gid;
- BOOL exists;
+ bool exists;
GROUP_MAP map;
TALLOC_CTX *mem_ctx;
NTSTATUS status;
NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods,
enum lsa_SidType sid_name_use,
GROUP_MAP **rmap, size_t *num_entries,
- BOOL unix_only)
+ bool unix_only)
{
return NT_STATUS_UNSUCCESSFUL;
}
/****************************************************************************
These need to be redirected through pdb_interface.c
****************************************************************************/
-BOOL pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info)
+bool pdb_get_dom_grp_info(const DOM_SID *sid, struct acct_info *info)
{
GROUP_MAP map;
- BOOL res;
+ bool res;
become_root();
res = get_domain_group_from_sid(*sid, &map);
return True;
}
-BOOL pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info)
+bool pdb_set_dom_grp_info(const DOM_SID *sid, const struct acct_info *info)
{
GROUP_MAP map;
groupdb mapping backend abstraction
*/
struct mapping_backend {
- BOOL (*init_group_mapping)(void);
- BOOL (*add_mapping_entry)(GROUP_MAP *map, int flag);
- BOOL (*get_group_map_from_sid)(DOM_SID sid, GROUP_MAP *map);
- BOOL (*get_group_map_from_gid)(gid_t gid, GROUP_MAP *map);
- BOOL (*get_group_map_from_ntname)(const char *name, GROUP_MAP *map);
- BOOL (*group_map_remove)(const DOM_SID *sid);
- BOOL (*enum_group_mapping)(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
+ bool (*init_group_mapping)(void);
+ bool (*add_mapping_entry)(GROUP_MAP *map, int flag);
+ bool (*get_group_map_from_sid)(DOM_SID sid, GROUP_MAP *map);
+ bool (*get_group_map_from_gid)(gid_t gid, GROUP_MAP *map);
+ bool (*get_group_map_from_ntname)(const char *name, GROUP_MAP *map);
+ bool (*group_map_remove)(const DOM_SID *sid);
+ bool (*enum_group_mapping)(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only);
+ size_t *p_num_entries, bool unix_only);
NTSTATUS (*one_alias_membership)(const DOM_SID *member,
DOM_SID **sids, size_t *num);
NTSTATUS (*add_aliasmem)(const DOM_SID *alias, const DOM_SID *member);
static struct ldb_context *ldb;
-static BOOL mapping_upgrade(const char *tdb_path);
+static bool mapping_upgrade(const char *tdb_path);
/*
connect to the group mapping ldb
*/
-static BOOL init_group_mapping(void)
+static bool init_group_mapping(void)
{
- BOOL existed;
+ bool existed;
const char *init_ldif[] =
{ "dn: @ATTRIBUTES\n" \
"ntName: CASE_INSENSITIVE\n" \
/*
add a group mapping entry
*/
-static BOOL add_mapping_entry(GROUP_MAP *map, int flag)
+static bool add_mapping_entry(GROUP_MAP *map, int flag)
{
struct ldb_message *msg;
int ret, i;
/*
unpack a ldb message into a GROUP_MAP structure
*/
-static BOOL msg_to_group_map(struct ldb_message *msg, GROUP_MAP *map)
+static bool msg_to_group_map(struct ldb_message *msg, GROUP_MAP *map)
{
const char *sidstr;
/*
return a group map entry for a given sid
*/
-static BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
+static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
{
int ret;
struct ldb_dn *dn;
/*
return a group map entry for a given gid
*/
-static BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
+static bool get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
{
int ret;
char *expr;
/*
Return the sid and the type of the unix group.
*/
-static BOOL get_group_map_from_ntname(const char *name, GROUP_MAP *map)
+static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map)
{
int ret;
char *expr;
/*
Remove a group mapping entry.
*/
-static BOOL group_map_remove(const DOM_SID *sid)
+static bool group_map_remove(const DOM_SID *sid)
{
struct ldb_dn *dn;
int ret;
/*
Enumerate the group mappings for a domain
*/
-static BOOL enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
+static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only)
+ size_t *p_num_entries, bool unix_only)
{
int i, ret;
char *expr;
/*
upgrade from a old style tdb
*/
-static BOOL mapping_upgrade(const char *tdb_path)
+static bool mapping_upgrade(const char *tdb_path)
{
static TDB_CONTEXT *tdb;
int ret, status=0;
static TDB_CONTEXT *tdb; /* used for driver files */
-static BOOL enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only);
-static BOOL group_map_remove(const DOM_SID *sid);
+static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
+ size_t *p_num_entries, bool unix_only);
+static bool group_map_remove(const DOM_SID *sid);
/****************************************************************************
Open the group mapping tdb.
****************************************************************************/
-static BOOL init_group_mapping(void)
+static bool init_group_mapping(void)
{
const char *vstring = "INFO/version";
int32 vers_id;
/****************************************************************************
****************************************************************************/
-static BOOL add_mapping_entry(GROUP_MAP *map, int flag)
+static bool add_mapping_entry(GROUP_MAP *map, int flag)
{
TDB_DATA dbuf;
pstring key, buf;
Return the sid and the type of the unix group.
****************************************************************************/
-static BOOL get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
+static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
{
TDB_DATA dbuf;
pstring key;
Return the sid and the type of the unix group.
****************************************************************************/
-static BOOL get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
+static bool get_group_map_from_gid(gid_t gid, GROUP_MAP *map)
{
TDB_DATA kbuf, dbuf, newkey;
fstring string_sid;
Return the sid and the type of the unix group.
****************************************************************************/
-static BOOL get_group_map_from_ntname(const char *name, GROUP_MAP *map)
+static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map)
{
TDB_DATA kbuf, dbuf, newkey;
fstring string_sid;
Remove a group mapping entry.
****************************************************************************/
-static BOOL group_map_remove(const DOM_SID *sid)
+static bool group_map_remove(const DOM_SID *sid)
{
TDB_DATA dbuf;
pstring key;
Enumerate the group mapping.
****************************************************************************/
-static BOOL enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
- size_t *p_num_entries, BOOL unix_only)
+static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap,
+ size_t *p_num_entries, bool unix_only)
{
TDB_DATA kbuf, dbuf, newkey;
fstring string_sid;
return NT_STATUS_OK;
}
-static BOOL is_aliasmem(const DOM_SID *alias, const DOM_SID *member)
+static bool is_aliasmem(const DOM_SID *alias, const DOM_SID *member)
{
DOM_SID *sids;
size_t i, num;
NTSTATUS result;
DOM_SID *sids;
size_t i, num;
- BOOL found = False;
+ bool found = False;
char *member_string;
TDB_DATA dbuf;
pstring key;
char **current_strings,
const char **next_attribute,
size_t *num_strings,
- BOOL *more_strings);
-BOOL ads_pull_uint32(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
+ bool *more_strings);
+bool ads_pull_uint32(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
uint32 *v);
-BOOL ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid);
-BOOL ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
+bool ads_pull_guid(ADS_STRUCT *ads, LDAPMessage *msg, struct GUID *guid);
+bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field,
DOM_SID *sid);
int ads_pull_sids(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
LDAPMessage *msg, const char *field, DOM_SID **sids);
-BOOL ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
+bool ads_pull_sd(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
LDAPMessage *msg, const char *field, SEC_DESC **sd);
char *ads_pull_username(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx,
LDAPMessage *msg);
LDAPMessage *ads_first_entry(ADS_STRUCT *ads, LDAPMessage *res);
LDAPMessage *ads_next_entry(ADS_STRUCT *ads, LDAPMessage *res);
void ads_process_results(ADS_STRUCT *ads, LDAPMessage *res,
- BOOL(*fn)(ADS_STRUCT *,char *, void **, void *),
+ bool (*fn)(ADS_STRUCT *,char *, void **, void *),
void *data_area);
void ads_dump(ADS_STRUCT *ads, LDAPMessage *res);
#ifndef ADT_TREE_H
#define ADT_TREE_H
-#ifndef _UPPER_BOOL
-typedef int BOOL;
-#define _UPPER_BOOL
-#endif
-
-
/* data structure used to build the tree */
typedef struct _tree_node {
/* add a new path component */
-BOOL pathtree_add( SORTED_TREE *tree, const char *path, void *data_p );
+bool pathtree_add( SORTED_TREE *tree, const char *path, void *data_p );
/* search path */
size_t length;
off_t ofs;
struct nesting *nesting;
- BOOL has_error;
+ bool has_error;
} ASN1_DATA;
DATA_BLOB nt_interactive_pwd;
DATA_BLOB plaintext_password;
- BOOL encrypted;
+ bool encrypted;
- BOOL was_mapped; /* Did the username map actually match? */
+ bool was_mapped; /* Did the username map actually match? */
char *client_domain; /* domain name string */
char *domain; /* domain name after mapping */
char *internal_username; /* username after mapping */
} auth_usersupplied_info;
typedef struct auth_serversupplied_info {
- BOOL guest;
+ bool guest;
DOM_SID *sids; /* These SIDs are preliminary between
check_ntlm_password and the token creation. */
void *pam_handle;
- BOOL was_mapped; /* Did the username map match? */
+ bool was_mapped; /* Did the username map match? */
char *unix_name;
} auth_serversupplied_info;
/* Who set this up in the first place? */
const char *challenge_set_by;
- BOOL challenge_may_be_modified;
+ bool challenge_may_be_modified;
struct auth_methods *challenge_set_method;
/* What order are the various methods in? Try to stop it changing under us */
unsigned int bufsize;
int initialised;
int win95;
- BOOL is_samba;
+ bool is_samba;
uint32 capabilities;
uint32 posix_capabilities;
- BOOL dfsroot;
+ bool dfsroot;
TALLOC_CTX *mem_ctx;
/* The list of pipes currently open on this connection. */
struct rpc_pipe_client *pipe_list;
- BOOL use_kerberos;
- BOOL fallback_after_kerberos;
- BOOL use_spnego;
+ bool use_kerberos;
+ bool fallback_after_kerberos;
+ bool use_spnego;
- BOOL use_oplocks; /* should we use oplocks? */
- BOOL use_level_II_oplocks; /* should we use level II oplocks? */
+ bool use_oplocks; /* should we use oplocks? */
+ bool use_level_II_oplocks; /* should we use level II oplocks? */
/* a oplock break request handler */
- BOOL (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level);
+ bool (*oplock_handler)(struct cli_state *cli, int fnum, unsigned char level);
- BOOL force_dos_errors;
- BOOL case_sensitive; /* False by default. */
+ bool force_dos_errors;
+ bool case_sensitive; /* False by default. */
};
typedef struct file_info {
uint32 dst_vnn, uint64 dst_srvid,
struct messaging_rec *msg);
-BOOL ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn,
+bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn,
pid_t pid);
char *ctdbd_dbpath(struct ctdbd_connection *conn,
/* PRINTFLIKE1 */
int Debug1( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
/* PRINTFLIKE1 */
-BOOL dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
-BOOL dbghdr( int level, int cls, const char *file, const char *func, int line );
+bool dbgtext( const char *, ... ) PRINTF_ATTRIBUTE(1,2);
+bool dbghdr( int level, int cls, const char *file, const char *func, int line );
#if defined(sgi) && (_COMPILER_VERSION >= 730)
#pragma mips_frequency_hint NEVER Debug1
#endif
extern int *DEBUGLEVEL_CLASS;
-extern BOOL *DEBUGLEVEL_CLASS_ISSET;
+extern bool *DEBUGLEVEL_CLASS_ISSET;
/* Debugging macros
*
struct idmap_domain {
const char *name;
- BOOL default_domain;
- BOOL readonly;
+ bool default_domain;
+ bool readonly;
void *private_data;
struct idmap_methods *methods;
- BOOL initialized;
+ bool initialized;
const char *params;
};
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
-#ifndef _UPPER_BOOL
-typedef int BOOL;
-#define _UPPER_BOOL
-#endif
-
#ifdef HAVE_BROKEN_GETGROUPS
#define GID_T int
#else
void setup_kaddr( krb5_address *pkaddr, struct sockaddr *paddr);
int create_kerberos_key_from_string(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype);
int create_kerberos_key_from_string_direct(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype);
-BOOL get_auth_data_from_tkt(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, krb5_ticket *tkt);
+bool get_auth_data_from_tkt(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, krb5_ticket *tkt);
krb5_const_principal get_principal_from_tkt(krb5_ticket *tkt);
krb5_error_code smb_krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters);
#if defined(HAVE_KRB5_LOCATE_KDC)
krb5_error_code krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters);
#endif
krb5_error_code get_kerberos_allowed_etypes(krb5_context context, krb5_enctype **enctypes);
-BOOL get_krb5_smb_session_key(krb5_context context, krb5_auth_context auth_context, DATA_BLOB *session_key, BOOL remote);
+bool get_krb5_smb_session_key(krb5_context context, krb5_auth_context auth_context, DATA_BLOB *session_key, bool remote);
krb5_error_code smb_krb5_kt_free_entry(krb5_context context, krb5_keytab_entry *kt_entry);
krb5_principal kerberos_fetch_salt_princ_for_host_princ(krb5_context context, krb5_principal host_princ, int enctype);
void kerberos_set_creds_enctype(krb5_creds *pcreds, int enctype);
-BOOL kerberos_compatible_enctypes(krb5_context context, krb5_enctype enctype1, krb5_enctype enctype2);
+bool kerberos_compatible_enctypes(krb5_context context, krb5_enctype enctype1, krb5_enctype enctype2);
void kerberos_free_data_contents(krb5_context context, krb5_data *pdata);
NTSTATUS decode_pac_data(TALLOC_CTX *mem_ctx,
DATA_BLOB *pac_data_blob,
krb5_error_code smb_krb5_parse_name_norealm(krb5_context context,
const char *name,
krb5_principal *principal);
-BOOL smb_krb5_principal_compare_any_realm(krb5_context context,
+bool smb_krb5_principal_compare_any_realm(krb5_context context,
krb5_const_principal princ1,
krb5_const_principal princ2);
int cli_krb5_get_ticket(const char *principal, time_t time_offset,
char **etype_s);
krb5_error_code smb_krb5_open_keytab(krb5_context context,
const char *keytab_name,
- BOOL write_access,
+ bool write_access,
krb5_keytab *keytab);
#endif /* HAVE_KRB5 */
uint32 type;
/*if the name or RID was looked up, then found = True*/
- BOOL found;
+ bool found;
} CacLookupRidsRecord;
typedef struct _CACUSERINFO {
uint16 logon_count;
/**Change password at next logon?*/
- BOOL pass_must_change;
+ bool pass_must_change;
/**Username*/
char *username;
* @return - un-initialized server handle
* - NULL if no memory could be allocated
*/
-CacServerHandle * cac_NewServerHandle(BOOL allocate_fields);
+CacServerHandle * cac_NewServerHandle(bool allocate_fields);
/**
* Specifies the smbc_get_auth_data_fn to use if you do not want to use the default.
uint32 access;
/**Use security quality of service? (True/False)*/
- BOOL security_qos;
+ bool security_qos;
} in;
/**Outputs*/
char *name;
/**delete recursively. WARNING: this might not always work as planned*/
- BOOL recursive;
+ bool recursive;
} in;
};
uint32 timeout;
/**False = shutdown, True = reboot*/
- BOOL reboot;
+ bool reboot;
/**force the*/
- BOOL force;
+ bool force;
/*FIXME: make this useful*/
uint32 reason;
/**Array storing the names of all the users returned*/
char **names;
- BOOL done;
+ bool done;
} out;
};
/**Array storing the descriptions of all the groups returned*/
char **descriptions;
- BOOL done;
+ bool done;
} out;
};
/**Array storing the descriptions of all the groups returned*/
char **descriptions;
- BOOL done;
+ bool done;
} out;
};
/**Internal value. Do not modify.*/
uint32 loop_count;
- BOOL done;
+ bool done;
} out;
};
uint16 srv_level;
/*stores the initialized/active pipes*/
- BOOL pipes[PI_MAX_PIPES];
+ bool pipes[PI_MAX_PIPES];
/*underlying smbc context*/
SMBCCTX *ctx;
/*did the user supply this SMBCCTX?*/
- BOOL user_supplied_ctx;
+ bool user_supplied_ctx;
};
/*used to get a struct rpc_pipe_client* to be passed into rpccli* calls*/
/*nessecary prototypes*/
-BOOL rid_in_list(uint32 rid, uint32 *list, uint32 list_len);
+bool rid_in_list(uint32 rid, uint32 *list, uint32 list_len);
int cac_ParseRegPath(char *path, uint32 *reg_type, char **key_name);
struct _SMBCSRV {
struct cli_state *cli;
dev_t dev;
- BOOL no_pathinfo;
- BOOL no_pathinfo2;
- BOOL no_nt_session;
+ bool no_pathinfo;
+ bool no_pathinfo2;
+ bool no_nt_session;
SMBCSRV *next, *prev;
char *fname;
SMB_OFF_T offset;
struct _SMBCSRV *srv;
- BOOL file;
+ bool file;
struct smbc_dir_list *dir_list, *dir_end, *dir_next;
int dir_type, dir_error;
/*
* Is this handle initialized ?
*/
- BOOL _initialized;
+ bool _initialized;
/* dirent pointer location
*
/*
* Log to standard error instead of the more typical standard output
*/
- BOOL _debug_stderr;
+ bool _debug_stderr;
/*
* Support "Create Time" in get/set with the *xattr() functions, if
* CREATE_TIME. Default is FALSE, i.e. to use the old-style shorter
* names and to not support CREATE time, for backward compatibility.
*/
- BOOL _full_time_names;
+ bool _full_time_names;
/*
* The share mode of a file being opened. To match POSIX semantics
struct byte_range_lock {
struct files_struct *fsp;
unsigned int num_locks;
- BOOL modified;
- BOOL read_only;
+ bool modified;
+ bool read_only;
struct file_id key;
struct lock_struct *lock_data;
struct db_record *record;
struct mangle_fns {
void (*reset)(void);
- BOOL (*is_mangled)(const char *s, const struct share_params *p);
- BOOL (*must_mangle)(const char *s, const struct share_params *p);
- BOOL (*is_8_3)(const char *fname, BOOL check_case, BOOL allow_wildcards,
+ bool (*is_mangled)(const char *s, const struct share_params *p);
+ bool (*must_mangle)(const char *s, const struct share_params *p);
+ bool (*is_8_3)(const char *fname, bool check_case, bool allow_wildcards,
const struct share_params *p);
- BOOL (*lookup_name_from_8_3)(TALLOC_CTX *ctx,
+ bool (*lookup_name_from_8_3)(TALLOC_CTX *ctx,
const char *in,
char **out, /* talloced on the given context. */
const struct share_params *p);
- BOOL (*name_to_8_3)(const char *in,
+ bool (*name_to_8_3)(const char *in,
char out[13],
- BOOL cache83,
+ bool cache83,
int default_case,
const struct share_params *p);
};
struct messaging_backend **presult);
struct ctdbd_connection *messaging_ctdbd_connection(void);
-BOOL message_send_all(struct messaging_context *msg_ctx,
+bool message_send_all(struct messaging_context *msg_ctx,
int msg_type,
const void *buf, size_t len,
int *n_sent);
char *hostname;
char *servicename;
char *reqpath;
- BOOL posix_path;
+ bool posix_path;
};
#define init_dfsroot(conn, inbuf, outbuf) \
/* Announce info. */
time_t lastannounce_time;
int announce_interval;
- BOOL needannounce;
+ bool needannounce;
/* Timeout time for this workgroup. 0 means permanent. */
time_t death_time;
/* Election info */
- BOOL RunningElection;
- BOOL needelection;
+ bool RunningElection;
+ bool needelection;
int ElectionCount;
uint32 ElectionCriterion;
int repeat_count;
/* Recursion protection. */
- BOOL in_expiration_processing;
+ bool in_expiration_processing;
};
/* A subnet structure. It contains a list of workgroups and netbios names. */
struct name_record *namelist; /* List of netbios names. */
struct response_record *responselist; /* List of responses expected. */
- BOOL namelist_changed;
- BOOL work_changed;
+ bool namelist_changed;
+ bool work_changed;
struct in_addr bcast_ip;
struct in_addr mask_ip;
struct {
int name_trn_id;
int opcode;
- BOOL response;
+ bool response;
struct {
- BOOL bcast;
- BOOL recursion_available;
- BOOL recursion_desired;
- BOOL trunc;
- BOOL authoritative;
+ bool bcast;
+ bool recursion_available;
+ bool recursion_desired;
+ bool trunc;
+ bool authoritative;
} nm_flags;
int rcode;
int qdcount;
int msg_type;
struct {
enum node_type node_type;
- BOOL first;
- BOOL more;
+ bool first;
+ bool more;
} flags;
int dgm_id;
struct in_addr source_ip;
{
struct packet_struct *next;
struct packet_struct *prev;
- BOOL locked;
+ bool locked;
struct in_addr ip;
int port;
int fd;
uint32 dblspool;
fstring ipaddr;
uint32 port;
- BOOL enable_snmp;
+ bool enable_snmp;
uint32 snmp_index;
} NT_PORT_DATA_1;
/* that's the central struct */
typedef struct _Printer{
struct _Printer *prev, *next;
- BOOL document_started;
- BOOL page_started;
+ bool document_started;
+ bool page_started;
uint32 jobid; /* jobid in printing backend */
- BOOL printer_type;
+ int printer_type;
TALLOC_CTX *ctx;
fstring servername;
fstring sharename;
uint32 printerlocal;
SPOOL_NOTIFY_OPTION *option;
POLICY_HND client_hnd;
- BOOL client_connected;
+ bool client_connected;
uint32 change;
/* are we in a FindNextPrinterChangeNotify() call? */
- BOOL fnpcn;
+ bool fnpcn;
} notify;
struct {
fstring machine;
/* the following rather strange looking definitions of NTSTATUS and WERROR
and there in order to catch common coding errors where different error types
are mixed up. This is especially important as we slowly convert Samba
- from using BOOL for internal functions
+ from using bool for internal functions
*/
#if defined(HAVE_IMMEDIATE_STRUCTURES)
*/
typedef struct _prs_struct {
- BOOL io; /* parsing in or out of data stream */
+ bool io; /* parsing in or out of data stream */
/*
* If the (incoming) data is big-endian. On output we are
* always little-endian.
*/
- BOOL bigendian_data;
+ bool bigendian_data;
uint8 align; /* data alignment */
- BOOL is_dynamic; /* Do we own this memory or not ? */
+ bool is_dynamic; /* Do we own this memory or not ? */
uint32 data_offset; /* Current working offset into data. */
uint32 buffer_size; /* Current allocated size of the buffer. */
uint32 grow_size; /* size requested via prs_grow() calls */
fstring remote_machine; /* Machine name we've authenticated. */
fstring domain;
- BOOL challenge_sent;
- BOOL authenticated;
+ bool challenge_sent;
+ bool authenticated;
};
typedef struct pipe_rpc_fns {
* Set to true when an RPC bind has been done on this pipe.
*/
- BOOL pipe_bound;
+ bool pipe_bound;
/*
* Set to true when we should return fault PDU's for everything.
*/
- BOOL fault_state;
+ bool fault_state;
/*
* Set to true when we should return fault PDU's for a bad handle.
*/
- BOOL bad_handle_fault_state;
+ bool bad_handle_fault_state;
/*
* Set to true when the backend does not support a call.
*/
- BOOL rng_fault_state;
+ bool rng_fault_state;
/*
* Set to RPC_BIG_ENDIAN when dealing with big-endian PDU's
*/
- BOOL endian;
+ bool endian;
/*
* Struct to deal with multiple pdu inputs.
int pnum;
connection_struct *conn;
uint16 vuid; /* points to the unauthenticated user that opened this pipe. */
- BOOL open; /* open connection */
+ bool open; /* open connection */
uint16 device_state;
uint16 priority;
fstring name;
ssize_t (*namedpipe_transact)(void *np_state,
char *data, int len,
char *rdata, int rlen,
- BOOL *pipe_outstanding);
+ bool *pipe_outstanding);
/* call to perform a write namedpipe operation
*/
*/
ssize_t (*namedpipe_read)(void * np_state,
char *data, size_t max_len,
- BOOL *pipe_outstanding);
+ bool *pipe_outstanding);
/* call to close a namedpipe.
* function is expected to perform all cleanups
* returns True if cleanup was successful (not that
* we particularly care).
*/
- BOOL (*namedpipe_close)(void * np_state);
+ bool (*namedpipe_close)(void * np_state);
} smb_np_struct;
struct api_struct {
const char *name;
uint8 opnum;
- BOOL (*fn) (pipes_struct *);
+ bool (*fn) (pipes_struct *);
};
typedef struct {
enum server_types server_role;
uint32 expected_state;
- BOOL unicode;
- BOOL use_ntlmv2;
+ bool unicode;
+ bool use_ntlmv2;
char *user;
char *domain;
char *workstation;
* @return Can the challenge be set to arbitary values?
*
*/
- BOOL (*may_set_challenge)(const struct ntlmssp_state *ntlmssp_state);
+ bool (*may_set_challenge)(const struct ntlmssp_state *ntlmssp_state);
/**
* Callback to set the 'challenge' used for NTLM authentication.
} SMB_NTQUOTA_LIST;
typedef struct _SMB_NTQUOTA_HANDLE {
- BOOL valid;
+ bool valid;
SMB_NTQUOTA_LIST *quota_list;
SMB_NTQUOTA_LIST *tmp_list;
} SMB_NTQUOTA_HANDLE;
* Return False if none is available
* Otherwise return True and store the callback result in *status
*/
-BOOL packet_handler(struct packet_context *ctx,
- BOOL (*full_req)(const struct data_blob *data,
+bool packet_handler(struct packet_context *ctx,
+ bool (*full_req)(const struct data_blob *data,
size_t *length,
void *private_data),
NTSTATUS (*callback)(const struct data_blob *data,
struct samr_displayentry *cache;
uint32 num_entries;
ssize_t cache_size;
- BOOL search_ended;
+ bool search_ended;
void *private_data;
- BOOL (*next_entry)(struct pdb_search *search,
+ bool (*next_entry)(struct pdb_search *search,
struct samr_displayentry *entry);
void (*search_end)(struct pdb_search *search);
};
{
const char *name; /* What name got this module */
- NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update, uint32 acb_mask);
+ NTSTATUS (*setsampwent)(struct pdb_methods *, bool update, uint32 acb_mask);
void (*endsampwent)(struct pdb_methods *);
NTSTATUS (*rename_sam_account)(struct pdb_methods *, struct samu *oldname, const char *newname);
- NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, BOOL success);
+ NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, bool success);
NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid);
NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods,
const DOM_SID *sid, enum lsa_SidType sid_name_use,
GROUP_MAP **pp_rmap, size_t *p_num_entries,
- BOOL unix_only);
+ bool unix_only);
NTSTATUS (*enum_group_members)(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
NTSTATUS (*get_seq_num)(struct pdb_methods *methods, time_t *seq_num);
- BOOL (*search_users)(struct pdb_methods *methods,
+ bool (*search_users)(struct pdb_methods *methods,
struct pdb_search *search,
uint32 acct_flags);
- BOOL (*search_groups)(struct pdb_methods *methods,
+ bool (*search_groups)(struct pdb_methods *methods,
struct pdb_search *search);
- BOOL (*search_aliases)(struct pdb_methods *methods,
+ bool (*search_aliases)(struct pdb_methods *methods,
struct pdb_search *search,
const DOM_SID *sid);
- BOOL (*uid_to_rid)(struct pdb_methods *methods, uid_t uid,
+ bool (*uid_to_rid)(struct pdb_methods *methods, uid_t uid,
uint32 *rid);
- BOOL (*uid_to_sid)(struct pdb_methods *methods, uid_t uid,
+ bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid,
DOM_SID *sid);
- BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid,
+ bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid,
DOM_SID *sid);
- BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid,
+ bool (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid,
union unid_t *id, enum lsa_SidType *type);
- BOOL (*rid_algorithm)(struct pdb_methods *methods);
- BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid);
+ bool (*rid_algorithm)(struct pdb_methods *methods);
+ bool (*new_rid)(struct pdb_methods *methods, uint32 *rid);
- BOOL (*get_trusteddom_pw)(struct pdb_methods *methods,
+ bool (*get_trusteddom_pw)(struct pdb_methods *methods,
const char *domain, char** pwd,
DOM_SID *sid, time_t *pass_last_set_time);
- BOOL (*set_trusteddom_pw)(struct pdb_methods *methods,
+ bool (*set_trusteddom_pw)(struct pdb_methods *methods,
const char* domain, const char* pwd,
const DOM_SID *sid);
- BOOL (*del_trusteddom_pw)(struct pdb_methods *methods,
+ bool (*del_trusteddom_pw)(struct pdb_methods *methods,
const char *domain);
NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx, uint32 *num_domains,
struct user_auth_info {
pstring username;
pstring password;
- BOOL got_pass;
- BOOL use_kerberos;
+ bool got_pass;
+ bool use_kerberos;
int signing_state;
};
int status; /* the status of this job */
size_t size; /* the size of the job so far */
int page_count; /* then number of pages so far */
- BOOL spooled; /* has it been sent to the spooler yet? */
- BOOL smbjob; /* set if the job is a SMB job */
+ bool spooled; /* has it been sent to the spooler yet? */
+ bool smbjob; /* set if the job is a SMB job */
fstring filename; /* the filename used to spool the file */
fstring jobname; /* the job name given to us by the client */
fstring user; /* the user who started the job */
uint32 attr;
} LUID_ATTR;
-#ifndef _UPPER_BOOL
-typedef int BOOL;
-#define _UPPER_BOOL
-#endif
-
typedef struct {
TALLOC_CTX *mem_ctx;
- BOOL ext_ctx;
+ bool ext_ctx;
uint32 count;
uint32 control;
LUID_ATTR *set;
/* functions for enumerating subkeys and values */
int (*fetch_subkeys)( const char *key, REGSUBKEY_CTR *subkeys);
int (*fetch_values) ( const char *key, REGVAL_CTR *val );
- BOOL (*store_subkeys)( const char *key, REGSUBKEY_CTR *subkeys );
- BOOL (*store_values)( const char *key, REGVAL_CTR *val );
- BOOL (*reg_access_check)( const char *keyname, uint32 requested,
+ bool (*store_subkeys)( const char *key, REGSUBKEY_CTR *subkeys );
+ bool (*store_values)( const char *key, REGVAL_CTR *val );
+ bool (*reg_access_check)( const char *keyname, uint32 requested,
uint32 *granted,
const NT_USER_TOKEN *token );
WERROR (*get_secdesc)(TALLOC_CTX *mem_ctx, const char *key,
prs_struct ps; /* data */
- BOOL dirty; /* has this hbin block been modified? */
+ bool dirty; /* has this hbin block been modified? */
} REGF_HBIN;
/* ??? List -- list of key offsets and hashed names for consistency */
#define _RPC_MISC_H
#define SMB_RPC_INTERFACE_VERSION 1
-#define PRS_POINTER_CAST BOOL (*)(const char*, prs_struct*, int, void*)
+#define PRS_POINTER_CAST bool (*)(const char*, prs_struct*, int, void*)
enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_TERMINATE = 2, UNI_BROKEN_NON_NULL = 3, UNI_STR_DBLTERMINATE = 4 };
#define SMB_PORTS "445 139"
#define Undefined (-1)
-#define False (0)
-#define True (1)
+#define False false
+#define True true
#define Auto (2)
#define Required (3)
#include "librpc/gen_ndr/svcctl.h"
struct lsa_dom_info {
- BOOL valid;
+ bool valid;
DOM_SID sid;
const char *name;
int num_idxs;
struct timeval open_time;
uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */
uint32 share_access; /* NTCreateX share constants (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE). */
- BOOL pending_modtime_owner;
+ bool pending_modtime_owner;
struct timespec pending_modtime;
struct timespec last_write_time;
int oplock_type;
struct share_mode_entry *pending_break_messages;
int num_pending_break_messages;
- BOOL can_lock;
- BOOL can_read;
- BOOL can_write;
- BOOL print_file;
- BOOL modified;
- BOOL is_directory;
- BOOL is_stat;
- BOOL aio_write_behind;
- BOOL lockdb_clean;
- BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */
- BOOL posix_open;
+ bool can_lock;
+ bool can_read;
+ bool can_write;
+ bool print_file;
+ bool modified;
+ bool is_directory;
+ bool is_stat;
+ bool aio_write_behind;
+ bool lockdb_clean;
+ bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */
+ bool posix_open;
char *fsp_name;
struct vfs_fsp_data *vfs_extension;
struct vuid_cache_entry {
uint16 vuid;
- BOOL read_only;
- BOOL admin_user;
+ bool read_only;
+ bool admin_user;
};
struct vuid_cache {
typedef struct {
char *name;
- BOOL is_wild;
+ bool is_wild;
} name_compare_entry;
struct trans_state {
fstring name; /* for trans requests */
uint16 call; /* for trans2 and nttrans requests */
- BOOL close_on_completion;
- BOOL one_way;
+ bool close_on_completion;
+ bool one_way;
unsigned int setup_count;
uint16 *setup;
TALLOC_CTX *mem_ctx; /* long-lived memory context for things hanging off this struct. */
unsigned cnum; /* an index passed over the wire */
struct share_params *params;
- BOOL force_user;
- BOOL force_group;
+ bool force_user;
+ bool force_group;
struct vuid_cache vuid_cache;
struct dptr_struct *dirptr;
- BOOL printer;
- BOOL ipc;
- BOOL read_only; /* Attributes for the current user of the share. */
- BOOL admin_user; /* Attributes for the current user of the share. */
+ bool printer;
+ bool ipc;
+ bool read_only; /* Attributes for the current user of the share. */
+ bool admin_user; /* Attributes for the current user of the share. */
char *dirpath;
char *connectpath;
char *origpath;
time_t lastused;
time_t lastused_count;
- BOOL used;
+ bool used;
int num_files_open;
unsigned int num_smb_operations; /* Count of smb operations on this tree. */
- BOOL case_sensitive;
- BOOL case_preserve;
- BOOL short_case_preserve;
+ bool case_sensitive;
+ bool case_preserve;
+ bool short_case_preserve;
name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */
name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */
uint32 type;
fstring comment;
fstring domain; /* used ONLY in ipc.c NOT namework.c */
- BOOL server_added; /* used ONLY in ipc.c NOT namework.c */
+ bool server_added; /* used ONLY in ipc.c NOT namework.c */
};
/* used for network interfaces */
int num_share_modes;
struct share_mode_entry *share_modes;
UNIX_USER_TOKEN *delete_token;
- BOOL delete_on_close;
- BOOL fresh;
- BOOL modified;
+ bool delete_on_close;
+ bool fresh;
+ bool modified;
struct db_record *record;
};
union {
struct {
int num_share_mode_entries;
- BOOL delete_on_close;
+ bool delete_on_close;
uint32 delete_token_size; /* Only valid if either of
the two previous fields
are True. */
parm_type type;
parm_class p_class;
void *ptr;
- BOOL (*special)(int snum, const char *, char **);
+ bool (*special)(int snum, const char *, char **);
const struct enum_list *enum_list;
unsigned flags;
union {
- BOOL bvalue;
+ bool bvalue;
int ivalue;
char *svalue;
char cvalue;
typee is used to describe how to interact with the kernel */
struct kernel_oplocks {
files_struct * (*receive_message)(fd_set *fds);
- BOOL (*set_oplock)(files_struct *fsp, int oplock_type);
+ bool (*set_oplock)(files_struct *fsp, int oplock_type);
void (*release_oplock)(files_struct *fsp);
- BOOL (*msg_waiting)(fd_set *fds);
+ bool (*msg_waiting)(fd_set *fds);
int notification_fd;
};
};
struct pwd_info {
- BOOL null_pwd;
- BOOL cleartext;
+ bool null_pwd;
+ bool cleartext;
fstring password;
};
const char *unix_homedir;
const char *logon_script;
- BOOL guest;
+ bool guest;
/* following groups stuff added by ih */
/* This groups info is needed for when we become_user() for this uid */
typedef struct smb_sign_info {
void (*sign_outgoing_message)(char *outbuf, struct smb_sign_info *si);
- BOOL (*check_incoming_message)(const char *inbuf, struct smb_sign_info *si, BOOL must_be_ok);
+ bool (*check_incoming_message)(const char *inbuf, struct smb_sign_info *si, bool must_be_ok);
void (*free_signing_context)(struct smb_sign_info *si);
void *signing_context;
- BOOL negotiated_smb_signing;
- BOOL allow_smb_signing;
- BOOL doing_signing;
- BOOL mandatory_signing;
- BOOL seen_valid; /* Have I ever seen a validly signed packet? */
+ bool negotiated_smb_signing;
+ bool allow_smb_signing;
+ bool doing_signing;
+ bool mandatory_signing;
+ bool seen_valid; /* Have I ever seen a validly signed packet? */
} smb_sign_info;
struct ea_struct {
enum ldap_deref deref;
uint32 timelimit;
uint32 sizelimit;
- BOOL attributesonly;
+ bool attributesonly;
char *filter;
int num_attributes;
const char **attributes;
struct ldap_ModifyDNRequest {
const char *dn;
const char *newrdn;
- BOOL deleteolddn;
+ bool deleteolddn;
const char *newsuperior;
};
struct ldap_Control {
const char *oid;
- BOOL critical;
+ bool critical;
DATA_BLOB value;
};
int next_msgid;
char *host;
uint16 port;
- BOOL ldaps;
+ bool ldaps;
const char *auth_dn;
const char *simple_pw;
void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing,
LDAPMod ***mods,
const char *attribute, const char *newval);
-BOOL smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry,
+bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, char *value,
int max_len);
-BOOL smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
+bool smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, pstring value);
char *smbldap_get_dn(LDAP *ld, LDAPMessage *entry);
int smbldap_modify(struct smbldap_state *ldap_state,
const char *uri;
/* credentials */
- BOOL anonymous;
+ bool anonymous;
char *bind_dn;
char *bind_secret;
- BOOL paged_results;
+ bool paged_results;
unsigned int num_failures;
extern struct profile_header *profile_h;
extern struct profile_stats *profile_p;
-extern BOOL do_profile_flag;
-extern BOOL do_profile_times;
+extern bool do_profile_flag;
+extern bool do_profile_times;
#ifdef WITH_PROFILE
#include "tdb.h"
-#ifndef _BOOL
-typedef int BOOL;
-#define _BOOL
-#endif
-
/* single node of a list returned by tdb_search_keys */
typedef struct keys_node
{
};
struct tdb_validation_status {
- BOOL tdb_error;
- BOOL bad_freelist;
- BOOL bad_entry;
- BOOL unknown_key;
- BOOL success;
+ bool tdb_error;
+ bool bad_freelist;
+ bool bad_entry;
+ bool unknown_key;
+ bool success;
};
typedef int (*tdb_validate_data_func)(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state);
unsigned int timeout);
void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval);
int32 tdb_fetch_int32(struct tdb_context *tdb, const char *keystr);
-int tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32 value);
+bool tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32 value);
int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32 v);
-int tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32 *value);
+bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32 *value);
int tdb_traverse_delete_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf,
void *state);
int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags);
TDB_DATA string_term_tdb_data(const char *string);
int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf,
int flag);
-BOOL tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr,
+bool tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr,
uint32 *oldval, uint32 change_val);
int tdb_chainlock_with_timeout( TDB_CONTEXT *tdb, TDB_DATA key,
unsigned int timeout);
/* Changed to version22 to add lchown operation -- jra */
/* Leave at 22 - not yet released. But change set_nt_acl to return an NTSTATUS. jra. */
/* Leave at 22 - not yet released. Add file_id_create operation. --metze */
+/* Leave at 22 - not yet released. Change all BOOL parameters (int) to bool. jra. */
#define SMB_VFS_INTERFACE_VERSION 22
int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user);
void (*disconnect)(struct vfs_handle_struct *handle);
- SMB_BIG_UINT (*disk_free)(struct vfs_handle_struct *handle, const char *path, BOOL small_query, SMB_BIG_UINT *bsize,
+ SMB_BIG_UINT (*disk_free)(struct vfs_handle_struct *handle, const char *path, bool small_query, SMB_BIG_UINT *bsize,
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
int (*get_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
int (*set_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
- int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels);
+ int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels);
int (*statvfs)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf);
/* Directory operations */
char *(*getwd)(struct vfs_handle_struct *handle, char *buf);
int (*ntimes)(struct vfs_handle_struct *handle, const char *path, const struct timespec ts[2]);
int (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_OFF_T offset);
- BOOL (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
+ bool (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 share_mode);
int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, int leasetype);
- BOOL (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
+ bool (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
int (*symlink)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath);
int (*readlink)(struct vfs_handle_struct *handle, const char *path, char *buf, size_t bufsiz);
int (*link)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath);
/* load a msg file into the tdb */
-static BOOL load_msg(const char *msg_file)
+static bool load_msg(const char *msg_file)
{
char **lines;
int num_lines, i;
/* initialise the message translation subsystem. If the "lang" argument
is NULL then get the language from the normal environment variables */
-BOOL lang_tdb_init(const char *lang)
+bool lang_tdb_init(const char *lang)
{
char *path = NULL;
char *msg_path = NULL;
struct stat st;
static int initialised;
time_t loadtime;
- BOOL result = False;
+ bool result = False;
/* we only want to init once per process, unless given
an override */
Get default value for account policy
*****************************************************************************/
-BOOL account_policy_get_default(int account_policy, uint32 *val)
+bool account_policy_get_default(int account_policy, uint32 *val)
{
int i;
for (i=0; account_policy_names[i].field; i++) {
Set default for a field if it is empty
*****************************************************************************/
-static BOOL account_policy_set_default_on_empty(int account_policy)
+static bool account_policy_set_default_on_empty(int account_policy)
{
uint32 value;
Open the account policy tdb.
***`*************************************************************************/
-BOOL init_account_policy(void)
+bool init_account_policy(void)
{
const char *vstring = "INFO/version";
Get an account policy (from tdb)
*****************************************************************************/
-BOOL account_policy_get(int field, uint32 *value)
+bool account_policy_get(int field, uint32 *value)
{
const char *name;
uint32 regval;
Set an account policy (in tdb)
****************************************************************************/
-BOOL account_policy_set(int field, uint32 value)
+bool account_policy_set(int field, uint32 value)
{
const char *name;
Set an account policy in the cache
****************************************************************************/
-BOOL cache_account_policy_set(int field, uint32 value)
+bool cache_account_policy_set(int field, uint32 value)
{
const char *policy_name = NULL;
char *cache_key = NULL;
char *cache_value = NULL;
- BOOL ret = False;
+ bool ret = False;
policy_name = decode_account_policy_name(field);
if (policy_name == NULL) {
Get an account policy from the cache
*****************************************************************************/
-BOOL cache_account_policy_get(int field, uint32 *value)
+bool cache_account_policy_get(int field, uint32 *value)
{
const char *policy_name = NULL;
char *cache_key = NULL;
char *cache_value = NULL;
- BOOL ret = False;
+ bool ret = False;
policy_name = decode_account_policy_name(field);
if (policy_name == NULL) {
/**************************************************************************
*************************************************************************/
-static BOOL trim_tree_keypath( char *path, char **base, char **new_path )
+static bool trim_tree_keypath( char *path, char **base, char **new_path )
{
char *p;
Add a new node into the tree given a key path and a blob of data
*************************************************************************/
- BOOL pathtree_add( SORTED_TREE *tree, const char *path, void *data_p )
+ bool pathtree_add( SORTED_TREE *tree, const char *path, void *data_p )
{
char *str, *base, *path2;
TREE_NODE *current, *next;
- BOOL ret = True;
+ bool ret = True;
DEBUG(8,("pathtree_add: Enter\n"));
/* Create a ClearToken and an encrypted ticket. ClearToken has not yet the
* ViceId set, this should be set by the caller. */
-static BOOL afs_createtoken(const char *username, const char *cell,
+static bool afs_createtoken(const char *username, const char *cell,
DATA_BLOB *ticket, struct ClearToken *ct)
{
fstring clear_ticket;
For the comments "Alice" is the User to be auth'ed, and "Bob" is the
AFS server. */
-BOOL afs_login(connection_struct *conn)
+bool afs_login(connection_struct *conn)
{
extern userdom_struct current_user_info;
extern struct current_user current_user;
DATA_BLOB ticket;
pstring afs_username;
char *cell;
- BOOL result;
+ bool result;
char *ticket_str;
const DOM_SID *user_sid;
#else
-BOOL afs_login(connection_struct *conn)
+bool afs_login(connection_struct *conn)
{
return True;
}
uint32 EndTimestamp;
};
-static BOOL afs_decode_token(const char *string, char **cell,
+static bool afs_decode_token(const char *string, char **cell,
DATA_BLOB *ticket, struct ClearToken *ct)
{
DATA_BLOB blob;
to avoid.
*/
-static BOOL afs_settoken(const char *cell,
+static bool afs_settoken(const char *cell,
const struct ClearToken *ctok,
DATA_BLOB ticket)
{
return (ret == 0);
}
-BOOL afs_settoken_str(const char *token_string)
+bool afs_settoken_str(const char *token_string)
{
DATA_BLOB ticket;
struct ClearToken ct;
- BOOL result;
+ bool result;
char *cell;
if (!afs_decode_token(token_string, &cell, &ticket, &ct))
#else
-BOOL afs_settoken_str(const char *token_string)
+bool afs_settoken_str(const char *token_string)
{
return False;
}
return NULL;
}
-BOOL get_audit_category_from_param(const char *param, uint32 *audit_category)
+bool get_audit_category_from_param(const char *param, uint32 *audit_category)
{
*audit_category = Undefined;
/****************************************************************************
set a bit in a bitmap
****************************************************************************/
-BOOL bitmap_set(struct bitmap *bm, unsigned i)
+bool bitmap_set(struct bitmap *bm, unsigned i)
{
if (i >= bm->n) {
DEBUG(0,("Setting invalid bitmap entry %d (of %d)\n",
/****************************************************************************
clear a bit in a bitmap
****************************************************************************/
-BOOL bitmap_clear(struct bitmap *bm, unsigned i)
+bool bitmap_clear(struct bitmap *bm, unsigned i)
{
if (i >= bm->n) {
DEBUG(0,("clearing invalid bitmap entry %d (of %d)\n",
/****************************************************************************
query a bit in a bitmap
****************************************************************************/
-BOOL bitmap_query(struct bitmap *bm, unsigned i)
+bool bitmap_query(struct bitmap *bm, unsigned i)
{
if (i >= bm->n) return False;
if (bm->b[i/32] & (1<<(i%32))) {
static smb_iconv_t conv_handles[NUM_CHARSETS][NUM_CHARSETS];
-static BOOL conv_silent; /* Should we do a debug if the conversion fails ? */
+static bool conv_silent; /* Should we do a debug if the conversion fails ? */
/**
* Return the name of a charset to give to iconv().
void init_iconv(void)
{
int c1, c2;
- BOOL did_reload = False;
+ bool did_reload = False;
/* so that charset_name() works we need to get the UNIX<->UCS2 going
first */
static size_t convert_string_internal(charset_t from, charset_t to,
void const *src, size_t srclen,
- void *dest, size_t destlen, BOOL allow_bad_conv)
+ void *dest, size_t destlen, bool allow_bad_conv)
{
size_t i_len, o_len;
size_t retval;
size_t convert_string(charset_t from, charset_t to,
void const *src, size_t srclen,
- void *dest, size_t destlen, BOOL allow_bad_conv)
+ void *dest, size_t destlen, bool allow_bad_conv)
{
/*
* NB. We deliberately don't do a strlen here if srclen == -1.
**/
size_t convert_string_allocate(TALLOC_CTX *ctx, charset_t from, charset_t to,
- void const *src, size_t srclen, void *dst, BOOL allow_bad_conv)
+ void const *src, size_t srclen, void *dst, bool allow_bad_conv)
{
size_t i_len, o_len, destlen = MAX(srclen, 512);
size_t retval;
**/
size_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to,
void const *src, size_t srclen, void *dst,
- BOOL allow_bad_conv)
+ bool allow_bad_conv)
{
void **dest = (void **)dst;
size_t dest_len;
#include "includes.h"
-static struct db_context *connections_db_ctx(BOOL rw)
+static struct db_context *connections_db_ctx(bool rw)
{
static struct db_context *db_ctx;
return connections_traverse(conn_traverse_fn, (void *)&state);
}
-BOOL connections_init(BOOL rw)
+bool connections_init(bool rw)
{
return (connections_db_ctx(rw) != NULL);
}
* Do we have a complete ctdb packet in the queue?
*/
-static BOOL ctdb_req_complete(const struct data_blob *data,
+static bool ctdb_req_complete(const struct data_blob *data,
size_t *length,
void *private_data)
{
/*
* see if a remote process exists
*/
-BOOL ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn, pid_t pid)
+bool ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn, pid_t pid)
{
NTSTATUS status;
TDB_DATA data;
XFILE *dbf = NULL;
pstring debugf = "";
-BOOL debug_warn_unknown_class = True;
-BOOL debug_auto_add_unknown_class = True;
-BOOL AllowDebugChange = True;
+bool debug_warn_unknown_class = True;
+bool debug_auto_add_unknown_class = True;
+bool AllowDebugChange = True;
/*
used to check if the user specified a
logfile on the command line
*/
-BOOL override_logfile;
+bool override_logfile;
/*
* system has been initialised.
*/
static int debug_all_class_hack = 1;
-static BOOL debug_all_class_isset_hack = True;
+static bool debug_all_class_isset_hack = True;
static int debug_num_classes = 0;
int *DEBUGLEVEL_CLASS = &debug_all_class_hack;
-BOOL *DEBUGLEVEL_CLASS_ISSET = &debug_all_class_isset_hack;
+bool *DEBUGLEVEL_CLASS_ISSET = &debug_all_class_isset_hack;
/* DEBUGLEVEL is #defined to *debug_level */
int DEBUGLEVEL = &debug_all_class_hack;
* are unable to open a new log file for some reason.
*/
-static BOOL stdout_logging = False;
+static bool stdout_logging = False;
static int debug_count = 0;
#ifdef WITH_SYSLOG
static int syslog_level = 0;
#endif
static pstring format_bufr = { '\0' };
static size_t format_pos = 0;
-static BOOL log_overflow = False;
+static bool log_overflow = False;
/*
* Define all the debug class selection names here. Names *MUST NOT* contain
char **list;
char *buf = NULL;
char *b;
- BOOL err = False;
+ bool err = False;
if (DEBUGLEVEL_CLASS == &debug_all_class_hack) {
return NULL;
if (new_ptr == &debug_all_class_isset_hack) {
new_ptr = NULL;
}
- new_ptr = SMB_REALLOC_ARRAY(new_ptr, BOOL, debug_num_classes + 1);
+ new_ptr = SMB_REALLOC_ARRAY(new_ptr, bool, debug_num_classes + 1);
if (!new_ptr)
return -1;
- DEBUGLEVEL_CLASS_ISSET = (int *)new_ptr;
+ DEBUGLEVEL_CLASS_ISSET = (bool *)new_ptr;
DEBUGLEVEL_CLASS_ISSET[ndx] = False;
new_ptr = SMB_REALLOC_ARRAY(classname_table, char *, debug_num_classes + 1);
printdrivers:7
****************************************************************************/
-static BOOL debug_parse_params(char **params)
+static bool debug_parse_params(char **params)
{
int i, ndx;
char *class_name;
Note: the 1st param has no "name:" preceeding it.
****************************************************************************/
-BOOL debug_parse_levels(const char *params_str)
+bool debug_parse_levels(const char *params_str)
{
char **params;
void debug_init(void)
{
- static BOOL initialised = False;
+ static bool initialised = False;
const char **p;
if (initialised)
Get ready for syslog stuff
**************************************************************************/
-void setup_logging(const char *pname, BOOL interactive)
+void setup_logging(const char *pname, bool interactive)
{
debug_init();
Fix from dgibson@linuxcare.com.
**************************************************************************/
-BOOL reopen_logs( void )
+bool reopen_logs( void )
{
pstring fname;
mode_t oldumask;
XFILE *new_dbf = NULL;
XFILE *old_dbf = NULL;
- BOOL ret = True;
+ bool ret = True;
if (stdout_logging)
return True;
Check to see if there is any need to check if the logfile has grown too big.
**************************************************************************/
-BOOL need_to_check_log_size( void )
+bool need_to_check_log_size( void )
{
int maxlog;
static void format_debug_text( const char *msg )
{
size_t i;
- BOOL timestamp = (!stdout_logging && (lp_timestamp_logs() || !(lp_loaded())));
+ bool timestamp = (!stdout_logging && (lp_timestamp_logs() || !(lp_loaded())));
for( i = 0; msg[i]; i++ ) {
/* Indent two spaces at each new line. */
****************************************************************************/
-BOOL dbghdr(int level, int cls, const char *file, const char *func, int line)
+bool dbghdr(int level, int cls, const char *file, const char *func, int line)
{
/* Ensure we don't lose any real errno value. */
int old_errno = errno;
***************************************************************************/
- BOOL dbgtext( const char *format_str, ... )
+ bool dbgtext( const char *format_str, ... )
{
va_list ap;
pstring msgbuf;
return -1;
}
-BOOL conn_snum_used(int snum)
+bool conn_snum_used(int snum)
{
return False;
}
* Return if there's something in the queue
*/
-BOOL event_add_to_select_args(struct event_context *event_ctx,
+bool event_add_to_select_args(struct event_context *event_ctx,
const struct timeval *now,
fd_set *read_fds, fd_set *write_fds,
struct timeval *timeout, int *maxfd)
{
struct fd_event *fde;
struct timeval diff;
- BOOL ret = False;
+ bool ret = False;
for (fde = event_ctx->fd_events; fde; fde = fde->next) {
if (fde->flags & EVENT_FD_READ) {
return True;
}
-BOOL events_pending(struct event_context *event_ctx)
+bool events_pending(struct event_context *event_ctx)
{
struct fd_event *fde;
return False;
}
-BOOL run_events(struct event_context *event_ctx,
+bool run_events(struct event_context *event_ctx,
int selrtn, fd_set *read_fds, fd_set *write_fds)
{
- BOOL fired = False;
+ bool fired = False;
struct fd_event *fde, *next;
/* Run all events that are pending, not just one (as we
/*
return True if two file_id structures are equal
*/
-BOOL file_id_equal(const struct file_id *id1, const struct file_id *id2)
+bool file_id_equal(const struct file_id *id1, const struct file_id *id2)
{
return id1->inode == id2->inode && id1->devid == id2->devid;
}
#define BLOB_TYPE_LEN 9
static TDB_CONTEXT *cache;
-static BOOL cache_readonly;
+static bool cache_readonly;
/**
* @file gencache.c
* false on failure
**/
-BOOL gencache_init(void)
+bool gencache_init(void)
{
char* cache_fname = NULL;
* false on failure during cache shutdown
**/
-BOOL gencache_shutdown(void)
+bool gencache_shutdown(void)
{
int ret;
/* tdb_close routine returns -1 on error */
* @retval false on failure
**/
-BOOL gencache_set(const char *keystr, const char *value, time_t timeout)
+bool gencache_set(const char *keystr, const char *value, time_t timeout)
{
int ret;
TDB_DATA databuf;
* @retval false in case of failure
**/
-BOOL gencache_del(const char *keystr)
+bool gencache_del(const char *keystr)
{
int ret;
* @retval False for failure
**/
-BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout)
+bool gencache_get(const char *keystr, char **valstr, time_t *timeout)
{
TDB_DATA databuf;
time_t t;
*
* @param keystr string that represents a key of this entry
* @param blob DATA_BLOB that is filled with entry's blob
- * @param expired pointer to a BOOL that indicates whether the entry is expired
+ * @param expired pointer to a bool that indicates whether the entry is expired
*
* @retval true when entry is successfuly fetched
* @retval False for failure
**/
-BOOL gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, BOOL *expired)
+bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired)
{
TDB_DATA databuf;
time_t t;
char *blob_type;
unsigned char *buf = NULL;
- BOOL ret = False;
+ bool ret = False;
fstring valstr;
int buflen = 0, len = 0, blob_len = 0;
unsigned char *blob_buf = NULL;
* @retval false on failure
**/
-BOOL gencache_set_data_blob(const char *keystr, DATA_BLOB *blob, time_t timeout)
+bool gencache_set_data_blob(const char *keystr, DATA_BLOB *blob, time_t timeout)
{
- BOOL ret = False;
+ bool ret = False;
int tdb_ret;
TDB_DATA databuf;
char *valstr = NULL;
static unsigned char smb_arc4_state[258];
static uint32 counter;
-static BOOL done_reseed = False;
+static bool done_reseed = False;
static void (*reseed_callback)(int *newseed);
/****************************************************************
above...
**************************************************************/
-static int do_reseed(BOOL use_fd, int fd)
+static int do_reseed(bool use_fd, int fd)
{
unsigned char seed_inbuf[40];
uint32 v1, v2; struct timeval tval; pid_t mypid;
static void lazy_initialize_iconv(void)
{
- static BOOL initialized;
+ static bool initialized;
int i;
if (!initialized) {
}
-static BOOL is_utf16(const char *name)
+static bool is_utf16(const char *name)
{
return strcasecmp(name, "UCS-2LE") == 0 ||
strcasecmp(name, "UTF-16LE") == 0;
*
* @retval True for success.
**/
-BOOL message_send_all(struct messaging_context *msg_ctx,
+bool message_send_all(struct messaging_context *msg_ctx,
int msg_type,
const void *buf, size_t len,
int *n_sent)
/* Load a dynamic module. Only log a level 0 error if we are not checking
for the existence of a module (probling). */
-static NTSTATUS do_smb_load_module(const char *module_name, BOOL is_probe)
+static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
{
void *handle;
init_module_function *init;
*/
static int ms_fnmatch_core(const smb_ucs2_t *p, const smb_ucs2_t *n,
struct max_n *max_n, const smb_ucs2_t *ldot,
- BOOL is_case_sensitive)
+ bool is_case_sensitive)
{
smb_ucs2_t c;
int i;
return -1;
}
-int ms_fnmatch(const char *pattern, const char *string, BOOL translate_pattern,
- BOOL is_case_sensitive)
+int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
+ bool is_case_sensitive)
{
smb_ucs2_t *p = NULL;
smb_ucs2_t *s = NULL;
return packet_fd_read(ctx);
}
-BOOL packet_handler(struct packet_context *ctx,
- BOOL (*full_req)(const struct data_blob *data,
+bool packet_handler(struct packet_context *ctx,
+ bool (*full_req)(const struct data_blob *data,
size_t *length,
void *private_data),
NTSTATUS (*callback)(const struct data_blob *data,
*/
extern pstring user_socket_options;
-extern BOOL AllowDebugChange;
-extern BOOL override_logfile;
+extern bool AllowDebugChange;
+extern bool override_logfile;
struct user_auth_info cmdline_auth_info;
lp_set_logfile(logfile);
}
-static BOOL PrintSambaVersionString;
+static bool PrintSambaVersionString;
static void popt_common_callback(poptContext con,
enum poptCallbackReason reason,
{
int fd = -1;
char *p;
- BOOL close_it = False;
+ bool close_it = False;
pstring spec;
char pass[128];
} PRIV_SID_LIST;
-static BOOL get_privileges( const DOM_SID *sid, SE_PRIV *mask )
+static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask )
{
TDB_CONTEXT *tdb = get_account_pol_tdb();
fstring keystr;
Store the privilege mask (set) for a given SID
****************************************************************************/
-static BOOL set_privileges( const DOM_SID *sid, SE_PRIV *mask )
+static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask )
{
TDB_CONTEXT *tdb = get_account_pol_tdb();
fstring keystr;
get a list of all privileges for all sids in the list
*********************************************************************/
-BOOL get_privileges_for_sids(SE_PRIV *privileges, DOM_SID *slist, int scount)
+bool get_privileges_for_sids(SE_PRIV *privileges, DOM_SID *slist, int scount)
{
SE_PRIV mask;
int i;
- BOOL found = False;
+ bool found = False;
se_priv_copy( privileges, &se_priv_none );
Add privilege to sid
****************************************************************************/
-BOOL grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask)
+bool grant_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask)
{
SE_PRIV old_mask, new_mask;
Add a privilege based on its name
*********************************************************************/
-BOOL grant_privilege_by_name(DOM_SID *sid, const char *name)
+bool grant_privilege_by_name(DOM_SID *sid, const char *name)
{
SE_PRIV mask;
Remove privilege from sid
****************************************************************************/
-BOOL revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask)
+bool revoke_privilege(const DOM_SID *sid, const SE_PRIV *priv_mask)
{
SE_PRIV mask;
Revoke all privileges
*********************************************************************/
-BOOL revoke_all_privileges( DOM_SID *sid )
+bool revoke_all_privileges( DOM_SID *sid )
{
return revoke_privilege( sid, &se_priv_all );
}
Add a privilege based on its name
*********************************************************************/
-BOOL revoke_privilege_by_name(DOM_SID *sid, const char *name)
+bool revoke_privilege_by_name(DOM_SID *sid, const char *name)
{
SE_PRIV mask;
/*******************************************************************
*******************************************************************/
-BOOL is_privileged_sid( const DOM_SID *sid )
+bool is_privileged_sid( const DOM_SID *sid )
{
SE_PRIV mask;
/*******************************************************************
*******************************************************************/
-BOOL grant_all_privileges( const DOM_SID *sid )
+bool grant_all_privileges( const DOM_SID *sid )
{
SE_PRIV mask;
copy an SE_PRIV structure
****************************************************************************/
-BOOL se_priv_copy( SE_PRIV *dst, const SE_PRIV *src )
+bool se_priv_copy( SE_PRIV *dst, const SE_PRIV *src )
{
if ( !dst || !src )
return False;
put all privileges into a mask
****************************************************************************/
-BOOL se_priv_put_all_privileges(SE_PRIV *mask)
+bool se_priv_put_all_privileges(SE_PRIV *mask)
{
int i;
uint32 num_privs = count_all_privileges();
check if 2 SE_PRIV structure are equal
****************************************************************************/
-BOOL se_priv_equal( const SE_PRIV *mask1, const SE_PRIV *mask2 )
+bool se_priv_equal( const SE_PRIV *mask1, const SE_PRIV *mask2 )
{
return ( memcmp(mask1, mask2, sizeof(SE_PRIV)) == 0 );
}
check if a SE_PRIV has any assigned privileges
****************************************************************************/
-static BOOL se_priv_empty( const SE_PRIV *mask )
+static bool se_priv_empty( const SE_PRIV *mask )
{
SE_PRIV p1;
int i;
Lookup the SE_PRIV value for a privilege name
*********************************************************************/
-BOOL se_priv_from_name( const char *name, SE_PRIV *mask )
+bool se_priv_from_name( const char *name, SE_PRIV *mask )
{
int i;
check if the privilege is in the privilege list
****************************************************************************/
-BOOL is_privilege_assigned(const SE_PRIV *privileges,
+bool is_privilege_assigned(const SE_PRIV *privileges,
const SE_PRIV *check)
{
SE_PRIV p1, p2;
check if the privilege is in the privilege list
****************************************************************************/
-static BOOL is_any_privilege_assigned( SE_PRIV *privileges, const SE_PRIV *check )
+static bool is_any_privilege_assigned( SE_PRIV *privileges, const SE_PRIV *check )
{
SE_PRIV p1, p2;
at a time here.
*****************************************************************************/
-BOOL user_has_privileges(const NT_USER_TOKEN *token, const SE_PRIV *privilege)
+bool user_has_privileges(const NT_USER_TOKEN *token, const SE_PRIV *privilege)
{
if ( !token )
return False;
at a time here.
*****************************************************************************/
-BOOL user_has_any_privilege(NT_USER_TOKEN *token, const SE_PRIV *privilege)
+bool user_has_any_privilege(NT_USER_TOKEN *token, const SE_PRIV *privilege)
{
if ( !token )
return False;
add a privilege to a privilege array
****************************************************************************/
-static BOOL privilege_set_add(PRIVILEGE_SET *priv_set, LUID_ATTR set)
+static bool privilege_set_add(PRIVILEGE_SET *priv_set, LUID_ATTR set)
{
LUID_ATTR *new_set;
/*******************************************************************
*******************************************************************/
-BOOL se_priv_to_privilege_set( PRIVILEGE_SET *set, SE_PRIV *mask )
+bool se_priv_to_privilege_set( PRIVILEGE_SET *set, SE_PRIV *mask )
{
int i;
uint32 num_privs = count_all_privileges();
/*******************************************************************
*******************************************************************/
-static BOOL luid_to_se_priv( LUID *luid, SE_PRIV *mask )
+static bool luid_to_se_priv( LUID *luid, SE_PRIV *mask )
{
int i;
uint32 num_privs = count_all_privileges();
/*******************************************************************
*******************************************************************/
-BOOL privilege_set_to_se_priv( SE_PRIV *mask, PRIVILEGE_SET *privset )
+bool privilege_set_to_se_priv( SE_PRIV *mask, PRIVILEGE_SET *privset )
{
int i;
char **(completion_fn)(const char *text, int start, int end))
{
char *ret;
- BOOL interactive;
+ bool interactive;
interactive = isatty(x_fileno(x_stdin)) || getenv("CLI_FORCE_INTERACTIVE");
if (!interactive) {
Check if ACE has OBJECT type.
********************************************************************/
-BOOL sec_ace_object(uint8 type)
+bool sec_ace_object(uint8 type)
{
if (type == SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT ||
type == SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ||
Compares two SEC_ACE structures
********************************************************************/
-BOOL sec_ace_equal(SEC_ACE *s1, SEC_ACE *s2)
+bool sec_ace_equal(SEC_ACE *s1, SEC_ACE *s2)
{
/* Trivial case */
Check if this ACE has a SID in common with the token.
********************************************************************/
-BOOL token_sid_in_ace(const NT_USER_TOKEN *token, const SEC_ACE *ace)
+bool token_sid_in_ace(const NT_USER_TOKEN *token, const SEC_ACE *ace)
{
size_t i;
Compares two SEC_ACL structures
********************************************************************/
-BOOL sec_acl_equal(SEC_ACL *s1, SEC_ACL *s2)
+bool sec_acl_equal(SEC_ACL *s1, SEC_ACL *s2)
{
unsigned int i, j;
each ACE in s2. */
for (i = 0; i < s1->num_aces; i++) {
- BOOL found = False;
+ bool found = False;
for (j = 0; j < s2->num_aces; j++) {
if (sec_ace_equal(&s1->aces[i], &s2->aces[j])) {
Compares two SEC_DESC structures
********************************************************************/
-BOOL sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2)
+bool sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2)
{
/* Trivial case */
non-container object. */
SEC_DESC_BUF *se_create_child_secdesc(TALLOC_CTX *ctx, SEC_DESC *parent_ctr,
- BOOL child_container)
+ bool child_container)
{
SEC_DESC_BUF *sdb;
SEC_DESC *sd;
SEC_ACE *ace = &the_acl->aces[i];
SEC_ACE *new_ace = &new_ace_list[new_ace_list_ndx];
uint8 new_flags = 0;
- BOOL inherit = False;
+ bool inherit = False;
fstring sid_str;
/* The OBJECT_INHERIT_ACE flag causes the ACE to be
static char *mutex_server_name;
-BOOL grab_server_mutex(const char *name)
+bool grab_server_mutex(const char *name)
{
mutex_server_name = SMB_STRDUP(name);
if (!mutex_server_name) {
};
-BOOL share_info_db_init(void)
+bool share_info_db_init(void)
{
const char *vstring = "INFO/version";
int32 vers_id;
Store a security descriptor in the share db.
********************************************************************/
-BOOL set_share_security(const char *share_name, SEC_DESC *psd)
+bool set_share_security(const char *share_name, SEC_DESC *psd)
{
TALLOC_CTX *frame;
char *key;
- BOOL ret = False;
+ bool ret = False;
TDB_DATA blob;
NTSTATUS status;
Delete a security descriptor.
********************************************************************/
-BOOL delete_share_security(const char *servicename)
+bool delete_share_security(const char *servicename)
{
TDB_DATA kbuf;
char *key;
Can this user access with share with the required permissions ?
********************************************************************/
-BOOL share_access_check(const NT_USER_TOKEN *token, const char *sharename,
+bool share_access_check(const NT_USER_TOKEN *token, const char *sharename,
uint32 desired_access)
{
uint32 granted;
TALLOC_CTX *mem_ctx = NULL;
SEC_DESC *psd = NULL;
size_t sd_size;
- BOOL ret = True;
+ bool ret = True;
if (!(mem_ctx = talloc_init("share_access_check"))) {
return False;
Parse the contents of an acl string from a usershare file.
***************************************************************************/
-BOOL parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, SEC_DESC **ppsd)
+bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, SEC_DESC **ppsd)
{
size_t s_size = 0;
const char *pacl = acl_str;
Block sigs.
********************************************************************/
-void BlockSignals(BOOL block,int signum)
+void BlockSignals(bool block,int signum)
{
#ifdef HAVE_SIGPROCMASK
sigset_t set;
Search an attribute and return the first value found.
******************************************************************/
- BOOL smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry,
+ bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, char *value,
int max_len)
{
return True;
}
- BOOL smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
+ bool smbldap_get_single_pstring (LDAP * ldap_struct, LDAPMessage * entry,
const char *attribute, pstring value)
{
return smbldap_get_single_attribute(ldap_struct, entry,
const char *attribute, const char *newval)
{
char oldval[2048]; /* current largest allowed value is mungeddial */
- BOOL existed;
+ bool existed;
if (attribute == NULL) {
/* This can actually happen for ldapsam_compat where we for
static int smbldap_open(struct smbldap_state *ldap_state)
{
int rc, opt_rc;
- BOOL reopen = False;
+ bool reopen = False;
SMB_ASSERT(ldap_state);
#ifndef NO_LDAP_SECURITY
return NT_STATUS_OK;
}
-static BOOL got_alarm;
+static bool got_alarm;
static void (*old_handler)(int);
BerElement *cookie_be = NULL;
struct berval *cookie_bv = NULL;
int tmp = 0, i, rc;
- BOOL critical = True;
+ bool critical = True;
*res = NULL;
Check if root-dse has a certain Control or Extension
********************************************************************/
-static BOOL smbldap_check_root_dse(LDAP *ld, const char **attrs, const char *value)
+static bool smbldap_check_root_dse(LDAP *ld, const char **attrs, const char *value)
{
LDAPMessage *msg = NULL;
LDAPMessage *entry = NULL;
char **values = NULL;
int rc, num_result, num_values, i;
- BOOL result = False;
+ bool result = False;
if (!attrs[0]) {
DEBUG(3,("smbldap_check_root_dse: nothing to look for\n"));
Check if LDAP-Server supports a certain Control (OID in string format)
********************************************************************/
-BOOL smbldap_has_control(LDAP *ld, const char *control)
+bool smbldap_has_control(LDAP *ld, const char *control)
{
const char *attrs[] = { "supportedControl", NULL };
return smbldap_check_root_dse(ld, attrs, control);
Check if LDAP-Server supports a certain Extension (OID in string format)
********************************************************************/
-BOOL smbldap_has_extension(LDAP *ld, const char *extension)
+bool smbldap_has_extension(LDAP *ld, const char *extension)
{
const char *attrs[] = { "supportedExtension", NULL };
return smbldap_check_root_dse(ld, attrs, extension);
Check if LDAP-Server holds a given namingContext
********************************************************************/
-BOOL smbldap_has_naming_context(LDAP *ld, const char *naming_context)
+bool smbldap_has_naming_context(LDAP *ld, const char *naming_context)
{
const char *attrs[] = { "namingContexts", NULL };
return smbldap_check_root_dse(ld, attrs, naming_context);
}
-BOOL smbldap_set_creds(struct smbldap_state *ldap_state, BOOL anon, const char *dn, const char *secret)
+bool smbldap_set_creds(struct smbldap_state *ldap_state, bool anon, const char *dn, const char *secret)
{
ldap_state->anonymous = anon;
NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
LDAPMessage ** result, const char *domain_name,
- BOOL try_add)
+ bool try_add)
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
pstring filter;
outfd (or discard it if outfd is NULL).
****************************************************************************/
-static int smbrun_internal(const char *cmd, int *outfd, BOOL sanitize)
+static int smbrun_internal(const char *cmd, int *outfd, bool sanitize)
{
pid_t pid;
uid_t uid = current_user.ut.uid;
* @param if this is the 'final' name for us, not be be changed again
*/
-void set_local_machine_name(const char* local_name, BOOL perm)
+void set_local_machine_name(const char* local_name, bool perm)
{
- static BOOL already_perm = False;
+ static bool already_perm = False;
fstring tmp_local_machine;
fstrcpy(tmp_local_machine,local_name);
* @param if this is the 'final' name for them, not be be changed again
*/
-void set_remote_machine_name(const char* remote_name, BOOL perm)
+void set_remote_machine_name(const char* remote_name, bool perm)
{
- static BOOL already_perm = False;
+ static bool already_perm = False;
fstring tmp_remote_machine;
if (already_perm)
{
fstring tmp;
int len;
- BOOL is_machine_account = False;
+ bool is_machine_account = False;
/* don't let anonymous logins override the name */
if (! *name)
{
int ret = -1;
int i;
- BOOL ready = False;
+ bool ready = False;
char *mntpath = NULL;
char *bdev = NULL;
char *fs = NULL;
{
int ret = -1;
int i;
- BOOL ready = False;
+ bool ready = False;
char *mntpath = NULL;
char *bdev = NULL;
char *fs = NULL;
* from the inheritable set, because there is no circumstance in which our
* children should inherit our elevated privileges.
*/
-static BOOL set_process_capability(enum smbd_capability capability,
- BOOL enable)
+static bool set_process_capability(enum smbd_capability capability,
+ bool enable)
{
cap_value_t cap_vals[2] = {0};
int num_cap_vals = 0;
static int sys_getgrouplist(const char *user, gid_t gid, gid_t *groups, int *grpcnt)
{
int retval;
- BOOL winbind_env;
+ bool winbind_env;
DEBUG(10,("sys_getgrouplist: user [%s]\n", user));
return retval;
}
-BOOL getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
+bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
gid_t primary_gid,
gid_t **ret_groups, size_t *p_ngroups)
{
Check if it's a null unix time.
****************************************************************************/
-BOOL null_time(time_t t)
+bool null_time(time_t t)
{
return t == 0 ||
t == (time_t)0xFFFFFFFF ||
Check if it's a null NTTIME.
****************************************************************************/
-BOOL null_nttime(NTTIME t)
+bool null_nttime(NTTIME t)
{
return t == 0 || t == (NTTIME)-1;
}
Check if it's a null timespec.
****************************************************************************/
-BOOL null_timespec(struct timespec ts)
+bool null_timespec(struct timespec ts)
{
return ts.tv_sec == 0 ||
ts.tv_sec == (time_t)0xFFFFFFFF ||
/**
return True if a timeval is zero
*/
-BOOL timeval_is_zero(const struct timeval *tv)
+bool timeval_is_zero(const struct timeval *tv)
{
return tv->tv_sec == 0 && tv->tv_usec == 0;
}
/**
return True if a timer is in the past
*/
-BOOL timeval_expired(const struct timeval *tv)
+bool timeval_expired(const struct timeval *tv)
{
struct timeval tv2 = timeval_current();
if (tv2.tv_sec > tv->tv_sec) return True;
Check if NTTIME is 0.
****************************************************************************/
-BOOL nt_time_is_zero(const NTTIME *nt)
+bool nt_time_is_zero(const NTTIME *nt)
{
return (*nt == 0);
}
Return the date and time as a string
****************************************************************************/
-char *current_timestring(BOOL hires)
+char *current_timestring(bool hires)
{
fstring TimeBuf;
struct timeval tp;
structure.
****************************************************************************/
-time_t get_create_time(const SMB_STRUCT_STAT *st,BOOL fake_dirs)
+time_t get_create_time(const SMB_STRUCT_STAT *st,bool fake_dirs)
{
time_t ret, ret1;