2006-12-23 12:28:17

by Steinar H. Gunderson

[permalink] [raw]
Subject: [PATCH] Make mountd complain on unsupported uid mapping schemes

[As usual, please Cc me on any replies]

I just put the following patch into Debian's nfs-utils; I thought it might be
useful for upstream as well:

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 <[email protected]>

--- nfs-utils-1.0.10.orig/utils/mountd/cache.c
+++ nfs-utils-1.0.10/utils/mountd/cache.c
@@ -381,6 +381,12 @@
{
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;

/* Steinar */
--
Homepage: http://www.sesse.net/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs