Merge indirection, signed/unsigned and uninitialiased-value fixes from HEAD.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 14 Jan 2003 07:26:12 +0000 (07:26 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 14 Jan 2003 07:26:12 +0000 (07:26 +0000)
Andrew Bartlett
(This used to be commit 2a1adb8f81d8966e8919fffb9b4c69f3e6acd44f)

source3/auth/auth_domain.c
source3/auth/auth_util.c
source3/passdb/secrets.c
source3/smbd/notify_kernel.c
source3/smbd/oplock_linux.c

index 79cf5b156d56fecbf8a357c63c1afde243ff86b1..b3f50072bcb6ea965b23a0c78bf073c8b1cd72ec 100644 (file)
@@ -432,7 +432,8 @@ static NTSTATUS check_ntdomain_security(const struct auth_context *auth_context,
 
        /* 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;
                }
index 0a27e6176d0c3666c9e60e89377c401b8c3439c0..5fdfd0694a1610c2f05c283bdfc33cc84663650f 100644 (file)
@@ -475,7 +475,7 @@ BOOL make_user_info_guest(auth_usersupplied_info **user_info)
 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"));
@@ -564,7 +564,7 @@ static NTSTATUS create_nt_user_token(const DOM_SID *user_sid, const DOM_SID *gro
        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])) {
@@ -678,7 +678,7 @@ static NTSTATUS get_user_groups_from_local_sam(const DOM_SID *user_sid,
        }
        
        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);
@@ -867,7 +867,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
        NT_USER_TOKEN *token;
 
        DOM_SID *all_group_SIDs;
-       int i;
+       size_t i;
 
        /* 
           Here is where we should check the list of
index d30b13c3b6efd5d8e18d7caf9e3ea68eec994132..5ba9f1dc1e178d238f0e36c6f2d477a046c4107c 100644 (file)
@@ -240,6 +240,7 @@ BOOL secrets_fetch_trust_account_password(const char *domain, uint8 ret_pwd[16],
                DEBUG(4,("Using ADS machine password\n"));
                E_md4hash(plaintext, ret_pwd);
                SAFE_FREE(plaintext);
+               pass_last_set_time = 0;
                return True;
        }
 
index df553721ef7e7da9184d33afb165e50c9c4d3740..8b7ff21ecb944e6848e677d2c127437fe43e8d4b 100644 (file)
@@ -215,6 +215,8 @@ struct cnotify_fns *kernel_notify_init(void)
        static struct cnotify_fns cnotify;
         struct sigaction act;
 
+       ZERO_STRUCT(act);
+
         act.sa_handler = NULL;
         act.sa_sigaction = signal_handler;
         act.sa_flags = SA_SIGINFO;
index 85f89c12a068e555808f91262e4c66132fc972bd..deed0c51073af1d584a347004445ecb66d464662 100644 (file)
@@ -279,6 +279,8 @@ struct kernel_oplocks *linux_init_kernel_oplocks(void)
                return NULL;
        }
 
+       ZERO_STRUCT(act);
+
        act.sa_handler = NULL;
        act.sa_sigaction = signal_handler;
        act.sa_flags = SA_SIGINFO;