/* Test if machine password has expired and needs to be changed */
if (lp_machine_password_timeout()) {
- if (time(NULL) > (last_change_time +
+ if (last_change_time > 0 &&
+ time(NULL) > (last_change_time +
lp_machine_password_timeout())) {
global_machine_password_needs_changing = True;
}
void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token)
{
fstring sid_str;
- int i;
+ size_t i;
if (!token) {
DEBUGC(dbg_class, dbg_lev, ("NT user token: (NULL)\n"));
sid_ndx = 5; /* next available spot */
for (i = 0; i < n_groupSIDs; i++) {
- int check_sid_idx;
+ size_t check_sid_idx;
for (check_sid_idx = 1; check_sid_idx < ptoken->num_sids; check_sid_idx++) {
if (sid_equal(&ptoken->user_sids[check_sid_idx],
&groupSIDs[i])) {
}
if (sys_getgrouplist(usr->pw_name, usr->pw_gid, *unix_groups, &n_unix_groups) == -1) {
- *unix_groups = Realloc(unix_groups, sizeof(gid_t) * n_unix_groups);
+ *unix_groups = Realloc(*unix_groups, sizeof(gid_t) * n_unix_groups);
if (sys_getgrouplist(usr->pw_name, usr->pw_gid, *unix_groups, &n_unix_groups) == -1) {
DEBUG(0, ("get_user_groups_from_local_sam: failed to get the unix group list\n"));
SAFE_FREE(*unix_groups);
NT_USER_TOKEN *token;
DOM_SID *all_group_SIDs;
- int i;
+ size_t i;
/*
Here is where we should check the list of
DEBUG(4,("Using ADS machine password\n"));
E_md4hash(plaintext, ret_pwd);
SAFE_FREE(plaintext);
+ pass_last_set_time = 0;
return True;
}