aboutsummaryrefslogtreecommitdiffstats
path: root/dfs_server
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@karoshi.org.uk>2015-07-09 21:20:12 +0100
committerVolker Lendecke <vl@samba.org>2015-07-10 17:33:22 +0200
commitaeb4ba18012d71de350e99d9636a305f4817689c (patch)
tree8474e54f0ada057194a353b7ae44b671067400c2 /dfs_server
parenta12c2d0762c2a97820131fc74ec0e0f9f2abcc5f (diff)
downloadsamba-aeb4ba18012d71de350e99d9636a305f4817689c.tar.gz
samba-aeb4ba18012d71de350e99d9636a305f4817689c.tar.xz
samba-aeb4ba18012d71de350e99d9636a305f4817689c.zip
Fix MSDFS with POSIX paths in vfs_dfs_samba4
Allow for POSIX path separators when parsing a DFS query string Signed-off-by: Robin McCorkell <rmccorkell@karoshi.org.uk> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'dfs_server')
-rw-r--r--dfs_server/dfs_server_ad.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/dfs_server/dfs_server_ad.c b/dfs_server/dfs_server_ad.c
index 2a1d9ec02e1..cacad0bff17 100644
--- a/dfs_server/dfs_server_ad.c
+++ b/dfs_server/dfs_server_ad.c
@@ -799,6 +799,7 @@ NTSTATUS dfs_server_ad_get_referrals(struct loadparm_context *lp_ctx,
const char *netbios_name;
const char *dns_name;
const char **netbios_aliases;
+ char path_separator;
if (!lpcfg_host_msdfs(lp_ctx)) {
return NT_STATUS_FS_DRIVER_REQUIRED;
@@ -826,16 +827,18 @@ NTSTATUS dfs_server_ad_get_referrals(struct loadparm_context *lp_ctx,
return NT_STATUS_NO_MEMORY;
}
- while(*server_name && *server_name == '\\') {
+ path_separator = (*server_name == '/') ? '/' : '\\';
+
+ while(*server_name && *server_name == path_separator) {
server_name++;
}
- dfs_name = strchr(server_name, '\\');
+ dfs_name = strchr(server_name, path_separator);
if (dfs_name != NULL) {
dfs_name[0] = '\0';
dfs_name++;
- link_path = strchr(dfs_name, '\\');
+ link_path = strchr(dfs_name, path_separator);
if (link_path != NULL) {
link_path[0] = '\0';
link_path++;