IFSTEST fixes for open fid, nametoolong.
authorJeremy Allison <jra@samba.org>
Tue, 20 Aug 2002 20:54:32 +0000 (20:54 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 20 Aug 2002 20:54:32 +0000 (20:54 +0000)
Jeremy.
(This used to be commit e53a81261ed189881c0f07e1b46f97aa6770cab7)

source3/include/smb.h
source3/lib/error.c
source3/smbd/nttrans.c

index 1ff0f1c32868a16233765be7ed09748c1a2e8dd9..091ef780adeeb14378c3f8c165df53dbba022851 100644 (file)
@@ -1148,17 +1148,17 @@ struct bitmap {
 #define FILE_SHARE_DELETE 4
 
 /* FileAttributesField */
-#define FILE_ATTRIBUTE_READONLY aRONLY
-#define FILE_ATTRIBUTE_HIDDEN aHIDDEN
-#define FILE_ATTRIBUTE_SYSTEM aSYSTEM
-#define FILE_ATTRIBUTE_DIRECTORY aDIR
-#define FILE_ATTRIBUTE_ARCHIVE aARCH
-#define FILE_ATTRIBUTE_NORMAL 0x80L
-#define FILE_ATTRIBUTE_TEMPORARY 0x100L
-#define FILE_ATTRIBUTE_SPARSE 0x200L
-#define FILE_ATTRIBUTE_COMPRESSED 0x800L
-#define FILE_ATTRIBUTE_NONINDEXED 0x2000L
-#define SAMBA_ATTRIBUTES_MASK 0x7F
+#define FILE_ATTRIBUTE_READONLY                0x001L
+#define FILE_ATTRIBUTE_HIDDEN          0x002L
+#define FILE_ATTRIBUTE_SYSTEM          0x004L
+#define FILE_ATTRIBUTE_DIRECTORY       0x010L
+#define FILE_ATTRIBUTE_ARCHIVE         0x020L
+#define FILE_ATTRIBUTE_NORMAL          0x080L
+#define FILE_ATTRIBUTE_TEMPORARY       0x100L
+#define FILE_ATTRIBUTE_SPARSE          0x200L
+#define FILE_ATTRIBUTE_COMPRESSED      0x800L
+#define FILE_ATTRIBUTE_NONINDEXED      0x2000L
+#define SAMBA_ATTRIBUTES_MASK          0x7F
 
 /* Flags - combined with attributes. */
 #define FILE_FLAG_WRITE_THROUGH    0x80000000L
@@ -1186,6 +1186,7 @@ struct bitmap {
 #define FILE_EIGHT_DOT_THREE_ONLY 0x0400
 #define FILE_RANDOM_ACCESS        0x0800
 #define FILE_DELETE_ON_CLOSE      0x1000
+#define FILE_OPEN_BY_FILE_ID     0x2000
 
 /* Responses when opening a file. */
 #define FILE_WAS_OPENED 1
index 608d2b89bad4ed951cdb9747eee4488b40ab3b9c..af8cf960e8f2aee91f5776f6253b983bd03f02d5 100644 (file)
@@ -45,6 +45,9 @@ const struct unix_error_map unix_dos_nt_errmap[] = {
 #endif
 #ifdef EROFS
        { EROFS, ERRHRD, ERRnowrite, NT_STATUS_ACCESS_DENIED },
+#endif
+#ifdef ENAMETOOLONG
+       { ENAMETOOLONG, ERRDOS, 206, NT_STATUS_OBJECT_NAME_INVALID },
 #endif
        { 0, 0, 0, NT_STATUS_OK }
 };
index 133782459597e368729ec2b742fc9809a418cc17..4e02ecce6e6c5b5fe0139c78134313c69aecbe6d 100644 (file)
@@ -565,6 +565,12 @@ int reply_ntcreate_and_X(connection_struct *conn,
        time_t c_time;
        START_PROFILE(SMBntcreateX);
 
+       DEBUG(10,("reply_ntcreateX: flags = 0x%x, desired_access = 0x%x \
+file_attributes = 0x%x, share_access = 0x%x, create_disposition = 0x%x \
+create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attributes,
+                       share_access, create_disposition,
+                       root_dir_fid, create_options ));
+
        /* If it's an IPC, use the pipe handler. */
 
        if (IS_IPC(conn)) {
@@ -577,6 +583,10 @@ int reply_ntcreate_and_X(connection_struct *conn,
                }
        }
                        
+       if (create_options & FILE_OPEN_BY_FILE_ID) {
+               END_PROFILE(SMBntcreateX);
+               return ERROR_NT(NT_STATUS_NOT_SUPPORTED);
+       }
 
        /* 
         * We need to construct the open_and_X ofun value from the
@@ -1071,6 +1081,11 @@ static int call_nt_transact_create(connection_struct *conn,
        root_dir_fid = (uint16)IVAL(params,4);
        smb_attr = (file_attributes & SAMBA_ATTRIBUTES_MASK);
 
+       if (create_options & FILE_OPEN_BY_FILE_ID) {
+               END_PROFILE(SMBntcreateX);
+               return ERROR_NT(NT_STATUS_NOT_SUPPORTED);
+       }
+
        /* 
         * We need to construct the open_and_X ofun value from the
         * NT values, as that's what our code is structured to accept.