More gentest error fixups.
authorJeremy Allison <jra@samba.org>
Tue, 24 Feb 2004 00:55:05 +0000 (00:55 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 24 Feb 2004 00:55:05 +0000 (00:55 +0000)
Jeremy.
(This used to be commit 00f71fc8361919b87b62389ada8bd9a73f9f98b5)

source3/smbd/nttrans.c
source3/smbd/open.c
source3/smbd/reply.c

index 2831f759331459125b21a7b3f939e9aeb98d747e..a432e2aaea9f96be5a0b2eeaa420759ccd6f7eb2 100644 (file)
@@ -673,14 +673,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));
index 3807c18e784a4e9cec6407fe2cb4303fe961b6e0..dd10a8705583a766165801bb5f152524c18c0763 100644 (file)
@@ -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) ));
index ee474851267cd5c0386bfebe2e1c31db2bc7962c..26c107e17a26e34de2bd6561cccf8ff3faca865d 100644 (file)
@@ -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;
        }