summaryrefslogtreecommitdiffstats
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/smbpass.c4
-rw-r--r--source3/passdb/smbpassfile.c36
2 files changed, 38 insertions, 2 deletions
diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c
index eefc30382b7..bde696290d2 100644
--- a/source3/passdb/smbpass.c
+++ b/source3/passdb/smbpass.c
@@ -330,8 +330,8 @@ static struct sam_passwd *getsmbfile21pwent(void *vp)
pwfile = getpwnam(pw_buf->smb_name);
if (pwfile == NULL)
{
- DEBUG(0,"getsmbfile21pwent: smbpasswd database is corrupt!\n"));
- DEBUG(0,"getsmbfile21pwent: username %s not in unix passwd database!\n", pw_buf->smb_name));
+ DEBUG(0,("getsmbfile21pwent: smbpasswd database is corrupt!\n"));
+ DEBUG(0,("getsmbfile21pwent: username %s not in unix passwd database!\n", pw_buf->smb_name));
return NULL;
}
diff --git a/source3/passdb/smbpassfile.c b/source3/passdb/smbpassfile.c
index 8542ad081d2..13a1a9f5089 100644
--- a/source3/passdb/smbpassfile.c
+++ b/source3/passdb/smbpassfile.c
@@ -24,6 +24,8 @@ extern int DEBUGLEVEL;
static int gotalarm;
int pw_file_lock_depth = 0;
+BOOL global_machine_password_needs_changing = False;
+
/***************************************************************
Signal function to tell us we timed out.
****************************************************************/
@@ -318,3 +320,37 @@ account is now invalid. Please recreate. Error was %s.\n", strerror(errno) ));
fflush(mach_passwd_fp);
return True;
}
+
+BOOL trust_get_passwd( unsigned char trust_passwd[16], char *myname, char *domain)
+{
+ time_t lct;
+
+ /*
+ * Get the machine account password.
+ */
+ if(!trust_password_lock( myname, domain, False)) {
+ DEBUG(0,("domain_client_validate: unable to open the machine account password file for \
+machine %s in domain %s.\n", myname, domain ));
+ return False;
+ }
+
+ if(get_trust_account_password( trust_passwd, &lct) == False) {
+ DEBUG(0,("domain_client_validate: unable to read the machine account password for \
+machine %s in domain %s.\n", myname, domain ));
+ trust_password_unlock();
+ return False;
+ }
+
+ trust_password_unlock();
+
+ /*
+ * Here we check the last change time to see if the machine
+ * password needs changing. JRA.
+ */
+
+ if(time(NULL) > lct + lp_machine_password_timeout())
+ {
+ global_machine_password_needs_changing = True;
+ }
+ return True;
+}