summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-10-20 17:36:10 +0200
committerMichael Adam <obnox@samba.org>2011-10-26 02:44:03 +0200
commit4fe5e091e13a450b67759725f41f3b748e235890 (patch)
tree5c68ce0d19976ce5a22b408d6c6da255ee46e1a8
parent91a999270e349b08b848075f07488c6d0962e6e0 (diff)
downloadsamba-4fe5e091e13a450b67759725f41f3b748e235890.tar.gz
samba-4fe5e091e13a450b67759725f41f3b748e235890.tar.xz
samba-4fe5e091e13a450b67759725f41f3b748e235890.zip
s3:net registry check: do not silently replace separators
Signed-off-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/utils/net_registry_check.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 2511f534e6f..0ae2c962d34 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)