Skip to contentSkip to conversation

nfs-utils: Add nfsidmap (take 2)

PATCH In review Steve Dickson 1 participant 4 messages Nov 19, 2010 – Nov 22, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover nfs-utils: Add nfsidmap (take 2)

The is a re-post of Bryan origin patches that added in the new nfsidmap program. I tweaked them in the following ways:

Rename the binary from nfs.idmap to nfsidmap to maintain conformity with the rest of the binary names.

Since do not like to commit patches that do not compile, I moved all the autoconfig setting to the second patch. Then I re-wrote Trond's patch to not compile the nfsidmap code when libnfsidmap does not have the updated support instead of failing the compilation.

Bryan Schumaker (1):
Add the new nfsidmap program

Steve Dickson (1):
Enable nfsidmap to compile

 aclocal/keyutils.m4         |   11 ++++
 aclocal/libnfsidmap.m4      |    4 ++
 configure.ac                |    7 +++
 utils/Makefile.am           |    3 +
 utils/nfsidmap/Makefile.am  |    9 +++
 utils/nfsidmap/nfsidmap.c   |  118 +++++++++++++++++++++++++++++++++++++++++++
 utils/nfsidmap/nfsidmap.man |   60 ++++++++++++++++++++++
 7 files changed, 212 insertions(+), 0 deletions(-)
 create mode 100644 aclocal/keyutils.m4
 create mode 100644 utils/nfsidmap/Makefile.am
 create mode 100644 utils/nfsidmap/nfsidmap.c
 create mode 100644 utils/nfsidmap/nfsidmap.man
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/2 Add the new nfsidmap program

From: Bryan Schumaker <[email protected]>

This patch adds the nfsidmap program to nfs-utils. This program is called by the nfs idmapper through request-keys to map between uid / user name and gid / group name.

---
 aclocal/keyutils.m4         |   11 ++++
 configure.ac                |    4 ++
 utils/nfsidmap/Makefile.am  |    9 +++
 utils/nfsidmap/nfsidmap.c   |  118 +++++++++++++++++++++++++++++++++++++++++++
 utils/nfsidmap/nfsidmap.man |   60 ++++++++++++++++++++++
 5 files changed, 202 insertions(+), 0 deletions(-)
 create mode 100644 aclocal/keyutils.m4
 create mode 100644 utils/nfsidmap/Makefile.am
 create mode 100644 utils/nfsidmap/nfsidmap.c
 create mode 100644 utils/nfsidmap/nfsidmap.man
aclocal/keyutils.m4 new file +11 -0
new file mode 100644
index 0000000..84bc112
@@ -0,0 +1,11 @@
+dnl Checks for keyutils library and headers
+dnl
+AC_DEFUN([AC_KEYUTILS], [
+
+  dnl Check for libkeyutils; do not add to LIBS if found
+  AC_CHECK_LIB([keyutils], [keyctl_instantiate], [LIBKEYUTILS=-lkeyutils], ,)
+  AC_SUBST(LIBKEYUTILS)
+
+  AC_CHECK_HEADERS([keyutils.h], ,
+  		   [AC_MSG_ERROR([keyutils.h header not found.])])
+])dnl
configure.ac +4 -0
index 5408e85..b39dbcd 100644
@@ -247,6 +247,9 @@ if test "$enable_nfsv4" = yes; then
   dnl check for nfsidmap libraries and headers
   AC_LIBNFSIDMAP
 
+  dnl check for the keyutils libraries and headers
+  AC_KEYUTILS
+
   dnl librpcsecgss already has a dependency on libgssapi,
   dnl but we need to make sure we get the right version
   if test "$enable_gss" = yes; then
