chiark / gitweb /
user-util: rework maybe_setgroups() a bit
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Oct 2016 15:54:12 +0000 (17:54 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 5 Jul 2017 06:50:54 +0000 (08:50 +0200)
commit98882279e46c4a4776d68872340f636bd1ec1863
treee1c18d804ed1eada4cfb9f0456c4e036c29d3231
parent26e777ad8e15ff57aed603ce37e18e9b46384e06
user-util: rework maybe_setgroups() a bit

Let's drop the caching of the setgroups /proc field for now. While there's a
strict regime in place when it changes states, let's better not cache it since
we cannot really be sure we follow that regime correctly.

More importantly however, this is not in performance sensitive code, and
there's no indication the cache is really beneficial, hence let's drop the
caching and make things a bit simpler.

Also, while we are at it, rework the error handling a bit, and always return
negative errno-style error codes, following our usual coding style. This has
the benefit that we can sensible hanld read_one_line_file() errors, without
having to updat errno explicitly.
src/basic/capability-util.c
src/basic/user-util.c