Linux: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS (user namespaces)
commit30160ad6eec3c290a770b6069fc106f452e5b4ba
authorAnders Kaseorg <andersk@mit.edu>
Thu, 31 Oct 2013 13:11:59 +0000 (31 09:11 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Thu, 14 Nov 2013 13:35:16 +0000 (14 05:35 -0800)
tree31eecfb156fa7d569b7706670db33dde4a786f75
parent70790f87b7b0ef3746c043a868c4306e05008ecd
Linux: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS (user namespaces)

With CONFIG_UIDGID_STRICT_TYPE_CHECKS (a dependency of user namespace
support, CONFIG_USER_NS) turned on, uid_t and kuid_t are different
types, as are gid_t and kgid_t, and we need to use namespace-dependent
functions to convert between them.

We can’t use init_user_ns as the namespace because it’s GPL-only, so
instead we grab the current user_ns at module load time.

This is required to support kernels with user namespace support.  We
don’t yet have full support for independent AFS use by different users
in a multiuser container; that will need to wait for future work.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10386
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit b7f4f2023b2b3e1aac46715176940fb50cc75265)

Change-Id: I55fb7d4ccbed2b4381937270955b117244b80719
Reviewed-on: http://gerrit.openafs.org/10457
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
acinclude.m4
src/afs/LINUX/osi_compat.h
src/afs/LINUX/osi_cred.c
src/afs/LINUX/osi_groups.c
src/afs/LINUX/osi_machdep.h
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_pag_module.c
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test4.m4