bus: raise fd limits before dropping privs
authorDavid King <dking@redhat.com>
Wed, 7 Feb 2018 14:37:24 +0000 (14:37 +0000)
committerSimon McVittie <smcv@collabora.com>
Tue, 20 Feb 2018 18:42:44 +0000 (18:42 +0000)
commitb4a4323c68f38fb4852840c879c7b2c5e0b565cf
treedc7d1f4f41e39dfc0a6c266d6f6161da8b604a9b
parent9a2846e105b129567c58b339a57ffe8b9232ed19
bus: raise fd limits before dropping privs

Startup ordering was changed in #92832 to ensure that SELinux audit
messages could be sent. As a side effect, the raising of file descriptor
limits was moved to after the dropping of root privileges, resulting in
the limit change always failing.

Move the raise_file_descriptor_limit() call to ensure that it is called
before dropping root privileges.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=105165
Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1529044
[smcv: Call raise_file_descriptor_limit() even if !context->user]
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 6e42964f5f850f4108fd8f7f3cd385ab4d60f9f6)
bus/bus.c