From 49839f356f493d0de1b719c8c3bfdee4713c0728 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 26 Sep 2005 16:57:08 +0000 Subject: r10513: Reduce some use of pstring. The main reason some parts of the code still use pstring is next_token() now. (This used to be commit a5b88bcd420eb7ae42283293541519e142be36e3) --- source4/passdb/secrets.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/passdb') diff --git a/source4/passdb/secrets.c b/source4/passdb/secrets.c index 13f82f61fd..9ebc836acf 100644 --- a/source4/passdb/secrets.c +++ b/source4/passdb/secrets.c @@ -26,7 +26,6 @@ #include "lib/tdb/include/tdbutil.h" #include "secrets.h" #include "system/filesys.h" -#include "pstring.h" #include "db_wrap.h" #include "lib/ldb/include/ldb.h" @@ -57,21 +56,22 @@ void secrets_shutdown(void) /* open up the secrets database */ BOOL secrets_init(void) { - pstring fname; + char *fname; uint8_t dummy; if (tdb) return True; - pstrcpy(fname, lp_private_dir()); - pstrcat(fname,"/secrets.tdb"); + asprintf(&fname, "%s/secrets.tdb", lp_private_dir()); tdb = tdb_wrap_open(talloc_autofree_context(), fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!tdb) { DEBUG(0,("Failed to open %s\n", fname)); + SAFE_FREE(fname); return False; } + SAFE_FREE(fname); /** * Set a reseed function for the crypto random generator @@ -96,7 +96,7 @@ static void *secrets_fetch(const char *key, size_t *size) secrets_init(); if (!tdb) return NULL; - kbuf.dptr = strdup(key); + kbuf.dptr = (uint8_t *)strdup(key); kbuf.dsize = strlen(key); dbuf = tdb_fetch(tdb->tdb, kbuf); if (size) -- cgit