Commit graph

165 commits

Author SHA1 Message Date
Casey Bodley
2baeeb855b volume: cache volume attributes on mount
struct NFS41_V_NET_ROOT_EXTENSION now stores only the FILE_FS_ATTRIBUTE_INFORMATION (without the extra buffer space for a name).  on QueryVolumeInfo() for FileFsAttributeInformation on the root directory, the FILE_FS_ATTRIBUTE_INFORMATION is copied into the output buffer, and the name is added there.  QueryVolumeInfo() only makes upcalls when FileFsAttributeInformation queries are not for the root directory

new function is_root_directory() uses the logic from Set/GetReparsePoint() to determine whether it's operating on the root directory

moved logic from volume.c:handle_volume_attributes() to superblock.c:nfs41_superblock_fs_attributes().  the mount downcall copies the FILE_FS_ATTRIBUTE_INFORMATION buffer down to the driver.  the driver reads this buffer directly into VNetRootContext->FsAttrs

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-20 15:03:14 -04:00
Olga Kornievskaia
4c8c263b49 implement getattr for FileNetworkOpenInformation 2012-04-20 12:42:36 -04:00
Olga Kornievskaia
f4071450c0 [driver] done overide open create mode 0 w 0777
removing the check of mode 0 and then setting mode 0777. cygwin can
open for create with mode 0 which we were overriding with 0777.
2012-04-09 15:02:21 -04:00
Casey Bodley
c837631750 ea: fail non-cygwin EAs without named attr support
if non-cygwin EAs are given to Create, SetEaInfo, or QueryEaInfo and the server does not support named attributes, fail with STATUS_EAS_NOT_SUPPORTED.  also adds access checks for FILE_READ_EA and FILE_WRITE_EA

Create will accept all 3 cygwin EAs: NfsV3Attributes, NfsActOnLink, and NfsSymlinkTargetName.  it now handles NfsActOnLink by adding FILE_OPEN_REPARSE_POINT to the create options

SetEaInfo will only accept NfsV3Attributes for setting the file mode. the other two will fail with STATUS_INVALID_PARAMETER.  removed handling of NfsActOnLink in setattr.c

QueryEaInfo will accept all 3 cygwin EAs

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-09 15:01:15 -04:00
Casey Bodley
7bd70cf488 ea: defer storing mode until SetEaInfo succeeds
on SetEaInfo for NfsV3Attributes, wait to set nfs41_fcb.mode until the upcall returns successfully

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-04-09 15:00:57 -04:00
Olga Kornievskaia
99e127156a [driver] make default upcall timeout 50s 2012-04-03 14:40:56 -04:00
Olga Kornievskaia
41389178a3 setting archive attr based on createopts
was incorrectly using file_attributes instead of create attributes to check
if we are creating a file or a directory. it lead to creating directories
with archive set.
2012-04-02 18:39:54 -04:00
Olga Kornievskaia
9320098f0c [driver] access error code on open
returning access_denied instead of network_access_denied
2012-04-02 12:51:31 -04:00
Olga Kornievskaia
19715faf2b removing readonly file opened for write check
it causes ifstest problems
2012-04-02 12:50:48 -04:00
Olga Kornievskaia
49580a8cfe handling hidden system archive file attributes
todo: still need to mask supported attributes while doing getattrs
2012-04-02 12:49:44 -04:00
Olga Kornievskaia
dc9377ce58 adding arguments check functions to mrx functions
moving input argument checks into check_nfs41_X () functions
2012-03-29 15:47:21 -04:00
Olga Kornievskaia
60e1d87a86 removing unused Flags field in FCB context 2012-03-29 15:47:05 -04:00
Casey Bodley
092c39d9d6 driver: change error code for rename, link with RootDirectory
http://msdn.microsoft.com/en-us/library/cc232085%28v=prot.10%29.aspx : "STATUS_INVALID_PARAMETER: An invalid parameter was passed for FileName or FileNameLength, or the target file was open, or the RootDirectory field value was nonzero for a network operation."

as network filesystems are not expected to support this, return STATUS_INVALID_PARAMETER instead of STATUS_NOT_SUPPORTED

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-29 15:46:55 -04:00
Casey Bodley
e83d36544f symlink: handle errors from REMOVE
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-29 15:46:44 -04:00
Casey Bodley
829c05d6b5 driver: add checks for reparse points on volume
fail attempts to set/get reparse points when the filename is no longer than the vnetroot name (plus a \) to prevent these operations on a volume.  also adds checks for non-null buffers to pass Set/GetPointInvalidParamTest

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-29 15:46:32 -04:00
Casey Bodley
61998b5968 driver: convert strings to utf8 instead of ansi
use RtlUnicodeToUTF8N() instead of RtlUnicodeStringToAnsiString() to preserve unicode filenames; passes fileio test UnicodeOnDiskTest

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-29 11:23:49 -04:00
Olga Kornievskaia
6119fba99f adding sharing violation check for supersede
rdbss usually does sharing violation checks for us but missed this one.
2012-03-29 11:23:45 -04:00
Olga Kornievskaia
b40f685286 return not_supported for windows streams 2012-03-29 11:23:38 -04:00
Olga Kornievskaia
0020104b95 fixing handling of delete_on_close
file can be opened with a delete_on_close flag set. this file can be
opened again as long as opens specify "file_share_delete" access.
after receiving the cleanup irp, the handle enters "delete-pending"
state. opens in this state must fail with status_delete_pending.
file query for standard_info.delete_pending now should return true.

calling setattr with disposition=1 puts the file in "delete-pending"
state.

