s3: smbd/nmbd/winbindd - fix append on trailing slash on system paths.
authorJeremy Allison <jra@samba.org>
Fri, 4 Apr 2014 23:47:32 +0000 (16:47 -0700)
committerVolker Lendecke <vl@samba.org>
Sat, 5 Apr 2014 11:40:29 +0000 (13:40 +0200)
The xx_path() function incorrectly uses talloc_asprintf_append()
instead of talloc_asprintf() on a path that may have been modified
by the trim_string() call previously. talloc_asprintf_append()
always sticks the new text at the *end* of the allocated buffer,
not at the end of the string.

Fix bug #10538 - Daemons crashing when lock/state/cache directory parameter has a trailing slash

https://bugzilla.samba.org/show_bug.cgi?id=10538

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sat Apr  5 13:40:30 CEST 2014 on sn-devel-104

source3/lib/util.c

index 07daad2894b6bd0bf41015b5b7b95b2d8b9613ac..374bc5d5c9206bcda994e4d657bed6614de46826 100644 (file)
@@ -1504,7 +1504,7 @@ static char *xx_path(const char *name, const char *rootpath)
                }
        }
 
-       return talloc_asprintf_append_buffer(fname, "/%s", name);
+       return talloc_asprintf_append(fname, "/%s", name);
 }
 
 /**