summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShirish Kalele <kalele@samba.org>2000-11-28 00:26:42 +0000
committerShirish Kalele <kalele@samba.org>2000-11-28 00:26:42 +0000
commita149c6b02534e417e324fc58e79dcca4553e2fe1 (patch)
tree8fb3ed5a29351469fa31aeff1a1dca6878abade2
parent0f1c800f8542297b9c1a6a4dff20263e3b6d9d40 (diff)
downloadsamba-a149c6b02534e417e324fc58e79dcca4553e2fe1.tar.gz
samba-a149c6b02534e417e324fc58e79dcca4553e2fe1.tar.bz2
samba-a149c6b02534e417e324fc58e79dcca4553e2fe1.zip
Ran DFS on Linux and found that readlink() on Linux does not append NUL
to the link read. So add a NUL.. (This used to be commit 04ebcf954c7568fc16ff4a75b31715d6b0a34aa4)
-rw-r--r--source3/msdfs/msdfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/msdfs/msdfs.c b/source3/msdfs/msdfs.c
index 999ffa78b7..d525edab3c 100644
--- a/source3/msdfs/msdfs.c
+++ b/source3/msdfs/msdfs.c
@@ -262,7 +262,9 @@ BOOL get_referred_path(struct junction_map* junction)
if(S_ISLNK(st.st_mode))
{
/* open the link and read it to get the dfs referral */
- readlink(path, buf, sizeof(buf));
+ int linkcnt = 0;
+ linkcnt = readlink(path, buf, sizeof(buf));
+ buf[linkcnt] = '\0';
DEBUG(5,("get_referred_path: Referral: %s\n",buf));
if(parse_symlink(buf, &junction->referral_list,
&junction->referral_count))