ms-nfs41-client/daemon/sources
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

32 lines
1.4 KiB
Text

TARGETTYPE=PROGRAM
TARGETNAME=nfsd
SOURCES=nfs41_daemon.c daemon_debug.c nfs41_ops.c nfs41_compound.c nfs41_xdr.c \
nfs41_server.c nfs41_client.c nfs41_superblock.c nfs41_session.c lookup.c \
mount.c open.c readwrite.c lock.c readdir.c getattr.c setattr.c upcall.c \
nfs41_rpc.c util.c pnfs_layout.c pnfs_device.c pnfs_debug.c pnfs_io.c \
name_cache.c namespace.c rbtree.c volume.c callback_server.c callback_xdr.c \
service.c symlink.c idmap.c
UMTYPE=console
USE_LIBCMT=1
#USE_MSVCRT=1
C_DEFINES=-DSTANDALONE_NFSD #-- use this for non-service nfsd
INCLUDES=..\sys;..\dll;..\libtirpc\tirpc
# Use the following for "service" version of nfsd
#TARGETLIBS=$(SDK_LIB_PATH)\ws2_32.lib $(SDK_LIB_PATH)\iphlpapi.lib \
# ..\libtirpc\src\obj$(BUILD_ALT_DIR)\*\libtirpc.lib \
# $(SDK_LIB_PATH)\kernel32.lib \
# $(SDK_LIB_PATH)\advapi32.lib \
# $(SDK_LIB_PATH)\shell32.lib
TARGETLIBS=$(SDK_LIB_PATH)\ws2_32.lib $(SDK_LIB_PATH)\iphlpapi.lib \
..\libtirpc\src\obj$(BUILD_ALT_DIR)\*\libtirpc.lib
!IF 0
/W3 is default level
bump to /Wall, but suppress warnings generated by system includes,
as well as the following warnings:
4100 - unused function call arguments (we have lots of stubs)
4127 - constant conditional (I like to use if(0) or if(1))
4220 - varargs matching remaining parameters
4204 - nonstandard extension
!ENDIF
MSC_WARNING_LEVEL=/Wall /wd4668 /wd4619 /wd4820 /wd4255 /wd4100 /wd4127 /wd4711 /wd4220 /wd4204