summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-03-09 11:26:50 +0100
committerVolker Lendecke <vl@samba.org>2008-03-10 09:52:08 +0100
commitb175ffa7024ee6bea89d51a4cfafdff71a63fb7d (patch)
tree8f86dec6ecb0ba5fe4ee2df84f5d91f6605c9791 /source3/passdb
parent2e8d37534679cb80318281346091042cfc271fc9 (diff)
downloadsamba-b175ffa7024ee6bea89d51a4cfafdff71a63fb7d.tar.gz
samba-b175ffa7024ee6bea89d51a4cfafdff71a63fb7d.tar.bz2
samba-b175ffa7024ee6bea89d51a4cfafdff71a63fb7d.zip
Make use of talloc_asprintf_strupper_m in secrets.c
(This used to be commit 3ac4f935c074af768d0b83514f86d010c387817a)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/secrets.c58
1 files changed, 21 insertions, 37 deletions
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index d88c53897d..2ef8f43988 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -155,12 +155,9 @@ static const char *domain_sid_keystr(const char *domain)
{
char *keystr;
- keystr = talloc_asprintf(talloc_tos(), "%s/%s",
- SECRETS_DOMAIN_SID, domain);
+ keystr = talloc_asprintf_strupper_m(talloc_tos(), "%s/%s",
+ SECRETS_DOMAIN_SID, domain);
SMB_ASSERT(keystr != NULL);
-
- strupper_m(keystr);
-
return keystr;
}
@@ -250,12 +247,10 @@ static const char *machine_sec_channel_type_keystr(const char *domain)
{
char *keystr;
- keystr = talloc_asprintf(talloc_tos(), "%s/%s",
- SECRETS_MACHINE_SEC_CHANNEL_TYPE, domain);
+ keystr = talloc_asprintf_strupper_m(talloc_tos(), "%s/%s",
+ SECRETS_MACHINE_SEC_CHANNEL_TYPE,
+ domain);
SMB_ASSERT(keystr != NULL);
-
- strupper_m(keystr);
-
return keystr;
}
@@ -270,12 +265,10 @@ static const char *machine_last_change_time_keystr(const char *domain)
{
char *keystr;
- keystr = talloc_asprintf(talloc_tos(), "%s/%s",
- SECRETS_MACHINE_LAST_CHANGE_TIME, domain);
+ keystr = talloc_asprintf_strupper_m(talloc_tos(), "%s/%s",
+ SECRETS_MACHINE_LAST_CHANGE_TIME,
+ domain);
SMB_ASSERT(keystr != NULL);
-
- strupper_m(keystr);
-
return keystr;
}
@@ -291,12 +284,9 @@ static const char *machine_password_keystr(const char *domain)
{
char *keystr;
- keystr = talloc_asprintf(talloc_tos(), "%s/%s",
- SECRETS_MACHINE_PASSWORD, domain);
+ keystr = talloc_asprintf_strupper_m(talloc_tos(), "%s/%s",
+ SECRETS_MACHINE_PASSWORD, domain);
SMB_ASSERT(keystr != NULL);
-
- strupper_m(keystr);
-
return keystr;
}
@@ -311,12 +301,9 @@ static const char *trust_keystr(const char *domain)
{
char *keystr;
- keystr = talloc_asprintf(talloc_tos(), "%s/%s",
- SECRETS_MACHINE_ACCT_PASS, domain);
+ keystr = talloc_asprintf_strupper_m(talloc_tos(), "%s/%s",
+ SECRETS_MACHINE_ACCT_PASS, domain);
SMB_ASSERT(keystr != NULL);
-
- strupper_m(keystr);
-
return keystr;
}
@@ -331,11 +318,10 @@ static char *trustdom_keystr(const char *domain)
{
char *keystr;
- keystr = talloc_asprintf(talloc_tos(), "%s/%s",
- SECRETS_DOMTRUST_ACCT_PASS, domain);
+ keystr = talloc_asprintf_strupper_m(talloc_tos(), "%s/%s",
+ SECRETS_DOMTRUST_ACCT_PASS,
+ domain);
SMB_ASSERT(keystr != NULL);
- strupper_m(keystr);
-
return keystr;
}
@@ -1211,14 +1197,13 @@ bool secrets_store_schannel_session_info(TALLOC_CTX *mem_ctx,
TDB_CONTEXT *tdb_sc = NULL;
TDB_DATA value;
bool ret;
- char *keystr = talloc_asprintf(mem_ctx, "%s/%s", SECRETS_SCHANNEL_STATE,
- remote_machine);
+ char *keystr = talloc_asprintf_strupper_m(mem_ctx, "%s/%s",
+ SECRETS_SCHANNEL_STATE,
+ remote_machine);
if (!keystr) {
return False;
}
- strupper_m(keystr);
-
/* Work out how large the record is. */
value.dsize = tdb_pack(NULL, 0, "dBBBBBfff",
pdc->sequence,
@@ -1285,8 +1270,9 @@ bool secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx,
uint32 l1, l2, l3, l4, l5;
int ret;
struct dcinfo *pdc = NULL;
- char *keystr = talloc_asprintf(mem_ctx, "%s/%s", SECRETS_SCHANNEL_STATE,
- remote_machine);
+ char *keystr = talloc_asprintf_strupper_m(mem_ctx, "%s/%s",
+ SECRETS_SCHANNEL_STATE,
+ remote_machine);
*ppdc = NULL;
@@ -1294,8 +1280,6 @@ bool secrets_restore_schannel_session_info(TALLOC_CTX *mem_ctx,
return False;
}
- strupper_m(keystr);
-
tdb_sc = open_schannel_session_store(mem_ctx);
if (!tdb_sc) {
TALLOC_FREE(keystr);