diff options
author | Frantisek Sumsal <fsumsal@redhat.com> | 2023-06-16 19:05:57 +0200 |
---|---|---|
committer | Frantisek Sumsal <fsumsal@redhat.com> | 2023-06-16 20:42:43 +0200 |
commit | 9ccd59f751bb639d31155dc6c8d3b76c1a98ef1c (patch) | |
tree | d5cf04cba32ad40701d71b5e022f22eaca1d1f17 /.github/codeql-custom.qls | |
parent | test: add a couple of tests for systemd-journal-gatewayd (diff) | |
download | systemd-9ccd59f751bb639d31155dc6c8d3b76c1a98ef1c.tar.xz systemd-9ccd59f751bb639d31155dc6c8d3b76c1a98ef1c.zip |
socket-activate: make a copy of the command name and arguments
When we call safe_fork() with the first argument set (process name), we
call rename_process() that zeroes out saved argv (that was saved by
save_argc_argv() in the main func defined by DEFINE_MAIN_FUNC()). In this
case this means that with --accept both the target executable name and
its arguments will be empty strings:
```
$ systemd-socket-activate --accept --listen 1111 cat &
Listening on [::]:1111 as 3.
$ curl localhost:1111
Communication attempt on fd 3.
Connection from 127.0.0.1:52948 to [::ffff:127.0.0.1]:1111
Spawned cat (cat) as PID 10576.
Execing ()
Failed to execp (): No such file or directory
Child 10576 died with code 1
curl: (56) Recv failure: Connection reset by peer
```
Let's make a copy of the necessary arguments beforehand and use it
instead to fix this.
Diffstat (limited to '.github/codeql-custom.qls')
0 files changed, 0 insertions, 0 deletions