Project

General

Profile

Actions

Bug #128

closed

cat /directory shows a (somewhat messy) list of files in a directory (even removed files)

Added by arachnist about 18 years ago. Updated over 17 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

When you create some dir, create some files in it, then remove them
and do a cat /path/to/that/dir you get a messed-up list of files along
with the removed ones, in some situations this might be considered a
security threat. The following script ilustrates what i mean:

#!/bin/sh
mkdir somedir
for i in file1 file2 file3 file4; do
touch somedir/$i;
done
echo contents of somedir:
ls somedir
for i in file1 file2 file3 file4; do
rm somedir/$i;
done;
echo contents of somedir:
ls somedir
echo that shouldn\'t be here
cat somedir

Expected results:
nothing or a ls-like list of files

What i got:

contents of somedir:
file1 file2 file3 file4
contents of somedir:
that shouldn't be here
2

.Yô..3
file1$ÁJ
file2$ÁM
file3$ÁN
Actions

Also available in: Atom PDF