Bug 1478128 - rpc.idmapd fails to initialize libnfsidmap settings due to clashing conf file parsing routines
rpc.idmapd fails to initialize libnfsidmap settings due to clashing conf file...
Status: NEW
Product: Fedora
Classification: Fedora
Component: libnfsidmap (Show other bugs)
26
All Linux
unspecified Severity high
: ---
: ---
Assigned To: Steve Dickson
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-03 12:03 EDT by Scott Mayhew
Modified: 2017-08-03 12:03 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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)

  None (edit)
Description Scott Mayhew 2017-08-03 12:03:36 EDT
Description of problem:

Spun off from bug 1477231:

Close: the issue is in libnfsidmap actually. 

Note that rpc.idmapd is from nfs-utils (with patches carried by Fedora [0]). Upstream [1] defines conf_init to be `void conf_init(void)` (in support/nfs/conffile.c:373). However, Fedora ships a patch (nfs-utils-2.1.2-rc4.patch?) which updates this to be `void conf_init(const char *conf_file)` (in supporf/nfs/conffile.c:529 after patches), replacing the global variable conf_path with an explicit passed-in argument. This is what rpc.idmapd is built against, and contains guards to replace conf_path with a default if conf_path is NULL, (and further, utils/idmapd/idmapd.c contains code to set it appropriately as well, so it should never be NULL).

==HOWEVER==

Note that rpc.idmapd links against libnfsidamp:

[root@nfs-server usr]# ldd /usr/sbin/rpc.idmapd
        linux-vdso.so.1 (0x00007ffffab5a000)
        libevent-2.0.so.5 => /lib64/libevent-2.0.so.5 (0x00007fc8a80ae000)
        libnfsidmap.so.0 => /lib64/libnfsidmap.so.0 (0x00007fc8a7ea6000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc8a7ad5000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc8a78b6000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fc8a76b2000)
        libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fc8a7497000)
        /lib64/ld-linux-x86-64.so.2 (0x0000561818709000)


In libnfsidmap, if you pull the RPM [2], it defines, in "cfg.c", a function conf_init which closely mirrors upstream's conf_init (an older version?) in that it uses conf_path and much of the same structure. However, this code has not been updated to reflect the new conf_init that rpc.idmapd is using. 

So, conf_path (the global) is NULL, and conf_init from the libnfsidmap package is being used:

# LD_DEBUG="bindings" ldd -r /usr/sbin/rpc.idmapd 2>&1 | grep 'conf_init'
       959:     binding file /lib64/libnfsidmap.so.0 [0] to /lib64/libnfsidmap.so.0 [0]: normal symbol `conf_init'
       959:     binding file /usr/sbin/rpc.idmapd [0] to /lib64/libnfsidmap.so.0 [0]: normal symbol `conf_init'


Hence, we get the error above, and rpc.idmapd crashes after first mount.


[0]: https://dl.fedoraproject.org/pub/fedora/linux/releases/26/Everything/source/tree/Packages/n/nfs-utils-2.1.1-5.rc4.fc26.src.rpm
[1]: https://www.kernel.org/pub/linux/utils/nfs-utils/2.1.1/nfs-utils-2.1.1.tar.xz
[2]: https://dl.fedoraproject.org/pub/fedora/linux/releases/26/Everything/source/tree/Packages/l/libnfsidmap-0.27-1.fc26.src.rpm



Version-Release number of selected component (if applicable):
libnfsidmap-0.27-1.fc26

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