Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 843009

Summary: Issues mapping uids and usernames between RHEL5 server and Gentoo client for NFSv4 mount
Product: Red Hat Enterprise Linux 5 Reporter: Dennis Schridde <heri>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED WONTFIX QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.8CC: gregory.lee.bartholomew, jlayton
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-05 21:47:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dennis Schridde 2012-07-25 09:58:05 UTC
Description of problem:
When I run "chown -R portage: /var/cache/portage" (portage is mounted via NFSv4 from a RHEL5 server) on my Gentoo machine, the uids of the files/directories will be nobody instead of portage.

The issue appears to be that somewhere along the way uid 250 gets misinterpreted as a username, which the server obviously cannot resolve and hence maps to nobody.

It also appears that the transmission of usernames from the server to the client works, as they appear correctly as "portage". Only when changing uids of files on the client, the server maps it to the wrong uid.

I need assistance in debugging this issue further.

Version-Release number of selected component (if applicable):
gentoo-client # eix -ec nfs-utils
[I] net-fs/nfs-utils (1.2.3-r1@07/20/12)

rhel5-server # rpm -q nfs-utils
nfs-utils-1.0.9-60.el5

gentoo-client # uname -r
3.4.5-gentoo

rhel5-server # uname -r
2.6.18-308.11.1.el5

# cat /etc/redhat-release 
CentOS release 5.8 (Final)

Additional info:
gentoo-client # grep /var/cache/portage /etc/fstab
192.168.100.1:/gentoo/portage            /var/cache/portage                  nfs4  defaults,noatime,nodev,noexec,nosuid,noauto  0 0
192.168.100.1:/gentoo/packages-ppc64     /var/cache/portage/packages-ppc64   nfs4  defaults,noatime,nodev,noexec,nosuid,noauto  0 0
192.168.100.1:/gentoo/distfiles          /var/cache/portage/distfiles        nfs4  defaults,noatime,nodev,noexec,nosuid,noauto  0 0

gentoo-client # mount | grep /var/cache/portage
192.168.100.1:/gentoo/portage/ on /var/cache/portage type nfs4 (rw,nosuid,nodev,noexec,noatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.100.51,local_lock=none,addr=192.168.100.1)
192.168.100.1:/gentoo/packages-ppc64/ on /var/cache/portage/packages-ppc64 type nfs4 (rw,nosuid,nodev,noexec,noatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.100.51,local_lock=none,addr=192.168.100.1)
192.168.100.1:/gentoo/distfiles/ on /var/cache/portage/distfiles type nfs4 (rw,nosuid,nodev,noexec,noatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.100.51,local_lock=none,addr=192.168.100.1)

gentoo-client # getent passwd portage
portage:x:250:250:portage:/var/tmp/portage:/bin/false

rhel5-server # getent passwd portage
portage:x:250:250::/dev/null:/sbin/nologin

/var/log/everything/current on Gentoo client:
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_uid: calling nsswitch->name_to_uid_
Jul 25 11:28:03 [rpc.idmapd] nss_getpwnam: name 'portage@MYDOMAIN' domain 'MYDOMAIN': resulting localname 'portage'_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_uid: nsswitch->name_to_uid returned 0_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_uid: final return value is 0_
Jul 25 11:28:03 [rpc.idmapd] Client c: (user) name "portage@MYDOMAIN" -> id "250"
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_gid: calling nsswitch->name_to_gid_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_gid: nsswitch->name_to_gid returned 0_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_gid: final return value is 0_
Jul 25 11:28:03 [rpc.idmapd] Client c: (group) name "portage@MYDOMAIN" -> id "250"
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_uid: calling nsswitch->name_to_uid_
Jul 25 11:28:03 [rpc.idmapd] nss_getpwnam: name 'nobody@MYDOMAIN' domain 'MYDOMAIN': resulting localname 'nobody'_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_uid: nsswitch->name_to_uid returned 0_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_uid: final return value is 0_
Jul 25 11:28:03 [rpc.idmapd] Client c: (user) name "nobody@MYDOMAIN" -> id "65534"
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_gid: calling nsswitch->name_to_gid_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_gid: nsswitch->name_to_gid returned 0_
Jul 25 11:28:03 [rpc.idmapd] nfs4_name_to_gid: final return value is 0_
Jul 25 11:28:03 [rpc.idmapd] Client c: (group) name "nobody@MYDOMAIN" -> id "65534"

