]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/binfmt/binfmt.c
binfmt: add logging information 21294/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Nov 2021 14:44:06 +0000 (15:44 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Nov 2021 16:23:36 +0000 (17:23 +0100)
commit99a041d1ceedc5d01d068888e6bdb06f8c6a507b
tree724d3e8c972239b3c4cd0f5404b014d36a9a0ea3
parent33068a0f5ee5269980defedb7aeaa6d2a232af3b
binfmt: add logging information

In delete_rule(), we already checked that the rule name is a valid file name
(i.e. no slashes), so we can just trivially append.

Also, let's always reject rules that we would later fail to delete. It's
probably better to avoid such confusion.

And print the operations we do with file name and line number. I hope this
helps with cases like https://github.com/systemd/systemd/pull/21178. At least
we'll know what rule failed.

$ sudo SYSTEMD_LOG_LEVEL=debug build/systemd-binfmt
Flushed all binfmt_misc rules.
Applying /etc/binfmt.d/kshcomp.conf…
/etc/binfmt.d/kshcomp.conf:1: binary format 'kshcomp' registered.
src/binfmt/binfmt.c