From 4fe5e091e13a450b67759725f41f3b748e235890 Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Thu, 20 Oct 2011 17:36:10 +0200 Subject: s3:net registry check: do not silently replace separators Signed-off-by: Michael Adam --- source3/utils/net_registry_check.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/utils/net_registry_check.c') diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c index 2511f534e6..0ae2c962d3 100644 --- a/source3/utils/net_registry_check.c +++ b/source3/utils/net_registry_check.c @@ -709,13 +709,14 @@ static bool normalize_path_internal(char* path, char sep) { static bool normalize_path(char* path, char sep) { static const char* SEPS = "\\/"; char* firstsep = strpbrk(path, SEPS); + bool wrong_sep = (firstsep && (*firstsep != sep)); assert (strchr(SEPS, sep)); - if (firstsep && (*firstsep != sep)) { + if (wrong_sep) { string_replace(path, *firstsep, sep); } - return normalize_path_internal(path, sep); + return normalize_path_internal(path, sep) || wrong_sep; } static int check_tdb_action(struct db_record *rec, void *check_ctx) -- cgit