diff options
author | Jeremy Allison <jra@samba.org> | 2002-08-20 20:54:32 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-08-20 20:54:32 +0000 |
commit | f744db7a5dee0764bb41c43336b1b1a933a79682 (patch) | |
tree | 9906c01cdbf8c7b7b7e42e4d076640a0ac91abe6 | |
parent | d9a4055174862c87c737685eb554429e2cd985d2 (diff) | |
download | samba-f744db7a5dee0764bb41c43336b1b1a933a79682.tar.gz samba-f744db7a5dee0764bb41c43336b1b1a933a79682.tar.bz2 samba-f744db7a5dee0764bb41c43336b1b1a933a79682.zip |
IFSTEST fixes for open fid, nametoolong.
Jeremy.
(This used to be commit e53a81261ed189881c0f07e1b46f97aa6770cab7)
-rw-r--r-- | source3/include/smb.h | 23 | ||||
-rw-r--r-- | source3/lib/error.c | 3 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 15 |
3 files changed, 30 insertions, 11 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h index 1ff0f1c328..091ef780ad 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -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 diff --git a/source3/lib/error.c b/source3/lib/error.c index 608d2b89ba..af8cf960e8 100644 --- a/source3/lib/error.c +++ b/source3/lib/error.c @@ -46,6 +46,9 @@ const struct unix_error_map unix_dos_nt_errmap[] = { #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 } }; diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 1337824595..4e02ecce6e 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -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. |