summaryrefslogtreecommitdiffstats
path: root/source/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-03-13 16:13:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:36 -0500
commitf94e5af72e282f70ca5454cdf3aed510b747eb93 (patch)
tree2d8d5abd3e800d4dfe2f37dbf06c687bd02e81d9 /source/passdb
parent34ae610bd5b9fd1210f16beac07a1c5984144ca7 (diff)
downloadsamba-f94e5af72e282f70ca5454cdf3aed510b747eb93.tar.gz
samba-f94e5af72e282f70ca5454cdf3aed510b747eb93.tar.xz
samba-f94e5af72e282f70ca5454cdf3aed510b747eb93.zip
r21823: Let secrets_store_machine_password() also store the account name. Not used
yet, the next step will be a secrets_fetch_machine_account() function that also pulls the account name to be used in the appropriate places. Volker
Diffstat (limited to 'source/passdb')
-rw-r--r--source/passdb/secrets.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/passdb/secrets.c b/source/passdb/secrets.c
index 15c79745a0e..21a55b09a09 100644
--- a/source/passdb/secrets.c
+++ b/source/passdb/secrets.c
@@ -553,7 +553,10 @@ BOOL secrets_store_trusted_domain_password(const char* domain, const char* pwd,
the password is assumed to be a null terminated ascii string
************************************************************************/
-BOOL secrets_store_machine_password(const char *pass, const char *domain, uint32 sec_channel)
+BOOL secrets_store_machine_password(const char *pass,
+ const char *accountname,
+ const char *domain,
+ uint32 sec_channel)
{
char *key = NULL;
BOOL ret = False;
@@ -581,6 +584,22 @@ BOOL secrets_store_machine_password(const char *pass, const char *domain, uint32
goto fail;
}
+ if (asprintf(&key, "%s/%s", SECRETS_MACHINE_ACCOUNTNAME,
+ domain) == -1) {
+ DEBUG(5, ("asprintf failed\n"));
+ goto fail;
+ }
+ strupper_m(key);
+
+ ret = secrets_store(key, accountname, strlen(accountname)+1);
+ SAFE_FREE(key);
+
+ if (!ret) {
+ DEBUG(5, ("secrets_store failed: %s\n",
+ tdb_errorstr(tdb)));
+ goto fail;
+ }
+
if (asprintf(&key, "%s/%s", SECRETS_MACHINE_LAST_CHANGE_TIME,
domain) == -1) {
DEBUG(5, ("asprintf failed\n"));