Commit graph

109 commits

Author SHA1 Message Date
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
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
Olga Kornievskaia
4c52473527 hooking up rsize-wsize mount options
after parsing read and write rpc size from the mount command,
add the values to mount upcall, then pass these values when creating
a CLIENT structure.
2011-10-11 16:03:59 -04:00
Olga Kornievskaia
d646e5c58c [driver] verifier raised issue with lists
first element in the lists (head) doesn't store any entries so
we should skip it when we traverse the list.
2011-10-06 12:38:55 -04:00
Olga Kornievskaia
65c6091f69 [driver] verifier raised issues with mdls
it complained that mdls had to have a certain (undocumented) flag set.
also, it seemed to imply that in readdir, the locking of pages needed
to be done by the thread creating the mdl. so i moved the locking/unlocking
there.
2011-10-06 12:32:50 -04:00
Olga Kornievskaia
b3e4953890 [driver] fixing printing a unicode string in setattr 2011-10-04 14:33:18 -04:00
Olga Kornievskaia
981e73dc61 [driver] read-only mount option
if the nfs_mount passes us a read-only mount option. then return
access_denied if:
1. requests for open with desired access of write or append,
2. we get a write irp,
3. requests for setattr, setattrex, setacl
4. ignore the delete_on_open flag passed to open
2011-10-04 10:57:06 -04:00
Olga Kornievskaia
52081e3175 support for multiuser environment
on a mount request, search a list of existing mounts for a given netroot
based on LUID entries (login ids). if an entry is found, then check the
current request rpcsec flavor against existing sessions/mounts. If no
match found, do another upcall for a mount and store a session of this
flavor for this LUID. if no entry found for this LUID, then do a mount
upcall, create a new entry and add it to the list.
2011-09-29 18:45:21 -04:00
Olga Kornievskaia
27030b1764 removing copies from readdir path 2011-09-27 12:21:26 -04:00
Olga Kornievskaia
7e52f53097 [acls] removing unneeded safety checks 2011-09-23 12:12:45 -04:00
Olga Kornievskaia
3295a9da05 [timings] counting avg acl reply size in cached case 2011-09-22 17:07:44 -04:00
Olga Kornievskaia
6eea9faa2e first draft of named attributes 2011-09-22 14:56:11 -04:00
Olga Kornievskaia
eae8988d6e [driver] minor fix store pointer not pointer to pointer 2011-09-07 13:45:09 -04:00
Olga Kornievskaia
0474d3afbe [driver] adding timing stats to upcalls 2011-09-06 18:01:17 -04:00
Olga Kornievskaia
e3cbc70f14 removing unnecessary copy in readdir 2011-09-06 17:55:02 -04:00
Olga Kornievskaia
27bc5b862e [driver] ignore label_security queries 2011-08-24 13:22:51 -04:00
Olga Kornievskaia
28992406a7 [driver] caching acl buffer between query security irps
windows api frequently sends a query security with a buffer len of 0
to figure out how big of buffer is needed for a security descriptor.

we send a getattr for acl attribute on the 1st irp, then cache the
returned security descriptor in fobx. on the 2nd query, if the buffer
is cached and it's not "stale", we return that buffer.
2011-08-24 12:23:04 -04:00
Olga Kornievskaia
04ab888492 [cosmetic] minor license changes
added 2011 year to the copyright line
added authors info to the license
added UofM license to libtirpc files that we modified
(but i probably missed some)
2011-08-12 13:20:12 -04:00
Olga Kornievskaia
c722076d09 [driver] removing mrxsetinfoatcleanup
this function was called before writes and was setting time and size
attributes of the file. we were translating it into a setattr. reads
were also followed by a setattr of timestamp (unnecessarily)
2011-07-18 15:24:19 -04:00
Olga Kornievskaia
2db91a3001 deny setattr for size if not opened for write
proposes an alternate solution for attempts to set file size without an open sta
teid.  instead of acquiring one by sending OPEN, fail the request with ACCESS_DE
NIED

according the MS File System Algorithms documentation for setting FileAllocation
Information and FileEndOfFileInformation [http://msdn.microsoft.com/en-us/librar
y/ff469355%28v=PROT.10%29.aspx]:
"If Open.GrantedAccess does not contain FILE_WRITE_DATA, the operation MUST be f
ailed with STATUS_ACCESS_DENIED"

-removes open_owner_id, access_mask, access_mode from setattr upcall arguments
-moves map_access_2_allowdeny() back to open.c as a static function, since handl
e_setattr() was its only other call site
2011-06-27 14:51:15 -04:00
Olga Kornievskaia
9f2587c3b3 [driver] abandoned upcalls dont delete security context
Deleting client's security context was causing kernel crashes.

During upcall, we remember a pointer to the client's security context,
then on close we delete the security context. Previously we would also
delete the context if the upcall was abandoned.

Apparently, windows will always send a close for the fcb that was used
for the abandoned upcall. Close deletes the context. Then when upcall
was done, it would try to delete the context again (oops).
2011-06-22 11:42:30 -04:00
Casey Bodley
d98da23d49 lock: address differences in lock semantics
zero-length ranges: valid on windows, but nfs servers MUST return NFS4ERR_INVAL for LOCK with length=0. use MRxIsLockRealizable() to return STATUS_NOT_SUPPORTED for zero-length ranges (avoiding the lock upcall and rpc)

ranges that extend past UINT64_MAX: not valid on windows. NFS expects length=UINT64_MAX for locking to end-of-file. use length=UINT64_MAX if length >= UINT64_MAX-offset (making lock ranges consistent with linux client)

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-06-13 12:02:59 -04:00
Olga Kornievskaia
2d252266c2 [driver] fixing dereference of upcall entry after free if we fail to get security context 2011-06-08 12:54:31 -04:00
Olga Kornievskaia
25cf92a60b [driver] changing logic in volume query
previously, if the supplied buffer length was smaller than the result
of the volume query we returned SUCCESS and no data (ie. it was needed
because Notepad passes in a buffer too small but doesn't like a
buffer_too_small error.) However, it does work with buffer_overflow
error and then a partial resulted returned.
2011-06-06 18:44:59 -04:00
Olga Kornievskaia
8153733a77 [driver] fixing volume label length 2011-06-06 11:25:02 -04:00
Olga Kornievskaia
d83fece068 [driver] fixing return value for security query
rdbss doesn't like status_buffer_too_small return and instead needs
status_buffer_overflow
2011-05-02 13:38:41 -04:00
Olga Kornievskaia
ab7bdbd125 [cosmetic] adding iostatus printf to fsddispatch 2011-04-29 14:29:54 -04:00
Olga Kornievskaia
dd6f2c1849 [driver] share any session for WILD vnetroot
when vnetroot creation of wild comes in it is always for "AUTH_SYS" but if
there exists a gss_session than use that.
2011-04-27 11:37:27 -04:00
Casey Bodley
880dbf8afc driver: fix for has_nfs_prefix()
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-04-20 12:46:29 -04:00
Olga Kornievskaia
5628175fbb [driver] handling UNC paths 2011-04-20 12:36:02 -04:00
Olga Kornievskaia
089a283a3a [driver] [cosmetic] changing printfs 2011-04-19 14:00:45 -04:00
Olga Kornievskaia
20493b9e88 turning off caching if WRITE_THROUGH or NO_BUFFERING is set 2011-04-14 20:14:59 -04:00
Olga Kornievskaia
7f5f903b0a [driver] [cosmetic] restructuring debugging output 2011-04-14 20:14:21 -04:00