diff options
-rw-r--r-- | source3/smbd/nttrans.c | 2 | ||||
-rw-r--r-- | source3/smbd/open.c | 9 | ||||
-rw-r--r-- | source3/smbd/reply.c | 4 |
3 files changed, 13 insertions, 2 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 954d90b4ad..4e87f191d8 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -674,14 +674,12 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND); } - /* we need to handle the case when we get a relative open relative to a file and the pathname is blank - this is a reopen! (hint from demyn plantenberg) */ - END_PROFILE(SMBntcreateX); return(ERROR_DOS(ERRDOS,ERRbadfid)); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 3807c18e78..dd10a87055 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1305,6 +1305,15 @@ files_struct *open_directory(connection_struct *conn, char *fname, SMB_STRUCT_ST return NULL; } + if( strchr_m(fname, ':')) { + file_free(fsp); + DEBUG(5,("open_directory: failing create on filename %s with colon in name\n", fname)); + unix_ERR_class = ERRDOS; + unix_ERR_code = ERRinvalidname; + unix_ERR_ntstatus = NT_STATUS_NOT_A_DIRECTORY; + return NULL; + } + if(vfs_MkDir(conn,fname, unix_mode(conn,aDIR, fname)) < 0) { DEBUG(2,("open_directory: unable to create %s. Error was %s\n", fname, strerror(errno) )); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ee47485126..26c107e17a 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -3005,6 +3005,10 @@ NTSTATUS mkdir_internal(connection_struct *conn, pstring directory) unix_convert(directory,conn,0,&bad_path,&sbuf); + if( strchr_m(directory, ':')) { + return NT_STATUS_NOT_A_DIRECTORY; + } + if (ms_has_wild(directory)) { return NT_STATUS_OBJECT_NAME_INVALID; } |