summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4892f82)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
## If not, call suricatactrl to fix them.
#
sub _check_rulesdir_permissions() {
## If not, call suricatactrl to fix them.
#
sub _check_rulesdir_permissions() {
+ # Check if the rulepath main directory is writable.
+ unless (-W $rulespath) {
+ # If not call suricatctrl to fix it.
+ &call_suricatactrl("fix-rules-dir");
+ }
+
# Open snort rules directory and do a directory listing.
opendir(DIR, $rulespath) or die $!;
# Loop through the direcory.
# Open snort rules directory and do a directory listing.
opendir(DIR, $rulespath) or die $!;
# Loop through the direcory.
} else if (strcmp(argv[1], "reload") == 0) {
safe_system("/etc/rc.d/init.d/suricata reload");
} else if (strcmp(argv[1], "fix-rules-dir") == 0) {
} else if (strcmp(argv[1], "reload") == 0) {
safe_system("/etc/rc.d/init.d/suricata reload");
} else if (strcmp(argv[1], "fix-rules-dir") == 0) {
- safe_system("chown nobody:nobody /etc/suricata/rules/*");
+ safe_system("chown -R nobody:nobody /etc/suricata/rules/");
} else {
fprintf(stderr, "\nBad argument given.\n\nsuricatactrl (start|stop|restart|reload)\n\n");
exit(1);
} else {
fprintf(stderr, "\nBad argument given.\n\nsuricatactrl (start|stop|restart|reload)\n\n");
exit(1);