calling setattr with dispositon=0 will clear delete_on_close only
if file is in "delete-pending" state. otherwise, setattr is ignored.
2012-03-29 11:23:34 -04:00
Casey Bodley
7a8861699f driver: add checks for ifs reparse point tests
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-29 11:23:28 -04:00
Olga Kornievskaia
4bfb05adac returning buffer_overflow instead of too_small 2012-03-29 11:23:23 -04:00
Olga Kornievskaia
24781aa472 checking parameters on open
based on MS-FSA document there are a few checks we should do
on open that we didn't before.
2012-03-29 11:23:13 -04:00
Olga Kornievskaia
fae194a5b6 respect NO_INTERMIDIATE_BUFFERING for an open 2012-03-20 11:20:11 -04:00
Olga Kornievskaia
735784e85b notepad specific fixes
removing notepad opens file as a directory ifdef

for volume query notepad supplies insufficient buffer space but
doesn't like buffer_too_small error code. it seems to be fine
with partial buffer filled and buffer_overflow error.
2012-03-19 16:52:20 -04:00
Olga Kornievskaia
f89ded9bf6 [debug] add a missing DEBUG_VOLUME_QUERY 2012-03-19 16:36:42 -04:00
Olga Kornievskaia
439621a459 [driver] respect READONLY attribute
if file is created with READONLY attr then set mode to 444

if file is opened with READONLY attr but askes for WRITE access
return an error
2012-03-19 15:05:02 -04:00
Olga Kornievskaia
c6ee60b362 [driver] fixing possible app/driver/nfsd race
entry->filename points to something the app address space. if app was
started and the ctrl-ed c, then when nfsd picks up the upcall it should
check if the pointer is still valid
2012-03-19 15:04:59 -04:00
Olga Kornievskaia
540ad44f21 [driver] enforcing filename component length checks
on create, check that provided name has the appropriate filename
length for each directory component.

also check on link and rename
2012-03-19 15:04:56 -04:00
Olga Kornievskaia
d1a05c810e fixing open a file as a directory
we should map this failure to STATUS_NOT_A_DIRECTORY

notepad.exe had been known to do this
2012-03-19 15:04:54 -04:00
Olga Kornievskaia
1a00a0bdce fixing opening dir as a file
open a of a directory with a NON_DIRECTORY_FILE specified should return
FILE_IS_A_DIRECTORY
2012-03-19 15:04:52 -04:00
Olga Kornievskaia
4017b235db handling creating new file for no access
windows can send a create irp with dispostion representing creation
of the file and specify DesiredAccess of 0.

we were treating no data access as lookup but in this case, we still
need to create a file. so send an open with a read access and
request no delegation to be returned.
2012-03-19 15:04:51 -04:00
Olga Kornievskaia
1ea2fb7891 calling asynch cache invalidation always 2012-03-19 15:04:49 -04:00
Olga Kornievskaia
e934484b1f [driver] check for nul reparse point buffer 2012-03-19 15:04:47 -04:00
Casey Bodley
bbb1ed696c license changed to LGPL: added COPYING file, changed source file comments
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2012-03-19 12:24:43 -04:00
Olga Kornievskaia
f71623bc02 adding a lease-based timeout to upcalls
adding -o timeout=value (in sec) mount option to override a default
timeout value for the upcalls for non-io upcalls. Default timeout is
at least the lease_time seconds of an established mount or 20secs.

read/write upcall also take into account number of bytes for the request
and 100MB/s network speed and 100MB/s disk speed
2012-03-05 17:49:52 -05:00
Olga Kornievskaia
b2f5d3c7a7 fixing printf format values in nfs41_mount 2012-02-29 13:55:40 -05:00
Olga Kornievskaia
88d6678f93 [driver] fixing multiple mount bug
When the client has an existing mount but for a different security context
and the new mount fails, don't free up the mount array for a given NetRoot.
2012-02-28 14:07:10 -05:00
Olga Kornievskaia
90c1137f85 [cosmetic] adding missing DEBUG_MOUNT define 2012-02-28 14:04:56 -05:00
Olga Kornievskaia
0322f53cce make io offset unsigned 2012-02-28 12:11:01 -05:00
Olga Kornievskaia
75c96068e9 [driver] changing error return values
instead of returning STATUS_INVALID_PARAMETER, return STATUS_NOT_SUPPORTED
for query classes we don't support in volume and file queries.
2012-02-16 11:54:05 -05:00
Olga Kornievskaia
5d60157e7c [driver] setting default printouts 2012-02-16 11:07:18 -05:00
Olga Kornievskaia
73294dff68 respecting FILE_WRITE_THROUGH flag on open 2012-02-16 11:06:31 -05:00
Olga Kornievskaia
0285d46a26 timing out an upcall after 2mins 2012-02-16 11:06:19 -05:00
Olga Kornievskaia
7d19a7ffef changing more printouts 2012-02-16 11:05:59 -05:00
Olga Kornievskaia
8adad77d4b more on time-based coherency
changing the code to keeping track of fcbs and not srv_opens.

problem of keeping srv_opens was that we could get an open for
attribute which will then do a setacl which will modify a change
attribute of the file but because the open is not for reading
data we won't have it on the list of opens.
2012-02-14 17:05:42 -05:00
Olga Kornievskaia
d42f769bff changing many printouts 2012-02-13 16:08:21 -05:00
Olga Kornievskaia
48d6775211 [driver] fixing wrong upcall size for setattr 2012-02-09 10:36:07 -05:00
Olga Kornievskaia
43424fc653 first stab at time-based data coherency 2012-02-08 18:24:19 -05:00
Olga Kornievskaia
13c3723191 propagating file change attr for setacl 2012-02-08 16:32:04 -05:00
Olga Kornievskaia
cdf31d3ee0 propagating file change attr on setattr 2012-02-08 16:31:17 -05:00