Commit graph

18 commits

Author SHA1 Message Date
Olga Kornievskaia
8b49beda10 [VS] adding needed cflags for 32bit build 2011-08-19 11:07:21 -04:00
Casey Bodley
8ef3ec9247 cosmetic: recovery.c for client state recovery
recovery.h exposes the following functions for nfs41_compound.c:

nfs41_recovery_start_or_wait()
nfs41_recovery_finish()
nfs41_recover_client_state()
nfs41_recover_stateid()

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-08-05 14:32:17 -04:00
Casey Bodley
0bee545e91 deleg: use delegations to satisfy opens locally
added delegation.c and .h

nfs41_client stores a list of nfs41_delegation_state
new function nfs41_delegate_open() to look for a compatible delegation before calling nfs41_open()
if nfs41_open() is granted a delegation, call nfs41_delegation_granted() to register it with the client
client calls nfs41_client_delegation_free() on unmount to free list of delegations

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-07-18 15:24:21 -04:00
Casey Bodley
2b5a5fb071 daemon: cleaned up compiler warnings
raised warning level to /Wall
changed nfs41_file_info.owner, owner_group to char[] to avoid casting

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-07-18 15:24:20 -04:00
Casey Bodley
32be705e4d test: asio.exe for async reads and writes
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-04-12 14:49:32 -04:00
Olga Kornievskaia
ab55e6e8c5 first stab at handling security irp
Basic handling of owner and group security query (no dacl).

Added new upcall for NFS41_ACL_QUERY (driver and daemon code).

Daemon, upon getting NFS41_ACL_QUERY first places a getattr that has
owner, group attribute request. We currently don't cache them!!!

Then, we parse nfs4name format (ie user@domain or group@domain)
into user and domain. We currently ignore domain part!!!

Then, we assume that whatever we are mapping is "known" locally
(ie LookupAccountName() api which retrieves a SID for a given name).
Mapping from name to SID can only be done in the userland. We then
copy the bytes via the upcall pipe to the kernel. If the received
user or group cant be mapped via LookupAccoundName(), we create a
well known null SID as the reply.

Kernel creates a security descriptor in the absolute-format and adds
owner and group sids to it. Important: RtlSetOwner/Group functions only
work with absolute-format security descriptor, however the reply to the
user needs to be in the self-relative format.

The way security query works is that it passes us a buffer to be filled
with the security context. However the user doesn't know how big the
buffer should be so, the user is allowed to pass a null buffer and have
the kernel return how much memory is needed. This leads to 2 security
queries => 2 NFS41_ACL_QUERY upcalls => 2 getattr rpcs... It should be
improved.

TODO:
- need to add caching of owner/group attributes for a file?
- need to add calls to LDAP for more general mapping?
- need to cache reply of the ACL if supplied length is 0?
2011-03-22 17:21:13 -04:00
Olga Kornievskaia
47b0ccda9c turning callback off for krb5p
sspi requires strict ordering of messages. we can't have more than 1 outstanding rpc thus, hold the lock over send and receive and turn off callbacks.
2011-02-03 13:13:10 -05:00
Casey Bodley
2286f7a1e3 build.vc10: added secur32.lib to all libtirpc configurations
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-01-04 13:44:02 -05:00
Casey Bodley
f63528064c build.vc10: updated warning settings for visual studio projects
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-12-10 13:49:37 -05:00
Olga Kornievskaia
b9494c3ccc first stab at SSPI leaving gss calls in 2010-12-02 14:22:04 -05:00
Casey Bodley
32f9fa9334 replace rbtree implementation with tree.h from freebsd
added tree.h from freebsd repository and ported our name cache and client owner code

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-12-01 10:25:29 -05:00
Casey Bodley
cd1251758d idmap.c for ldap caching and configuration
struct idmap_context contains configuration data (struct idmap_config), a cache for users, and a cache for groups.  idmap_context is declared in idmap.c, and only available as an opaque pointer (nfs41_idmapper) elsewhere.  similarly, Winldap.h is only included by idmap.c, and not needed elsewhere

nfs41_idmap_create() allocates the idmap_context, loads the configuration from file, and calls ldap_init().  it does not call ldap_connect(); we'll still be able to start the daemon if ldap isn't configured, or the ldap server is down.  calling ldap_connect() is optional, as any ldap operation that requires a connection will establish it internally.  this behavior, along with the LDAP_OPT_AUTO_RECONNECT option (defaults to on), means that we shouldn't have to maintain a separate connection for each thread

nfs41_idmap_*() functions return windows errors codes.  LDAP_RETCODEs are mapped to windows errors with LdapMapErrorToWin32()

the user and group caches share a common generic interface in struct idmap_cache, which uses a linked list for storage, and protects access with a SRWLOCK.  expiration of cache entries can be adjusted by the config option 'cache_ttl'

struct config_option g_options[] is a table of available config options and their default values.  this patch adds a 'ms-nfs41-idmap.conf' file with all possible options set to default values, and commented out.  the daemon expects to find this file under c:\etc\, and won't start if it can't be opened or parsed

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-11-08 12:54:40 -05:00
unknown
8688d75574 adding env.props to mount 2010-11-03 14:18:02 -04:00
Casey Bodley
0db42ed126 symlink: daemon parses SYMLINK upcall
added symlink.c for parse_symlink() and marshall_symlink()

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-14 12:42:33 -04:00
unknown
bc0b161fc6 STANDALONE_NFSD enabled 2010-10-14 11:45:51 -04:00
unknown
0fc82009a5 adding env.props to libtirpc 2010-10-13 18:40:10 -04:00
Casey Bodley
c80946b258 first stab at nfsd as a service 2010-10-12 10:36:03 -04:00
Casey Bodley
0ad4db4fad fresh git tree for public release
we regretfully had to remove our git history for licensing reasons

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:15:48 -04:00