]> git.tue.mpg.de Git - paraslash.git/commit
audiod: Move UID check from audiod_command.c to audiod.c.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 20 Jun 2016 21:20:59 +0000 (23:20 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 7 Aug 2016 12:03:44 +0000 (14:03 +0200)
commit67cb641c126769af98289539ff3425dfbf5e12e2
treebca22ad909decd8839bdb980d0dc965e18291333
parent780adf95bc4c7cfbb0c4e99cc56ec1282a4818a1
audiod: Move UID check from audiod_command.c to audiod.c.

check_perms() is the only reason for the gengetopt config pointer
being public and for passing the whitelist pointer to handle_connect()
in audiod_command.c. The code get less convoluted by moving the
permission check to audiod.c where both the conf pointer and the
uid_whitelist are defined.

This introduces the new public function uid_is_whitelisted() in
audiod.c which replaces check_perms(). This allows to

* pass only the UID to the check function,
* drop the whitelist pointer argument from handle_connect(),
* make the conf pointer in audiod.c static.

The patch also reorders the function declarations in audiod.h a bit
to separate the functions defined in audiod.c from those defined
in audiod_command.c.
audiod.c
audiod.h
audiod_command.c