NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/60213: cat dumps dir list and glitchs tty font after using cat on a directory accidentaly (for ex. cat /); using NetBSD 11.0_RC3 (i386)
The following reply was made to PR bin/60213; it has been noted by GNATS.
From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/60213: cat dumps dir list and glitchs tty font after using cat on a directory accidentaly (for ex. cat /); using NetBSD 11.0_RC3 (i386)
Date: Sun, 26 Apr 2026 20:20:05 -0000 (UTC)
gnats-admin%NetBSD.org@localhost ("c.santa%gmx.de@localhost via gnats") writes:
>I think I have found a serious bug /bin/cat. I used cat on a directory by accident. This dumps the contentent of that directory and glitches the font of my TTY, which made it unreadable. For reproducing this bug yourself, for ex.:
>cat /
UNIX directories can be files, originally all of them were, and
directories can be read like other files. A program like 'ls'
could just read such a file and print the contents in human
readable form.
The content of such a file is binary and may contain bytes that are
control characters for your tty. Printing to your tty has similar
results as printing any binary file to the tty and printing some
control characters may have dangerous consequences. Try 'cat /bin/hostname'
for an example.
Since not all directories are files, there are obviously alternatives
for reading a directory and nothing requires the historical behaviour.
Some programs like 'more' also reject reading from a directory.
But it's not a bug.
Home |
Main Index |
Thread Index |
Old Index