]> git.ipfire.org Git - thirdparty/shadow.git/commit
newuidmap/newgidmap: added support for user matching by UID in /etc/sub[ug]id
authorBostjan Skufca <bostjan@a2o.si>
Fri, 5 Sep 2014 21:21:03 +0000 (21:21 +0000)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 17 Sep 2014 20:48:10 +0000 (15:48 -0500)
commita113b87c4549b3236d43e1e1c31790b5167d87db
tree7860e810685b083817e3076f287b472f4cce2c07
parentb999d48941e86111589b38c1909d38a44319d0f0
newuidmap/newgidmap: added support for user matching by UID in /etc/sub[ug]id

Until now only exact username specification in /etc/sub[ug]id file allowed the
mapping. This prevented normal use for those users who use multiple usernames
with the same UID, as it rejected mapping even though it was allowed for
another username with the same UID.

This patch initially retains the old behaviour, for performance's sake. In the
first pass, new[ug]idmap only searches for exact username match.
If that yields no valid results, it continues into another loop, which does UID
resolution and comparison. If either definition (numeric UID mapping
specification or mapping specification for another username with the same UID as
current username) is found, it is used.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
lib/subordinateio.c
man/subgid.5.xml
man/subuid.5.xml