Patch to clean up vuurmuur_fopen
|Reported by:||Matthijs Kooijman||Owned by:||Victor Julien|
The attached patch cleans up
vuurmuur_fopen a bit. It removes all checks from the function and instead calls
stat_ok do do these checks. This has the following functional changes:
vuurmuur_fopennow only works for regular files (non fifo's, character devices, etc.). This shouldn't be a problem, config files should be regular files anyway.
vuurmuur_fopennow only works for existing files. This is because
stat_okfails when a stat call fails, without special case for a "File not found" error. The original
vuurmuur_fopenfunction skipped all checks when
lstatreturned an error (which might have been wrong, since an error does not always mean "File not found").
However, I have checked all uses of the
vuurmuur_fopenfunction, and all of them use it only on existing files (
opento create new files.
The patch is against svn r240.