mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 06:15:37 +00:00
Simplify the nss interface such that each sudoers provider fills
in a per-nss list of userspecs and defaults instead of using separate lookup and list functions. This makes it possible to have a single implementation of the code for sudoers lookup and listing.
This commit is contained in:
@@ -25,19 +25,18 @@ struct sudo_nss {
|
||||
int (*open)(struct sudo_nss *nss);
|
||||
int (*close)(struct sudo_nss *nss);
|
||||
int (*parse)(struct sudo_nss *nss);
|
||||
int (*setdefs)(struct sudo_nss *nss);
|
||||
int (*lookup)(struct sudo_nss *nss, int, int);
|
||||
int (*display_cmnd)(struct sudo_nss *nss, struct passwd *);
|
||||
int (*display_defaults)(struct sudo_nss *nss, struct passwd *, struct sudo_lbuf *);
|
||||
int (*display_bound_defaults)(struct sudo_nss *nss, struct passwd *, struct sudo_lbuf *);
|
||||
int (*display_privs)(struct sudo_nss *nss, struct passwd *, struct sudo_lbuf *);
|
||||
int (*query)(struct sudo_nss *nss, struct passwd *pw);
|
||||
int (*getdefs)(struct sudo_nss *nss);
|
||||
void *handle;
|
||||
short ret_if_found;
|
||||
short ret_if_notfound;
|
||||
bool ret_if_found;
|
||||
bool ret_if_notfound;
|
||||
struct defaults_list defaults;
|
||||
struct userspec_list userspecs;
|
||||
};
|
||||
|
||||
TAILQ_HEAD(sudo_nss_list, sudo_nss);
|
||||
|
||||
struct sudo_nss_list *sudo_read_nss(void);
|
||||
bool sudo_nss_can_continue(struct sudo_nss *nss, int match);
|
||||
|
||||
#endif /* SUDOERS_NSS_H */
|
||||
|
Reference in New Issue
Block a user