Commit graph

140 commits

Author SHA1 Message Date
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
cba20eeff4 [cosmetic] printing process id in hex in print_error 2012-02-28 15:59:14 -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
Olga Kornievskaia
aa7a680a40 propagating file change attr on writes 2012-02-08 16:29:25 -05:00
Olga Kornievskaia
ec034e7fd9 propagating file change attr on open 2012-02-08 11:11:09 -05:00
Olga Kornievskaia
3def6f5e24 propagating file change attr on getattr 2012-02-08 11:02:29 -05:00
Olga Kornievskaia
fb87e417fc enforcing data consistency
given a delegation type received on open, set buffering flags accordingly.

however, provide -o nocoherence mount options that will enable read/write
buffering regardless
2012-01-20 15:01:11 -05:00
Olga Kornievskaia
c22c2b6080 data cache invalidation on delegation recalls
when we receive a delegation recall, we need to make a downcall
to the kernel and change a buffering/caching policy on this file.

on each open and close we pass an srv_open pointer to the nfsd to
keep in case it receives a cb_recall. we store srv_open in the
delegation state if we got a delegation.
2012-01-19 19:46:03 -05:00
Olga Kornievskaia
39e90a7299 bug fix in nfs41_FinalizeVNetRoot
when we didn't create a mount, we don't have a security context to
destroy. in vnetroot creation, initialize session to invalid_handle.
if we fail to mount, then before deleting security context in
nfs41_FinalizeVNetRoot check that session is not invalid_handle.
2012-01-19 15:25:43 -05:00
Olga Kornievskaia
03bc4d4c2e adding back unimplemented functions
just in case some of them are required and will cause a kernel crash
if function pointer is dereferenced.
2012-01-18 18:21:28 -05:00
Olga Kornievskaia
a132b8b79c [driver] storing volinfo in devext
instaed of assembling FILE_FS_VOLUME_INFORMATION on every volume
query, story it in device extensions and just copy bytes.
2011-12-22 14:50:53 -05:00
Olga Kornievskaia
c61849fd14 [driver] fail if fail to impersonate client in nfsd thread 2011-12-22 12:06:44 -05:00
Olga Kornievskaia
790e6239d4 [driver] creating individual unmarshal functions 2011-12-22 11:59:45 -05:00
Olga Kornievskaia
62dfd87bda [driver] using InterlockedIncrement for open_owner_id 2011-12-21 17:42:04 -05:00
Olga Kornievskaia
9efa410e5a [driver] using InterlockedIncrement64 for xid 2011-12-21 17:19:38 -05:00
Olga Kornievskaia
4511dec4b7 [driver] properly release upcall entry lock in downcall
if we fail to allocate memory while processing acl downcall, dont
forget to release the lock on the entry before leaving the function.
2011-12-21 16:50:54 -05:00
Olga Kornievskaia
517db12d34 [driver] properly unlock mdls
when nobody is waiting for the upcall. if it was read/write upcall
unlock readwrite mdl. if it was a readdir upcall, unlock readdir
mdl and also free it.
2011-12-21 16:43:55 -05:00
Olga Kornievskaia
8d52181a3e [driver] delete sec context even if upcall fails 2011-12-21 16:36:39 -05:00
Olga Kornievskaia
fd21e7fbfd [driver] stop impersonating client even if it's a lost upcall 2011-12-21 16:15:26 -05:00
Olga Kornievskaia
0e272630a3 [driver] cosmetic changes
none (or all) functions should be static. making all function non-static.

consistent format of function args (ie each argument on its own line).

adding __notnull for our fcb, fobx, vnetroot, netroot context pointers.

removed some non-implemented function from our redirector functions table.
left some no-op functions that are just required: flush, isvaliddir,
deallocatefcb. not sure about completebufferingstate function.

80char lines corrections
2011-12-21 15:53:17 -05:00
Olga Kornievskaia
24ca1023bf [driver] bugfix: only free context for valid vnetroot 2011-12-20 15:19:01 -05:00
Olga Kornievskaia
6292181f8d adding nocache mount options 2011-12-08 17:47:34 -05:00
Olga Kornievskaia
aed1493e90 adding writethru mount option
for large writes it is beneficial to turnoff write buffering and allow
large write buffer sizes than 1M (for win 7).
2011-12-08 17:07:12 -05:00
Olga Kornievskaia
37f3fa0862 saving security context in vnetroot
windows calls into our driver from processes that have restricted access.

save security context during mount and use that for all other irps.
2011-12-08 17:07:05 -05:00
Olga Kornievskaia
33a5f24f1f [cosmetic] print processid instead of pointer to peprocess 2011-12-05 13:27:53 -05:00
Olga Kornievskaia
6b05d84e93 [driver] dont set NetRootStatus on failure
Setting it was cause exiting mounts to go away.
2011-11-08 14:35:17 -05:00
Olga Kornievskaia
572c69e3d0 need to close vnetroot handle in create_connection 2011-11-02 12:00:21 -04:00
Casey Bodley
3d053740c3 mount: propagate errors back to nfs_mount
nfs41_np.c:
NPAddConnection3() was overwriting status=WN_BAD_NETNAME on any errors from DeviceIoControl()

nfs41_driver.c:
GetConnectionHandle() was only returning the handle, and throwing away the return value from ZwCreateFile()
map_mount_errors() was missing a mapping from ERROR_BAD_NET_NAME to STATUS_BAD_NETWORK_NAME

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-10-25 11:44:37 -04:00
Olga Kornievskaia
a2375b78ac [cosmetic] [driver] modify printouts in getsecurity
print function names where SeCreateClientSecurityFromSubjectContext fails
2011-10-24 12:14:03 -04:00