diff options
author | Jeremy Allison <jra@samba.org> | 2004-03-12 01:43:25 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-03-12 01:43:25 +0000 |
commit | 03c0e32c2801d25aba7b6f906abdcb07497613d6 (patch) | |
tree | bdfddb363cfb155bf33c4732e0b64c4709e1b771 /source3 | |
parent | e3f5b542707e2328030b9d5eff0836a904eccde5 (diff) | |
download | samba-03c0e32c2801d25aba7b6f906abdcb07497613d6.tar.gz samba-03c0e32c2801d25aba7b6f906abdcb07497613d6.tar.bz2 samba-03c0e32c2801d25aba7b6f906abdcb07497613d6.zip |
Allow msdfs symlink syntax to be more forgiving (it took me ages to remember
what it was :-). Allow msdfs links to now look like UNC paths : eg.
sym_link -> msdfs://server/share/path/in/share
or :
sym_link -> msdfs:\\server\share\path\in\share
Jeremy.
(This used to be commit 2979c3e388400fb030b94da5c711f803f81ae0b9)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/msdfs/msdfs.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/msdfs/msdfs.c b/source3/msdfs/msdfs.c index 5af73356e0..b77e2111bc 100644 --- a/source3/msdfs/msdfs.c +++ b/source3/msdfs/msdfs.c @@ -198,13 +198,21 @@ static BOOL parse_symlink(char* buf,struct referral** preflist, } for(i=0;i<count;i++) { - /* replace / in the alternate path by a \ */ - char* p = strchr_m(alt_path[i],'/'); - if(p) + char *p; + + /* replace all /'s in the alternate path by a \ */ + for(p = alt_path[i]; *p && ((p = strchr_m(p,'/'))!=NULL); p++) { *p = '\\'; + } + + /* Remove leading '\\'s */ + p = alt_path[i]; + while (*p && (*p == '\\')) { + p++; + } pstrcpy(reflist[i].alternate_path, "\\"); - pstrcat(reflist[i].alternate_path, alt_path[i]); + pstrcat(reflist[i].alternate_path, p); reflist[i].proximity = 0; reflist[i].ttl = REFERRAL_TTL; DEBUG(10, ("parse_symlink: Created alt path: %s\n", reflist[i].alternate_path)); |