Interesting shenanigans

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: David A. Sinck
Date:  
Subject: Interesting shenanigans
I discovered something interesting. Both of these run as a user
without privileges on a RH7.3 + updates box:

dd if=/dev/zero of=oink
yes 'abcdabcd' > oink

Other than the contents of the file being pushed to disk, these are
the same essential thing, right?: fill the local disk partition up.

Wrong. Thank you for playing.

The first one *does* fill the disk.

The second one hits a filesize limit.

 | magnitude spare:0:267} dd if=/dev/zero of=oink
 | dd: writing to `oink': No space left on device
 | 19052521+0 records in
 | 19052520+0 records out
 | magnitude spare:1:268} df .
 | Filesystem           1k-blocks      Used Available Use% Mounted on
 | /dev/hda11            10080488   9568420         0 100% /mnt/spare
 | magnitude spare:0:269} ls
 | lost+found/  oink
 | magnitude spare:0:270} rm oink
 | magnitude spare:0:271} ls /dev/one
 | ls: /dev/one: No such file or directory
 | magnitude spare:1:272} yes 'abcdabcd' > oink
 | Filesize limit exceeded
 | magnitude spare:153:273} df .
 | Filesystem           1k-blocks      Used Available Use% Mounted on
 | /dev/hda11            10080488   2132044   7436376  23% /mnt/spare


After a bit more thought during typing the email, we have another dd
running in the background and wala!:

 | magnitude spare:0:280} ls -l
 | total 7450844
 | drwx------    2 root     root        16384 Mar 17  2002 lost+found/
 | -rw-r--r--    1 sinck    sinck    2147483647 Jan  9 06:12 oink
 | -rw-r--r--    1 sinck    sinck    5474697728 Jan  9 06:28 oink2


So... a 2G file limit. What?

:-)

Good morning.

David