* 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>
Mon, 1 Nov 2010 09:55:48 +0000 (10:55 +0100)
commit88d3d7d7b0dad4f5a5e0d4594d7e732e57a21f0f
treec05953d9c0ec623aa8eb0c579fa96bd741271572
parent96670e95711f2817e014cdc164b27633ff6e91e5
* 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