openrc/src
Johannes Heimansberg 47819f004c start-stop-daemon, supervise-daemon: fix parsing of usernames passed via --user that start with a number
start-stop-daemon and supervise-daemon parse usernames and group names
passed via the --user argument as numeric UID/GID if they start with a
number (e.g. user "4foo" will be treated as UID 4). This results in the
process that is being started to run under a totally unexpected user if
that UID exists.

Even though the result of the sscanf calls are tested for a result of
exactly 1, which means exactly one value was extracted, because sscanf's
format string only contains only one placeholder, it will never return
a value greater than 1, even if there are still characters left to be
parsed. This causes start-stop-daemon and supervise-daemon to assume
that usernames starting with a number are just that number. Adding a
second placeholder "%1s" to the format string, which matches a string of
length 1, makes sure that sscanf can distinguish between pure numbers
(in which case it will return 1) and strings either starting with a
number (in which case it will return 2) and any other string (in which
case it will return 0).

This fixes #379.
This fixes #380.
2020-11-27 16:40:12 -06:00
..
includes remove hidden-visibility.h 2019-02-26 17:47:55 -06:00
libeinfo Fix build with Clang 2019-07-24 12:32:23 -05:00
librc Fix build with Clang 2019-07-24 12:32:23 -05:00
rc start-stop-daemon, supervise-daemon: fix parsing of usernames passed via --user that start with a number 2020-11-27 16:40:12 -06:00
Makefile combine test directories 2019-02-22 18:08:19 -06:00