Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1455923 - Static IP mapping does not allow to map groups with white space such as 'domain users'
Static IP mapping does not allow to map groups with white space such as 'doma...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libnfsidmap (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
: OtherQA
Depends On:
Blocks: 1420851 1469559
  Show dependency treegraph
 
Reported: 2017-05-26 08:49 EDT by Stefan Walter
Modified: 2018-04-10 14:51 EDT (History)
13 users (show)

See Also:
Fixed In Version: libnfsidmap-0.25-19.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 14:51:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Alternative patch with minimal rewrite (3.63 KB, patch)
2017-11-15 13:27 EST, Justin Mitchell
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1016 None None None 2018-04-10 14:51 EDT

  None (edit)
Description Stefan Walter 2017-05-26 08:49:17 EDT
Description of problem:

The INI parsing of libnfsidmap is buggy. Looking at lines 261 to 270 of

http://git.linux-nfs.org/?p=steved/libnfsidmap.git;a=blob;f=cfg.c;h=e0ab839a494ee9186089d9d2ba8d4ba39ed05c8c;hb=HEAD

one can see that the first white space (even a leading one - lines 267 to 270 are useless) terminates the key. Mapping 'domain users' does not work which really hurts our deployment:

[Static]
domain users@example.com@example.com = others


Version-Release number of selected component (if applicable):

libnfsidmap-0.25-15.el7.x86_64


How reproducible:

Always.
Comment 7 Justin Mitchell 2017-10-12 13:05:22 EDT
Patch series which merges libnfsidmap into nfs-utils, thus fixing the white space parsing issue.

