Do not redefine system group and passwd functions for testsudoers.

Instead, prefix the replacements with "testsudoers_" and use a
custom pwutil backend so they get used.
This commit is contained in:
Todd C. Miller
2021-03-18 11:39:54 -06:00
parent 4c182c90f1
commit 3e5cf7baa3
6 changed files with 95 additions and 99 deletions

View File

@@ -0,0 +1,14 @@
/* Use custom passwd/group functions with the normal pwutil_impl.c */
#define sudo_make_pwitem testsudoers_make_pwitem
#define sudo_make_gritem testsudoers_make_gritem
#define sudo_make_gidlist_item testsudoers_make_gidlist_item
#define sudo_make_grlist_item testsudoers_make_grlist_item
#define getpwnam testsudoers_getpwnam
#define getpwuid testsudoers_getpwuid
#define getgrnam testsudoers_getgrnam
#define getgrgid testsudoers_getgrgid
#define sudo_getgrouplist2_v1 testsudoers_getgrouplist2_v1
#include "tsgetgrpw.h"
#include "pwutil_impl.c"