struct ap_table {
enum pdb_policy_type type;
const char *string;
- uint32 default_val;
+ uint32_t default_val;
const char *description;
const char *ldap_attr;
};
"Force Users to logon for password change (default: 0 => off, 2 => on)",
"sambaLogonToChgPwd" },
- {PDB_POLICY_MAX_PASSWORD_AGE, "maximum password age", (uint32) -1,
+ {PDB_POLICY_MAX_PASSWORD_AGE, "maximum password age", (uint32_t) -1,
"Maximum password age, in seconds (default: -1 => never expire passwords)",
"sambaMaxPwdAge" },
"Lockout users after bad logon attempts (default: 0 => off)",
"sambaLockoutThreshold" },
- {PDB_POLICY_TIME_TO_LOGOUT, "disconnect time", (uint32) -1,
+ {PDB_POLICY_TIME_TO_LOGOUT, "disconnect time", (uint32_t) -1,
"Disconnect Users outside logon hours (default: -1 => off, 0 => on)",
"sambaForceLogoff" },
static bool account_policy_set_default_on_empty(enum pdb_policy_type type)
{
- uint32 value;
+ uint32_t value;
if (!account_policy_get(type, &value) &&
!account_policy_get_default(type, &value)) {
status = dbwrap_store_uint32_bystring(db, vstring,
DATABASE_VERSION);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0, ("dbwrap_store_uint32 failed: %s\n",
+ DEBUG(0, ("dbwrap_store_uint32_t failed: %s\n",
nt_errstr(status)));
goto cancel;
}
bool account_policy_get(enum pdb_policy_type type, uint32_t *value)
{
const char *name;
- uint32 regval;
+ uint32_t regval;
NTSTATUS status;
if (!init_account_policy()) {
status = dbwrap_fetch_uint32_bystring(db, name, ®val);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(2, ("account_policy_get: tdb_fetch_uint32 failed for type %d (%s), returning 0\n", type, name));
+ DEBUG(2, ("account_policy_get: tdb_fetch_uint32_t failed for type %d (%s), returning 0\n", type, name));
return False;
}
status = dbwrap_trans_store_uint32_bystring(db, name, value);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(1, ("store_uint32 failed for type %d (%s) on value "
+ DEBUG(1, ("store_uint32_t failed for type %d (%s) on value "
"%u: %s\n", type, name, value, nt_errstr(status)));
return False;
}
}
if (gencache_get(cache_key, talloc_tos(), &cache_value, NULL)) {
- uint32 tmp = strtoul(cache_value, NULL, 10);
+ uint32_t tmp = strtoul(cache_value, NULL, 10);
*value = tmp;
ret = True;
}
entry->acct_ctrl,
entry->bad_password_count,
bad_password_time);
- databuf.dptr = SMB_MALLOC_ARRAY(uint8, databuf.dsize);
+ databuf.dptr = SMB_MALLOC_ARRAY(uint8_t, databuf.dsize);
if (!databuf.dptr) {
SAFE_FREE(keystr);
return False;
const char *tmp;
const char *domain = NULL;
const char *name = NULL;
- uint32 rid;
+ uint32_t rid;
struct dom_sid sid;
enum lsa_SidType type;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
static bool wb_lookup_rids(TALLOC_CTX *mem_ctx,
const struct dom_sid *domain_sid,
- int num_rids, uint32 *rids,
+ int num_rids, uint32_t *rids,
const char **domain_name,
const char **names, enum lsa_SidType *types)
{
}
if (IS_DC) {
- uint32 i, num_domains;
+ uint32_t i, num_domains;
struct trustdom_info **domains;
/* This is relatively expensive, but it happens only on DCs
continue;
}
- if (!(rids = talloc_array(tmp_ctx, uint32, dom->num_idxs))) {
+ if (!(rids = talloc_array(tmp_ctx, uint32_t, dom->num_idxs))) {
result = NT_STATUS_NO_MEMORY;
goto fail;
}
{
bool expired = true;
bool ret;
- uint32 rid;
+ uint32_t rid;
/* Optimize for the Unix Users Domain
* as the conversion is straightforward */
{
bool expired = true;
bool ret;
- uint32 rid;
+ uint32_t rid;
/* Optimize for the Unix Groups Domain
* as the conversion is straightforward */
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_PASSDB
-uint32 pdb_get_user_rid (const struct samu *sampass)
+uint32_t pdb_get_user_rid (const struct samu *sampass)
{
- uint32 u_rid;
+ uint32_t u_rid;
if (sampass)
if (sid_peek_check_rid(get_global_sam_sid(), pdb_get_user_sid(sampass),&u_rid))
return (0);
}
-uint32 pdb_get_group_rid (struct samu *sampass)
+uint32_t pdb_get_group_rid (struct samu *sampass)
{
- uint32 g_rid;
+ uint32_t g_rid;
if (sampass)
if (sid_peek_check_rid(get_global_sam_sid(), pdb_get_group_sid(sampass),&g_rid))
return (0);
}
-bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32 rid, enum pdb_value_state flag)
+bool pdb_set_user_sid_from_rid (struct samu *sampass, uint32_t rid, enum pdb_value_state flag)
{
struct dom_sid u_sid;
const struct dom_sid *global_sam_sid;
return True;
}
-bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32 grid, enum pdb_value_state flag)
+bool pdb_set_group_sid_from_rid (struct samu *sampass, uint32_t grid, enum pdb_value_state flag)
{
struct dom_sid g_sid;
const struct dom_sid *global_sam_sid;
return sampass->hours_len;
}
-const uint8 *pdb_get_hours(const struct samu *sampass)
+const uint8_t *pdb_get_hours(const struct samu *sampass)
{
return (sampass->hours);
}
-const uint8 *pdb_get_nt_passwd(const struct samu *sampass)
+const uint8_t *pdb_get_nt_passwd(const struct samu *sampass)
{
SMB_ASSERT((!sampass->nt_pw.data)
|| sampass->nt_pw.length == NT_HASH_LEN);
- return (uint8 *)sampass->nt_pw.data;
+ return (uint8_t *)sampass->nt_pw.data;
}
-const uint8 *pdb_get_lanman_passwd(const struct samu *sampass)
+const uint8_t *pdb_get_lanman_passwd(const struct samu *sampass)
{
SMB_ASSERT((!sampass->lm_pw.data)
|| sampass->lm_pw.length == LM_HASH_LEN);
- return (uint8 *)sampass->lm_pw.data;
+ return (uint8_t *)sampass->lm_pw.data;
}
-const uint8 *pdb_get_pw_history(const struct samu *sampass, uint32_t *current_hist_len)
+const uint8_t *pdb_get_pw_history(const struct samu *sampass, uint32_t *current_hist_len)
{
SMB_ASSERT((!sampass->nt_pw_his.data)
|| ((sampass->nt_pw_his.length % PW_HISTORY_ENTRY_LEN) == 0));
*current_hist_len = sampass->nt_pw_his.length / PW_HISTORY_ENTRY_LEN;
- return (uint8 *)sampass->nt_pw_his.data;
+ return (uint8_t *)sampass->nt_pw_his.data;
}
/* Return the plaintext password if known. Most of the time
Set the user's NT hash.
********************************************************************/
-bool pdb_set_nt_passwd(struct samu *sampass, const uint8 pwd[NT_HASH_LEN], enum pdb_value_state flag)
+bool pdb_set_nt_passwd(struct samu *sampass, const uint8_t pwd[NT_HASH_LEN], enum pdb_value_state flag)
{
data_blob_clear_free(&sampass->nt_pw);
Set the user's LM hash.
********************************************************************/
-bool pdb_set_lanman_passwd(struct samu *sampass, const uint8 pwd[LM_HASH_LEN], enum pdb_value_state flag)
+bool pdb_set_lanman_passwd(struct samu *sampass, const uint8_t pwd[LM_HASH_LEN], enum pdb_value_state flag)
{
data_blob_clear_free(&sampass->lm_pw);
/*********************************************************************
Set the user's password history hash. historyLen is the number of
PW_HISTORY_SALT_LEN+SALTED_MD5_HASH_LEN length
- entries to store in the history - this must match the size of the uint8 array
+ entries to store in the history - this must match the size of the uint8_t array
in pwd.
********************************************************************/
-bool pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32_t historyLen, enum pdb_value_state flag)
+bool pdb_set_pw_history(struct samu *sampass, const uint8_t *pwd, uint32_t historyLen, enum pdb_value_state flag)
{
DATA_BLOB new_nt_pw_his = {};
return pdb_set_init_flags(sampass, PDB_UNKNOWN6, flag);
}
-bool pdb_set_hours(struct samu *sampass, const uint8 *hours, int hours_len,
+bool pdb_set_hours(struct samu *sampass, const uint8_t *hours, int hours_len,
enum pdb_value_state flag)
{
if (hours_len > sizeof(sampass->hours)) {
initialized = True;
}
-static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid,
+static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32_t rid,
const char **name,
enum lsa_SidType *psid_name_use,
uid_t *uid, gid_t *gid);
*workstations = NULL,
*munged_dial = NULL;
uint32_t user_rid;
- uint8 smblmpwd[LM_HASH_LEN],
+ uint8_t smblmpwd[LM_HASH_LEN],
smbntpwd[NT_HASH_LEN];
bool use_samba_attrs = True;
uint32_t acct_ctrl = 0;
uint16_t bad_password_count = 0,
logon_count = 0;
uint32_t hours_len;
- uint8 hours[MAX_HOURS_LEN];
+ uint8_t hours[MAX_HOURS_LEN];
char *temp = NULL;
struct login_cache cache_entry;
uint32_t pwHistLen;
pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pwHistLen);
if (pwHistLen > 0){
- uint8 *pwhist = NULL;
+ uint8_t *pwhist = NULL;
int i;
char *history_string = talloc_array(ctx, char,
MAX_PW_HISTORY_LEN*64);
pwHistLen = MIN(pwHistLen, MAX_PW_HISTORY_LEN);
- pwhist = talloc_zero_array(ctx, uint8,
+ pwhist = talloc_zero_array(ctx, uint8_t,
pwHistLen * PW_HISTORY_ENTRY_LEN);
if (pwhist == NULL) {
DEBUG(0, ("init_sam_from_ldap: talloc failed!\n"));
} else {
int i;
uint32_t currHistLen = 0;
- const uint8 *pwhist = pdb_get_pw_history(sampass, &currHistLen);
+ const uint8_t *pwhist = pdb_get_pw_history(sampass, &currHistLen);
if (pwhist != NULL) {
/* We can only store (1024-1/64 password history entries. */
pwHistLen = MIN(pwHistLen, ((1024-1)/64));
}
if (need_update(sampass, PDB_HOURS)) {
- const uint8 *hours = pdb_get_hours(sampass);
+ const uint8_t *hours = pdb_get_hours(sampass);
if (hours) {
char hourstr[44];
pdb_sethexhours(hourstr, hours);
{
NTSTATUS ntstatus = NT_STATUS_UNSUCCESSFUL;
int i, rc;
- uint32 policy_default;
+ uint32_t policy_default;
const char *policy_attr = NULL;
char *dn = NULL;
LDAPMod **mods = NULL;
/* add the sambaNextUserRid attributes. */
{
- uint32 rid = BASE_RID;
+ uint32_t rid = BASE_RID;
fstring rid_str;
fstr_sprintf( rid_str, "%i", rid );
static NTSTATUS pdb_samba_dsdb_create_user(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
- const char *name, uint32 acct_flags,
- uint32 *rid)
+ const char *name, uint32_t acct_flags,
+ uint32_t *rid)
{
struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
m->private_data, struct pdb_samba_dsdb_state);
static NTSTATUS pdb_samba_dsdb_create_dom_group(struct pdb_methods *m,
TALLOC_CTX *mem_ctx, const char *name,
- uint32 *rid)
+ uint32_t *rid)
{
struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
m->private_data, struct pdb_samba_dsdb_state);
}
static NTSTATUS pdb_samba_dsdb_delete_dom_group(struct pdb_methods *m,
- TALLOC_CTX *mem_ctx, uint32 rid)
+ TALLOC_CTX *mem_ctx, uint32_t rid)
{
const char *attrs[] = { NULL };
struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
static NTSTATUS pdb_samba_dsdb_mod_groupmem(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
- uint32 grouprid, uint32 memberrid,
+ uint32_t grouprid, uint32_t memberrid,
int mod_op)
{
struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
static NTSTATUS pdb_samba_dsdb_add_groupmem(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
- uint32 group_rid, uint32 member_rid)
+ uint32_t group_rid, uint32_t member_rid)
{
return pdb_samba_dsdb_mod_groupmem(m, mem_ctx, group_rid, member_rid,
LDB_FLAG_MOD_ADD);
static NTSTATUS pdb_samba_dsdb_del_groupmem(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
- uint32 group_rid, uint32 member_rid)
+ uint32_t group_rid, uint32_t member_rid)
{
return pdb_samba_dsdb_mod_groupmem(m, mem_ctx, group_rid, member_rid,
LDB_FLAG_MOD_DELETE);
}
static NTSTATUS pdb_samba_dsdb_create_alias(struct pdb_methods *m,
- const char *name, uint32 *rid)
+ const char *name, uint32_t *rid)
{
TALLOC_CTX *frame = talloc_stackframe();
struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
static NTSTATUS pdb_samba_dsdb_lookup_rids(struct pdb_methods *m,
const struct dom_sid *domain_sid,
int num_rids,
- uint32 *rids,
+ uint32_t *rids,
const char **names,
enum lsa_SidType *lsa_attrs)
{
const struct dom_sid *domain_sid,
int num_names,
const char **pp_names,
- uint32 *rids,
+ uint32_t *rids,
enum lsa_SidType *attrs)
{
return NT_STATUS_NOT_IMPLEMENTED;
static bool pdb_samba_dsdb_search_users(struct pdb_methods *m,
struct pdb_search *search,
- uint32 acct_flags)
+ uint32_t acct_flags)
{
struct pdb_samba_dsdb_search_state *sstate;
bool ret;
return PDB_CAP_STORE_RIDS | PDB_CAP_ADS;
}
-static bool pdb_samba_dsdb_new_rid(struct pdb_methods *m, uint32 *rid)
+static bool pdb_samba_dsdb_new_rid(struct pdb_methods *m, uint32_t *rid)
{
return false;
}
static NTSTATUS pdb_samba_dsdb_enum_trusteddoms(struct pdb_methods *m,
TALLOC_CTX *mem_ctx,
- uint32 *num_domains,
+ uint32_t *num_domains,
struct trustdom_info ***domains)
{
*num_domains = 0;
**/
struct list_trusted_domains_state {
- uint32 num_domains;
+ uint32_t num_domains;
struct trustdom_info **domains;
};
return 0;
}
-NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
+NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
struct trustdom_info ***domains)
{
struct list_trusted_domains_state state;
/* The following definitions come from passdb/pdb_secrets.c */
-NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
+NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
struct trustdom_info ***domains);
#endif /* _PASSDB_PDB_SECRETS_H_ */
struct smb_passwd
{
- uint32 smb_userid; /* this is actually the unix uid_t */
+ uint32_t smb_userid; /* this is actually the unix uid_t */
const char *smb_name; /* username string */
const unsigned char *smb_passwd; /* Null if no password */
#ifdef DEBUG_PASSWORD
DEBUG(100,("mod_smbfilepwd_entry: "));
- dump_data(100, (uint8 *)ascii_p16, wr_len);
+ dump_data(100, (uint8_t *)ascii_p16, wr_len);
#endif
if(wr_len > LINEBUF_SIZE) {
switch (state->from) {
case 0:
ret = init_samu_from_buffer(user, SAMU_BUFFER_V0,
- (uint8 *)value.dptr,
+ (uint8_t *)value.dptr,
value.dsize);
break;
case 1:
ret = init_samu_from_buffer(user, SAMU_BUFFER_V1,
- (uint8 *)value.dptr,
+ (uint8_t *)value.dptr,
value.dsize);
break;
case 2:
ret = init_samu_from_buffer(user, SAMU_BUFFER_V2,
- (uint8 *)value.dptr,
+ (uint8_t *)value.dptr,
value.dsize);
break;
case 3:
ret = init_samu_from_buffer(user, SAMU_BUFFER_V3,
- (uint8 *)value.dptr,
+ (uint8_t *)value.dptr,
value.dsize);
break;
case 4:
ret = init_samu_from_buffer(user, SAMU_BUFFER_V4,
- (uint8 *)value.dptr,
+ (uint8_t *)value.dptr,
value.dsize);
break;
default:
static bool tdbsam_upgrade_next_rid(struct db_context *db)
{
TDB_CONTEXT *tdb;
- uint32 rid;
+ uint32_t rid;
bool ok = false;
NTSTATUS status;
char *db_path;
**************************************************************************/
static NTSTATUS tdbsam_getsampwrid (struct pdb_methods *my_methods,
- struct samu *user, uint32 rid)
+ struct samu *user, uint32_t rid)
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
TDB_DATA data;
static NTSTATUS tdbsam_getsampwsid(struct pdb_methods *my_methods,
struct samu * user, const struct dom_sid *sid)
{
- uint32 rid;
+ uint32_t rid;
if ( !sid_peek_check_rid(get_global_sam_sid(), sid, &rid) )
return NT_STATUS_UNSUCCESSFUL;
{
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
fstring keystr;
- uint32 rid;
+ uint32_t rid;
fstring name;
/* open the database */
static bool tdb_update_samacct_only( struct samu* newpwd, int flag )
{
TDB_DATA data;
- uint8 *buf = NULL;
+ uint8_t *buf = NULL;
fstring keystr;
fstring name;
bool ret = false;
return PDB_CAP_STORE_RIDS;
}
-static bool tdbsam_new_rid(struct pdb_methods *methods, uint32 *prid)
+static bool tdbsam_new_rid(struct pdb_methods *methods, uint32_t *prid)
{
- uint32 rid;
+ uint32_t rid;
NTSTATUS status;
rid = BASE_RID; /* Default if not set */
struct tdbsam_search_state *state = talloc_get_type_abort(
private_data, struct tdbsam_search_state);
size_t prefixlen = strlen(RIDPREFIX);
- uint32 rid;
+ uint32_t rid;
TDB_DATA key;
key = dbwrap_record_get_key(rec);
rid = strtoul((char *)key.dptr+prefixlen, NULL, 16);
- ADD_TO_LARGE_ARRAY(state, uint32, rid, &state->rids, &state->num_rids,
+ ADD_TO_LARGE_ARRAY(state, uint32_t, rid, &state->rids, &state->num_rids,
&state->array_size);
return 0;
static bool tdbsam_search_users(struct pdb_methods *methods,
struct pdb_search *search,
- uint32 acct_flags)
+ uint32_t acct_flags)
{
struct tdbsam_search_state *state;
static NTSTATUS pdb_wbc_sam_enum_group_members(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
const struct dom_sid *group,
- uint32 **pp_member_rids,
+ uint32_t **pp_member_rids,
size_t *p_num_members)
{
return NT_STATUS_NOT_IMPLEMENTED;
static NTSTATUS pdb_wbc_sam_lookup_rids(struct pdb_methods *methods,
const struct dom_sid *domain_sid,
int num_rids,
- uint32 *rids,
+ uint32_t *rids,
const char **names,
enum lsa_SidType *attrs)
{
static NTSTATUS pdb_wbc_sam_enum_trusteddoms(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- uint32 *num_domains,
+ uint32_t *num_domains,
struct trustdom_info ***domains)
{
return NT_STATUS_NOT_IMPLEMENTED;
const struct dom_sid *domain_sid,
const struct dom_sid *members,
size_t num_members,
- uint32 **pp_alias_rids,
+ uint32_t **pp_alias_rids,
size_t *p_num_alias_rids)
{
if (!winbind_get_sid_aliases(mem_ctx, domain_sid,
}
status = dbwrap_trans_store(db_ctx, string_tdb_data(key),
- make_tdb_data((const uint8 *)data, size),
+ make_tdb_data((const uint8_t *)data, size),
TDB_REPLACE);
return NT_STATUS_IS_OK(status);
}
fstring key;
struct afs_keyfile *keyfile;
size_t size = 0;
- uint32 i;
+ uint32_t i;
slprintf(key, sizeof(key)-1, "%s/%s", SECRETS_AFS_KEYFILE, cell);