Debian Developers - Bash /dev/tcp and /dev/udp

This is Interesting: Free IT Magazines  
Home > Archive > Debian Developers > November 2006 > Bash /dev/tcp and /dev/udp





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Bash /dev/tcp and /dev/udp
Klaus Ethgen

2006-11-23, 7:35 am

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

from the bash manpage:
/dev/tcp/host/port
If host is a valid hostname or Internet address, and port
is an integer port number or service name, bash attempts
to open a TCP connection to the corresponding socket.
/dev/udp/host/port
If host is a valid hostname or Internet address, and port
is an integer port number or service name, bash attempts
to open a UDP connection to the corresponding socket.

But this feature doesn't work on debian systems (on other distributions
it works and is not a problem).

For this feature there are several scripts and tools around which use
this feature. Moreover if you want to make a net boot image where you
need to contact a other host easy there is no way to do this with debian
Linux so I have to switch to an other distribution like RedHat or even
Susi^He.

The related bug report is tagged as wontfix (146464) but this is absolute
not reasonable.

Best wishes
Klaus Ethgen
- --
Klaus Ethgen http://www.ethgen.de/
pub 2048R/D1A4EDE5 2000-02-26 Klaus Ethgen <Klaus@Ethgen.de>
Fingerprint: D7 67 71 C4 99 A6 D4 FE EA 40 30 57 3C 88 26 2B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iQEVAwUBRWWGQJ+OKpjRpO3lAQL70Af9GwGu/sJ8nes8Nh6fRxpW6nsNuFwvqWAt
vMBosAmSBdpZWtUoOkCE2Figm+csHML1GDeLn7P9
RCcTfzgoVPGpXqlgBG3bAokS
FNU36wOwEQQ/ 1G1+daCvUmSsqMsyIGt6DNrRNr7q3wfHjPJXPiXJ
bAOQfvAh9LRT
5tk67EamhLoebVxSdC3wSc/d/dDlm/53L9v5oPeGceZrmqkqjovXTeAjIUkGehd5
j43DKEnUaSIEAsNDRvy6EyHy6zrVeoYQHainNqCT
qhKg2MBmjCYa/ORkm8tpJtnt
Tsjf54pg8V8PuUE3ChcKJ+pg/WxgToZQHfF6QUCunDLwiGlRXVp6+w==
=PHYH
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Steve Kemp

2006-11-23, 7:35 am

On Thu, Nov 23, 2006 at 12:30:09PM +0100, Klaus Ethgen wrote:

> For this feature there are several scripts and tools around which use
> this feature. Moreover if you want to make a net boot image where you
> need to contact a other host easy there is no way to do this with debian
> Linux so I have to switch to an other distribution like RedHat or even
> Susi^He.


Of course there is. Using netcat, telnet, ftp, tftp, or similar.

Yes it is a shame this isn't available, but it isn't something
that you should switch distribution over. If its that important
rebuilding the package with it enabled wouldn't take more than an
hour ..

> The related bug report is tagged as wontfix (146464) but this is absolute
> not reasonable.


You might disagree with the decision of the maintainer
but this isn't an unreasonable action at all.

Steve
--

Kevin Mark

2006-11-23, 7:35 am

On Thu, Nov 23, 2006 at 12:30:09PM +0100, Klaus Ethgen wrote:
> Hi all,
>
> from the bash manpage:
> /dev/tcp/host/port
> If host is a valid hostname or Internet address, andport
> is an integer port number or service name, bash attempts
> to open a TCP connection to the corresponding socket.
> /dev/udp/host/port
> If host is a valid hostname or Internet address, andport
> is an integer port number or service name, bash attempts
> to open a UDP connection to the corresponding socket.
>
> But this feature doesn't work on debian systems (on other distributions
> it works and is not a problem).
>
> For this feature there are several scripts and tools around which use
> this feature. Moreover if you want to make a net boot image where you
> need to contact a other host easy there is no way to do this with debian
> Linux so I have to switch to an other distribution like RedHat or even
> Susi^He.
>
> The related bug report is tagged as wontfix (146464) but this is absolute
> not reasonable.
>
> Best wishes

Hi Klaus,
If the bash source package can be recompiled to enable these options,
then that would seem to the most reasonable and easy course.

If they do not allow this at all or in a reasonable manner, then that
would be a bit more of a complex issue to tackle for you.
Now if you would like to see these options on the bash source
package changed, then you have a more difficult road. From my bits of
information, you have these paths:

-- convince the Debian package maintainer to agree with your position,
relabel the bug to something other than wontfix and give him/her time to
fix it
-- somehow become the Debian maintainer
-- ask the Debian technical committee for a hearing on the matter

