shadow/libmisc
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
..
.indent.pro
addgrps.c
age.c
audit_help.c
basename.c Miscellaneous: 2011-09-18 21:02:43 +00:00
btrfs.c silence compiler warnings 2020-01-12 07:31:26 -06:00
chkname.c chkname.c, pwck.c, useradd.c, usermod.c, newusers.c: Allow names that do not conform to standards 2019-10-04 18:40:41 -05:00
chkname.h
chowndir.c
chowntty.c
cleanup_group.c
cleanup_user.c
cleanup.c * lib/prototypes.h, libmisc/cleanup.c, lib/spawn.c, src/chage.c: 2011-10-18 20:23:33 +00:00
console.c Fix some issues found in Coverity scan. 2018-10-10 12:22:04 +02:00
copydir.c 2012-02-13 Mike Frysinger <vapier@gentoo.org> 2012-02-13 19:16:29 +00:00
entry.c
env.c
failure.c
failure.h spelling: cumulative 2017-10-22 18:33:13 +00:00
find_new_gid.c remove unused variables 2019-10-12 20:03:32 -05:00
find_new_sub_gids.c remove unused and misleading 'owner' argument from find_new_sub* 2020-04-17 16:32:44 -05:00
find_new_sub_uids.c remove unused and misleading 'owner' argument from find_new_sub* 2020-04-17 16:32:44 -05:00
find_new_uid.c remove unused variables 2019-10-12 20:03:32 -05:00
getdate.h
getdate.y spelling: gratuitously 2017-10-22 19:17:02 +00:00
getgr_nam_gid.c
getrange.c
gettime.c gettime: Use secure_getenv over getenv. 2019-03-31 16:00:01 +01:00
hushed.c
idmapping.c Fix hurd build 2020-04-17 21:50:48 +02:00
idmapping.h subids: support nsswitch 2021-04-16 21:02:37 -05:00
isexpired.c
limits.c * man/limits.5.xml, libmisc/limits.c: Sort limit identifiers. 2011-11-06 18:39:47 +00:00
list.c
log.c
loginprompt.c
mail.c
Makefile.am try again to fix libmisc sharing problem 2021-04-11 17:42:04 -05:00
motd.c
myname.c
obscure.c Add yescrypt support 2021-02-01 22:11:10 +01:00
pam_pass_non_interactive.c spelling: interactive 2017-10-22 20:24:32 +00:00
pam_pass.c
prefix_flag.c libmisc: Accept --root=path and --prefix=path option syntax 2020-02-07 21:57:12 +00:00
pwd2spwd.c Make the sp_lstchg shadow field reproducible (re. #71) 2019-03-31 16:00:01 +01:00
pwd_init.c
pwdcheck.c
remove_tree.c
rlogin.c
root_flag.c libmisc: Accept --root=path and --prefix=path option syntax 2020-02-07 21:57:12 +00:00
salt.c Add yescrypt support 2021-02-01 22:11:10 +01:00
setugid.c
setupenv.c spelling: else 2017-10-22 19:08:39 +00:00
shell.c
strtoday.c spelling: cumulative 2017-10-22 18:33:13 +00:00
sub.c Fix typo in comment. 2013-08-04 15:56:32 +02:00
sulog.c
ttytype.c
tz.c
ulimit.c
user_busy.c Do not mistake a regular user process for a namespaced one 2020-01-21 09:16:10 +01:00
utmp.c Support systems that only have utmpx 2018-06-24 00:13:12 -05:00
valid.c crypt() in glibc/eglibc 2.17 now fails if passed 2013-07-28 18:41:11 +02:00
xgetgrgid.c
xgetgrnam.c
xgetpwnam.c
xgetpwuid.c
xgetspnam.c
xgetXXbyYY.c Re-indent. 2011-11-06 18:40:06 +00:00
xmalloc.c xfree: move xfree() function to xmalloc.c 2020-10-15 21:52:06 -04:00
yesno.c