Skip to content

Conversation

@boring-brother
Copy link

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

@Cropi
Copy link
Member

Cropi commented Apr 23, 2025

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 #480.

@Cropi
Copy link
Member

Cropi commented Jul 16, 2025

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 Cropi closed this Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants