]> git.tuebingen.mpg.de Git - paraslash.git/commit
audiod: Allow to specify usernames in --user-allow.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 19 Jan 2015 23:25:18 +0000 (00:25 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 31 Mar 2015 19:55:53 +0000 (19:55 +0000)
commitcb193b91d68778125739fe129d49f3c5f4abf999
tree05eb6124a804bb9468fecff828ef57214590e3a2
parentca14953f8f1c5968578735af5de7e966e9b4487d
audiod: Allow to specify usernames in --user-allow.

It's more convenient to specify usernames rather than the UIDs of
the users who may execute an audiod command. This patch allows to
do so. For backwards compatibility we still need to accept numerical
UIDs though.

On startup we first try to convert each given --user-allow argument
to a number and regard this number as a UID. Only if the conversion
fails, we translate the argument to a username with getpwnam().
In order to not perform this conversion on each command, we allocate
a UID whitelist at startup and populate it with the UIDs derived from
both types of --user allow arguments. A pointer to the whitelist is
passed as an additional argument to handle_connect().

The documentation is updated to reflect this change.
audiod.c
audiod.h
audiod_command.c
m4/gengetopt/audiod.m4