Skip to content
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

contrib/vim: add missing noinput command to syn match #4259

Merged
merged 1 commit into from
May 11, 2021

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented May 8, 2021

Added on commit a90386d ("Map /dev/input with "--private-dev", add
"--no-input" option to disable it") / PR #4209. See also commit
0cee0ba ("Add noinput to all profiles with private-dev") / PR #4239.

Misc: I noticed that it was missing due to the lack of syntax
highlighting on etc/profile-m-z/webstorm.profile.

Cc: @davidebeatrici (as the author of #4209)

Added on commit a90386d ("Map /dev/input with "--private-dev", add
"--no-input" option to disable it") / PR netblue30#4209.  See also commit
0cee0ba ("Add noinput to all profiles with private-dev") / PR netblue30#4239.

Misc: I noticed that it was missing due to the lack of syntax
highlighting on etc/profile-m-z/webstorm.profile.
@kmk3 kmk3 force-pushed the contrib-vim-add-missing-noinput branch from 4f028ae to 22a91ae Compare May 8, 2021 02:15
Copy link
Collaborator

@rusty-snake rusty-snake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: dbus-* has no highlighting too.

@kmk3
Copy link
Collaborator Author

kmk3 commented May 10, 2021

Sorry for the late reply, I've been AFK.

FWIW: dbus-* has no highlighting too.

Good catch. This one is more complicated as it has 3 different forms and
arguments (compared to noinput having a single form with no arguments):

dbus-(user|system) (filter|none)
dbus-(user|system).(own|talk|see) name
dbus-(user|system).(call|broadcast) callrule

The commands/subcommands can be matched basically as is above, but validating
the arguments is not so easy. Looking at profile.c and dbus.c, I managed to
turn check_bus_or_interface_name into a regex for name:

grep -E '^(\*|[A-Za-z_-][A-Za-z0-9_-]*(\.[A-Za-z_-][A-Za-z0-9_-]*)*((\.[A-Za-z_-][A-Za-z0-9_-]*)+|\.\*))$'

It seems to match the behavior of the function in all the tests that I came up
with, but it looks quite gigantic and the dbus_check_call_rule function
(for callrule) is even more complex than the former (though the regex above
can probably be reused in a nextgroup=).

I could also just make the arguments match .*; not sure if half-highlighting
better or worse than no highlighting.

I think I'll try it in a new PR, but feel free to discuss it here in the
meantime.

@kmk3 kmk3 mentioned this pull request May 11, 2021
@kmk3 kmk3 merged commit 46e473c into netblue30:master May 11, 2021
@kmk3 kmk3 deleted the contrib-vim-add-missing-noinput branch May 11, 2021 11:00
kmk3 added a commit to kmk3/firejail that referenced this pull request May 11, 2021
Added on commit 617ff40 ("add --noautopulse arg for complex pulse
setups") / PR netblue30#1854.

Misc: I noticed that it was missing when comparing it to
contrib/vim/syntax/firejail.vim on commit 22a91ae ("contrib/vim: add
missing noinput command to syn match") / PR netblue30#4259.
kmk3 added a commit to kmk3/firejail that referenced this pull request May 11, 2021
Added on commit 617ff40 ("add --noautopulse arg for complex pulse
setups") / PR netblue30#1854.

Note: The template was added after that, on commit cb98aea ("Add
profile templates").

Misc: I noticed that it was missing when comparing it to
contrib/vim/syntax/firejail.vim on commit 22a91ae ("contrib/vim: add
missing noinput command to syn match") / PR netblue30#4259.
@rusty-snake
Copy link
Collaborator

All newly added commands/conditions since a1cc4a5 (I found): dbus-*, seccomp-error-action, seccomp.32*, allow-debuggers, ?HAS_NOSOUND, ?HAS_X11, ?HAS_NET, private-cwd

@kmk3
Copy link
Collaborator Author

kmk3 commented May 22, 2021

All newly added commands/conditions since
a1cc4a5
(I found): dbus-*, seccomp-error-action, seccomp.32*,
allow-debuggers, ?HAS_NOSOUND, ?HAS_X11, ?HAS_NET, private-cwd

Good catch. Would you mind creating an issue/task for that (and ideally
another just for dbus-*, as it seems much more complex)? This would help
make it more visible and ensure that it does not get lost over time. And I'd
really like to archive finished PRs/issues as "done", in order to unclutter the
inbox.

In a similar vein, I plan on moving some scattered ideas from my comments to
issues for the same reasons.

Additionally, I have some other branches that I'm working on in the meantime,
so if you want to do the changes, feel free to do so.

@rusty-snake rusty-snake mentioned this pull request May 24, 2021
9 tasks
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.

3 participants