Small update on the package includes SELinux support: set_opt HAVE_SELINUX use selinux However, I still had to do some tweaking to get it to link with libselinux properly: """ x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -lselinux -Llib -o rarp rarp.o -lnet-tools netstat.o: In function `prg_cache_load': netstat.c:(.text+0xa0c): undefined reference to `getpidcon' netstat.c:(.text+0xa89): undefined reference to `freecon' netstat.o: In function `main': netstat.c:(.text+0x556d): undefined reference to `is_selinux_enabled' collect2: ld returned 1 exit status """ Putting -lselinux before the LDFLAGS (for instance in the Makefile directly, where netstat is built: """ $(CC) -lselinux $(LDFLAGS) ... """ or prepend to LDFLAGS rather than append. Not sure though why this is important, I'll have to look into the details of ld for that first. Assigning to myself until I have a patch + reason ;) Reproducible: Always
Created attachment 347942 [details, diff] Makefile fix to add -lselinux at end of compile statement This patch file fixes the Makefile in net-tools to use an EXTRALIBS variable (instead of LDFLAGS) to append -lselinux to. The $(EXTRALIBS) is used at the end of the $(CC) call (like is done with other linkage targets).
Created attachment 347944 [details, diff] ebuild patch to enable SELinux support and apply beforementioned fix This patch applies against the net-tools ebuild and enables SELinux support as well as applies the above mentioned patch against the Makefile.
Comment on attachment 347944 [details, diff] ebuild patch to enable SELinux support and apply beforementioned fix we're not applying patches to the source anymore
Comment on attachment 347942 [details, diff] Makefile fix to add -lselinux at end of compile statement i've committed these upstream instead: http://sourceforge.net/p/net-tools/code/ci/4fa493927df676065fefabeee385ff10a3080cc7 http://sourceforge.net/p/net-tools/code/ci/266c1405a6c99fcfc4eba650eaf0061dd4939c25/
should be all set now in the tree; thanks for the report! Commit message: Version bump w/cleaned up selinux support http://sources.gentoo.org/sys-apps/net-tools/net-tools-1.60_p20130513023548.ebuild?rev=1.1 http://sources.gentoo.org/sys-apps/net-tools/net-tools-9999.ebuild?r1=1.3&r2=1.4