Red Hat Bugzilla – Bug 1478128
rpc.idmapd fails to initialize libnfsidmap settings due to clashing conf file parsing routines
Last modified: 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 ). Upstream  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).
Note that rpc.idmapd links against libnfsidamp:
[root@nfs-server usr]# ldd /usr/sbin/rpc.idmapd
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)
In libnfsidmap, if you pull the RPM , 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  to /lib64/libnfsidmap.so.0 : normal symbol `conf_init'
959: binding file /usr/sbin/rpc.idmapd  to /lib64/libnfsidmap.so.0 : normal symbol `conf_init'
Hence, we get the error above, and rpc.idmapd crashes after first mount.
Version-Release number of selected component (if applicable):