diff options
author | Jeremy Allison <jra@samba.org> | 2004-05-13 18:37:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:51:34 -0500 |
commit | 8fd6298df0c219c522e2262e16eaf97c47f3799f (patch) | |
tree | d09129ab032e482801543cd31249d62ccb28e180 /source3/smbd | |
parent | 0f462790a30296f5908b163a5ff06693ad844f05 (diff) | |
download | samba-8fd6298df0c219c522e2262e16eaf97c47f3799f.tar.gz samba-8fd6298df0c219c522e2262e16eaf97c47f3799f.tar.bz2 samba-8fd6298df0c219c522e2262e16eaf97c47f3799f.zip |
r698: Now wb pipe is non-blocking remember to read in non-blocking mode...
Jeremy.
(This used to be commit 3399727864f3aa8981f022254dfed622fcb50c49)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/trans2.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 91196766d1..ba2931d809 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -3506,12 +3506,17 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n", srvstr_pull(inbuf, link_target, pdata, sizeof(link_target), -1, STR_TERMINATE); /* !widelinks forces the target path to be within the share. */ + /* This means we can interpret the target as a pathname. */ if (!lp_widelinks(SNUM(conn))) { pstring rel_name; char *last_dirp = NULL; - unix_format(link_target); - + srvstr_get_path(inbuf, link_target, pdata, sizeof(link_target), + -1, STR_TERMINATE, &status); + if (!NT_STATUS_IS_OK(status)) { + return ERROR_NT(status); + } + unix_convert(link_target,conn,0,&bad_path,&sbuf); pstrcpy(rel_name, newname); last_dirp = strrchr_m(rel_name, '/'); if (last_dirp) { @@ -3520,6 +3525,7 @@ size = %.0f, uid = %u, gid = %u, raw perms = 0%o\n", pstrcpy(rel_name, "./"); } pstrcat(rel_name, link_target); + if (ensure_link_is_safe(conn, rel_name) != 0) { return(UNIXERROR(ERRDOS,ERRnoaccess)); } |