http://www.spinics.net/lists/linux-nfs/msg65539.html
Comment 8 Steve Whitehouse 2017-10-24 05:23:17 EDT
Can you check with Steve D how to get this fixed, since we are running out of time for doing larger changes in 7.5 now. Since this is on the RPL we need to move this bug on, or agree to defer to 7.6 at this stage.
Comment 9 Steve Dickson 2017-10-24 14:53:03 EDT
(In reply to Justin Mitchell from comment #7)
> Patch series which merges libnfsidmap into nfs-utils, thus fixing the white
> space parsing issue.
> 
> http://www.spinics.net/lists/linux-nfs/msg65539.html

I was just thinking about this... I don't think
we can put these patches in to merge libnfsidmap
into nfs-utils because it changes the RHEL ABI.

Packages that are now dependent on libnfsidmap will 
have to change to nfs-utils which I don't think 
is legal in a RHEL update release.

So I'm thinking this merge will have to be a RHEL8 thing.
The merge should probably start in Fedora.
Comment 10 Steve Dickson 2017-10-24 14:53:54 EDT
Wit that said... I guess we just need to pull in the patches that fix this bug.
Comment 11 Justin Mitchell 2017-10-24 17:32:33 EDT
These patches only need to merge the two SRPMS into one, it can still output two separate binary RPMS with the existing names. If libnfsidmap is listed as a subpackage within the nfs-utils spec file but with a non-derivate (-n) %package name.

The ABI stays exactly the same, the RPM filenames stay the same, even the dependencies would stay the same, only difference is the SRPM they came from.

If you can point me at where you keep the spec file for nfs-utils I am happy to make the changes for you to test.
Comment 12 Steve Dickson 2017-10-25 08:47:05 EDT
(In reply to Justin Mitchell from comment #11)
> These patches only need to merge the two SRPMS into one, it can still output
> two separate binary RPMS with the existing names. If libnfsidmap is listed
> as a subpackage within the nfs-utils spec file but with a non-derivate (-n)
> %package name.
> 
> The ABI stays exactly the same, the RPM filenames stay the same, even the
> dependencies would stay the same, only difference is the SRPM they came from.
> 
> If you can point me at where you keep the spec file for nfs-utils I am happy
> to make the changes for you to test.

fedpkg clone nfs-utils for fedora 
rhpkg clone nfs-utils for rhel
Comment 20 Steve Dickson 2017-11-15 09:31:17 EST
*** Bug 1498210 has been marked as a duplicate of this bug. ***
Comment 21 Justin Mitchell 2017-11-15 13:27 EST
Created attachment 1352845 [details]
Alternative patch with minimal rewrite

This is a minimal rewrite of the config parser code which should fix the whitespace issue without adding in any of the newer features that the nfs-utils version contains, like quoted strings or section arguments.
Comment 22 Steve Dickson 2017-11-15 14:22:34 EST
(In reply to Justin Mitchell from comment #21)
> Created attachment 1352845 [details]
> Alternative patch with minimal rewrite
> 
> This is a minimal rewrite of the config parser code which should fix the
> whitespace issue without adding in any of the newer features that the
> nfs-utils version contains, like quoted strings or section arguments.

Unfortunately does not apply to the latest version in libnfsidmap
Will take a quick look...
Comment 23 Steve Dickson 2017-11-15 14:43:08 EST
Under http://people.redhat.com/steved/.bz1455923/

I put an rpm that has Justin backported patch which
I believe takes care of the problem... would it be
possible to verify this?
Comment 24 Justin Mitchell 2017-11-16 04:21:04 EST
(In reply to Steve Dickson from comment #22)
> (In reply to Justin Mitchell from comment #21)
> > Created attachment 1352845 [details]
> > Alternative patch with minimal rewrite
> > 
> > This is a minimal rewrite of the config parser code which should fix the
> > whitespace issue without adding in any of the newer features that the
> > nfs-utils version contains, like quoted strings or section arguments.
> 
> Unfortunately does not apply to the latest version in libnfsidmap
> Will take a quick look...

Odd, I based it on my checkout of the libnfsidmap git tree, head of which was ba7daeb, which i couldnt update as you have now removed/locked the origin.
Comment 26 Stefan Walter 2017-11-28 05:40:23 EST
I tried the libnfsidmap-0.25-18.el7 RPM with the following idmapd.conf

[Translation]
Method = static, nsswitch

[Static]
domain users = users
domain users@ethz.ch = users
domain users@d.ethz.ch@ethz.ch = users

Didn't work and I found the following log entry:

Nov 28 11:31:01 muster nfsidmap[1674]: static_getpwnam: localname 'users' for 'domain' not found
Nov 28 11:31:01 muster nfsidmap[1674]: key: 0x2a5369b0 type: gid value: domain users@d.ethz.ch@ethz.ch timeout 600
Nov 28 11:31:01 muster nfsidmap[1674]: nfs4_name_to_gid: calling static->name_to_gid
Nov 28 11:31:01 muster nfsidmap[1674]: nfs4_name_to_gid: static->name_to_gid returned -2
Nov 28 11:31:01 muster nfsidmap[1674]: nfs4_name_to_gid: calling regex->name_to_gid

The '... static_getpwnam: localname 'users' ...' looks strange to me in the context of a group lookup. Can I have the SRPM for ibnfsidmap-0.25-18.el7 to debug?
Comment 27 Justin Mitchell 2017-11-28 06:01:37 EST
For the SRPMs that I can find, -18 had the patch file but it was empty, -19 contains the fix properly.
Comment 28 Yongcheng Yang 2017-11-29 00:07:33 EST
Thank Justin for the clarification.

Hi Steve, would you please help to share libnfsidmap-0.25-19.el7 out?
Comment 29 Steve Dickson 2017-11-29 07:20:07 EST
(In reply to Stefan Walter from comment #26)
> 
> The '... static_getpwnam: localname 'users' ...' looks strange to me in the
> context of a group lookup. Can I have the SRPM for ibnfsidmap-0.25-18.el7 to
> debug?
I just updated the rpms under http://people.redhat.com/steved/.bz1455923/
Please give them another try... Thank you!
Comment 30 Stefan Walter 2017-12-11 08:12:02 EST
Just tried libnfsidmap-0.25-19.el7 and with the following sections I get 'domain users' mapped to the local 'users' group:

[Static]
D\domain users@ETHZ.CH = users

[Translation]
Method = static, nsswitch

Seems to work!
Comment 31 Steve Dickson 2018-01-03 12:04:15 EST
(In reply to Stefan Walter from comment #30)
> Just tried libnfsidmap-0.25-19.el7 and with the following sections I get
> 'domain users' mapped to the local 'users' group:
> 
> [Static]
> D\domain users@ETHZ.CH = users
> 
> [Translation]
> Method = static, nsswitch
> 
> Seems to work!

Thank you!
Comment 32 Yongcheng Yang 2018-02-25 21:23:19 EST
Moving to VERIFIED according to comment #30. Thanks for your help!
Comment 35 errata-xmlrpc 2018-04-10 14:51:32 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1016

Note You need to log in before you can comment on or make changes to this bug.