]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: don't insert an extra space before each SocketBind{Allow,Deny}= item
authorFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 27 Oct 2023 16:36:35 +0000 (18:36 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Fri, 27 Oct 2023 18:08:47 +0000 (20:08 +0200)
commitb0bb3be130e241178646df0b5c5f02ed661651d4
tree5d97d292eb282f8fc607cbb55d5d0d3085ed27da
parenta4b156bb24b237d997773f29efefc82bf7687e64
core: don't insert an extra space before each SocketBind{Allow,Deny}= item

The extra space was actually screwing up deserialization:

~# systemd-run --wait --pipe -p SocketBindAllow=any true
Running as unit: run-u167.service
Finished with result: exit-code
Main processes terminated with: code=exited/status=234
Service runtime: 1ms
CPU time consumed: 0
~# journalctl -b -p err
...
Oct 27 16:39:15 arch systemd-executor[5983]: Failed to deserialize: Invalid argument

Let's not do that by default and introduce a simple wrapper which
inserts the space after each item only when necessary.
src/core/cgroup.c
src/core/cgroup.h
src/test/test-socket-bind.c