a113b87c45
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>