summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-01 13:27:47 -0800
committerJeremy Allison <jra@samba.org>2008-12-01 13:27:47 -0800
commit936037c7dabab1654d4d5e398b2a6ef2d640fc17 (patch)
tree9b168f16eeaa21ca5da38cc86253bfdba5d67ece
parentedde763d3f981f9ccdf65feffd85a591fb1708c1 (diff)
downloadsamba-936037c7dabab1654d4d5e398b2a6ef2d640fc17.tar.gz
samba-936037c7dabab1654d4d5e398b2a6ef2d640fc17.tar.bz2
samba-936037c7dabab1654d4d5e398b2a6ef2d640fc17.zip
s3:smbd: wildcard characters are allowed in stream names
We only check the filename of the basefile now. metze
-rw-r--r--source3/smbd/open.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index a6867e077c..a8cc5c9118 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -332,6 +332,7 @@ static NTSTATUS open_file(files_struct *fsp,
if ((open_access_mask & (FILE_READ_DATA|FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_EXECUTE)) ||
(!file_existed && (local_flags & O_CREAT)) ||
((local_flags & O_TRUNC) == O_TRUNC) ) {
+ const char *wild;
/*
* We can't actually truncate here as the file may be locked.
@@ -353,8 +354,17 @@ static NTSTATUS open_file(files_struct *fsp,
#endif
/* Don't create files with Microsoft wildcard characters. */
+ if (fsp->base_fsp) {
+ /*
+ * wildcard characters are allowed in stream names
+ * only test the basefilename
+ */
+ wild = fsp->base_fsp->fsp_name;
+ } else {
+ wild = path;
+ }
if ((local_flags & O_CREAT) && !file_existed &&
- ms_has_wild(path)) {
+ ms_has_wild(wild)) {
return NT_STATUS_OBJECT_NAME_INVALID;
}