From: Steinar H. Gunderson Date: Sat, 23 Dec 2006 12:28:20 +0000 (+0100) Subject: Make mountd complain on unsupported uid mapping schemes X-Git-Tag: nfs-utils-1-0-11~29 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=e673ca14c730ae4ed9e2acaea764c669d2b00433;p=nfs-utils.git Make mountd complain on unsupported uid mapping schemes The NFS kernel server does not support uid mappings, activated with flags such as "map_daemon" in exports. There is already code that parses these flags, and gives an error at mount time if an unsupported flag (ie. any but the default) is given. However, at some point the kernel changed the export interface, and the new code forgot to include the relevant check. Thus, simply copy the check from the old to the new code, which makes sure mountd behaves the same in this aspect regardless of kernel version, and makes sure the admin does not inadvertently use map_daemon and expect it to work. Signed-off-by: Steinar H. Gunderson --- diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index dcb5dac..e8d42ae 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -377,6 +377,12 @@ int cache_export(nfs_export *exp) int err; FILE *f; + if (exp->m_export.e_maptype != CLE_MAP_IDENT) { + xlog(L_ERROR, "%s: unsupported mapping; kernel supports only 'identity' (default)", + exp->m_export.m_path); + return; + } + f = fopen("/proc/net/rpc/auth.unix.ip/channel", "w"); if (!f) return -1;