Comparing files in .../local with the original profile files #211
Replies: 7 comments
-
I've modified the script to get a better output. However, strange things happen:
Any ideas how to fix this? |
Beta Was this translation helpful? Give feedback.
-
Did you have a look at |
Beta Was this translation helpful? Give feedback.
-
Thanks! No, I hadn't as I had not been aware of it. Now I've tried and got an error which seems to be a similar one like this. |
Beta Was this translation helpful? Give feedback.
-
Script updated with a much simpler version which should work reliably. Again, the syntax in both files must be identical, and the script cannot detect rules in included abstractions. |
Beta Was this translation helpful? Give feedback.
-
Back to another version as the previous one didn't work when there was a different number of invisible characters before the access modes. It should work in most cases - but there is one problem in cases with combined access modes, like:
As I'm a very lousy coder at best I don't know to avoid the blanks between the access modes. Anyone? |
Beta Was this translation helpful? Give feedback.
-
Post1 contains a new version which is simplified by putting the sed expressions into a variable and which is beautified using shellcheck. The problem mentioned in the last post (blanks within combined access modes) is not yet solved. So if anyone has an idea how to do it - please give it me ;-) |
Beta Was this translation helpful? Give feedback.
-
Closing as using |
Beta Was this translation helpful? Give feedback.
-
I'm usually collecting rules over several days or even weeks before submitting PRs. Sometimes it's a bit tedious to check if the rules in the local file have been added to the profile in the meantime (e.g. by an added abstraction) or to clean up the local files afterwords particularly if I don't do it immediately and/or new PRs come in.
I'm using this little script to make things a bit easier:
The usual diff tools show too much for these cases, IMO.
Needless to say that the output produced by this script is only reliable if the syntax in both files is the same, e.g. the variable names - hence, applying something like this to the local file beforehand makes probably sense. And it doesn't catch cases where new rules were added by an abstraction.
Does anybody have a more comprehensive or more straight-forward approach?
EDIT:
I'm now using
difftastic
. It's a simple one-liner that does what I want:difft --display inline /etc/apparmor.d/"$1" /etc/apparmor.d/local/"$1"
Beta Was this translation helpful? Give feedback.
All reactions