From f699e959d2afadffc6a4db96b57f873f7dd5e9d9 Mon Sep 17 00:00:00 2001 From: Shirish Pargaonkar Date: Tue, 24 May 2011 14:49:56 -0400 Subject: cifs-utils: Create new binary cifs.idmap for sid to uid/gid mapping (try #4) Handle cifs.idmap type of key. Extract a SID string from the description and map it to either an uid or gid using winbind APIs. If that fails (e.g. because winbind is not installed/running or winbind returns an error), kernel assigns uid and gid (from mount superblock). Enable including winbind header files and idmapping code conditional to winbind devel rpms (header and library). An entry such as this create cifs.idmap * * /usr/sbin/cifs.idmap %k is needed in the file /etc/request-key.conf. [Note: Modified to not build new tool by default, and to fix up some whitespace munging] Modified-by: Jeff Layton Signed-off-by: Shirish Pargaonkar --- aclocal/idmap.m4 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 aclocal/idmap.m4 (limited to 'aclocal/idmap.m4') diff --git a/aclocal/idmap.m4 b/aclocal/idmap.m4 new file mode 100644 index 0000000..211d372 --- /dev/null +++ b/aclocal/idmap.m4 @@ -0,0 +1,45 @@ +dnl Headers needed by wbclient.h +dnl +AC_DEFUN([AC_WBCH_COMPL],[ +[ +#ifdef HAVE_STDINT_H +#include +#endif +] +[#ifdef HAVE_STDBOOL_H +#include +#endif +] +[#ifdef HAVE_STDIO_H +#include +#endif +] +[#ifdef HAVE_STDLIB_H +#include +#endif +] +[#ifdef HAVE_ERRNO_H +#include +#endif +]]) + +dnl Check for wbclient.h header and libwbclietn.so +dnl +AC_DEFUN([AC_TEST_WBCHL],[ +if test $enable_cifsidmap != "no"; then + AC_CHECK_HEADERS([wbclient.h], , [ + if test "$enable_cifsidmap" = "yes"; then + AC_MSG_ERROR([wbclient.h not found, consider installing libwbclient-devel.]) + else + AC_MSG_WARN([wbclient.h not found, consider installing libwbclient-devel. Disabling cifs.idmap.]) + enable_cifsidmap="no" + fi + ], [ AC_WBCH_COMPL ]) +fi + +if test $enable_cifsidmap != "no"; then + AC_CHECK_LIB([wbclient], [wbcStringToSid], + [ WINB_LDADD='-lwbclient' ] [ AC_DEFINE(HAVE_LIBWBCLIENT, 1, ["Define var have_libwbclient"]) ], [AC_MSG_ERROR([No functioning wbclient library found!])]) + AC_SUBST(WINB_LDADD) +fi +]) -- cgit v1.2.3