* cmd_snet: make shure the target FS has enough space for the new config
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 30 Oct 2010 16:44:15 +0000 (18:44 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 30 Oct 2010 16:44:15 +0000 (18:44 +0200)
commite00be2dcd02464a28d22bf84e345600ce1ea8cf6
tree4123d0ec6df5b5e0945dd936dc29ace1cdba261e
parent4b62e4966319b8d7b02242643d7033da4c92d657
* cmd_snet: make shure the target FS has enough space for the new config

 - Create our own filename insteaf of using mk*tmp*; CC->cs_pid should be uniq.; we use  O_CREAT|O_EXCL so we're shure its ours or fails.
 - Create that filename in the same directory as the filal config filename; by that we can be shure its in the same filesystem, and if thats full, we will fail
 - Stat the original file for sise (if not there assume 80) and write twice as much into that file so we're next to shure the content from the client will fit in
 - the citadel protocol is a little st00pit here, we don't know the size in advance, and we can't return an error _after_ accepting the file
 - instead of moving the content of the tempfile into the final file, we use rename() which is supposed to be atomic.
citadel/modules/network/serv_network.c