summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-05-21 10:38:04 +1000
committerGünther Deschner <gd@samba.org>2010-05-21 10:24:55 +0200
commita92b653af964364ee438c6ee69a87eb7603ceab0 (patch)
treef4b97ac212fb19706b5fc89d7c5061b707f74a41 /source3/passdb
parentc8a23147fe12c693fd7944af7bb09b88393789d9 (diff)
downloadsamba-a92b653af964364ee438c6ee69a87eb7603ceab0.tar.gz
samba-a92b653af964364ee438c6ee69a87eb7603ceab0.tar.bz2
samba-a92b653af964364ee438c6ee69a87eb7603ceab0.zip
s3:passdb Remove use of uint8 uint16 and uint32 in favour of C99 types
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c206
-rw-r--r--source3/passdb/pdb_get_set.c40
-rw-r--r--source3/passdb/pdb_interface.c82
-rw-r--r--source3/passdb/pdb_ldap.c120
-rw-r--r--source3/passdb/pdb_smbpasswd.c10
5 files changed, 229 insertions, 229 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 08488f13c9..b6b3c530f8 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -145,7 +145,7 @@ static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *p
const char *guest_account = lp_guestaccount();
const char *domain = global_myname();
char *fullname;
- uint32 urid;
+ uint32_t urid;
if ( !pwd ) {
return NT_STATUS_NO_SUCH_USER;
@@ -241,7 +241,7 @@ static NTSTATUS samu_set_unix_internal(struct samu *user, const struct passwd *p
netr_SamInfo3 structure) */
if ( create && (pdb_capabilities() & PDB_CAP_STORE_RIDS)) {
- uint32 user_rid;
+ uint32_t user_rid;
DOM_SID user_sid;
if ( !pdb_new_rid( &user_rid ) ) {
@@ -371,7 +371,7 @@ uint32_t pdb_decode_acct_ctrl(const char *p)
Routine to set 32 hex password characters from a 16 byte array.
**************************************************************/
-void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32 acct_ctrl)
+void pdb_sethexpwd(char p[33], const unsigned char *pwd, uint32_t acct_ctrl)
{
if (pwd != NULL) {
int i;
@@ -495,7 +495,7 @@ int algorithmic_rid_base(void)
Converts NT user RID to a UNIX uid.
********************************************************************/
-uid_t algorithmic_pdb_user_rid_to_uid(uint32 user_rid)
+uid_t algorithmic_pdb_user_rid_to_uid(uint32_t user_rid)
{
int rid_offset = algorithmic_rid_base();
return (uid_t)(((user_rid & (~USER_RID_TYPE)) - rid_offset)/RID_MULTIPLIER);
@@ -510,17 +510,17 @@ uid_t max_algorithmic_uid(void)
converts UNIX uid to an NT User RID.
********************************************************************/
-uint32 algorithmic_pdb_uid_to_user_rid(uid_t uid)
+uint32_t algorithmic_pdb_uid_to_user_rid(uid_t uid)
{
int rid_offset = algorithmic_rid_base();
- return (((((uint32)uid)*RID_MULTIPLIER) + rid_offset) | USER_RID_TYPE);
+ return (((((uint32_t)uid)*RID_MULTIPLIER) + rid_offset) | USER_RID_TYPE);
}
/*******************************************************************
Converts NT group RID to a UNIX gid.
********************************************************************/
-gid_t pdb_group_rid_to_gid(uint32 group_rid)
+gid_t pdb_group_rid_to_gid(uint32_t group_rid)
{
int rid_offset = algorithmic_rid_base();
return (gid_t)(((group_rid & (~GROUP_RID_TYPE))- rid_offset)/RID_MULTIPLIER);
@@ -539,17 +539,17 @@ gid_t max_algorithmic_gid(void)
there is not anymore a direct link between the gid and the rid.
********************************************************************/
-uint32 algorithmic_pdb_gid_to_group_rid(gid_t gid)
+uint32_t algorithmic_pdb_gid_to_group_rid(gid_t gid)
{
int rid_offset = algorithmic_rid_base();
- return (((((uint32)gid)*RID_MULTIPLIER) + rid_offset) | GROUP_RID_TYPE);
+ return (((((uint32_t)gid)*RID_MULTIPLIER) + rid_offset) | GROUP_RID_TYPE);
}
/*******************************************************************
Decides if a RID is a well known RID.
********************************************************************/
-static bool rid_is_well_known(uint32 rid)
+static bool rid_is_well_known(uint32_t rid)
{
/* Not using rid_offset here, because this is the actual
NT fixed value (1000) */
@@ -561,7 +561,7 @@ static bool rid_is_well_known(uint32 rid)
Decides if a RID is a user or group RID.
********************************************************************/
-bool algorithmic_pdb_rid_is_user(uint32 rid)
+bool algorithmic_pdb_rid_is_user(uint32_t rid)
{
if ( rid_is_well_known(rid) ) {
/*
@@ -925,13 +925,13 @@ done:
/*********************************************************************
*********************************************************************/
-static bool init_samu_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 buflen)
+static bool init_samu_from_buffer_v0(struct samu *sampass, uint8_t *buf, uint32_t buflen)
{
/* times are stored as 32bit integer
take care on system with 64bit wide time_t
--SSS */
- uint32 logon_time,
+ uint32_t logon_time,
logoff_time,
kickoff_time,
pass_last_set_time,
@@ -949,18 +949,18 @@ static bool init_samu_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 bu
char *profile_path = NULL;
char *acct_desc = NULL;
char *workstations = NULL;
- uint32 username_len, domain_len, nt_username_len,
+ uint32_t username_len, domain_len, nt_username_len,
dir_drive_len, unknown_str_len, munged_dial_len,
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- uint32 user_rid, group_rid, remove_me, hours_len, unknown_6;
- uint16 acct_ctrl, logon_divs;
- uint16 bad_password_count, logon_count;
- uint8 *hours = NULL;
- uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL;
- uint32 len = 0;
- uint32 lm_pw_len, nt_pw_len, hourslen;
+ uint32_t user_rid, group_rid, remove_me, hours_len, unknown_6;
+ uint16_t acct_ctrl, logon_divs;
+ uint16_t bad_password_count, logon_count;
+ uint8_t *hours = NULL;
+ uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL;
+ uint32_t len = 0;
+ uint32_t lm_pw_len, nt_pw_len, hourslen;
bool ret = True;
if(sampass == NULL || buf == NULL) {
@@ -1003,7 +1003,7 @@ static bool init_samu_from_buffer_v0(struct samu *sampass, uint8 *buf, uint32 bu
&logon_count, /* w */
&unknown_6); /* d */
- if (len == (uint32) -1) {
+ if (len == (uint32_t) -1) {
ret = False;
goto done;
}
@@ -1110,13 +1110,13 @@ done:
/*********************************************************************
*********************************************************************/
-static bool init_samu_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 buflen)
+static bool init_samu_from_buffer_v1(struct samu *sampass, uint8_t *buf, uint32_t buflen)
{
/* times are stored as 32bit integer
take care on system with 64bit wide time_t
--SSS */
- uint32 logon_time,
+ uint32_t logon_time,
logoff_time,
kickoff_time,
bad_password_time,
@@ -1135,18 +1135,18 @@ static bool init_samu_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 bu
char *profile_path = NULL;
char *acct_desc = NULL;
char *workstations = NULL;
- uint32 username_len, domain_len, nt_username_len,
+ uint32_t username_len, domain_len, nt_username_len,
dir_drive_len, unknown_str_len, munged_dial_len,
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- uint32 user_rid, group_rid, remove_me, hours_len, unknown_6;
- uint16 acct_ctrl, logon_divs;
- uint16 bad_password_count, logon_count;
- uint8 *hours = NULL;
- uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL;
- uint32 len = 0;
- uint32 lm_pw_len, nt_pw_len, hourslen;
+ uint32_t user_rid, group_rid, remove_me, hours_len, unknown_6;
+ uint16_t acct_ctrl, logon_divs;
+ uint16_t bad_password_count, logon_count;
+ uint8_t *hours = NULL;
+ uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL;
+ uint32_t len = 0;
+ uint32_t lm_pw_len, nt_pw_len, hourslen;
bool ret = True;
if(sampass == NULL || buf == NULL) {
@@ -1191,7 +1191,7 @@ static bool init_samu_from_buffer_v1(struct samu *sampass, uint8 *buf, uint32 bu
&logon_count, /* w */
&unknown_6); /* d */
- if (len == (uint32) -1) {
+ if (len == (uint32_t) -1) {
ret = False;
goto done;
}
@@ -1299,13 +1299,13 @@ done:
return ret;
}
-static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen)
+static bool init_samu_from_buffer_v2(struct samu *sampass, uint8_t *buf, uint32_t buflen)
{
/* times are stored as 32bit integer
take care on system with 64bit wide time_t
--SSS */
- uint32 logon_time,
+ uint32_t logon_time,
logoff_time,
kickoff_time,
bad_password_time,
@@ -1324,19 +1324,19 @@ static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 bu
char *profile_path = NULL;
char *acct_desc = NULL;
char *workstations = NULL;
- uint32 username_len, domain_len, nt_username_len,
+ uint32_t username_len, domain_len, nt_username_len,
dir_drive_len, unknown_str_len, munged_dial_len,
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- uint32 user_rid, group_rid, hours_len, unknown_6;
- uint16 acct_ctrl, logon_divs;
- uint16 bad_password_count, logon_count;
- uint8 *hours = NULL;
- uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL;
- uint32 len = 0;
- uint32 lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen;
- uint32 pwHistLen = 0;
+ uint32_t user_rid, group_rid, hours_len, unknown_6;
+ uint16_t acct_ctrl, logon_divs;
+ uint16_t bad_password_count, logon_count;
+ uint8_t *hours = NULL;
+ uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL;
+ uint32_t len = 0;
+ uint32_t lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen;
+ uint32_t pwHistLen = 0;
bool ret = True;
fstring tmp_string;
bool expand_explicit = lp_passdb_expand_explicit();
@@ -1384,7 +1384,7 @@ static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 bu
&logon_count, /* w */
&unknown_6); /* d */
- if (len == (uint32) -1) {
+ if (len == (uint32_t) -1) {
ret = False;
goto done;
}
@@ -1473,7 +1473,7 @@ static bool init_samu_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 bu
/* Change from V1 is addition of password history field. */
pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pwHistLen);
if (pwHistLen) {
- uint8 *pw_hist = SMB_MALLOC_ARRAY(uint8, pwHistLen * PW_HISTORY_ENTRY_LEN);
+ uint8_t *pw_hist = SMB_MALLOC_ARRAY(uint8_t, pwHistLen * PW_HISTORY_ENTRY_LEN);
if (!pw_hist) {
ret = False;
goto done;
@@ -1534,13 +1534,13 @@ done:
/*********************************************************************
*********************************************************************/
-static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 buflen)
+static bool init_samu_from_buffer_v3(struct samu *sampass, uint8_t *buf, uint32_t buflen)
{
/* times are stored as 32bit integer
take care on system with 64bit wide time_t
--SSS */
- uint32 logon_time,
+ uint32_t logon_time,
logoff_time,
kickoff_time,
bad_password_time,
@@ -1559,19 +1559,19 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
char *profile_path = NULL;
char *acct_desc = NULL;
char *workstations = NULL;
- uint32 username_len, domain_len, nt_username_len,
+ uint32_t username_len, domain_len, nt_username_len,
dir_drive_len, comment_len, munged_dial_len,
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- uint32 user_rid, group_rid, hours_len, unknown_6, acct_ctrl;
- uint16 logon_divs;
- uint16 bad_password_count, logon_count;
- uint8 *hours = NULL;
- uint8 *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL;
- uint32 len = 0;
- uint32 lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen;
- uint32 pwHistLen = 0;
+ uint32_t user_rid, group_rid, hours_len, unknown_6, acct_ctrl;
+ uint16_t logon_divs;
+ uint16_t bad_password_count, logon_count;
+ uint8_t *hours = NULL;
+ uint8_t *lm_pw_ptr = NULL, *nt_pw_ptr = NULL, *nt_pw_hist_ptr = NULL;
+ uint32_t len = 0;
+ uint32_t lm_pw_len, nt_pw_len, nt_pw_hist_len, hourslen;
+ uint32_t pwHistLen = 0;
bool ret = True;
fstring tmp_string;
bool expand_explicit = lp_passdb_expand_explicit();
@@ -1610,7 +1610,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
&nt_pw_len, &nt_pw_ptr, /* B */
/* Change from V1 is addition of password history field. */
&nt_pw_hist_len, &nt_pw_hist_ptr, /* B */
- /* Change from V2 is the uint32 acb_mask */
+ /* Change from V2 is the uint32_t acb_mask */
&acct_ctrl, /* d */
/* Also "remove_me" field was removed. */
&logon_divs, /* w */
@@ -1620,18 +1620,18 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
&logon_count, /* w */
&unknown_6); /* d */
- if (len == (uint32) -1) {
+ if (len == (uint32_t) -1) {
ret = False;
goto done;
}
- pdb_set_logon_time(sampass, convert_uint32_to_time_t(logon_time), PDB_SET);
- pdb_set_logoff_time(sampass, convert_uint32_to_time_t(logoff_time), PDB_SET);
- pdb_set_kickoff_time(sampass, convert_uint32_to_time_t(kickoff_time), PDB_SET);
- pdb_set_bad_password_time(sampass, convert_uint32_to_time_t(bad_password_time), PDB_SET);
- pdb_set_pass_can_change_time(sampass, convert_uint32_to_time_t(pass_can_change_time), PDB_SET);
- pdb_set_pass_must_change_time(sampass, convert_uint32_to_time_t(pass_must_change_time), PDB_SET);
- pdb_set_pass_last_set_time(sampass, convert_uint32_to_time_t(pass_last_set_time), PDB_SET);
+ pdb_set_logon_time(sampass, convert_uint32_t_to_time_t(logon_time), PDB_SET);
+ pdb_set_logoff_time(sampass, convert_uint32_t_to_time_t(logoff_time), PDB_SET);
+ pdb_set_kickoff_time(sampass, convert_uint32_t_to_time_t(kickoff_time), PDB_SET);
+ pdb_set_bad_password_time(sampass, convert_uint32_t_to_time_t(bad_password_time), PDB_SET);
+ pdb_set_pass_can_change_time(sampass, convert_uint32_t_to_time_t(pass_can_change_time), PDB_SET);
+ pdb_set_pass_must_change_time(sampass, convert_uint32_t_to_time_t(pass_must_change_time), PDB_SET);
+ pdb_set_pass_last_set_time(sampass, convert_uint32_t_to_time_t(pass_last_set_time), PDB_SET);
pdb_set_username(sampass, username, PDB_SET);
pdb_set_domain(sampass, domain, PDB_SET);
@@ -1708,7 +1708,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pwHistLen);
if (pwHistLen) {
- uint8 *pw_hist = (uint8 *)SMB_MALLOC(pwHistLen * PW_HISTORY_ENTRY_LEN);
+ uint8_t *pw_hist = (uint8_t *)SMB_MALLOC(pwHistLen * PW_HISTORY_ENTRY_LEN);
if (!pw_hist) {
ret = False;
goto done;
@@ -1739,7 +1739,7 @@ static bool init_samu_from_buffer_v3(struct samu *sampass, uint8 *buf, uint32 bu
pdb_set_bad_password_count(sampass, bad_password_count, PDB_SET);
pdb_set_logon_count(sampass, logon_count, PDB_SET);
pdb_set_unknown_6(sampass, unknown_6, PDB_SET);
- /* Change from V2 is the uint32 acct_ctrl */
+ /* Change from V2 is the uint32_t acct_ctrl */
pdb_set_acct_ctrl(sampass, acct_ctrl, PDB_SET);
pdb_set_logon_divs(sampass, logon_divs, PDB_SET);
pdb_set_hours(sampass, hours, PDB_SET);
@@ -1769,14 +1769,14 @@ done:
/*********************************************************************
*********************************************************************/
-static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool size_only)
+static uint32_t init_buffer_from_samu_v3 (uint8_t **buf, struct samu *sampass, bool size_only)
{
size_t len, buflen;
/* times are stored as 32bit integer
take care on system with 64bit wide time_t
--SSS */
- uint32 logon_time,
+ uint32_t logon_time,
logoff_time,
kickoff_time,
bad_password_time,
@@ -1784,7 +1784,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
pass_can_change_time,
pass_must_change_time;
- uint32 user_rid, group_rid;
+ uint32_t user_rid, group_rid;
const char *username;
const char *domain;
@@ -1798,29 +1798,29 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
const char *profile_path;
const char *acct_desc;
const char *workstations;
- uint32 username_len, domain_len, nt_username_len,
+ uint32_t username_len, domain_len, nt_username_len,
dir_drive_len, comment_len, munged_dial_len,
fullname_len, homedir_len, logon_script_len,
profile_path_len, acct_desc_len, workstations_len;
- const uint8 *lm_pw;
- const uint8 *nt_pw;
- const uint8 *nt_pw_hist;
- uint32 lm_pw_len = 16;
- uint32 nt_pw_len = 16;
- uint32 nt_pw_hist_len;
- uint32 pwHistLen = 0;
+ const uint8_t *lm_pw;
+ const uint8_t *nt_pw;
+ const uint8_t *nt_pw_hist;
+ uint32_t lm_pw_len = 16;
+ uint32_t nt_pw_len = 16;
+ uint32_t nt_pw_hist_len;
+ uint32_t pwHistLen = 0;
*buf = NULL;
buflen = 0;
- logon_time = convert_time_t_to_uint32(pdb_get_logon_time(sampass));
- logoff_time = convert_time_t_to_uint32(pdb_get_logoff_time(sampass));
- kickoff_time = convert_time_t_to_uint32(pdb_get_kickoff_time(sampass));
- bad_password_time = convert_time_t_to_uint32(pdb_get_bad_password_time(sampass));
- pass_can_change_time = convert_time_t_to_uint32(pdb_get_pass_can_change_time_noncalc(sampass));
- pass_must_change_time = convert_time_t_to_uint32(pdb_get_pass_must_change_time(sampass));
- pass_last_set_time = convert_time_t_to_uint32(pdb_get_pass_last_set_time(sampass));
+ logon_time = convert_time_t_to_uint32_t(pdb_get_logon_time(sampass));
+ logoff_time = convert_time_t_to_uint32_t(pdb_get_logoff_time(sampass));
+ kickoff_time = convert_time_t_to_uint32_t(pdb_get_kickoff_time(sampass));
+ bad_password_time = convert_time_t_to_uint32_t(pdb_get_bad_password_time(sampass));
+ pass_can_change_time = convert_time_t_to_uint32_t(pdb_get_pass_can_change_time_noncalc(sampass));
+ pass_must_change_time = convert_time_t_to_uint32_t(pdb_get_pass_must_change_time(sampass));
+ pass_last_set_time = convert_time_t_to_uint32_t(pdb_get_pass_last_set_time(sampass));
user_rid = pdb_get_user_rid(sampass);
group_rid = pdb_get_group_rid(sampass);
@@ -1988,7 +1988,7 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
}
/* malloc the space needed */
- if ( (*buf=(uint8*)SMB_MALLOC(len)) == NULL) {
+ if ( (*buf=(uint8_t*)SMB_MALLOC(len)) == NULL) {
DEBUG(0,("init_buffer_from_samu_v3: Unable to malloc() memory for buffer!\n"));
return (-1);
}
@@ -2039,13 +2039,13 @@ static uint32 init_buffer_from_samu_v3 (uint8 **buf, struct samu *sampass, bool
return (buflen);
}
-static bool init_samu_from_buffer_v4(struct samu *sampass, uint8 *buf, uint32 buflen)
+static bool init_samu_from_buffer_v4(struct samu *sampass, uint8_t *buf, uint32_t buflen)
{
/* nothing changed between V3 and V4 */
return init_samu_from_buffer_v3(sampass, buf, buflen);
}
-static uint32 init_buffer_from_samu_v4(uint8 **buf, struct samu *sampass, bool size_only)
+static uint32_t init_buffer_from_samu_v4(uint8_t **buf, struct samu *sampass, bool size_only)
{
/* nothing changed between V3 and V4 */
return init_buffer_from_samu_v3(buf, sampass, size_only);
@@ -2056,7 +2056,7 @@ static uint32 init_buffer_from_samu_v4(uint8 **buf, struct samu *sampass, bool s
*********************************************************************/
bool init_samu_from_buffer(struct samu *sampass, uint32_t level,
- uint8 *buf, uint32 buflen)
+ uint8_t *buf, uint32_t buflen)
{
switch (level) {
case SAMU_BUFFER_V0:
@@ -2078,7 +2078,7 @@ bool init_samu_from_buffer(struct samu *sampass, uint32_t level,
Intialize a BYTE buffer from a struct samu struct
*********************************************************************/
-uint32 init_buffer_from_samu (uint8 **buf, struct samu *sampass, bool size_only)
+uint32_t init_buffer_from_samu (uint8_t **buf, struct samu *sampass, bool size_only)
{
return init_buffer_from_samu_v4(buf, sampass, size_only);
}
@@ -2088,7 +2088,7 @@ uint32 init_buffer_from_samu (uint8 **buf, struct samu *sampass, bool size_only)
bool pdb_copy_sam_account(struct samu *dst, struct samu *src )
{
- uint8 *buf = NULL;
+ uint8_t *buf = NULL;
int len;
len = init_buffer_from_samu(&buf, src, False);
@@ -2127,8 +2127,8 @@ bool pdb_copy_sam_account(struct samu *dst, struct samu *src )
bool pdb_update_bad_password_count(struct samu *sampass, bool *updated)
{
time_t LastBadPassword;
- uint16 BadPasswordCount;
- uint32 resettime;
+ uint16_t BadPasswordCount;
+ uint32_t resettime;
bool res;
BadPasswordCount = pdb_get_bad_password_count(sampass);
@@ -2147,15 +2147,15 @@ bool pdb_update_bad_password_count(struct samu *sampass, bool *updated)
}
/* First, check if there is a reset time to compare */
- if ((resettime == (uint32) -1) || (resettime == 0)) {
+ if ((resettime == (uint32_t) -1) || (resettime == 0)) {
DEBUG(9, ("No reset time, can't reset bad pw count\n"));
return True;
}
LastBadPassword = pdb_get_bad_password_time(sampass);
DEBUG(7, ("LastBadPassword=%d, resettime=%d, current time=%d.\n",
- (uint32) LastBadPassword, resettime, (uint32)time(NULL)));
- if (time(NULL) > (LastBadPassword + convert_uint32_to_time_t(resettime)*60)){
+ (uint32_t) LastBadPassword, resettime, (uint32_t)time(NULL)));
+ if (time(NULL) > (LastBadPassword + convert_uint32_t_to_time_t(resettime)*60)){
pdb_set_bad_password_count(sampass, 0, PDB_CHANGED);
pdb_set_bad_password_time(sampass, 0, PDB_CHANGED);
if (updated) {
@@ -2172,7 +2172,7 @@ bool pdb_update_bad_password_count(struct samu *sampass, bool *updated)
bool pdb_update_autolock_flag(struct samu *sampass, bool *updated)
{
- uint32 duration;
+ uint32_t duration;
time_t LastBadPassword;
bool res;
@@ -2192,14 +2192,14 @@ bool pdb_update_autolock_flag(struct samu *sampass, bool *updated)
}
/* First, check if there is a duration to compare */
- if ((duration == (uint32) -1) || (duration == 0)) {
+ if ((duration == (uint32_t) -1) || (duration == 0)) {
DEBUG(9, ("pdb_update_autolock_flag: No reset duration, can't reset autolock\n"));
return True;
}
LastBadPassword = pdb_get_bad_password_time(sampass);
DEBUG(7, ("pdb_update_autolock_flag: Account %s, LastBadPassword=%d, duration=%d, current time =%d.\n",
- pdb_get_username(sampass), (uint32)LastBadPassword, duration*60, (uint32)time(NULL)));
+ pdb_get_username(sampass), (uint32_t)LastBadPassword, duration*60, (uint32_t)time(NULL)));
if (LastBadPassword == (time_t)0) {
DEBUG(1,("pdb_update_autolock_flag: Account %s "
@@ -2209,7 +2209,7 @@ bool pdb_update_autolock_flag(struct samu *sampass, bool *updated)
return True;
}
- if ((time(NULL) > (LastBadPassword + convert_uint32_to_time_t(duration) * 60))) {
+ if ((time(NULL) > (LastBadPassword + convert_uint32_t_to_time_t(duration) * 60))) {
pdb_set_acct_ctrl(sampass,
pdb_get_acct_ctrl(sampass) & ~ACB_AUTOLOCK,
PDB_CHANGED);
@@ -2229,7 +2229,7 @@ bool pdb_update_autolock_flag(struct samu *sampass, bool *updated)
bool pdb_increment_bad_password_count(struct samu *sampass)
{
- uint32 account_policy_lockout;
+ uint32_t account_policy_lockout;
bool autolock_updated = False, badpw_updated = False;
bool ret;
@@ -2365,7 +2365,7 @@ bool get_trust_pw_clear(const char *domain, char **ret_pwd,
appropriate account name is stored in account_name.
*******************************************************************/
-bool get_trust_pw_hash(const char *domain, uint8 ret_pwd[16],
+bool get_trust_pw_hash(const char *domain, uint8_t ret_pwd[16],
const char **account_name,
enum netr_SchannelType *channel)
{
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c
index 1416e287ac..554e8127d2 100644
--- a/source3/passdb/pdb_get_set.c
+++ b/source3/passdb/pdb_get_set.c
@@ -40,7 +40,7 @@
Collection of get...() functions for struct samu.
********************************************************************/
-uint32 pdb_get_acct_ctrl(const struct samu *sampass)
+uint32_t pdb_get_acct_ctrl(const struct samu *sampass)
{
return sampass->acct_ctrl;
}
@@ -72,7 +72,7 @@ time_t pdb_get_pass_last_set_time(const struct samu *sampass)
time_t pdb_get_pass_can_change_time(const struct samu *sampass)
{
- uint32 allow;
+ uint32_t allow;
/* if the last set time is zero, it means the user cannot
change their password, and this time must be zero. jmcd
@@ -104,7 +104,7 @@ time_t pdb_get_pass_can_change_time_noncalc(const struct samu *sampass)
time_t pdb_get_pass_must_change_time(const struct samu *sampass)
{
- uint32 expire;
+ uint32_t expire;
if (sampass->pass_last_set_time == 0)
return (time_t) 0;
@@ -113,7 +113,7 @@ time_t pdb_get_pass_must_change_time(const struct samu *sampass)
return get_time_t_max();
if (!pdb_get_account_policy(PDB_POLICY_MAX_PASSWORD_AGE, &expire)
- || expire == (uint32)-1 || expire == 0)
+ || expire == (uint32_t)-1 || expire == 0)
return get_time_t_max();
return sampass->pass_last_set_time + expire;
@@ -127,12 +127,12 @@ bool pdb_get_pass_can_change(const struct samu *sampass)
return True;
}
-uint16 pdb_get_logon_divs(const struct samu *sampass)
+uint16_t pdb_get_logon_divs(const struct samu *sampass)
{
return sampass->logon_divs;
}
-uint32 pdb_get_hours_len(const struct samu *sampass)
+uint32_t pdb_get_hours_len(const struct samu *sampass)
{
return sampass->hours_len;
}
@@ -156,7 +156,7 @@ const uint8 *pdb_get_lanman_passwd(const struct samu *sampass)
return (uint8 *)sampass->lm_pw.data;
}
-const uint8 *pdb_get_pw_history(const struct samu *sampass, uint32 *current_hist_len)
+const uint8 *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));
@@ -371,17 +371,17 @@ const char *pdb_get_munged_dial(const struct samu *sampass)
return sampass->munged_dial;
}
-uint16 pdb_get_bad_password_count(const struct samu *sampass)
+uint16_t pdb_get_bad_password_count(const struct samu *sampass)
{
return sampass->bad_password_count;
}
-uint16 pdb_get_logon_count(const struct samu *sampass)
+uint16_t pdb_get_logon_count(const struct samu *sampass)
{
return sampass->logon_count;
}
-uint32 pdb_get_unknown_6(const struct samu *sampass)
+uint32_t pdb_get_unknown_6(const struct samu *sampass)
{
return sampass->unknown_6;
}
@@ -399,7 +399,7 @@ void *pdb_get_backend_private_data(const struct samu *sampass, const struct pdb_
Collection of set...() functions for struct samu.
********************************************************************/
-bool pdb_set_acct_ctrl(struct samu *sampass, uint32 acct_ctrl, enum pdb_value_state flag)
+bool pdb_set_acct_ctrl(struct samu *sampass, uint32_t acct_ctrl, enum pdb_value_state flag)
{
sampass->acct_ctrl = acct_ctrl;
return pdb_set_init_flags(sampass, PDB_ACCTCTRL, flag);
@@ -447,13 +447,13 @@ bool pdb_set_pass_last_set_time(struct samu *sampass, time_t mytime, enum pdb_va
return pdb_set_init_flags(sampass, PDB_PASSLASTSET, flag);
}
-bool pdb_set_hours_len(struct samu *sampass, uint32 len, enum pdb_value_state flag)
+bool pdb_set_hours_len(struct samu *sampass, uint32_t len, enum pdb_value_state flag)
{
sampass->hours_len = len;
return pdb_set_init_flags(sampass, PDB_HOURSLEN, flag);
}
-bool pdb_set_logon_divs(struct samu *sampass, uint16 hours, enum pdb_value_state flag)
+bool pdb_set_logon_divs(struct samu *sampass, uint16_t hours, enum pdb_value_state flag)
{
sampass->logon_divs = hours;
return pdb_set_init_flags(sampass, PDB_LOGONDIVS, flag);
@@ -911,7 +911,7 @@ bool pdb_set_lanman_passwd(struct samu *sampass, const uint8 pwd[LM_HASH_LEN], e
in pwd.
********************************************************************/
-bool pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32 historyLen, enum pdb_value_state flag)
+bool pdb_set_pw_history(struct samu *sampass, const uint8 *pwd, uint32_t historyLen, enum pdb_value_state flag)
{
if (historyLen && pwd){
data_blob_free(&(sampass->nt_pw_his));
@@ -952,19 +952,19 @@ bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum
return pdb_set_init_flags(sampass, PDB_PLAINTEXT_PW, flag);
}
-bool pdb_set_bad_password_count(struct samu *sampass, uint16 bad_password_count, enum pdb_value_state flag)
+bool pdb_set_bad_password_count(struct samu *sampass, uint16_t bad_password_count, enum pdb_value_state flag)
{
sampass->bad_password_count = bad_password_count;
return pdb_set_init_flags(sampass, PDB_BAD_PASSWORD_COUNT, flag);
}
-bool pdb_set_logon_count(struct samu *sampass, uint16 logon_count, enum pdb_value_state flag)
+bool pdb_set_logon_count(struct samu *sampass, uint16_t logon_count, enum pdb_value_state flag)
{
sampass->logon_count = logon_count;
return pdb_set_init_flags(sampass, PDB_LOGON_COUNT, flag);
}
-bool pdb_set_unknown_6(struct samu *sampass, uint32 unkn, enum pdb_value_state flag)
+bool pdb_set_unknown_6(struct samu *sampass, uint32_t unkn, enum pdb_value_state flag)
{
sampass->unknown_6 = unkn;
return pdb_set_init_flags(sampass, PDB_UNKNOWN6, flag);
@@ -1020,8 +1020,8 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext)
uchar new_lanman_p16[LM_HASH_LEN];
uchar new_nt_p16[NT_HASH_LEN];
uchar *pwhistory;
- uint32 pwHistLen;
- uint32 current_history_len;
+ uint32_t pwHistLen;
+ uint32_t current_history_len;
if (!plaintext)
return False;
@@ -1129,7 +1129,7 @@ bool pdb_set_plaintext_passwd(struct samu *sampass, const char *plaintext)
}
/* check for any PDB_SET/CHANGED field and fill the appropriate mask bit */
-uint32 pdb_build_fields_present(struct samu *sampass)
+uint32_t pdb_build_fields_present(struct samu *sampass)
{
/* value set to all for testing */
return 0x00ffffff;
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
index abc023081e..ac53e52d14 100644
--- a/source3/passdb/pdb_interface.c
+++ b/source3/passdb/pdb_interface.c
@@ -273,7 +273,7 @@ static bool guest_user_info( struct samu *user )
bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid)
{
struct pdb_methods *pdb = pdb_get_methods();
- uint32 rid;
+ uint32_t rid;
void *cache_data;
/* hard code the Guest RID of 501 */
@@ -303,7 +303,7 @@ bool pdb_getsampwsid(struct samu *sam_acct, const DOM_SID *sid)
static NTSTATUS pdb_default_create_user(struct pdb_methods *methods,
TALLOC_CTX *tmp_ctx, const char *name,
- uint32 acb_info, uint32 *rid)
+ uint32_t acb_info, uint32_t *rid)
{
struct samu *sam_pass;
NTSTATUS status;
@@ -389,8 +389,8 @@ static NTSTATUS pdb_default_create_user(struct pdb_methods *methods,
return status;
}
-NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32 flags,
- uint32 *rid)
+NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32_t flags,
+ uint32_t *rid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->create_user(pdb, mem_ctx, name, flags, rid);
@@ -558,7 +558,7 @@ bool pdb_getgrnam(GROUP_MAP *map, const char *name)
static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
const char *name,
- uint32 *rid)
+ uint32_t *rid)
{
DOM_SID group_sid;
struct group *grp;
@@ -595,7 +595,7 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods,
}
NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name,
- uint32 *rid)
+ uint32_t *rid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->create_dom_group(pdb, mem_ctx, name, rid);
@@ -603,7 +603,7 @@ NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name,
static NTSTATUS pdb_default_delete_dom_group(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- uint32 rid)
+ uint32_t rid)
{
DOM_SID group_sid;
GROUP_MAP map;
@@ -652,7 +652,7 @@ static NTSTATUS pdb_default_delete_dom_group(struct pdb_methods *methods,
return NT_STATUS_OK;
}
-NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32 rid)
+NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32_t rid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->delete_dom_group(pdb, mem_ctx, rid);
@@ -686,7 +686,7 @@ bool pdb_enum_group_mapping(const DOM_SID *sid, enum lsa_SidType sid_name_use, G
NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx,
const DOM_SID *sid,
- uint32 **pp_member_rids,
+ uint32_t **pp_member_rids,
size_t *p_num_members)
{
struct pdb_methods *pdb = pdb_get_methods();
@@ -698,7 +698,7 @@ NTSTATUS pdb_enum_group_members(TALLOC_CTX *mem_ctx,
/* special check for rid 513 */
if ( !NT_STATUS_IS_OK( result ) ) {
- uint32 rid;
+ uint32_t rid;
sid_peek_rid( sid, &rid );
@@ -778,8 +778,8 @@ static bool pdb_user_in_group(TALLOC_CTX *mem_ctx, struct samu *account,
static NTSTATUS pdb_default_add_groupmem(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- uint32 group_rid,
- uint32 member_rid)
+ uint32_t group_rid,
+ uint32_t member_rid)
{
DOM_SID group_sid, member_sid;
struct samu *account = NULL;
@@ -834,8 +834,8 @@ static NTSTATUS pdb_default_add_groupmem(struct pdb_methods *methods,
return NT_STATUS_OK;
}
-NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid,
- uint32 member_rid)
+NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid,
+ uint32_t member_rid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->add_groupmem(pdb, mem_ctx, group_rid, member_rid);
@@ -843,8 +843,8 @@ NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid,
static NTSTATUS pdb_default_del_groupmem(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- uint32 group_rid,
- uint32 member_rid)
+ uint32_t group_rid,
+ uint32_t member_rid)
{
DOM_SID group_sid, member_sid;
struct samu *account = NULL;
@@ -896,14 +896,14 @@ static NTSTATUS pdb_default_del_groupmem(struct pdb_methods *methods,
return NT_STATUS_OK;
}
-NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid,
- uint32 member_rid)
+NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32_t group_rid,
+ uint32_t member_rid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->del_groupmem(pdb, mem_ctx, group_rid, member_rid);
}
-NTSTATUS pdb_create_alias(const char *name, uint32 *rid)
+NTSTATUS pdb_create_alias(const char *name, uint32_t *rid)
{
struct pdb_methods *pdb = pdb_get_methods();
return pdb->create_alias(pdb, name, rid);
@@ -950,7 +950,7 @@ NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias, TALLOC_CTX *mem_ctx,
NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx,
const DOM_SID *domain_sid,
const DOM_SID *members, size_t num_members,
- uint32 **pp_alias_rids,
+ uint32_t **pp_alias_rids,
size_t *p_num_alias_rids)
{
struct pdb_methods *pdb = pdb_get_methods();
@@ -963,7 +963,7 @@ NTSTATUS pdb_enum_alias_memberships(TALLOC_CTX *mem_ctx,
NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid,
int num_rids,
- uint32 *rids,
+ uint32_t *rids,
const char **names,
enum lsa_SidType *attrs)
{
@@ -986,7 +986,7 @@ NTSTATUS pdb_lookup_rids(const DOM_SID *domain_sid,
NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid,
int num_names,
const char **names,
- uint32 *rids,
+ uint32_t *rids,
enum lsa_SidType *attrs)
{
struct pdb_methods *pdb = pdb_get_methods();
@@ -1056,12 +1056,12 @@ uint32_t pdb_capabilities(void)
with add RIDs (assigned from previous algorithmic mappings)
********************************************************************/
-bool pdb_new_rid(uint32 *rid)
+bool pdb_new_rid(uint32_t *rid)
{
struct pdb_methods *pdb = pdb_get_methods();
const char *name = NULL;
enum lsa_SidType type;
- uint32 allocated_rid = 0;
+ uint32_t allocated_rid = 0;
int i;
TALLOC_CTX *ctx;
@@ -1243,7 +1243,7 @@ static bool pdb_default_sid_to_id(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx;
bool ret = False;
const char *name;
- uint32 rid;
+ uint32_t rid;
mem_ctx = talloc_new(NULL);
@@ -1368,7 +1368,7 @@ static bool get_memberuids(TALLOC_CTX *mem_ctx, gid_t gid, uid_t **pp_uids, size
static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
const DOM_SID *group,
- uint32 **pp_member_rids,
+ uint32_t **pp_member_rids,
size_t *p_num_members)
{
gid_t gid;
@@ -1387,7 +1387,7 @@ static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods,
if (num_uids == 0)
return NT_STATUS_OK;
- *pp_member_rids = TALLOC_ZERO_ARRAY(mem_ctx, uint32, num_uids);
+ *pp_member_rids = TALLOC_ZERO_ARRAY(mem_ctx, uint32_t, num_uids);
for (i=0; i<num_uids; i++) {
DOM_SID sid;
@@ -1457,7 +1457,7 @@ static NTSTATUS pdb_default_enum_group_memberships(struct pdb_methods *methods,
Look up a rid in the SAM we're responsible for (i.e. passdb)
********************************************************************/
-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,
union unid_t *unix_id)
@@ -1549,7 +1549,7 @@ static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid,
static NTSTATUS pdb_default_lookup_rids(struct pdb_methods *methods,
const DOM_SID *domain_sid,
int num_rids,
- uint32 *rids,
+ uint32_t *rids,
const char **names,
enum lsa_SidType *attrs)
{
@@ -1614,7 +1614,7 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods,
const DOM_SID *domain_sid,
int num_names,
const char **names,
- uint32 *rids,
+ uint32_t *rids,
enum lsa_SidType *attrs)
{
int i;
@@ -1625,7 +1625,7 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods,
if (sid_check_is_builtin(domain_sid)) {
for (i=0; i<num_names; i++) {
- uint32 rid;
+ uint32_t rid;
if (lookup_builtin_name(names[i], &rid)) {
attrs[i] = SID_NAME_ALIAS;
@@ -1703,8 +1703,8 @@ struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx,
return result;
}
-static void fill_displayentry(TALLOC_CTX *mem_ctx, uint32 rid,
- uint16 acct_flags,
+static void fill_displayentry(TALLOC_CTX *mem_ctx, uint32_t rid,
+ uint16_t acct_flags,
const char *account_name,
const char *fullname,
const char *description,
@@ -1738,7 +1738,7 @@ static bool next_entry_groups(struct pdb_search *s,
struct samr_displayentry *entry)
{
struct group_search *state = (struct group_search *)s->private_data;
- uint32 rid;
+ uint32_t rid;
GROUP_MAP *map = &state->groups[state->current_group];
if (state->current_group == state->num_groups)
@@ -1798,7 +1798,7 @@ static bool pdb_default_search_aliases(struct pdb_methods *methods,
}
static struct samr_displayentry *pdb_search_getentry(struct pdb_search *search,
- uint32 idx)
+ uint32_t idx)
{
if (idx < search->num_entries)
return &search->cache[idx];
@@ -1823,7 +1823,7 @@ static struct samr_displayentry *pdb_search_getentry(struct pdb_search *search,
return (search->num_entries > idx) ? &search->cache[idx] : NULL;
}
-struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32 acct_flags)
+struct pdb_search *pdb_search_users(TALLOC_CTX *mem_ctx, uint32_t acct_flags)
{
struct pdb_methods *pdb = pdb_get_methods();
struct pdb_search *result;
@@ -1876,12 +1876,12 @@ struct pdb_search *pdb_search_aliases(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
return result;
}
-uint32 pdb_search_entries(struct pdb_search *search,
- uint32 start_idx, uint32 max_entries,
+uint32_t pdb_search_entries(struct pdb_search *search,
+ uint32_t start_idx, uint32_t max_entries,
struct samr_displayentry **result)
{
struct samr_displayentry *end_entry;
- uint32 end_idx = start_idx+max_entries-1;
+ uint32_t end_idx = start_idx+max_entries-1;
/* The first entry needs to be searched after the last. Otherwise the
* first entry might have moved due to a realloc during the search for
@@ -1924,7 +1924,7 @@ bool pdb_del_trusteddom_pw(const char *domain)
return pdb->del_trusteddom_pw(pdb, domain);
}
-NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32 *num_domains,
+NTSTATUS pdb_enum_trusteddoms(TALLOC_CTX *mem_ctx, uint32_t *num_domains,
struct trustdom_info ***domains)
{
struct pdb_methods *pdb = pdb_get_methods();
@@ -1964,7 +1964,7 @@ static bool pdb_default_del_trusteddom_pw(struct pdb_methods *methods,
static NTSTATUS pdb_default_enum_trusteddoms(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- uint32 *num_domains,
+ uint32_t *num_domains,
struct trustdom_info ***domains)
{
return secrets_trusted_domains(mem_ctx, num_domains, domains);
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index e3bd72a629..32eacd1bc8 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -376,7 +376,7 @@ int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state,
******************************************************************/
static int ldapsam_search_suffix_by_rid (struct ldapsam_privates *ldap_state,
- uint32 rid, LDAPMessage ** result,
+ uint32_t rid, LDAPMessage ** result,
const char **attr)
{
char *filter = NULL;
@@ -529,19 +529,19 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
*acct_desc = NULL,
*workstations = NULL,
*munged_dial = NULL;
- uint32 user_rid;
+ uint32_t user_rid;
uint8 smblmpwd[LM_HASH_LEN],
smbntpwd[NT_HASH_LEN];
bool use_samba_attrs = True;
- uint32 acct_ctrl = 0;
- uint16 logon_divs;
- uint16 bad_password_count = 0,
+ uint32_t acct_ctrl = 0;
+ uint16_t logon_divs;
+ uint16_t bad_password_count = 0,
logon_count = 0;
- uint32 hours_len;
+ uint32_t hours_len;
uint8 hours[MAX_HOURS_LEN];
char *temp = NULL;
struct login_cache cache_entry;
- uint32 pwHistLen;
+ uint32_t pwHistLen;
bool expand_explicit = lp_passdb_expand_explicit();
bool ret = false;
TALLOC_CTX *ctx = talloc_init("init_sam_from_ldap");
@@ -604,7 +604,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
get_userattr_key2string(ldap_state->schema_ver,
LDAP_ATTR_USER_RID),
ctx))!=NULL) {
- user_rid = (uint32)atol(temp);
+ user_rid = (uint32_t)atol(temp);
pdb_set_user_sid_from_rid(sampass, user_rid, PDB_SET);
}
}
@@ -985,7 +985,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
LDAP_ATTR_BAD_PASSWORD_COUNT),
ctx);
if (temp) {
- bad_password_count = (uint32) atol(temp);
+ bad_password_count = (uint32_t) atol(temp);
pdb_set_bad_password_count(sampass,
bad_password_count, PDB_SET);
}
@@ -1009,7 +1009,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
LDAP_ATTR_LOGON_COUNT),
ctx);
if (temp) {
- logon_count = (uint32) atol(temp);
+ logon_count = (uint32_t) atol(temp);
pdb_set_logon_count(sampass, logon_count, PDB_SET);
}
@@ -1172,7 +1172,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
enum pdb_elements))
{
char *temp = NULL;
- uint32 rid;
+ uint32_t rid;
if (mods == NULL || sampass == NULL) {
DEBUG(0, ("init_ldap_from_sam: NULL parameters found!\n"));
@@ -1396,7 +1396,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
if (need_update(sampass, PDB_PWHISTORY)) {
char *pwstr = NULL;
- uint32 pwHistLen = 0;
+ uint32_t pwHistLen = 0;
pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &pwHistLen);
pwstr = SMB_MALLOC_ARRAY(char, 1024);
@@ -1409,7 +1409,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
pwstr[64] = '\0';
} else {
int i;
- uint32 currHistLen = 0;
+ uint32_t currHistLen = 0;
const uint8 *pwhist = pdb_get_pw_history(sampass, &currHistLen);
if (pwhist != NULL) {
/* We can only store (1024-1/64 password history entries. */
@@ -1471,9 +1471,9 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
if (need_update(sampass, PDB_BAD_PASSWORD_COUNT)) /* &&
need_update(sampass, PDB_BAD_PASSWORD_TIME)) */ {
- uint16 badcount = pdb_get_bad_password_count(sampass);
+ uint16_t badcount = pdb_get_bad_password_count(sampass);
time_t badtime = pdb_get_bad_password_time(sampass);
- uint32 pol;
+ uint32_t pol;
pdb_get_account_policy(PDB_POLICY_BAD_ATTEMPT_LOCKOUT, &pol);
DEBUG(3, ("updating bad password fields, policy=%u, count=%u, time=%u\n",
@@ -1628,7 +1628,7 @@ static int ldapsam_get_ldap_user_by_sid(struct ldapsam_privates *ldap_state,
{
int rc = -1;
const char ** attr_list;
- uint32 rid;
+ uint32_t rid;
switch ( ldap_state->schema_ver ) {
case SCHEMAVER_SAMBASAMACCOUNT: {
@@ -2068,8 +2068,8 @@ static NTSTATUS ldapsam_update_sam_account(struct pdb_methods *my_methods, struc
static NTSTATUS ldapsam_del_groupmem(struct pdb_methods *my_methods,
TALLOC_CTX *tmp_ctx,
- uint32 group_rid,
- uint32 member_rid);
+ uint32_t group_rid,
+ uint32_t member_rid);
static NTSTATUS ldapsam_enum_group_memberships(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
@@ -2175,7 +2175,7 @@ static NTSTATUS ldapsam_add_sam_account(struct pdb_methods *my_methods, struct s
LDAPMessage *entry = NULL;
LDAPMod **mods = NULL;
int ldap_op = LDAP_MOD_REPLACE;
- uint32 num_result;
+ uint32_t num_result;
const char **attr_list;
char *escape_user = NULL;
const char *username = pdb_get_username(newpwd);
@@ -2663,7 +2663,7 @@ static NTSTATUS ldapsam_getgrnam(struct pdb_methods *methods, GROUP_MAP *map,
static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct,
LDAPMessage *entry,
const DOM_SID *domain_sid,
- uint32 *rid)
+ uint32_t *rid)
{
fstring str;
DOM_SID sid;
@@ -2696,7 +2696,7 @@ static bool ldapsam_extract_rid_from_entry(LDAP *ldap_struct,
static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
const DOM_SID *group,
- uint32 **pp_member_rids,
+ uint32_t **pp_member_rids,
size_t *p_num_members)
{
struct ldapsam_privates *ldap_state =
@@ -2814,7 +2814,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods,
{
char *sidstr;
DOM_SID sid;
- uint32 rid;
+ uint32_t rid;
sidstr = smbldap_talloc_single_attribute(conn->ldap_struct,
entry, "sambaSID",
@@ -2865,7 +2865,7 @@ static NTSTATUS ldapsam_enum_group_members(struct pdb_methods *methods,
entry != NULL;
entry = ldap_next_entry(conn->ldap_struct, entry))
{
- uint32 rid;
+ uint32_t rid;
if (!ldapsam_extract_rid_from_entry(conn->ldap_struct,
entry,
@@ -3791,7 +3791,7 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods,
const DOM_SID *domain_sid,
const DOM_SID *members,
size_t num_members,
- uint32 **pp_alias_rids,
+ uint32_t **pp_alias_rids,
size_t *p_num_alias_rids)
{
struct ldapsam_privates *ldap_state =
@@ -3870,7 +3870,7 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods,
{
fstring sid_str;
DOM_SID sid;
- uint32 rid;
+ uint32_t rid;
if (!smbldap_get_single_attribute(ldap_struct, entry,
LDAP_ATTRIBUTE_SID,
@@ -3907,7 +3907,7 @@ static NTSTATUS ldapsam_alias_memberships(struct pdb_methods *methods,
static NTSTATUS ldapsam_set_account_policy_in_ldap(struct pdb_methods *methods,
enum pdb_policy_type type,
- uint32 value)
+ uint32_t value)
{
NTSTATUS ntstatus = NT_STATUS_UNSUCCESSFUL;
int rc;
@@ -3963,7 +3963,7 @@ static NTSTATUS ldapsam_set_account_policy(struct pdb_methods *methods,
static NTSTATUS ldapsam_get_account_policy_from_ldap(struct pdb_methods *methods,
enum pdb_policy_type type,
- uint32 *value)
+ uint32_t *value)
{
NTSTATUS ntstatus = NT_STATUS_UNSUCCESSFUL;
LDAPMessage *result = NULL;
@@ -4022,7 +4022,7 @@ static NTSTATUS ldapsam_get_account_policy_from_ldap(struct pdb_methods *methods
goto out;
}
- *value = (uint32)atol(vals[0]);
+ *value = (uint32_t)atol(vals[0]);
ntstatus = NT_STATUS_OK;
@@ -4100,7 +4100,7 @@ static NTSTATUS ldapsam_get_account_policy(struct pdb_methods *methods,
static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
const DOM_SID *domain_sid,
int num_rids,
- uint32 *rids,
+ uint32_t *rids,
const char **names,
enum lsa_SidType *attrs)
{
@@ -4181,7 +4181,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
for (entry = ldap_first_entry(ld, msg);
entry != NULL;
entry = ldap_next_entry(ld, entry)) {
- uint32 rid;
+ uint32_t rid;
int rid_index;
const char *name;
@@ -4255,7 +4255,7 @@ static NTSTATUS ldapsam_lookup_rids(struct pdb_methods *methods,
entry != NULL;
entry = ldap_next_entry(ld, entry))
{
- uint32 rid;
+ uint32_t rid;
int rid_index;
const char *attr;
enum lsa_SidType type;
@@ -4379,8 +4379,8 @@ const char **talloc_attrs(TALLOC_CTX *mem_ctx, ...)
struct ldap_search_state {
struct smbldap_state *connection;
- uint32 acct_flags;
- uint16 group_type;
+ uint32_t acct_flags;
+ uint16_t group_type;
const char *base;
int scope;
@@ -4558,7 +4558,7 @@ static bool ldapuser2displayentry(struct ldap_search_state *state,
char **vals;
size_t converted_size;
DOM_SID sid;
- uint32 acct_flags;
+ uint32_t acct_flags;
vals = ldap_get_values(ld, entry, "sambaAcctFlags");
if ((vals == NULL) || (vals[0] == NULL)) {
@@ -4650,7 +4650,7 @@ static bool ldapuser2displayentry(struct ldap_search_state *state,
static bool ldapsam_search_users(struct pdb_methods *methods,
struct pdb_search *search,
- uint32 acct_flags)
+ uint32_t acct_flags)
{
struct ldapsam_privates *ldap_state =
(struct ldapsam_privates *)methods->private_data;
@@ -4704,7 +4704,7 @@ static bool ldapgroup2displayentry(struct ldap_search_state *state,
char **vals;
size_t converted_size;
DOM_SID sid;
- uint16 group_type;
+ uint16_t group_type;
result->account_name = "";
result->fullname = "";
@@ -4885,7 +4885,7 @@ static uint32_t ldapsam_capabilities(struct pdb_methods *methods)
}
static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
- uint32 *rid)
+ uint32_t *rid)
{
struct smbldap_state *smbldap_state = priv->smbldap_state;
@@ -4895,7 +4895,7 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
NTSTATUS status;
char *value;
int rc;
- uint32 nextRid = 0;
+ uint32_t nextRid = 0;
const char *dn;
TALLOC_CTX *mem_ctx;
@@ -4932,21 +4932,21 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
value = smbldap_talloc_single_attribute(priv2ld(priv), entry,
"sambaNextRid", mem_ctx);
if (value != NULL) {
- uint32 tmp = (uint32)strtoul(value, NULL, 10);
+ uint32_t tmp = (uint32_t)strtoul(value, NULL, 10);
nextRid = MAX(nextRid, tmp);
}
value = smbldap_talloc_single_attribute(priv2ld(priv), entry,
"sambaNextUserRid", mem_ctx);
if (value != NULL) {
- uint32 tmp = (uint32)strtoul(value, NULL, 10);
+ uint32_t tmp = (uint32_t)strtoul(value, NULL, 10);
nextRid = MAX(nextRid, tmp);
}
value = smbldap_talloc_single_attribute(priv2ld(priv), entry,
"sambaNextGroupRid", mem_ctx);
if (value != NULL) {
- uint32 tmp = (uint32)strtoul(value, NULL, 10);
+ uint32_t tmp = (uint32_t)strtoul(value, NULL, 10);
nextRid = MAX(nextRid, tmp);
}
@@ -4981,7 +4981,7 @@ static NTSTATUS ldapsam_get_new_rid(struct ldapsam_privates *priv,
return status;
}
-static NTSTATUS ldapsam_new_rid_internal(struct pdb_methods *methods, uint32 *rid)
+static NTSTATUS ldapsam_new_rid_internal(struct pdb_methods *methods, uint32_t *rid)
{
int i;
@@ -5003,7 +5003,7 @@ static NTSTATUS ldapsam_new_rid_internal(struct pdb_methods *methods, uint32 *ri
return NT_STATUS_ACCESS_DENIED;
}
-static bool ldapsam_new_rid(struct pdb_methods *methods, uint32 *rid)
+static bool ldapsam_new_rid(struct pdb_methods *methods, uint32_t *rid)
{
NTSTATUS result = ldapsam_new_rid_internal(methods, rid);
return NT_STATUS_IS_OK(result) ? True : False;
@@ -5261,12 +5261,12 @@ static bool ldapsam_gid_to_sid(struct pdb_methods *methods, gid_t gid,
static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods,
TALLOC_CTX *tmp_ctx, const char *name,
- uint32 acb_info, uint32 *rid)
+ uint32_t acb_info, uint32_t *rid)
{
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
LDAPMessage *entry = NULL;
LDAPMessage *result = NULL;
- uint32 num_result;
+ uint32_t num_result;
bool is_machine = False;
bool add_posix = False;
LDAPMod **mods = NULL;
@@ -5583,13 +5583,13 @@ static NTSTATUS ldapsam_delete_user(struct pdb_methods *my_methods, TALLOC_CTX *
static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods,
TALLOC_CTX *tmp_ctx,
const char *name,
- uint32 *rid)
+ uint32_t *rid)
{
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
NTSTATUS ret;
LDAPMessage *entry = NULL;
LDAPMessage *result = NULL;
- uint32 num_result;
+ uint32_t num_result;
bool is_new_entry = False;
LDAPMod **mods = NULL;
char *filter;
@@ -5735,7 +5735,7 @@ static NTSTATUS ldapsam_create_dom_group(struct pdb_methods *my_methods,
return NT_STATUS_OK;
}
-static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, uint32 rid)
+static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_CTX *tmp_ctx, uint32_t rid)
{
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
LDAPMessage *result = NULL;
@@ -5831,14 +5831,14 @@ static NTSTATUS ldapsam_delete_dom_group(struct pdb_methods *my_methods, TALLOC_
static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods,
TALLOC_CTX *tmp_ctx,
- uint32 group_rid,
- uint32 member_rid,
+ uint32_t group_rid,
+ uint32_t member_rid,
int modop)
{
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
LDAPMessage *entry = NULL;
LDAPMessage *result = NULL;
- uint32 num_result;
+ uint32_t num_result;
LDAPMod **mods = NULL;
char *filter;
char *uidstr;
@@ -5993,15 +5993,15 @@ static NTSTATUS ldapsam_change_groupmem(struct pdb_methods *my_methods,
static NTSTATUS ldapsam_add_groupmem(struct pdb_methods *my_methods,
TALLOC_CTX *tmp_ctx,
- uint32 group_rid,
- uint32 member_rid)
+ uint32_t group_rid,
+ uint32_t member_rid)
{
return ldapsam_change_groupmem(my_methods, tmp_ctx, group_rid, member_rid, LDAP_MOD_ADD);
}
static NTSTATUS ldapsam_del_groupmem(struct pdb_methods *my_methods,
TALLOC_CTX *tmp_ctx,
- uint32 group_rid,
- uint32 member_rid)
+ uint32_t group_rid,
+ uint32_t member_rid)
{
return ldapsam_change_groupmem(my_methods, tmp_ctx, group_rid, member_rid, LDAP_MOD_DELETE);
}
@@ -6013,7 +6013,7 @@ static NTSTATUS ldapsam_set_primary_group(struct pdb_methods *my_methods,
struct ldapsam_privates *ldap_state = (struct ldapsam_privates *)my_methods->private_data;
LDAPMessage *entry = NULL;
LDAPMessage *result = NULL;
- uint32 num_result;
+ uint32_t num_result;
LDAPMod **mods = NULL;
char *filter;
char *escape_username;
@@ -6128,7 +6128,7 @@ static bool get_trusteddom_pw_int(struct ldapsam_privates *ldap_state,
int attrsonly = 0; /* 0: return values too */
LDAPMessage *result = NULL;
char *trusted_dn;
- uint32 num_result;
+ uint32_t num_result;
filter = talloc_asprintf(talloc_tos(),
"(&(objectClass=%s)(sambaDomainName=%s))",
@@ -6339,7 +6339,7 @@ static bool ldapsam_del_trusteddom_pw(struct pdb_methods *methods,
static NTSTATUS ldapsam_enum_trusteddoms(struct pdb_methods *methods,
TALLOC_CTX *mem_ctx,
- uint32 *num_domains,
+ uint32_t *num_domains,
struct trustdom_info ***domains)
{
int rc;
@@ -6556,7 +6556,7 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location)
{
NTSTATUS nt_status;
struct ldapsam_privates *ldap_state = NULL;
- uint32 alg_rid_base;
+ uint32_t alg_rid_base;
char *alg_rid_base_string = NULL;
LDAPMessage *result = NULL;
LDAPMessage *entry = NULL;
@@ -6688,7 +6688,7 @@ NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location)
LDAP_ATTR_ALGORITHMIC_RID_BASE ),
talloc_tos());
if (alg_rid_base_string) {
- alg_rid_base = (uint32)atol(alg_rid_base_string);
+ alg_rid_base = (uint32_t)atol(alg_rid_base_string);
if (alg_rid_base != algorithmic_rid_base()) {
DEBUG(0, ("The value of 'algorithmic RID base' has "
"changed since the LDAP\n"
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c
index 17c7f333d2..78bd0e7561 100644
--- a/source3/passdb/pdb_smbpasswd.c
+++ b/source3/passdb/pdb_smbpasswd.c
@@ -39,7 +39,7 @@ struct smb_passwd
const unsigned char *smb_passwd; /* Null if no password */
const unsigned char *smb_nt_passwd; /* Null if no password */
- uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */
+ uint16_t acct_ctrl; /* account info (ACB_xxxx bit-mask) */
time_t pass_last_set_time; /* password last set time */
};
@@ -614,7 +614,7 @@ static char *format_new_smbpasswd_entry(const struct smb_passwd *newpwd)
/* Add the account encoding and the last change time. */
slprintf((char *)p, new_entry_length - 1 - (p - new_entry), "%s:LCT-%08X:\n",
pdb_encode_acct_ctrl(newpwd->acct_ctrl, NEW_PW_FORMAT_SPACE_PADDED_LEN),
- (uint32)newpwd->pass_last_set_time);
+ (uint32_t)newpwd->pass_last_set_time);
return new_entry;
}
@@ -1003,7 +1003,7 @@ This is no longer supported.!\n", pwd->smb_name));
slprintf(&ascii_p16[strlen(ascii_p16)],
sizeof(ascii_p16)-(strlen(ascii_p16)+1),
"%s:LCT-%08X:",
- encode_bits, (uint32)pwd->pass_last_set_time );
+ encode_bits, (uint32_t)pwd->pass_last_set_time );
wr_len = strlen(ascii_p16);
}
@@ -1185,7 +1185,7 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno)));
static bool build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampass)
{
- uint32 rid;
+ uint32_t rid;
if (sampass == NULL)
return False;
@@ -1323,7 +1323,7 @@ static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, struct sam
struct smbpasswd_privates *smbpasswd_state = (struct smbpasswd_privates*)my_methods->private_data;
struct smb_passwd *smb_pw;
FILE *fp = NULL;
- uint32 rid;
+ uint32_t rid;
DEBUG(10, ("smbpasswd_getsampwrid: search by sid: %s\n",
sid_string_dbg(sid)));