1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Make use of talloc_asprintf_strupper_m in secrets.c

This commit is contained in:
Volker Lendecke 2008-03-09 11:26:50 +01:00
parent 8725dbc888
commit 3ac4f935c0

View File

@ -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);