DragonFly BSD
DragonFly bugs List (threaded) for 2006-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: "Robert Sebastian Gerus" <arachnist@xxxxxxxxx>
Date: Sun, 26 Mar 2006 12:00:50 +0200

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

--
jid: arachnist@xxxxxxxxx
gg: 7988510
irc: ar/arachnist @ ircnet/efnet/freenode




[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]