usbguard icon indicating copy to clipboard operation
usbguard copied to clipboard

Modified USBguard append-rule to add support to the beginning of the …

Open boring-brother opened this issue 9 months ago • 1 comments

Modified USBguard append-rule to add support to the beginning of the configuration file (-a 0 command) this cmd will failed:

usbguard append-rule -a 0 "allow 000e:1923"

IPC ERROR: request id=1: Policy append: rule: Invalid parent ID

from RuleSet::appendRule func,it show can support ID 0 to Add to the head of a rule usbguard-append-rule-a-0

boring-brother avatar Mar 06 '25 07:03 boring-brother

Hello, I haven't had time to look into this but this might not be as straightforward as it looks like. An attempt has been made to introduce insertRule in https://github.com/USBGuard/usbguard/pull/480.

Cropi avatar Apr 23 '25 11:04 Cropi

Thanks a lot for your work on this. However, I don't think we should merge support for inserting at the beginning of the rule set. Instead, I would be happy to review a patch that implements inserting a rule at any specified position in the list, rather than just at index 0. We would not fix the original problem. For example to insert to the end of a specific ruleset within a file from the rules.d folder.

Cropi avatar Jul 16 '25 11:07 Cropi