My hunch is that this is a decided issue within Debian. :-( You can ask
for a hearing and see what they say as that is the most likely option to
succeed apart from making your own debian package of bash.
cheers,
Kev
ps. all of these things should be in the Debian developers reference
and/or Debian policy manual
--
| .''`. == Debian GNU/Linux == | my web site: |
| : :' : The Universal | debian.home.pipeline.com |
| `. `' Operating System | go to counter.li.org and |
| `- http://www.debian.org/ | be counted! #238656 |
| my keysever: pgp.mit.edu | my NPO: cfsg.org |

Jan C. Nordholz

2006-11-23, 7:35 am

Hi Klaus,

> /dev/tcp/host/port
> /dev/udp/host/port


This has been discussed several times [1][2], and the outcome was every time
that this should not be a feature of the shell, but of more specialized
tools like nc. Use those or recompile your bash.


Regards,

Jan

[1] http://lists.debian.org/debian-user...4/msg01591.html
[2] http://lists.debian.org/debian-user...7/msg00121.html

Oleg Verych

2006-11-23, 7:35 am

On 2006-11-23, Klaus Ethgen wrote:
>
> Hi all,
>
> from the bash manpage:
> /dev/tcp/host/port
> If host is a valid hostname or Internet address, and port
> is an integer port number or service name, bash attempts
> to open a TCP connection to the corresponding socket.
> /dev/udp/host/port
> If host is a valid hostname or Internet address, and port
> is an integer port number or service name, bash attempts
> to open a UDP connection to the corresponding socket.
>
> But this feature doesn't work on debian systems (on other distributions
> it works and is not a problem).


Hammer for opening doors, or just keys ? IMHO, that is another useless
stuff, _shell_ mustn't have, and it does in debian (see curl).

____


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Ron Johnson

2006-11-23, 1:17 pm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/23/06 07:09, Jan C. Nordholz wrote:
> Hi Klaus,
>
>
> This has been discussed several times [1][2], and the outcome was every time
> that this should not be a feature of the shell, but of more specialized
> tools like nc. Use those or recompile your bash.

[snip]
>
> [1] http://lists.debian.org/debian-user...4/msg01591.html
> [2] http://lists.debian.org/debian-user...7/msg00121.html


http://lists.debian.org/debian-user...7/msg00204.html

It can produce completely unexpected results.

C & PERL also can produce completely unexpected results, and C is a
security nightmare, but we don't ban/disable them in Debian.

What's the real problem with /dev/{tcp|udp}?

- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFZcF6S9HxQb37XmcRAu75AJ9S5N5WsO3+
E55j4tPT/ef26icYCwCZAa1e
bhf8OxMiQisYxeAymSOMpv0=
=ztqT
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Hendrik Sattler

2006-11-23, 1:17 pm

Am Donnerstag 23 November 2006 16:42 schrieb Ron Johnson:
> What's the real problem with /dev/{tcp|udp}?


# ls /dev/udp /dev/tcp
ls: /dev/udp: No such file or directory
ls: /dev/tcp: No such file or directory

The chosen method of integration is practical non-sense.
What happens if /dev/tcp is present and a character device?

Did anyone show an example that didn't have a much better solution than this
bash hack?

HS


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Tim Dijkstra

2006-11-23, 1:17 pm

Javier Fernández-Sanguino Peña

2006-11-23, 7:19 pm

On Thu, Nov 23, 2006 at 02:09:33PM +0100, Jan C. Nordholz wrote:
> Hi Klaus,
>
>
> This has been discussed several times [1][2], and the outcome was every time
> that this should not be a feature of the shell, but of more specialized
> tools like nc. Use those or recompile your bash.


Then the manpage should be ammended and those things removed. It does not
make sense to disable things and ship a manpage that implies that they do
work.

Regards

Javier

Julien Cristau

2006-11-23, 7:19 pm

On Thu, Nov 23, 2006 at 22:54:59 +0100, Javier Fernández-Sanguino Peña wrote:

> Then the manpage should be ammended and those things removed. It does not
> make sense to disable things and ship a manpage that implies that they do
> work.
>

Did you look at the bash manpage?

NOTE: Bash, as packaged for Debian, does not support using the /dev/tcp
and /dev/udp files.

Cheers,
Julien


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Charles Plessy

2006-11-24, 1:31 am

Le Thu, Nov 23, 2006 at 02:09:33PM +0100, Jan C. Nordholz a écrit :
> Hi Klaus,
>
>
> This has been discussed several times [1][2], and the outcome was every time
> that this should not be a feature of the shell, but of more specialized
> tools like nc. Use those or recompile your bash.
>
>
> Regards,
>
> Jan
>
> [1] http://lists.debian.org/debian-user...4/msg01591.html
> [2] http://lists.debian.org/debian-user...7/msg00121.html


Dear all,

I found the following additional discussions in my crystal ball:

http://lists.debian.org/debian-user...9/msg00087.html
http://lists.debian.org/debian-user...2/msg00295.html

Maybe one source of the problem is that the bug report contains only
messages advocating the inclusion of the feature, and that the
maintainer tagged it "wontfix" without explaining his reasons?

Have a nice day,

--
Charles Plessy
http://charles.plessy.org
Wako, Saitama, Japan


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Brian May

2006-11-24, 1:31 am

>>>>> "Charles" == Charles Plessy <charles-debian-nospam@plessy.org> writes:

Charles> I found the following additional discussions in my
Charles> crystal ball:

Charles> http://lists.debian.org/debian-user...9/msg00087.html
Charles> http://lists.debian.org/debian-user...2/msg00295.html

