New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow comments in rules file #111
Comments
Thanks for the suggestion. This is certainly a nice to have feature. |
Having generated and edited a rule file, I naturally added comment lines, only to discover usbguard would fail starting. I would also like this. :) |
@ilf Hi and thanks for the feedback. I guess I'm going to implement this sooner than planned. |
As a side note, empty lines seem to end the parsing prematurely, and silently. I noticed it while playing with So please support both comments and empty lines :) |
To anyone interested, I did some testing on 0.7.1 because I initially thought that #209 solved this issue. Doing some testing with a bunch of devices and twisting my rules to make sure that I'm not weakening my setup I came to the conclusion that empty lines are indeed supported. The This ignores empty lines: usbguard/src/Library/RuleSetPrivate.cpp Lines 87 to 89 in 6b7863a
This stops on the first empty line: usbguard/src/CLI/usbguard-rule-parser.cpp Lines 104 to 106 in e7f984b
While we still don't have comments in rules files, I can easily identify most of my devices by simply separating them with empty lines (there's one device I couldn't identify easily that took some plugging and unplugging to figure out=). |
Also, it would be nice if it had the usual "rules.d" sort of directory, so /etc/usbguard/rules.d/*.conf would be processed in lexical order. |
This keeps the output consistent with how usbguard itself behaves. References USBGuard#111
Is this comment support already implemented? I tried v 0.7.2 and it does not have support for comments in rules.conf file. |
Unfortunately 09be6dc is not part of a release, it was pushed on July 24th and the last release was on July 12th. I'm very much waiting for the next release to finally get comments in my setup. My concern is that the last code update on the master branch was in October :( |
OK, hopefully it is coming soon, because long configuration files without any comments are extremely hard to maintain. |
Currently no comments are allowed in the rules files (e.g. lines starting with "#") - this should be allowed
The text was updated successfully, but these errors were encountered: