summaryrefslogtreecommitdiff
path: root/source3/passdb/smbpassfile.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-01 19:25:51 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-01 19:25:51 +0000
commit86ac6fa9389532bc0e39b4da2fb73766cf29aeb9 (patch)
tree4b3c8546baa832cc228ad796ab6a10676993b88e /source3/passdb/smbpassfile.c
parentd9cc4c39504534da0f4cd2569c724de4909ebd79 (diff)
downloadsamba-86ac6fa9389532bc0e39b4da2fb73766cf29aeb9.tar.gz
samba-86ac6fa9389532bc0e39b4da2fb73766cf29aeb9.tar.bz2
samba-86ac6fa9389532bc0e39b4da2fb73766cf29aeb9.zip
fixing joining to domain plus something weird going down with nt logins...
(This used to be commit cef258f1c931ecb7c2dda9d5c9977153e4c1dc73)
Diffstat (limited to 'source3/passdb/smbpassfile.c')
-rw-r--r--source3/passdb/smbpassfile.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/source3/passdb/smbpassfile.c b/source3/passdb/smbpassfile.c
index 83b0e7ef6b..d2a7b0bdf9 100644
--- a/source3/passdb/smbpassfile.c
+++ b/source3/passdb/smbpassfile.c
@@ -43,7 +43,7 @@ static void get_trust_account_file_name( char *domain, char *name, char *mac_fil
if ((int)(sizeof(pstring) - mac_file_len - strlen(domain) - strlen(name) - 6) < 0)
{
- DEBUG(0,("trust_password_lock: path %s too long to add trust details.\n",
+ DEBUG(0,("get_trust_account_file_name: path %s too long to add trust details.\n",
mac_file));
return;
}
@@ -268,3 +268,36 @@ trust %s in domain %s.\n", myname, domain ));
}
return True;
}
+
+/*********************************************************
+record Trust Account password.
+**********************************************************/
+BOOL create_trust_account_file(char *domain, char *name, uchar pass[16])
+{
+ /*
+ * Create the machine account password file.
+ */
+
+ if (!trust_password_lock( domain, name, True))
+ {
+ DEBUG(0,("unable to open the trust account password file for \
+account %s in domain %s.\n", name, domain));
+ return False;
+ }
+
+ /*
+ * Write the old machine account password.
+ */
+
+ if (!set_trust_account_password( pass))
+ {
+ DEBUG(0,("unable to write the trust account password for \
+%s in domain %s.\n", name, domain));
+ trust_password_unlock();
+ return False;
+ }
+
+ trust_password_unlock();
+
+ return True;
+}