Skip to content

Commit

Permalink
build: sort.py: use case-sensitive sorting
Browse files Browse the repository at this point in the history
To match how things are sorted elsewhere, such as with `noblacklist` /
`whitelist` lines (vertically) in profiles and in
ci/check/profiles/sort-disable-programs.sh and src/etc-cleanup/main.c.

This makes the order in `private-etc` always be groups (`@group`), then
uppercase paths, then lowercase paths.  Example from
etc/profile-m-z/softmaker-common.profile:

    private-etc @tls-ca,SoftMaker,fstab

Note that this does not affect a significant amount of profiles; most
changes are in `private-bin` / `private-lib` lines and in `private-etc`
lines for newer profiles that do not use groups.  This is partly due to
commit 5d0822c ("private-etc: big profile changes", 2023-02-05)
replacing `X11` with `@x11` in `private-etc` lines and then commit
0f996ea ("private-etc: groups modified", 2023-02-05) removing
`Trolltech.conf` from `private-etc` lines and using case-sensitive
sorting in them.

Relates to netblue30#5610.
  • Loading branch information
kmk3 committed Oct 27, 2023
1 parent ee27c8e commit 98e34c4
Show file tree
Hide file tree
Showing 24 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion contrib/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

def sort_alphabetical(original_items):
items = original_items.split(",")
items.sort(key=str.casefold)
items.sort()
return ",".join(items)


Expand Down
2 changes: 1 addition & 1 deletion etc/profile-a-l/ani-cli.profile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ notv
disable-mnt
private-bin ani-cli,aria2c,cat,cp,curl,cut,ffmpeg,fzf,grep,head,mkdir,mktemp,mv,nl,nohup,patch,printf,rm,rofi,sed,sh,sort,tail,tput,tr,uname,wc
#private-cache
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg
private-tmp

# Redirect
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-a-l/discord-canary.profile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ whitelist ${HOME}/.config/discordcanary
whitelist /opt/DiscordCanary
whitelist /opt/discord-canary

private-bin discord-canary,DiscordCanary
private-bin DiscordCanary,discord-canary

# Redirect
include discord-common.profile
2 changes: 1 addition & 1 deletion etc/profile-a-l/discord-ptb.profile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ whitelist ${HOME}/.config/discordptb
whitelist /opt/DiscordPTB
whitelist /opt/discord

private-bin discord-ptb,DiscordPTB
private-bin DiscordPTB,discord-ptb

# Redirect
include discord-common.profile
2 changes: 1 addition & 1 deletion etc/profile-a-l/discord.profile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ whitelist ${HOME}/.config/discord
whitelist /opt/Discord
whitelist /opt/discord

private-bin discord,Discord
private-bin Discord,discord

# Redirect
include discord-common.profile
2 changes: 1 addition & 1 deletion etc/profile-a-l/display.profile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private-bin display,python*
private-dev
# On Debian-based systems, display is a symlink in /etc/alternatives
private-etc ImageMagick-6,ImageMagick-7
private-lib gcc/*/*/libgcc_s.so.*,gcc/*/*/libgomp.so.*,ImageMagick*,libfreetype.so.*,libltdl.so.*,libMagickWand-*.so.*,libXext.so.*
private-lib ImageMagick*,gcc/*/*/libgcc_s.so.*,gcc/*/*/libgomp.so.*,libMagickWand-*.so.*,libXext.so.*,libfreetype.so.*,libltdl.so.*
private-tmp

dbus-user none
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-a-l/enpass.profile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protocol unix,inet,inet6,netlink
seccomp
tracelog

private-bin dirname,Enpass,importer_enpass,readlink,sh
private-bin Enpass,dirname,importer_enpass,readlink,sh
?HAS_APPIMAGE: ignore private-dev
private-dev
private-opt Enpass
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-a-l/fbreader.profile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ novideo
protocol unix,inet,inet6
seccomp

private-bin fbreader,FBReader
private-bin FBReader,fbreader
private-dev
private-tmp

Expand Down
2 changes: 1 addition & 1 deletion etc/profile-a-l/fluffychat.profile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ disable-mnt
private-bin firefox,fluffychat,sh,which,zenity
private-cache
private-dev
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,gconf,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,dconf,fonts,gconf,gtk-3.0,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg
private-tmp

dbus-user filter
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-a-l/hugin.profile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ novideo
protocol unix
seccomp

private-bin align_image_stack,autooptimiser,calibrate_lens_gui,celeste_standalone,checkpto,cpclean,cpfind,deghosting_mask,enblend,exiftool,fulla,geocpset,hugin,hugin_executor,hugin_hdrmerge,hugin_lensdb,hugin_stitch_project,icpfind,linefind,nona,pano_modify,pano_trafo,perl,PTBatcherGUI,pto_gen,pto_lensstack,pto_mask,pto_merge,pto_move,pto_template,pto_var,sh,tca_correct,uname,verdandi,vig_optimize
private-bin PTBatcherGUI,align_image_stack,autooptimiser,calibrate_lens_gui,celeste_standalone,checkpto,cpclean,cpfind,deghosting_mask,enblend,exiftool,fulla,geocpset,hugin,hugin_executor,hugin_hdrmerge,hugin_lensdb,hugin_stitch_project,icpfind,linefind,nona,pano_modify,pano_trafo,perl,pto_gen,pto_lensstack,pto_mask,pto_merge,pto_move,pto_template,pto_var,sh,tca_correct,uname,verdandi,vig_optimize
private-cache
private-dev
private-tmp
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-a-l/lobster.profile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ notv
disable-mnt
private-bin base64,bash,cat,command,curl,cut,date,dirname,echo,ffmpeg,ffprobe,find,fzf,grep,head,hxunent,ln,lobster,ls,mkdir,mkfifo,nano,nohup,openssl,patch,pgrep,ps,rm,rofi,sed,sh,sleep,socat,tail,tee,tput,tr,ueberzugpp,uname,uuidgen,vim,wc
#private-cache
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,mime.types,nsswitch.conf,pango,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg
private-tmp

