summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-10-03 22:58:37 +0000
committerJeremy Allison <jra@samba.org>2001-10-03 22:58:37 +0000
commit3a17bab00f7ab3a3e506c5a6b10a85a8cb65b0d2 (patch)
tree9bed5116a2e87ee2a6393fabbcb926b5eb908bdf /source3
parenta42efb497153dcca1fad227e28f5eaf41ee943c3 (diff)
downloadsamba-3a17bab00f7ab3a3e506c5a6b10a85a8cb65b0d2.tar.gz
samba-3a17bab00f7ab3a3e506c5a6b10a85a8cb65b0d2.tar.bz2
samba-3a17bab00f7ab3a3e506c5a6b10a85a8cb65b0d2.zip
Ensure accessing NT member servers works with a Samba PDC. Don't
change these timestamp settings without good reason. Remove CLEAR_IF_FIRST flag is tdb is read-only. Jeremy. (This used to be commit a71d9d98b013a6c30fd85524b7cdc929bdbd9bcb)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/passdb.c4
-rw-r--r--source3/passdb/pdb_nisplus.c8
-rw-r--r--source3/passdb/pdb_smbpasswd.c2
-rw-r--r--source3/tdb/tdb.c3
4 files changed, 9 insertions, 8 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 86ee97d281..0e1ebf8a28 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -77,10 +77,10 @@ static BOOL pdb_fill_default_sam(SAM_ACCOUNT *user)
ZERO_STRUCTP(user);
user->logon_time = (time_t)0;
+ user->pass_last_set_time = (time_t)0;
+ user->pass_can_change_time = (time_t)0;
user->logoff_time =
user->kickoff_time =
- user->pass_last_set_time =
- user->pass_can_change_time =
user->pass_must_change_time = get_time_t_max();
user->unknown_3 = 0x00ffffff; /* don't know */
diff --git a/source3/passdb/pdb_nisplus.c b/source3/passdb/pdb_nisplus.c
index b73072015b..af4bf1b823 100644
--- a/source3/passdb/pdb_nisplus.c
+++ b/source3/passdb/pdb_nisplus.c
@@ -209,7 +209,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
* time values. note: this code assumes 32bit time_t!
*/
- pdb_set_logon_time(pw_buf, get_time_t_max());
+ pdb_set_logon_time(pw_buf, (time_t)0);
ptr = (uchar *)ENTRY_VAL(obj, NPF_LOGON_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "LNT-", 4)==0)) {
int i;
@@ -251,7 +251,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
- pdb_set_pass_last_set_time(pw_buf, get_time_t_max());
+ pdb_set_pass_last_set_time(pw_buf, (time_t)0);
ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDLSET_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "LCT-", 4)==0)) {
int i;
@@ -265,7 +265,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
- pdb_set_pass_can_change_time(pw_buf, get_time_t_max());
+ pdb_set_pass_can_change_time(pw_buf, (time_t)0);
ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDCCHG_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "CCT-", 4)==0)) {
int i;
@@ -279,7 +279,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
- pdb_set_pass_must_change_time(pw_buf, get_time_t_max());
+ pdb_set_pass_must_change_time(pw_buf, get_time_t_max()); /* Password never expires. */
ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDMCHG_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "MCT-", 4)==0)) {
int i;
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c
index 7d14d3e0e0..45c983b1ca 100644
--- a/source3/passdb/pdb_smbpasswd.c
+++ b/source3/passdb/pdb_smbpasswd.c
@@ -108,7 +108,7 @@ static void pdb_init_smb(struct smb_passwd *user)
return;
ZERO_STRUCTP (user);
- user->pass_last_set_time = get_time_t_max();
+ user->pass_last_set_time = (time_t)0;
}
/***************************************************************
diff --git a/source3/tdb/tdb.c b/source3/tdb/tdb.c
index b90c307ec6..d0527919bc 100644
--- a/source3/tdb/tdb.c
+++ b/source3/tdb/tdb.c
@@ -1377,8 +1377,9 @@ TDB_CONTEXT *tdb_open(char *name, int hash_size, int tdb_flags,
hash_size = DEFAULT_HASH_SIZE;
if ((open_flags & O_ACCMODE) == O_RDONLY) {
tdb.read_only = 1;
- /* read only databases don't do locking */
+ /* read only databases don't do locking or clear if first */
tdb.flags |= TDB_NOLOCK;
+ tdb.flags &= ~TDB_CLEAR_IF_FIRST;
}
/* internal databases don't mmap or lock, and start off cleared */