[9fans] Fileserver doesn't exit when it should

2014-08-08 Thread Porlock
Here is some behaviour which I don't understand. Something seems to be preventing a fileserver process from exiting (since it doesn't receive end-of-file on its 9p pipe). To see this, open a new rio window and enter the following commands :- ramfs -m /n/junk cp /bin/echo /n/junk /n/junk/echo

[9fans] Bug in ramfs.c

2014-08-08 Thread Porlock
There is a bug in ramfs which causes it to crash when the length of a file is set to zero (using the wstat message). To see this bug, the attached utility to set the file length is helpful. Having first saved setlength.c into a plan9 directory, the following commands can be used to see the bug :-

[9fans] snprintf buffer overrun

2016-11-27 Thread Porlock
Plan 9's implementation of the standard C functions snprintf and vsnprintf have a buffer overrun bug. If the buffer length equals the output length (without the terminating null), then one too many characters is written to the buffer. For example, snprintf(buf, 4, "ABCD"); will wri