@@ -435,6 +438,7 @@ AC_CONFIG_FILES([
 	utils/mountd/Makefile
 	utils/nfsd/Makefile
 	utils/nfsstat/Makefile
+	utils/nfsidmap/Makefile
 	utils/showmount/Makefile
 	utils/statd/Makefile
 	tests/Makefile
utils/nfsidmap/Makefile.am new file +9 -0
new file mode 100644
index 0000000..f837b91
@@ -0,0 +1,9 @@
+## Process this file with automake to produce Makefile.in
+
+man8_MANS = nfsidmap.man
+
+sbin_PROGRAMS	= nfsidmap
+nfsidmap_SOURCES = nfsidmap.c
+nfsidmap_LDADD = -lnfsidmap -lkeyutils
+
+MAINTAINERCLEANFILES = Makefile.in
utils/nfsidmap/nfsidmap.c new file +118 -0

118 lines not on this page · raw message

utils/nfsidmap/nfsidmap.man new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
1.7.3.2
#2 lore raw

PATCH 2/2 Enable nfsidmap to compile

In reply to Steve Dickson

Only enable the compilation of nfsidmap when libnfsidmap support it.

---
 aclocal/libnfsidmap.m4 |    4 ++++
 configure.ac           |    3 +++
 utils/Makefile.am      |    3 +++
 3 files changed, 10 insertions(+), 0 deletions(-)
aclocal/libnfsidmap.m4 +4 -0
index cfcde2f..e636604 100644
@@ -14,4 +14,8 @@ AC_DEFUN([AC_LIBNFSIDMAP], [
                [AC_DEFINE([HAVE_NFS4_SET_DEBUG], 1,
                           [Define to 1 if you have the `nfs4_set_debug' function.])])
 
+  dnl only enable nfsidmap when libnfsidmap supports it
+  AC_CHECK_LIB([nfsidmap], [nfs4_owner_to_uid], [enable_nfsidmap=1],
+               [enable_nfsidmap=0])
+
 ])dnl
configure.ac +3 -0
index b39dbcd..92833e3 100644
@@ -247,6 +247,9 @@ if test "$enable_nfsv4" = yes; then
   dnl check for nfsidmap libraries and headers
   AC_LIBNFSIDMAP
 
+  dnl enable nfsidmap when its support by libnfsidmap
+  AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$enable_nfsidmap" = "yes"])
+
   dnl check for the keyutils libraries and headers
   AC_KEYUTILS
 
utils/Makefile.am +3 -0
index 8665183..a0ea116 100644
@@ -4,6 +4,9 @@ OPTDIRS =
 
 if CONFIG_NFSV4
 OPTDIRS += idmapd
+if CONFIG_NFSIDMAP
+OPTDIRS += nfsidmap
+endif
 endif
 
 if CONFIG_GSS
Signature · 1 line
1.7.3.2
#3 lore raw
In reply to Steve Dickson
Quoted 19 lines · Steve Dickson

The is a re-post of Bryan origin patches that added in the new nfsidmap program. I tweaked them in the following ways:

Rename the binary from nfs.idmap to nfsidmap to maintain conformity with the rest of the binary names.

Since do not like to commit patches that do not compile, I moved all the autoconfig setting to the second patch. Then I re-wrote Trond's patch to not compile the nfsidmap code when libnfsidmap does not have the updated support instead of failing the compilation.

Bryan Schumaker (1):
Add the new nfsidmap program

Steve Dickson (1):
Enable nfsidmap to compile

Quoted 13 lines
 aclocal/keyutils.m4         |   11 ++++
 aclocal/libnfsidmap.m4      |    4 ++
 configure.ac                |    7 +++
 utils/Makefile.am           |    3 +
 utils/nfsidmap/Makefile.am  |    9 +++
 utils/nfsidmap/nfsidmap.c   |  118 +++++++++++++++++++++++++++++++++++++++++++
 utils/nfsidmap/nfsidmap.man |   60 ++++++++++++++++++++++
 7 files changed, 212 insertions(+), 0 deletions(-)
 create mode 100644 aclocal/keyutils.m4
 create mode 100644 utils/nfsidmap/Makefile.am
 create mode 100644 utils/nfsidmap/nfsidmap.c
 create mode 100644 utils/nfsidmap/nfsidmap.man

Committed...

steved.