summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-17 23:16:53 +0100
committerGünther Deschner <gd@samba.org>2010-03-17 23:57:30 +0100
commitb170ebe08b78c5240266578a19dae424802cda0e (patch)
tree64c3c50ec53254de2625f3ccb3504ef811c0fc83 /source3/lib
parent3bc18d9f67feea901cc9f8e254bf23429b03a4e7 (diff)
downloadsamba-b170ebe08b78c5240266578a19dae424802cda0e.tar.gz
samba-b170ebe08b78c5240266578a19dae424802cda0e.tar.bz2
samba-b170ebe08b78c5240266578a19dae424802cda0e.zip
s3-eventlog: fix elog_tdbname(), we were always lower-casing entire lockdir path...
Found by RPC-EVENTLOG torture test. Guenther
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/eventlog/eventlog.c24
1 files changed, 19 insertions, 5 deletions
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;
}