Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 488522 - net-analyzer/tcpdump[-drop-root] - Disabling USE flag drop-root might not work, --with-user=tcpdump still present as configure parameter
Summary: net-analyzer/tcpdump[-drop-root] - Disabling USE flag drop-root might not wor...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-18 19:18 UTC by Travis Semczyszyn
Modified: 2013-12-06 04:43 UTC (History)
2 users (show)

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


Attachments
output from USE="-drop-root" emerge tcpdump (emerge-tcpdump-drop-root.txt,1.36 KB, text/plain)
2013-10-18 19:18 UTC, Travis Semczyszyn
Details
patch against tcpdump-4.5.1.ebuild, includes hateful sed hack (tcpdump-4.5.1.ebuild.patch,364 bytes, patch)
2013-12-05 17:50 UTC, Panagiotis Christopoulos (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Travis Semczyszyn 2013-10-18 19:18:36 UTC
Created attachment 361256 [details]
output from USE="-drop-root" emerge tcpdump

When trying to build tcpdump with USE="-drop-root" I can still see --with-user=tcpdump in the configure output. Shouldn't this use flag cause it to compile without dropping root privileges?
Comment 1 Tim Harder gentoo-dev 2013-11-28 05:05:33 UTC
Fixed in 4.5.1.
Comment 2 Panagiotis Christopoulos (RETIRED) gentoo-dev 2013-12-05 17:50:38 UTC
Created attachment 364682 [details, diff]
patch against tcpdump-4.5.1.ebuild, includes hateful sed hack

Bah, that didn't fix it because its build system's configure when takes --without-user and makes it --with-user="no", doesn't check for the latter to skip any action, so it creates a crazy entry:

#define WITH_USER "no" 

in config.h

which results to the funny:

((~amd64-pure)) Jupiter tcpdump # tcpdump -i enp2s0  not port 9999
tcpdump: Couldn't find user 'no'
((~amd64-pure)) Jupiter tcpdump #

output.

The sed hack in my patch fixes this for the time being but upstream should be informed (didn't do it cause I don't have a github account yet) or we should not give at all --without-user when !drop-root if they reject to fix it (they have it as it is by design). 

I open this again as it hit me and hit me hard.
Comment 3 Panagiotis Christopoulos (RETIRED) gentoo-dev 2013-12-05 18:20:56 UTC
of course, now that I think about it again, rightttt, there could be at some system a "no" user, so maybe a $(use drop-root && echo -n "--with-user=tcpdump") in place of $(use_with drop-root user tcpdump) or some similar logic would do trick.
Comment 4 Panagiotis Christopoulos (RETIRED) gentoo-dev 2013-12-05 22:42:57 UTC
back to netmon, I pressed accidentally the button to assign to myself. I can commit this myself if someone gives the ack.
Comment 5 Rick Farina (Zero_Chaos) gentoo-dev 2013-12-06 04:43:48 UTC
with 4.5.1:

ozzie ~ # tcpdump -w test.pcap -i wlan0
tcpdump: Couldn't find user 'no'


with hateful sed hack:

ozzie ~ # tcpdump -w test.pcap -i wlan0
tcpdump: listening on wlan0, link-type EN10MB (Ethernet), capture size 65535 bytes


I really don't love this fix, but works is works.  Anyone who has a better solution which is actually tested and confirmed is welcome to provide it.

+  06 Dec 2013; Rick Farina <zerochaos@gentoo.org> +tcpdump-4.5.1-r1.ebuild:
+  fix for bug #488522 thanks to pchrist