From b170ebe08b78c5240266578a19dae424802cda0e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 17 Mar 2010 23:16:53 +0100 Subject: s3-eventlog: fix elog_tdbname(), we were always lower-casing entire lockdir path... Found by RPC-EVENTLOG torture test. Guenther --- source3/lib/eventlog/eventlog.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/lib/eventlog/eventlog.c b/source3/lib/eventlog/eventlog.c index 1c0dba980d..dc14214e36 100644 --- a/source3/lib/eventlog/eventlog.c +++ b/source3/lib/eventlog/eventlog.c @@ -65,14 +65,28 @@ TDB_CONTEXT *elog_init_tdb( char *tdbfilename ) char *elog_tdbname(TALLOC_CTX *ctx, const char *name ) { - char *path = talloc_asprintf(ctx, "%s/%s.tdb", - state_path("eventlog"), - name); + char *path; + char *file; + char *tdbname; + + path = talloc_strdup(ctx, state_path("eventlog")); if (!path) { return NULL; } - strlower_m(path); - return path; + + file = talloc_asprintf_strlower_m(path, "%s.tdb", name); + if (!file) { + talloc_free(path); + return NULL; + } + + tdbname = talloc_asprintf(path, "%s/%s", state_path("eventlog"), file); + if (!tdbname) { + talloc_free(path); + return NULL; + } + + return tdbname; } -- cgit