summaryrefslogtreecommitdiffstats
path: root/source3/smbd/msdfs.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-24 12:13:07 -0700
committerTim Prouty <tprouty@samba.org>2009-07-24 15:10:45 -0700
commit10324b177ed2c5de07039f035905b8272f51fbf7 (patch)
tree9be44fc8c61bb0dbf4e3453efaaf0b6212b8e15b /source3/smbd/msdfs.c
parentc472bca42c587d46bd9d11a1c02fe53808cee08e (diff)
downloadsamba-10324b177ed2c5de07039f035905b8272f51fbf7.tar.gz
samba-10324b177ed2c5de07039f035905b8272f51fbf7.tar.xz
samba-10324b177ed2c5de07039f035905b8272f51fbf7.zip
s3: Allow filename_convert() to pass through unix_convert_flags and let the caller know if the path has a wildcard
This also eliminates the need for resolve_dfspath().
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r--source3/smbd/msdfs.c45
1 files changed, 10 insertions, 35 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 2b63eb17432..3641e8d4cc6 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -1718,40 +1718,9 @@ struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, size_t *p_num_jn)
}
/******************************************************************************
- Core function to resolve a dfs pathname.
-******************************************************************************/
-
-NTSTATUS resolve_dfspath(TALLOC_CTX *ctx,
- connection_struct *conn,
- bool dfs_pathnames,
- const char *name_in,
- char **pp_name_out)
-{
- NTSTATUS status = NT_STATUS_OK;
- bool dummy;
- if (dfs_pathnames) {
- status = dfs_redirect(ctx,
- conn,
- name_in,
- False,
- pp_name_out,
- &dummy);
- } else {
- /*
- * Cheat and just return a copy of the in ptr.
- * Once srvstr_get_path() uses talloc it'll
- * be a talloced ptr anyway.
- */
- *pp_name_out = CONST_DISCARD(char *,name_in);
- }
- return status;
-}
-
-/******************************************************************************
- Core function to resolve a dfs pathname possibly containing a wildcard.
- This function is identical to the above except for the bool param to
- dfs_redirect but I need this to be separate so it's really clear when
- we're allowing wildcards and when we're not. JRA.
+ Core function to resolve a dfs pathname possibly containing a wildcard. If
+ ppath_contains_wcard != NULL, it will be set to true if a wildcard is
+ detected during dfs resolution.
******************************************************************************/
NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
@@ -1761,14 +1730,20 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx,
char **pp_name_out,
bool *ppath_contains_wcard)
{
+ bool path_contains_wcard;
NTSTATUS status = NT_STATUS_OK;
+
if (dfs_pathnames) {
status = dfs_redirect(ctx,
conn,
name_in,
True,
pp_name_out,
- ppath_contains_wcard);
+ &path_contains_wcard);
+
+ if (NT_STATUS_IS_OK(status) && ppath_contains_wcard != NULL) {
+ *ppath_contains_wcard = path_contains_wcard;
+ }
} else {
/*
* Cheat and just return a copy of the in ptr.