Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 576278 - sys-libs/glibc: add USE=rpc or USE=nis to control sunrpc export
Summary: sys-libs/glibc: add USE=rpc or USE=nis to control sunrpc export
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on: glibc-rpc
Blocks:
  Show dependency tree
 
Reported: 2016-03-02 19:27 UTC by uran238
Modified: 2016-03-30 22:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
added nis and sunrpc useflag (glibc-2.22-r2.ebuild,6.53 KB, text/plain)
2016-03-02 19:27 UTC, uran238
Details

Note You need to log in before you can comment on or make changes to this bug.
Description uran238 2016-03-02 19:27:21 UTC
Created attachment 427242 [details]
added nis and sunrpc useflag

Glibc builds and installs by default the obsolete RPC code, which is superseeded by libtirpc and the rarely used NIS nss modules. 
This increases the size of libc and, even worse, some programs link against libnsl (NIS), without being asked to do so (potential security implications).

For an embedded project I created an ebuild which has the mentioned use flags, so these features can be disabled. The size of libc.so.6 itself was reduced by about 70KiB (6%) on ARM.

I tested the ebuild on my desktop system, the following packages linked against libnsl and after merging @preserved-rebuild were fine without it.
net-libs/libasyncns
dev-libs/xerces-c
dev-lang/perl
www-client/w3m
net-libs/libvncserver
dev-lang/python
net-misc/openvpn
net-misc/openssh
kde-frameworks/kio
kde-base/kdelibs
kde-apps/kopete

libtirpc won't build anymore, but it looks like all problems have already been solved by buildroot. 

How are the prospects of getting these useflags included in future glibc ebuilds? Other nis modules like hesiod could be made optional as well, but these are just unused files without any influence on libc.6.so.

The changes to glibc are:

if ! use sunrpc ; then
	sed -i 's:sunrpc::' sysdeps/unix/inet/Subdirs
fi

if ! use nis ; then
	sed -i 's:nis::' sysdeps/unix/inet/Subdirs
fi



Tags:
disable nis rpc sunrpc
Comment 1 SpanKY gentoo-dev 2016-03-04 16:00:15 UTC
we're not going to add USE flags that change the ABI

the rpc code can have its exported API disabled by passing --disable-obsolete-rpc but it would still carry the internal code for old linked apps

libtirpc also is not a full replacement (yet) sadly.  see bug 381391 for more.
Comment 2 uran238 2016-03-11 21:31:26 UTC
I tried the ebuild on another machine and the the transition wasn't as smooth as on the first one. On some applications I got:

relocation error: /lib64/libnsl.so.1: symbol xdr_void, version GLIBC_2.2.5 not defined in file libc.so.6 with link time reference

re-merging glibc was still possible.
Comment 3 SpanKY gentoo-dev 2016-03-30 22:07:44 UTC
i've added USE=rpc to glibc-2.23+ and labeled it experimental.  any other requests should go through upstream.

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7998e81a4b5423a4501ee8faee05089c9f3df7c5