Skip to content

Commit

Permalink
Fix MSDFS with POSIX paths in vfs_dfs_samba4
Browse files Browse the repository at this point in the history
Allow for POSIX path separators when parsing a DFS query string

Signed-off-by: Robin McCorkell <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
  • Loading branch information
Robin McCorkell authored and vlendec committed Jul 10, 2015
1 parent a12c2d0 commit aeb4ba1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dfs_server/dfs_server_ad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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++;
Expand Down

0 comments on commit aeb4ba1

Please sign in to comment.