/* The following definitions come from lib/audit.c */
-const char *audit_category_str(uint32 category);
-const char *audit_param_str(uint32 category);
-const char *audit_description_str(uint32 category);
-bool get_audit_category_from_param(const char *param, uint32 *audit_category);
-const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32 policy);
+const char *audit_category_str(uint32_t category);
+const char *audit_param_str(uint32_t category);
+const char *audit_description_str(uint32_t category);
+bool get_audit_category_from_param(const char *param, uint32_t *audit_category);
+const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32_t policy);
/* The following definitions come from lib/charcnv.c */
size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src);
size_t push_string_check_fn(void *dest, const char *src,
size_t dest_len, int flags);
-size_t push_string_base(const char *base, uint16 flags2,
+size_t push_string_base(const char *base, uint16_t flags2,
void *dest, const char *src,
size_t dest_len, int flags);
size_t pull_string_talloc(TALLOC_CTX *ctx,
const void *base_ptr,
- uint16 smb_flags2,
+ uint16_t smb_flags2,
char **ppdest,
const void *src,
size_t src_len,
/* The following definitions come from lib/sharesec.c */
bool share_info_db_init(void);
-struct security_descriptor *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access);
+struct security_descriptor *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32_t def_access);
struct security_descriptor *get_share_security( TALLOC_CTX *ctx, const char *servicename,
size_t *psize);
bool set_share_security(const char *share_name, struct security_descriptor *psd);
bool delete_share_security(const char *servicename);
bool share_access_check(const struct security_token *token,
const char *sharename,
- uint32 desired_access,
+ uint32_t desired_access,
uint32_t *pgranted);
bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, struct security_descriptor **ppsd);
bool fake_dir_create_times);
int sys_posix_fallocate(int fd, off_t offset, off_t len);
int sys_fallocate(int fd, uint32_t mode, off_t offset, off_t len);
-void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
+void kernel_flock(int fd, uint32_t share_mode, uint32_t access_mask);
DIR *sys_fdopendir(int fd);
int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev);
int sys_waitpid(pid_t pid,int *status,int options);
int sys_fremovexattr (int filedes, const char *name);
int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags);
int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags);
-uint32 unix_dev_major(SMB_DEV_T dev);
-uint32 unix_dev_minor(SMB_DEV_T dev);
+uint32_t unix_dev_major(SMB_DEV_T dev);
+uint32_t unix_dev_minor(SMB_DEV_T dev);
#if 0
int sys_get_number_of_cores(void);
#endif
void *malloc_(size_t size);
void *Realloc(void *p, size_t size, bool free_old_on_error);
void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size,
- void *element, void *_array, uint32 *num_elements,
+ void *element, void *_array, uint32_t *num_elements,
ssize_t *array_size);
char *get_myname(TALLOC_CTX *ctx);
char *get_mydnsdomname(TALLOC_CTX *ctx);
bool unix_wild_match(const char *pattern, const char *string);
bool name_to_fqdn(fstring fqdn, const char *name);
void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob);
-uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options);
+uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options);
pid_t procid_to_pid(const struct server_id *proc);
-void set_my_vnn(uint32 vnn);
-uint32 get_my_vnn(void);
+void set_my_vnn(uint32_t vnn);
+uint32_t get_my_vnn(void);
void set_my_unique_id(uint64_t unique_id);
struct server_id pid_to_procid(pid_t pid);
struct server_id procid_self(void);
bool is_executable(const char *fname);
bool map_open_params_to_ntcreate(const char *smb_base_fname,
int deny_mode, int open_func,
- uint32 *paccess_mask,
- uint32 *pshare_mode,
- uint32 *pcreate_disposition,
- uint32 *pcreate_options,
+ uint32_t *paccess_mask,
+ uint32_t *pshare_mode,
+ uint32_t *pcreate_disposition,
+ uint32_t *pcreate_options,
uint32_t *pprivate_flags);
struct security_unix_token *copy_unix_token(TALLOC_CTX *ctx, const struct security_unix_token *tok);
bool dir_check_ftype(uint32_t mode, uint32_t dirtype);
/* The following definitions come from lib/util_builtin.c */
-bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name);
-bool lookup_builtin_name(const char *name, uint32 *rid);
+bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32_t rid, const char **name);
+bool lookup_builtin_name(const char *name, uint32_t *rid);
const char *builtin_domain_name(void);
bool sid_check_is_builtin(const struct dom_sid *sid);
bool sid_check_is_in_builtin(const struct dom_sid *sid);
int spnego_gen_krb5_negTokenInit(TALLOC_CTX *ctx,
const char *principal, int time_offset,
DATA_BLOB *targ,
- DATA_BLOB *session_key_krb5, uint32 extra_ap_opts,
+ DATA_BLOB *session_key_krb5, uint32_t extra_ap_opts,
const char *ccname, time_t *expire_time);
bool spnego_parse_challenge(TALLOC_CTX *ctx, const DATA_BLOB blob,
DATA_BLOB *chal1, DATA_BLOB *chal2);
/* The following definitions come from libsmb/errormap.c */
-NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode);
+NTSTATUS dos_to_ntstatus(uint8 eclass, uint32_t ecode);
/* The following definitions come from libsmb/namecache.c */
bool trustdom_cache_store(const char *name, const char *alt_name,
const struct dom_sid *sid, time_t timeout);
bool trustdom_cache_fetch(const char* name, struct dom_sid* sid);
-uint32 trustdom_cache_fetch_timestamp( void );
-bool trustdom_cache_store_timestamp( uint32 t, time_t timeout );
+uint32_t trustdom_cache_fetch_timestamp( void );
+bool trustdom_cache_store_timestamp( uint32_t t, time_t timeout );
void trustdom_cache_flush(void);
void update_trustdom_cache( void );
bool (*snumused) (struct smbd_server_connection *, int));
void lp_kill_all_services(void);
void lp_killservice(int iServiceIn);
-const char* server_role_str(uint32 role);
+const char* server_role_str(uint32_t role);
enum usershare_err parse_usershare_file(TALLOC_CTX *ctx,
SMB_STRUCT_STAT *psbuf,
const char *servicename,
int lp_maxprintjobs(int snum);
const char *lp_printcapname(void);
bool lp_disable_spoolss( void );
-void lp_set_spoolss_state( uint32 state );
-uint32 lp_get_spoolss_state( void );
+void lp_set_spoolss_state( uint32_t state );
+uint32_t lp_get_spoolss_state( void );
struct smb_signing_state;
bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
void set_use_sendfile(int snum, bool val);
/* The following definitions come from param/util.c */
-uint32 get_int_param( const char* param );
+uint32_t get_int_param( const char* param );
char* get_string_param( const char* param );
/* The following definitions come from lib/server_contexts.c */
#include "../librpc/gen_ndr/lsa.h"
static const struct audit_category_tab {
- uint32 category;
+ uint32_t category;
const char *category_str;
const char *param_str;
const char *description;
{ 0, NULL, NULL }
};
-const char *audit_category_str(uint32 category)
+const char *audit_category_str(uint32_t category)
{
int i;
for (i=0; audit_category_tab[i].category_str; i++) {
return NULL;
}
-const char *audit_param_str(uint32 category)
+const char *audit_param_str(uint32_t category)
{
int i;
for (i=0; audit_category_tab[i].param_str; i++) {
return NULL;
}
-const char *audit_description_str(uint32 category)
+const char *audit_description_str(uint32_t category)
{
int i;
for (i=0; audit_category_tab[i].description; i++) {
return NULL;
}
-bool get_audit_category_from_param(const char *param, uint32 *audit_category)
+bool get_audit_category_from_param(const char *param, uint32_t *audit_category)
{
*audit_category = Undefined;
return True;
}
-const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32 policy)
+const char *audit_policy_str(TALLOC_CTX *mem_ctx, uint32_t policy)
{
const char *ret = NULL;
is -1 then no maxiumum is used.
**/
-size_t push_string_base(const char *base, uint16 flags2,
+size_t push_string_base(const char *base, uint16_t flags2,
void *dest, const char *src,
size_t dest_len, int flags)
{
size_t pull_string_talloc(TALLOC_CTX *ctx,
const void *base_ptr,
- uint16 smb_flags2,
+ uint16_t smb_flags2,
char **ppdest,
const void *src,
size_t src_len,
def_access is a GENERIC_XXX access mode.
********************************************************************/
-struct security_descriptor *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32 def_access)
+struct security_descriptor *get_share_security_default( TALLOC_CTX *ctx, size_t *psize, uint32_t def_access)
{
uint32_t sa;
struct security_ace ace;
struct security_acl *psa = NULL;
struct security_descriptor *psd = NULL;
- uint32 spec_access = def_access;
+ uint32_t spec_access = def_access;
se_map_generic(&spec_access, &file_generic_mapping);
bool share_access_check(const struct security_token *token,
const char *sharename,
- uint32 desired_access,
+ uint32_t desired_access,
uint32_t *pgranted)
{
- uint32 granted;
+ uint32_t granted;
NTSTATUS status;
struct security_descriptor *psd = NULL;
size_t sd_size;
for (i = 0; i < num_aces; i++) {
uint32_t sa;
- uint32 g_access;
- uint32 s_access;
+ uint32_t g_access;
+ uint32_t s_access;
struct dom_sid sid;
char *sidstr;
enum security_ace_type type = SEC_ACE_TYPE_ACCESS_ALLOWED;
A flock() wrapper that will perform the kernel flock.
********************************************************************/
-void kernel_flock(int fd, uint32 share_mode, uint32 access_mask)
+void kernel_flock(int fd, uint32_t share_mode, uint32_t access_mask)
{
#if HAVE_KERNEL_SHARE_MODES
int kernel_mode = 0;
Return the major devicenumber for UNIX extensions.
****************************************************************************/
-uint32 unix_dev_major(SMB_DEV_T dev)
+uint32_t unix_dev_major(SMB_DEV_T dev)
{
#if defined(HAVE_DEVICE_MAJOR_FN)
return (uint32)major(dev);
Return the minor devicenumber for UNIX extensions.
****************************************************************************/
-uint32 unix_dev_minor(SMB_DEV_T dev)
+uint32_t unix_dev_minor(SMB_DEV_T dev)
{
#if defined(HAVE_DEVICE_MINOR_FN)
return (uint32)minor(dev);
if (DEBUGLEVEL < 50)
bcc = MIN(bcc, 512);
- dump_data(10, (const uint8 *)smb_buf_const(buf), bcc);
+ dump_data(10, (const uint8_t *)smb_buf_const(buf), bcc);
}
/*******************************************************************
Return the bytes added
********************************************************************/
-ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob)
+ssize_t message_push_blob(uint8_t **outbuf, DATA_BLOB blob)
{
size_t newlen = smb_len(*outbuf) + 4 + blob.length;
- uint8 *tmp;
+ uint8_t *tmp;
if (!(tmp = talloc_realloc(NULL, *outbuf, uint8, newlen))) {
DEBUG(0, ("talloc failed\n"));
****************************************************************************/
void add_to_large_array(TALLOC_CTX *mem_ctx, size_t element_size,
- void *element, void *_array, uint32 *num_elements,
+ void *element, void *_array, uint32_t *num_elements,
ssize_t *array_size)
{
void **array = (void **)_array;
return result;
}
-uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options)
+uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options)
{
switch (share_access & ~FILE_SHARE_DELETE) {
case FILE_SHARE_NONE:
return proc->pid;
}
-static uint32 my_vnn = NONCLUSTER_VNN;
+static uint32_t my_vnn = NONCLUSTER_VNN;
-void set_my_vnn(uint32 vnn)
+void set_my_vnn(uint32_t vnn)
{
DEBUG(10, ("vnn pid %d = %u\n", (int)getpid(), (unsigned int)vnn));
my_vnn = vnn;
}
-uint32 get_my_vnn(void)
+uint32_t get_my_vnn(void)
{
return my_vnn;
}
bool map_open_params_to_ntcreate(const char *smb_base_fname,
int deny_mode, int open_func,
- uint32 *paccess_mask,
- uint32 *pshare_mode,
- uint32 *pcreate_disposition,
- uint32 *pcreate_options,
+ uint32_t *paccess_mask,
+ uint32_t *pshare_mode,
+ uint32_t *pcreate_disposition,
+ uint32_t *pcreate_options,
uint32_t *pprivate_flags)
{
- uint32 access_mask;
- uint32 share_mode;
- uint32 create_disposition;
- uint32 create_options = FILE_NON_DIRECTORY_FILE;
+ uint32_t access_mask;
+ uint32_t share_mode;
+ uint32_t create_disposition;
+ uint32_t create_options = FILE_NON_DIRECTORY_FILE;
uint32_t private_flags = 0;
DEBUG(10,("map_open_params_to_ntcreate: fname = %s, deny_mode = 0x%x, "
#include "../libcli/security/security.h"
struct rid_name_map {
- uint32 rid;
+ uint32_t rid;
const char *name;
};
/*******************************************************************
Look up a rid in the BUILTIN domain
********************************************************************/
-bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32 rid, const char **name)
+bool lookup_builtin_rid(TALLOC_CTX *mem_ctx, uint32_t rid, const char **name)
{
const struct rid_name_map *aliases = builtin_aliases;
/*******************************************************************
Look up a name in the BUILTIN domain
********************************************************************/
-bool lookup_builtin_name(const char *name, uint32 *rid)
+bool lookup_builtin_name(const char *name, uint32_t *rid)
{
const struct rid_name_map *aliases = builtin_aliases;
*/
if (asn1_peek_tag(data, ASN1_CONTEXT(1))) {
- uint8 flags;
+ uint8_t flags;
/* reqFlags [1] ContextFlags OPTIONAL */
if (!asn1_start_tag(data, ASN1_CONTEXT(1))) goto err;
/*
generate a krb5 GSS-API wrapper packet given a ticket
*/
-DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const uint8 tok_id[2])
+DATA_BLOB spnego_gen_krb5_wrap(TALLOC_CTX *ctx, const DATA_BLOB ticket, const uint8_t tok_id[2])
{
ASN1_DATA *data;
DATA_BLOB ret = data_blob_null;
int spnego_gen_krb5_negTokenInit(TALLOC_CTX *ctx,
const char *principal, int time_offset,
DATA_BLOB *targ,
- DATA_BLOB *session_key_krb5, uint32 extra_ap_opts,
+ DATA_BLOB *session_key_krb5, uint32_t extra_ap_opts,
const char *ccname, time_t *expire_time)
{
int retval;
DATA_BLOB *auth)
{
ASN1_DATA *data;
- uint8 negResult;
+ uint8_t negResult;
bool ret = false;
if (NT_STATUS_IS_OK(nt_status)) {
/* dos -> nt status error map */
static const struct {
- uint8 dos_class;
- uint32 dos_code;
+ uint8_t dos_class;
+ uint32_t dos_code;
NTSTATUS ntstatus;
} dos_to_ntstatus_map[] = {
{ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED},
/*****************************************************************************
convert a dos eclas/ecode to a NT status32 code
*****************************************************************************/
-NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode)
+NTSTATUS dos_to_ntstatus(uint8_t eclass, uint32_t ecode)
{
int i;
if (eclass == 0) return NT_STATUS_OK;
/****************************************************************************
return a SMB error name from a class and code
****************************************************************************/
-const char *smb_dos_err_name(uint8 e_class, uint16 num)
+const char *smb_dos_err_name(uint8_t e_class, uint16_t num)
{
char *result;
int i,j;
const char *get_dos_error_msg(WERROR result)
{
- uint16 errnum;
+ uint16_t errnum;
errnum = W_ERROR_V(result);
/****************************************************************************
return a SMB error class name as a string.
****************************************************************************/
-const char *smb_dos_err_class(uint8 e_class)
+const char *smb_dos_err_class(uint8_t e_class)
{
char *result;
int i;
fetch the timestamp from the last update
*******************************************************************/
-uint32 trustdom_cache_fetch_timestamp( void )
+uint32_t trustdom_cache_fetch_timestamp( void )
{
char *value = NULL;
time_t timeout;
- uint32 timestamp;
+ uint32_t timestamp;
if (!gencache_get(TDOMTSKEY, talloc_tos(), &value, &timeout)) {
DEBUG(5, ("no timestamp for trusted domain cache located.\n"));
store the timestamp from the last update
*******************************************************************/
-bool trustdom_cache_store_timestamp( uint32 t, time_t timeout )
+bool trustdom_cache_store_timestamp( uint32_t t, time_t timeout )
{
fstring value;
*********************************************************************/
static bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
- char ***domain_names, uint32 *num_domains,
+ char ***domain_names, uint32_t *num_domains,
struct dom_sid **sids )
{
struct policy_handle pol;
NTSTATUS status, result;
fstring dc_name;
struct sockaddr_storage dc_ss;
- uint32 enum_ctx = 0;
+ uint32_t enum_ctx = 0;
struct cli_state *cli = NULL;
struct rpc_pipe_client *lsa_pipe = NULL;
struct lsa_DomainList dom_list;
{
char **domain_names;
struct dom_sid *dom_sids;
- uint32 num_domains;
- uint32 last_check;
+ uint32_t num_domains;
+ uint32_t last_check;
int time_diff;
TALLOC_CTX *mem_ctx = NULL;
time_t now = time(NULL);
canon_name = canonicalize_servicename(talloc_tos(), name );
dbwrap_store_bystring(ServiceHash, canon_name,
- make_tdb_data((uint8 *)&idx, sizeof(idx)),
+ make_tdb_data((uint8_t *)&idx, sizeof(idx)),
TDB_REPLACE);
TALLOC_FREE(canon_name);
return PRINTCAP_NAME;
}
-static uint32 spoolss_state;
+static uint32_t spoolss_state;
bool lp_disable_spoolss( void )
{
return spoolss_state == SVCCTL_STOPPED ? true : false;
}
-void lp_set_spoolss_state( uint32 state )
+void lp_set_spoolss_state( uint32_t state )
{
SMB_ASSERT( (state == SVCCTL_STOPPED) || (state == SVCCTL_RUNNING) );
spoolss_state = state;
}
-uint32 lp_get_spoolss_state( void )
+uint32_t lp_get_spoolss_state( void )
{
return lp_disable_spoolss() ? SVCCTL_STOPPED : SVCCTL_RUNNING;
}
utility function to parse an integer parameter from
"parameter = value"
**********************************************************/
-uint32 get_int_param( const char* param )
+uint32_t get_int_param( const char* param )
{
char *p;