# Redirect
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/QMediathekView.profile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ seccomp
tracelog

disable-mnt
private-bin mplayer,mpv,QMediathekView,smplayer,totem,vlc,xplayer
private-bin QMediathekView,mplayer,mpv,smplayer,totem,vlc,xplayer
private-cache
private-dev
private-etc @tls-ca
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/QOwnNotes.profile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ seccomp
tracelog

disable-mnt
private-bin gio,QOwnNotes
private-bin QOwnNotes,gio
private-dev
private-etc @tls-ca,host.conf
private-tmp
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/Viber.profile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protocol unix,inet,inet6
seccomp !chroot

disable-mnt
private-bin awk,bash,dig,sh,Viber
private-bin Viber,awk,bash,dig,sh
private-etc @tls-ca,@x11,mailcap,proxychains.conf
private-tmp

Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/XMind.profile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protocol unix,inet,inet6
seccomp

disable-mnt
private-bin cp,sh,XMind
private-bin XMind,cp,sh
private-tmp
private-dev

Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/mov-cli.profile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ notv
disable-mnt
private-bin ffmpeg,fzf,mov-cli
#private-cache
private-etc alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,magic,magic.mgc,mime.types,nsswitch.conf,pango,passwd,pki,protocols,pulse,resolv.conf,rpc,services,ssl,X11,xdg
private-etc X11,alsa,alternatives,asound.conf,ca-certificates,crypto-policies,fonts,group,host.conf,hostname,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,locale,locale.alias,locale.conf,localtime,machine-id,magic,magic.mgc,mime.types,nsswitch.conf,pango,passwd,pki,protocols,pulse,resolv.conf,rpc,services,ssl,xdg
private-tmp

# Redirect
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/mutt.profile
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ tracelog
#disable-mnt
private-cache
private-dev
private-etc @tls-ca,@x11,msmtprc,Mutt,Muttrc,Muttrc.d,gai.conf,gnupg,gnutls,hosts.conf,mail,mailname,nntpserver,terminfo
private-etc @tls-ca,@x11,Mutt,Muttrc,Muttrc.d,gai.conf,gnupg,gnutls,hosts.conf,mail,mailname,msmtprc,nntpserver,terminfo
private-tmp
writable-run-user
writable-var
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/natron.profile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ nou2f
protocol unix
seccomp

private-bin natron,Natron,NatronRenderer
private-bin Natron,NatronRenderer,natron

dbus-user none
dbus-system none
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/neomutt.profile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ tracelog
#disable-mnt
private-cache
private-dev
private-etc @tls-ca,@x11,msmtprc,Mutt,Muttrc,Muttrc.d,gnupg,hosts.conf,mail,mailname,neomuttrc,neomuttrc.d,nntpserver
private-etc @tls-ca,@x11,Mutt,Muttrc,Muttrc.d,gnupg,hosts.conf,mail,mailname,msmtprc,neomuttrc,neomuttrc.d,nntpserver
private-tmp
writable-run-user
writable-var
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/postman.profile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ include whitelist-run-common.inc

protocol unix,inet,inet6,netlink

private-bin electron,electron[0-9],electron[0-9][0-9],locale,node,Postman,postman,sh
private-bin Postman,electron,electron[0-9],electron[0-9][0-9],locale,node,postman,sh
private-etc alternatives,ca-certificates,crypto-policies,fonts,hosts,ld.so.cache,ld.so.conf,ld.so.conf.d,ld.so.preload,localtime,nsswitch.conf,pki,resolv.conf,ssl
# private-opt breaks file-copy-limit, use a whitelist instead of draining RAM
# https://github.com/netblue30/firejail/discussions/5307
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/ppsspp.profile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ novideo
protocol unix,netlink
seccomp

private-bin ppsspp,PPSSPP,PPSSPPQt,PPSSPPSDL
private-bin PPSSPP,PPSSPPQt,PPSSPPSDL,ppsspp
# Add the next line to your ppsspp.local if you do not need controller support.
#private-dev
private-etc @tls-ca,@x11,host.conf
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/softmaker-common.profile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tracelog
private-bin freeoffice-planmaker,freeoffice-presentations,freeoffice-textmaker,planmaker18,planmaker18free,presentations18,presentations18free,sh,textmaker18,textmaker18free
private-cache
private-dev
private-etc @tls-ca,fstab,SoftMaker
private-etc @tls-ca,SoftMaker,fstab
private-tmp

dbus-user none
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/telegram.profile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ seccomp
seccomp.block-secondary

disable-mnt
private-bin bash,sh,telegram,Telegram,telegram-desktop,xdg-open
private-bin Telegram,bash,sh,telegram,telegram-desktop,xdg-open
private-cache
private-dev
private-etc @tls-ca,@x11,os-release
Expand Down
2 changes: 1 addition & 1 deletion etc/profile-m-z/transgui.profile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private-bin geoiplookup,geoiplookup6,transgui
private-cache
private-dev
private-etc @network,@tls-ca,@x11
private-lib libgdk_pixbuf-2.0.so.*,libGeoIP.so*,libgthread-2.0.so.*,libgtk-x11-2.0.so.*,libX11.so.*
private-lib libGeoIP.so*,libX11.so.*,libgdk_pixbuf-2.0.so.*,libgthread-2.0.so.*,libgtk-x11-2.0.so.*
private-tmp

dbus-user none
Expand Down

0 comments on commit 98e34c4

Please sign in to comment.