firejail/contrib
Kelvin M. Klann 08e5f8161c build: sort.py: strip whitespace in commands
Currently whitespace is left as is within an entry.

In a `protocol` entry, if there is whitespace between the command and
its argument or around an item, the item in question is dropped from the
output.

Changes:

* `protocol`: Strip all whitespace in the argument
* Other commands: Strip leading/trailing whitespace around each item,
  including any extra whitespace between a command and its argument

Note: Whitespace characters inside paths are left as is, as some paths
(such as `Foo Bar` may contain spaces.

Before:

    $ printf 'private-bin a,b\nprivate-bin  a,b\nprivate-bin  b,a\nprivate-bin  C,A  B\nprotocol  unix,net\nprotocol  inet,unix\n' \
      >foo.profile
    $ ./contrib/sort.py -n foo.profile
    sort.py: checking 1 profile(s)...
    foo.profile:5:-protocol  unix,net
    foo.profile:5:+protocol
    foo.profile:6:-protocol  inet,unix
    foo.profile:6:+protocol unix

After:

    $ printf 'private-bin a,b\nprivate-bin  a,b\nprivate-bin  b,a\nprivate-bin  C,A  B\nprotocol  unix,net\nprotocol  inet,unix\n' \
      >foo.profile
    $ ./contrib/sort.py -n foo.profile
    sort.py: checking 1 profile(s)...
    foo.profile:2:-private-bin  a,b
    foo.profile:2:+private-bin a,b
    foo.profile:3:-private-bin  b,a
    foo.profile:3:+private-bin a,b
    foo.profile:4:-private-bin  C,A  B
    foo.profile:4:+private-bin A  B,C
    foo.profile:5:-protocol  unix,net
    foo.profile:5:+protocol unix
    foo.profile:6:-protocol  inet,unix
    foo.profile:6:+protocol unix,inet
2024-12-05 04:53:41 -03:00
..
syntax feature: add notpm command & keep tpm devices in private-dev (#6390) 2024-07-09 01:43:55 +00:00
vim/ftdetect contrib/vim: match profile files more broadly 2023-06-10 14:16:41 -03:00
fix_private-bin.py fix spelling (#4573) 2021-09-22 23:05:33 +02:00
fj-mkdeb.py update copyright 2024 2024-01-12 11:23:22 -05:00
fjclip.py update copyright 2024 2024-01-12 11:23:22 -05:00
fjdisplay.py update copyright 2024 2024-01-12 11:23:22 -05:00
fjresize.py update copyright 2024 2024-01-12 11:23:22 -05:00
gdb-firejail.sh update copyright 2024 2024-01-12 11:23:22 -05:00
jail_prober.py update copyright 2024 2024-01-12 11:23:22 -05:00
sort.py build: sort.py: strip whitespace in commands 2024-12-05 04:53:41 -03:00
syscalls.sh update copyright 2024 2024-01-12 11:23:22 -05:00
update_deb.sh build: use generic wildcard on package install 2024-02-29 07:52:33 -03:00