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

profiles: replace x11 socket blacklist with disable-X11.inc #6286

Merged
merged 2 commits into from
Mar 24, 2024

Conversation

kmk3
Copy link
Collaborator

@kmk3 kmk3 commented Mar 23, 2024

Replace all occurrences of blacklist /tmp/.X11-unix with
include disable-X11.inc, which blacklists more X11-related files.

Commands used to search and replace:

$ git grep -Ilz '^blacklist /tmp/.X11-unix' -- \
  etc/profile*/*.profile | xargs -0 perl -0 -pi -e '\
    s/\nblacklist \/tmp\/.X11-unix\n/\n/; \
    s/(\ninclude disable-xdg.inc\n)/\ninclude disable-X11.inc$1/; \
    s/(\ninclude disable-[^Xx\n]+\n)(\n|# )/$1include disable-X11.inc\n$2/'

Note: The following files were also edited manually:

  • etc/profile-a-l/erd.profile
  • etc/profile-a-l/links-common.profile
  • etc/profile-m-z/termshark.profile
  • etc/profile-m-z/tmux.profile
  • etc/profile-m-z/tshark.profile

Relates to #4462 #4854 #5544.

@kmk3 kmk3 requested review from glitsj16 and rusty-snake March 23, 2024 06:25
@kmk3 kmk3 marked this pull request as draft March 23, 2024 06:42
@kmk3 kmk3 force-pushed the x11-none-improvements branch from 1c4a080 to e47861b Compare March 23, 2024 07:49
@kmk3 kmk3 changed the title modif: use disable-X11.inc in more profiles and for "x11 none" profiles: replace x11 socket blacklist with include Mar 23, 2024
@kmk3 kmk3 force-pushed the x11-none-improvements branch from e47861b to 110d2c1 Compare March 23, 2024 07:52
@kmk3 kmk3 changed the title profiles: replace x11 socket blacklist with include profiles: replace x11 socket blacklist with disable-X11.inc Mar 23, 2024
@kmk3
Copy link
Collaborator Author

kmk3 commented Mar 23, 2024

Note: I did not manage to call include disable-X11.inc from the code itself
without errors, so I left just the main profile search/replace for this PR.

@kmk3 kmk3 marked this pull request as ready for review March 23, 2024 07:56
Copy link
Collaborator

@glitsj16 glitsj16 left a comment

Choose a reason for hiding this comment

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

See gconf-editor.profile comment.

Move disable-X11.inc before disable-xdg.inc for consistency with other
profiles.

Added on commit 73a6fce ("New profile: ssmtp (netblue30#5544)", 2022-12-21).
kmk3 added a commit that referenced this pull request Mar 23, 2024
It is a GUI program.

It was apparently added by accident on commit 73321c5 ("Fixes
(#2816)", 2019-07-01).

Reported by @glitsj16 at
#6286 (comment)
@kmk3 kmk3 force-pushed the x11-none-improvements branch from 110d2c1 to afc6762 Compare March 23, 2024 12:12
Replace all occurrences of `blacklist /tmp/.X11-unix` with
`include disable-X11.inc`, which blacklists more X11-related files.

Commands used to search and replace:

    $ git grep -Ilz '^blacklist /tmp/.X11-unix' -- \
      etc/profile*/*.profile | xargs -0 perl -0 -pi -e '\
        s/\nblacklist \/tmp\/.X11-unix\n/\n/; \
        s/(\ninclude disable-xdg.inc\n)/\ninclude disable-X11.inc$1/; \
        s/(\ninclude disable-[^Xx\n]+\n)(\n|# )/$1include disable-X11.inc\n$2/'

Note: The following files were also edited manually:

* etc/profile-a-l/erd.profile
* etc/profile-a-l/links-common.profile
* etc/profile-m-z/termshark.profile
* etc/profile-m-z/tmux.profile
* etc/profile-m-z/tshark.profile

Relates to netblue30#4462 netblue30#4854.
@kmk3 kmk3 force-pushed the x11-none-improvements branch from afc6762 to 04efbb2 Compare March 24, 2024 06:47
@kmk3 kmk3 merged commit eaee336 into netblue30:master Mar 24, 2024
3 checks passed
@kmk3 kmk3 deleted the x11-none-improvements branch March 24, 2024 06:50
kmk3 added a commit to kmk3/firejail that referenced this pull request Mar 24, 2024
See etc/templates/profile.template.

This is a follow-up to netblue30#6286.
kmk3 added a commit that referenced this pull request Mar 25, 2024
kmk3 added a commit to kmk3/firejail that referenced this pull request Mar 26, 2024
That is, make "X11" lowercase so that the order of the includes in the
disable- section remain the same when sorted with `LC_ALL=C`, as is the
case for most of the other sections.  That is also likely to be the
default in text editors (such as in vim on Arch), so this should make
the disable- section more consistent and easier to sort when editing the
profile.

Also, keep the old include as a redirect to the new one for now to avoid
breakage.

Commands used to search and replace:

    git mv etc/inc/disable-X11.inc etc/inc/disable-x11.inc
    git grep -Ilz 'disable-X11' -- etc | xargs -0 \
      perl -pi -e 's/disable-X11/disable-x11/'

Relates to netblue30#4462 netblue30#4854 netblue30#6070 netblue30#6289.

This is a follow-up to netblue30#6286.
kmk3 added a commit that referenced this pull request Mar 27, 2024
See etc/templates/profile.template.

This is a follow-up to #6286.
kmk3 added a commit that referenced this pull request Mar 27, 2024
That is, make "X11" lowercase so that the order of the includes in the
disable- section remain the same when sorted with `LC_ALL=C`, as is the
case for most of the other sections.  That is also likely to be the
default in text editors (such as in vim on Arch), so this should make
the disable- section more consistent and easier to sort when editing the
profile.

Also, keep the old include as a redirect to the new one for now to avoid
breakage.

Commands used to search and replace:

    git mv etc/inc/disable-X11.inc etc/inc/disable-x11.inc
    git grep -Ilz 'disable-X11' -- etc | xargs -0 \
      perl -pi -e 's/disable-X11/disable-x11/'

Relates to #4462 #4854 #6070 #6289.

This is a follow-up to #6286.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done (on RELNOTES)
Development

Successfully merging this pull request may close these issues.

3 participants