diff options
author | Jeremy Allison <jra@samba.org> | 2002-07-02 06:34:27 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-07-02 06:34:27 +0000 |
commit | 82176f4d85225c2aae15f9ce3e03730f019934f5 (patch) | |
tree | 3a5ba0496d1e49c3c9c21de5b1fa4d8c56d593c1 /source3/msdfs | |
parent | 9674ec6987a002ebdcfedeac4d66a096a1007bef (diff) | |
download | samba-82176f4d85225c2aae15f9ce3e03730f019934f5.tar.gz samba-82176f4d85225c2aae15f9ce3e03730f019934f5.tar.bz2 samba-82176f4d85225c2aae15f9ce3e03730f019934f5.zip |
Address the string_sub problem by changing len = 0 to mean "no expand".
Went through and checked all string_subs I could to ensure they're being
used correctly.
Jeremy.
(This used to be commit 17cae0d683be404be69554cd0e84117bdcc56c87)
Diffstat (limited to 'source3/msdfs')
-rw-r--r-- | source3/msdfs/msdfs.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source3/msdfs/msdfs.c b/source3/msdfs/msdfs.c index 1af848b55a..3e66c1c10c 100644 --- a/source3/msdfs/msdfs.c +++ b/source3/msdfs/msdfs.c @@ -80,13 +80,12 @@ static BOOL parse_dfs_path(char* pathname, struct dfs_path* pdp) Fake up a connection struct for the VFS layer. *********************************************************/ -static BOOL create_conn_struct( connection_struct *conn, int snum, - char *path) +static BOOL create_conn_struct( connection_struct *conn, int snum, char *path) { ZERO_STRUCTP(conn); conn->service = snum; conn->connectpath = path; - pstring_sub(conn->connectpath, "%S", lp_servicename(snum)); + pstring_sub(conn->connectpath , "%S", lp_servicename(snum)); if (!smbd_vfs_init(conn)) { DEBUG(0,("create_conn_struct: smbd_vfs_init failed.\n")); @@ -335,6 +334,7 @@ BOOL get_referred_path(char *pathname, struct junction_map* jn, struct connection_struct conns; struct connection_struct* conn = &conns; + pstring conn_path; int snum; BOOL self_referral = False; @@ -371,7 +371,8 @@ BOOL get_referred_path(char *pathname, struct junction_map* jn, return False; } - if (!create_conn_struct(conn, snum, lp_pathname(snum))) + pstrcpy(conn_path, lp_pathname(snum)); + if (!create_conn_struct(conn, snum, conn_path)) return False; if (!lp_msdfs_root(SNUM(conn))) { @@ -701,10 +702,12 @@ BOOL create_junction(char* pathname, struct junction_map* jn) /********************************************************************** Forms a valid Unix pathname from the junction **********************************************************************/ + static BOOL junction_to_local_path(struct junction_map* jn, char* path, int max_pathlen, connection_struct *conn) { int snum; + pstring conn_path; if(!path || !jn) return False; @@ -718,7 +721,8 @@ static BOOL junction_to_local_path(struct junction_map* jn, char* path, strlower(jn->volume_name); safe_strcat(path, jn->volume_name, max_pathlen-1); - if (!create_conn_struct(conn, snum, lp_pathname(snum))) + pstrcpy(conn_path, lp_pathname(snum)); + if (!create_conn_struct(conn, snum, conn_path)) return False; return True; |