Opened 16 years ago
Last modified 12 years ago
#23 new defect
Rules are not reloaded (within vuurmuur_conf), when they are changed on disk
|Reported by:||Tiger!P||Owned by:||Victor Julien|
When a user keeps vuurmuur_conf open and changes the rules on the disk, then all the things that are done via vuurmuur_conf will overwrite the changes that were made on the disk.
Change History (2)
comment:1 by , 16 years ago
comment:2 by , 12 years ago
Well in Bash we'd use lsof to check if a file is currently in use. For C I'm guessing you should use inotify, C++ has an is_open().
If two people are using vuurmuur_conf at the same time it's a recipe for disaster anyway, you could check when launching vuurmuur_conf if it isn't running somewhere yet to avoid such a scenario.
If two users want to edit the same vuurmuur file through another editor it's up to the editors to handle that gracefully, there's nothing much we can do about that.
Ideally, there would be a single process (server) having all data. But this is not the case, and all programs and program instances keep their own data. Vuurmuur and vuurmuur_log reload the data from disk on the SIGHUP signal. Vuurmuur even compares the new file from disk with the data in memory to signal changes. I think for vuurmuur_conf a simpler approach is possible. Just check if the rules/zone/service/etc file has been changed since it was loaded and if so reload it. The only problem when two ppl are editing the same file at the same time... what happens then?