summaryrefslogtreecommitdiffstats
path: root/source3/passdb/smbpassfile.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-10-15 23:51:07 +0000
committerLuke Leighton <lkcl@samba.org>1998-10-15 23:51:07 +0000
commitc404bb775414139a4b07a73f79cf069a083acb26 (patch)
tree259eeef5e467083c0b7b29bec846bab90c522bf7 /source3/passdb/smbpassfile.c
parent0d5ff90bffe1a5d2bf03412ef0bd12996cbc2f09 (diff)
downloadsamba-c404bb775414139a4b07a73f79cf069a083acb26.tar.gz
samba-c404bb775414139a4b07a73f79cf069a083acb26.tar.xz
samba-c404bb775414139a4b07a73f79cf069a083acb26.zip
rpcclient interactive login (with trust account changing if you are root)
cli_session_setup handles null sessions correctly (This used to be commit 60c0f22a4e84703467006dfe1971384a6294a9aa)
Diffstat (limited to 'source3/passdb/smbpassfile.c')
-rw-r--r--source3/passdb/smbpassfile.c36
1 files changed, 36 insertions, 0 deletions
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;
+}