check_nfs41_queryea_args() will now accept EaList == NULL, unless EAs are unsupported
moved handling of cygwin EAs to new function QueryCygwinEA()
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
when open is given an ea buffer, pass it to new function nfs41_ea_set() after successful file creation. matches NTFS behavior on all dispositions: sets EAs on FILE_CREATE, FILE_OVERWRITE, FILE_OVERWRITE_IF, FILE_SUPERSEDE. does not set EAs on FILE_OPEN. only sets EAs on FILE_OPEN_IF if file did not previously exist. see new function create_with_ea()
nfs41_ea_set() returns nfs error codes. uses NFS4ERR_FBIG when the EaValueLength exceeds NFS4_EASIZE (256). this gets mapped to windows error ERROR_FILE_TOO_LARGE, which the driver now converts to STATUS_EA_TOO_LARGE
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
if an EA buffer is given on create, map it to use space and pass
it to the daemon
removed check for FILE_WRITE_EA permission; it isn't required on ntfs
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
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>
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>
on SetEaInfo for NfsV3Attributes, wait to set nfs41_fcb.mode until the upcall returns successfully
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
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.
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>
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>
use RtlUnicodeToUTF8N() instead of RtlUnicodeStringToAnsiString() to preserve unicode filenames; passes fileio test UnicodeOnDiskTest
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
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.
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.
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
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.
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