Sure about these URLs?

Or do we have to wait several years before the messages will get
posted?

;-)
--
Brian May <bam@snoopy.debian.net>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Javier Fernández-Sanguino Peña

2006-11-24, 1:31 am

On Thu, Nov 23, 2006 at 11:02:15PM +0100, Julien Cristau wrote:
> On Thu, Nov 23, 2006 at 22:54:59 +0100, Javier Fernández-Sanguino Peña wrote:
>
> Did you look at the bash manpage?
>
> NOTE: Bash, as packaged for Debian, does not support using the /dev/tcp
> and /dev/udp files.


Yes, but I missed that paragraph.

Javier

Jon Dowland

2006-11-24, 7:24 am

On Thu, Nov 23, 2006 at 09:42:50AM -0600, Ron Johnson wrote:
> What's the real problem with /dev/{tcp|udp}?


My issue with it is having phantom files that only exist in
one shell on the system, could clash with real files
(although that is more or less totally unlikely). I think
that having the shell re-implement netcat to be a violation
of "do one thing and do it well". I've never came across a
script on debian or elsewhere that required this
functionality enabled. Indeed I'm horrified to find this
feature enabled on RHEL boxes.


--
Jon Dowland


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Ron Johnson

2006-11-24, 1:22 pm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/24/06 06:06, Jon Dowland wrote:
> On Thu, Nov 23, 2006 at 09:42:50AM -0600, Ron Johnson wrote:
>
> My issue with it is having phantom files that only exist in
> one shell on the system, could clash with real files


That's reasonable.

> (although that is more or less totally unlikely). I think
> that having the shell re-implement netcat to be a violation
> of "do one thing and do it well".


Hmmm. A large, complicated shell like bash broke that stricture
long ago, no?

> I've never came across a
> script on debian or elsewhere that required this
> functionality enabled. Indeed I'm horrified to find this
> feature enabled on RHEL boxes.
>
>



- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFZwDXS9HxQb37XmcRAsjaAKCokRp0iMJT
pi7Vu05kv55c9ZnKJgCg7zLT
Kb0U3+3Su3VAJniI1s+16ic=
=2O8j
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Jon Dowland

2006-11-24, 1:22 pm

On Fri, Nov 24, 2006 at 08:25:27AM -0600, Ron Johnson wrote:
> On 11/24/06 06:06, Jon Dowland wrote:
>
> Hmmm. A large, complicated shell like bash broke that
> stricture long ago, no?


Absolutely: but that doesn't give it a free licence to
continue doing so

--
Jon Dowland


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Ron Johnson

2006-11-24, 7:19 pm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/24/06 11:54, Jon Dowland wrote:
> On Fri, Nov 24, 2006 at 08:25:27AM -0600, Ron Johnson wrote:
>
> Absolutely: but that doesn't give it a free licence to
> continue doing so


Sure it does. How long ago did PERL stop being just a Practical
Extraction and Report Language?

- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFZ0QiS9HxQb37XmcRAn/AAJ4ki19tIDELrqOz6DTpY3xwCLy0yACgid0E
U39ZnWEF3on2RLeBlzMv/2U=
=r3W9
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Greg Norris

2006-11-25, 1:31 am

On Fri, Nov 24, 2006 at 12:06:09PM +0000, Jon Dowland wrote:
> I've never came across a script on debian or elsewhere that required
> this functionality enabled. Indeed I'm horrified to find this feature
> enabled on RHEL boxes.


FWIW, ksh93 (as packaged in Debian) has this functionality enabled... it
seems to be available by default in various *nix incarnations as well,
such as Solaris 9 & 10. This doesn't make the feature a good idea, of
course, but it does appear to be commonly available.

A quick perusal of the zsh manpage seems to indicate that it can do this
as well (albeit with quite different syntax), but I didn't take the time
to verify.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Greg Folkert

2006-11-25, 1:31 am

On Fri, 2006-11-24 at 13:12 -0600, Ron Johnson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 11/24/06 11:54, Jon Dowland wrote:
>
> Sure it does. How long ago did PERL stop being just a Practical
> Extraction and Report Language?


Ron, please stop that urban legend. PERL is PERL not P.E.R.L as you say.

I have been corrected for saying that, by more than one PERL Monk, also
by Mr. Wall.

Perl is Perl. It has no meaning other than Perl.
--
greg, greg@gregfolkert.net

The technology that is
Stronger, better, faster: Linux

Dwayne C. Litzenberger

2006-11-26, 1:30 am

On Thu, Nov 23, 2006 at 05:03:13PM +0100, Hendrik Sattler wrote:
># ls /dev/udp /dev/tcp
>ls: /dev/udp: No such file or directory
>ls: /dev/tcp: No such file or directory
>
>The chosen method of integration is practical non-sense.
>What happens if /dev/tcp is present and a character device?


That's more likely than it might sound. A proper way to implement the
/dev/tcp/ feature (if you're going to implement it at all) would be to use
FUSE, and it wouldn't surprise me if someone did that within the next 5
years.

--
Dwayne C. Litzenberger <dlitz@dlitz.net>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com