/var/log/messages on RHEL5 server:
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfsdcb: authbuf=192.168.100.0/24,192.168.100.51 authtype=user
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_uid_to_name: calling nsswitch->uid_to_name 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_uid_to_name: nsswitch->uid_to_name returned 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_uid_to_name: final return value is 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]:  Server: (user) id "250" -> name "portage@MYDOMAIN"
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfsdcb: authbuf=192.168.100.0/24,192.168.100.51 authtype=group
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_gid_to_name: calling nsswitch->gid_to_name 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_gid_to_name: nsswitch->gid_to_name returned 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_gid_to_name: final return value is 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]:  Server: (group) id "250" -> name "portage@MYDOMAIN"
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfsdcb: authbuf=192.168.100.0/24,192.168.100.51 authtype=user
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_uid_to_name: calling nsswitch->uid_to_name 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_uid_to_name: nsswitch->uid_to_name returned 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_uid_to_name: final return value is 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]:  Server: (user) id "99" -> name "nobody@MYDOMAIN"
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfsdcb: authbuf=192.168.100.0/24,192.168.100.51 authtype=group
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_gid_to_name: calling nsswitch->gid_to_name 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_gid_to_name: nsswitch->gid_to_name returned 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_gid_to_name: final return value is 0 
Jul 25 11:28:02 navier rpc.idmapd[26248]:  Server: (group) id "99" -> name "nobody@MYDOMAIN"
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfsdcb: authbuf=192.168.100.0/24,192.168.100.51 authtype=user
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_name_to_uid: calling nsswitch->name_to_uid 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nss_getpwnam: name '250' domain 'MYDOMAIN': resulting localname '(null)' 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nss_getpwnam: name '250' does not map into domain 'MYDOMAIN' 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_name_to_uid: nsswitch->name_to_uid returned -22 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_name_to_uid: final return value is -22 
Jul 25 11:28:02 navier rpc.idmapd[26248]:  Server: (user) name "250" -> id "99"
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfsdcb: authbuf=192.168.100.0/24,192.168.100.51 authtype=group
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_name_to_gid: calling nsswitch->name_to_gid 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_name_to_gid: nsswitch->name_to_gid returned -22 
Jul 25 11:28:02 navier rpc.idmapd[26248]: nfs4_name_to_gid: final return value is -22 
Jul 25 11:28:02 navier rpc.idmapd[26248]:  Server: (group) name "250" -> id "99"
Jul 25 11:28:09 navier dhcpd: DHCPINFORM from 130.75.26.165 via eth2: not authoritative for subnet 130.75.26.128

Portage 2.1.10.65 (default/linux/powerpc/ppc64/10.0/64bit-userland, gcc-4.5.3, glibc-2.14.1-r3, 3.4.5-gentoo ppc64)
=================================================================
System uname: Linux-3.4.5-gentoo-ppc64-Cell_Broadband_Engine,_altivec_supported-with-gentoo-2.1
Timestamp of tree: Unknown
distcc 3.1 powerpc64-unknown-linux-gnu [enabled]
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.3-r2, 3.2.3
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.6
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.4 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo x-local sunrise
ACCEPT_KEYWORDS="ppc64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="powerpc64-unknown-linux-gnu"
CFLAGS="-pipe -O2 -mcpu=cell -mabi=altivec"
CHOST="powerpc64-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-pipe -O2 -mcpu=cell -mabi=altivec"
DISTDIR="/var/cache/portage/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg --buildpkg --binpkg-respect-use --with-bdeps y --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distcc distcc-pump distlocks ebuild-locks fixlafiles news parallel-fetch parallel-install parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features
-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.spline.inf.fu-berlin.de/mirrors/gentoo/ http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
PKGDIR="/var/cache/portage/packages-ppc64"
PORTAGE_COMPRESS="xz"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/cache/portage/gentoo"
PORTDIR_OVERLAY="/var/cache/portage/local /var/cache/portage/overlays/sunrise"
[...]
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

Comment 1 Steve Dickson 2012-07-30 14:34:54 UTC
(In reply to comment #0)
> Description of problem:
> When I run "chown -R portage: /var/cache/portage" (portage is mounted via
> NFSv4 from a RHEL5 server) on my Gentoo machine, the uids of the
> files/directories will be nobody instead of portage.
> 
> The issue appears to be that somewhere along the way uid 250 gets
> misinterpreted as a username, which the server obviously cannot resolve and
> hence maps to nobody.
> 
> It also appears that the transmission of usernames from the server to the
> client works, as they appear correctly as "portage". Only when changing uids
> of files on the client, the server maps it to the wrong uid.
> 
> I need assistance in debugging this issue further.
in /etc/idmap.conf set Verbose=9

Comment 2 Dennis Schridde 2012-07-30 23:32:56 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > I need assistance in debugging this issue further.
> in /etc/idmap.conf set Verbose=9

I have in /etc/idmapd.conf:
[General]
Verbosity = 10

There is no file /etc/idmap.conf. Did you mean this setting? Is 9 more verbose than 10 - i.e. is the verbosity some bitflag? Otherwise the logs given above were created with Verbosity=10.

Comment 3 RHEL Program Management 2014-01-29 10:36:30 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 4 RHEL Program Management 2014-02-05 21:47:23 UTC
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.