shadow/src
Serge Hallyn 8492dee663 subids: support nsswitch
Closes #154

When starting any operation to do with subuid delegation, check
nsswitch for a module to use.  If none is specified, then use
the traditional /etc/subuid and /etc/subgid files.

Currently only one module is supported, and there is no fallback
to the files on errors.  Several possibilities could be considered:

1. in case of connection error, fall back to files
2. in case of unknown user, also fall back to files

etc...

When non-files nss module is used, functions to edit the range
are not supported.  It may make sense to support it, but it also
may make sense to require another tool to be used.

libsubordinateio also uses the nss_ helpers.  This is how for instance
lxc could easily be converted to supporting nsswitch.

Add a set of test cases, including a dummy libsubid_zzz module.  This
hardcodes values such that:

'ubuntu' gets 200000 - 300000
'user1' gets 100000 - 165536
'error' emulates an nss module error
'unknown' emulates a user unknown to the nss module
'conn' emulates a connection error ot the nss module

Changes to libsubid:

Change the list_owner_ranges api: return a count instead of making the array
null terminated.

This is a breaking change, so bump the libsubid abi major number.

Rename free_subuid_range and free_subgid_range to ungrant_subuid_range,
because otherwise it's confusing with free_subid_ranges which frees
    memory.

Run libsubid tests in jenkins

Switch argument order in find_subid_owners

Move the db locking into subordinateio.c

Signed-off-by: Serge Hallyn <serge@hallyn.com>
2021-04-16 21:02:37 -05:00
..
.gitignore Create a new libsubid 2020-06-07 12:11:58 -05:00
.indent.pro [svn-upgrade] Integrating new upstream version, shadow (4.0.8) 2007-10-07 11:46:07 +00:00
Makefile.am subids: support nsswitch 2021-04-16 21:02:37 -05:00
chage.c chage: Prevent signed integer overflows. 2020-07-12 17:56:38 +02:00
check_subid_range.c subids: support nsswitch 2021-04-16 21:02:37 -05:00
chfn.c chfn: Prevent buffer overflow. 2020-07-12 19:09:14 +02:00
chgpasswd.c Add yescrypt support 2021-02-01 22:11:10 +01:00
chpasswd.c Add yescrypt support 2021-02-01 22:11:10 +01:00
chsh.c migrate to new SELinux api 2019-10-22 14:56:31 +02:00
expiry.c Fixed signal races in shadow tools. 2016-07-02 18:11:09 +02:00
faillog.c Replacing exit with return 2020-03-09 18:01:32 +00:00
free_subid_range.c subids: support nsswitch 2021-04-16 21:02:37 -05:00
get_subid_owners.c Create a new libsubid 2020-06-07 12:11:58 -05:00
gpasswd.c xfree: move xfree() function to xmalloc.c 2020-10-15 21:52:06 -04:00
groupadd.c add -U option to groupadd and groupmod 2020-08-09 22:11:33 -05:00
groupdel.c add parsing support for advertised force long opt 2020-10-17 09:18:30 -07:00
groupmems.c spelling: remove 2017-10-22 21:12:29 +00:00
groupmod.c add -U option to groupadd and groupmod 2020-08-09 22:11:33 -05:00
groups.c * src/newgrp.c, src/userdel.c, src/grpck.c, src/gpasswd.c, 2010-08-22 19:36:09 +00:00
grpck.c Removing trailing n typo 2020-08-12 17:53:28 +01:00
grpconv.c Flush sssd caches in addition to nscd caches 2018-09-13 14:20:02 +02:00
grpunconv.c Flush sssd caches in addition to nscd caches 2018-09-13 14:20:02 +02:00
id.c * src/newgrp.c: Limit the scope of variable pid. 2010-03-23 11:26:34 +00:00
lastlog.c Add maximum padding to fit IPv6-Addresses 2020-05-24 23:48:25 +02:00
list_subid_ranges.c subids: support nsswitch 2021-04-16 21:02:37 -05:00
login.c login & su: Treat an empty passwd field as invalid (#315) 2021-03-28 22:16:03 -05:00
login_nopam.c * src/newgrp.c: Limit the scope of variable pid. 2010-03-23 11:26:34 +00:00
logoutd.c * src/newgrp.c, src/userdel.c, src/grpck.c, src/gpasswd.c, 2010-08-22 19:36:09 +00:00
new_subid_range.c Create a new libsubid 2020-06-07 12:11:58 -05:00
newgidmap.c newuidmap,newgidmap: Relax gid checking to allow running under alternative group ID 2021-02-08 13:32:18 +01:00
newgrp.c newgrp: delete dead code 2020-10-27 11:42:08 +01:00
newuidmap.c newuidmap,newgidmap: Relax gid checking to allow running under alternative group ID 2021-02-08 13:32:18 +01:00
newusers.c Add yescrypt support 2021-02-01 22:11:10 +01:00
nologin.c Adding logging of SSH_ORIGINAL_COMMAND to nologin. 2020-01-11 14:46:52 -06:00
passwd.c Add yescrypt support 2021-02-01 22:11:10 +01:00
pwck.c Check for "NONEXISTENT" in "src/pwck.c" 2020-05-11 09:26:43 -04:00
pwconv.c Make the sp_lstchg shadow field reproducible (re. #71) 2019-03-31 16:00:01 +01:00
pwunconv.c Flush sssd caches in addition to nscd caches 2018-09-13 14:20:02 +02:00
su.c login & su: Treat an empty passwd field as invalid (#315) 2021-03-28 22:16:03 -05:00
suauth.c spelling: unrecognized 2017-10-22 21:30:30 +00:00
sulogin.c Fixed signal races in shadow tools. 2016-07-02 18:11:09 +02:00
useradd.c useradd: don't try to create 0 subuids 2021-01-01 13:10:12 -06:00
userdel.c userdel: clarify "-f" usage 2021-02-23 12:21:42 +01:00
usermod.c usermod: check if shell exists & is executable 2021-02-07 19:26:55 +01:00
vipw.c Fix vipw not resuming correctly when suspended 2019-11-11 20:19:57 -06:00