2007-12-31 15:24:57 +00:00
|
|
|
/*
|
2019-04-29 07:21:51 -06:00
|
|
|
* SPDX-License-Identifier: ISC
|
|
|
|
*
|
2018-07-26 15:12:33 -06:00
|
|
|
* Copyright (c) 2007-2011, 2013-2015, 2017-2018
|
|
|
|
* Todd C. Miller <Todd.Miller@sudo.ws>
|
2007-12-31 15:24:57 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2015-05-21 11:13:20 -06:00
|
|
|
#ifndef SUDOERS_NSS_H
|
|
|
|
#define SUDOERS_NSS_H
|
2011-04-05 11:42:53 -04:00
|
|
|
|
2007-12-31 15:24:57 +00:00
|
|
|
struct passwd;
|
2018-05-29 09:39:40 -06:00
|
|
|
struct userspec_list;
|
|
|
|
struct defaults_list;
|
2008-02-03 15:43:38 +00:00
|
|
|
|
2018-07-26 15:12:33 -06:00
|
|
|
/* XXX - parse_tree, ret_if_found and ret_if_notfound should be private */
|
2007-12-31 15:24:57 +00:00
|
|
|
struct sudo_nss {
|
2013-10-22 09:00:37 -06:00
|
|
|
TAILQ_ENTRY(sudo_nss) entries;
|
2022-03-09 12:38:25 -07:00
|
|
|
const char *source;
|
2010-03-17 19:56:27 -04:00
|
|
|
int (*open)(struct sudo_nss *nss);
|
|
|
|
int (*close)(struct sudo_nss *nss);
|
2023-03-17 13:41:38 -06:00
|
|
|
struct sudoers_parse_tree *(*parse)(const struct sudo_nss *nss);
|
|
|
|
int (*query)(const struct sudo_nss *nss, struct passwd *pw);
|
|
|
|
int (*getdefs)(const struct sudo_nss *nss);
|
|
|
|
int (*innetgr)(const struct sudo_nss *nss, const char *netgr,
|
|
|
|
const char *host, const char *user, const char *domain);
|
2007-12-31 15:24:57 +00:00
|
|
|
void *handle;
|
2018-07-26 15:12:33 -06:00
|
|
|
struct sudoers_parse_tree *parse_tree;
|
2018-05-14 09:05:03 -06:00
|
|
|
bool ret_if_found;
|
|
|
|
bool ret_if_notfound;
|
2007-12-31 15:24:57 +00:00
|
|
|
};
|
|
|
|
|
2013-10-22 09:00:37 -06:00
|
|
|
TAILQ_HEAD(sudo_nss_list, sudo_nss);
|
2007-12-31 15:24:57 +00:00
|
|
|
|
2010-03-17 19:56:27 -04:00
|
|
|
struct sudo_nss_list *sudo_read_nss(void);
|
2023-03-17 13:41:38 -06:00
|
|
|
bool sudo_nss_can_continue(const struct sudo_nss *nss, int match);
|
2011-04-05 11:42:53 -04:00
|
|
|
|
2015-05-21 11:13:20 -06:00
|
|
|
#endif /* SUDOERS_NSS_H */
|