diff options
author | Shirish Pargaonkar <shirishpargaonkar@gmail.com> | 2011-05-24 14:49:56 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2011-05-24 14:49:56 -0400 |
commit | f699e959d2afadffc6a4db96b57f873f7dd5e9d9 (patch) | |
tree | 112154943ae1de7f3ccf97fbb54b2d3d11824574 /aclocal/idmap.m4 | |
parent | a6c23f4421ae02de9f01bb6264a03ede9970cb19 (diff) | |
download | cifs-utils-f699e959d2afadffc6a4db96b57f873f7dd5e9d9.tar.gz cifs-utils-f699e959d2afadffc6a4db96b57f873f7dd5e9d9.tar.bz2 cifs-utils-f699e959d2afadffc6a4db96b57f873f7dd5e9d9.zip |
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 <jlayton@redhat.com>
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Diffstat (limited to 'aclocal/idmap.m4')
-rw-r--r-- | aclocal/idmap.m4 | 45 |
1 files changed, 45 insertions, 0 deletions
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 <stdint.h> +#endif +] +[#ifdef HAVE_STDBOOL_H +#include <stdbool.h> +#endif +] +[#ifdef HAVE_STDIO_H +#include <stdio.h> +#endif +] +[#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +] +[#ifdef HAVE_ERRNO_H +#include <errno.h> +#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 +]) |