Move parser prototypes / externs from sudoers.h to parse.h or toke.h.
This commit is contained in:
@@ -375,6 +375,8 @@ struct parser_leak_entry {
|
|||||||
};
|
};
|
||||||
SLIST_HEAD(parser_leak_list, parser_leak_entry);
|
SLIST_HEAD(parser_leak_list, parser_leak_entry);
|
||||||
|
|
||||||
|
#define YY_DECL int sudoerslex(void)
|
||||||
|
|
||||||
/* alias.c */
|
/* alias.c */
|
||||||
struct rbtree *alloc_aliases(void);
|
struct rbtree *alloc_aliases(void);
|
||||||
void free_aliases(struct rbtree *aliases);
|
void free_aliases(struct rbtree *aliases);
|
||||||
@@ -392,9 +394,9 @@ void alias_put(struct alias *a);
|
|||||||
int check_aliases(struct sudoers_parse_tree *parse_tree, bool strict, bool quiet, int (*cb_unused)(struct sudoers_parse_tree *, struct alias *, void *));
|
int check_aliases(struct sudoers_parse_tree *parse_tree, bool strict, bool quiet, int (*cb_unused)(struct sudoers_parse_tree *, struct alias *, void *));
|
||||||
|
|
||||||
/* gram.y */
|
/* gram.y */
|
||||||
|
extern bool parse_error;
|
||||||
extern struct sudoers_parse_tree parsed_policy;
|
extern struct sudoers_parse_tree parsed_policy;
|
||||||
extern bool (*sudoers_error_hook)(const char *file, int line, int column, const char *fmt, va_list args);
|
extern bool (*sudoers_error_hook)(const char *file, int line, int column, const char *fmt, va_list args);
|
||||||
bool init_parser(const char *file, const struct sudoers_parser_config *conf);
|
|
||||||
bool reset_parser(void);
|
bool reset_parser(void);
|
||||||
void free_member(struct member *m);
|
void free_member(struct member *m);
|
||||||
void free_members(struct member_list *members);
|
void free_members(struct member_list *members);
|
||||||
@@ -405,12 +407,19 @@ void free_userspec(struct userspec *us);
|
|||||||
void free_userspecs(struct userspec_list *usl);
|
void free_userspecs(struct userspec_list *usl);
|
||||||
void free_default(struct defaults *def);
|
void free_default(struct defaults *def);
|
||||||
void free_defaults(struct defaults_list *defs);
|
void free_defaults(struct defaults_list *defs);
|
||||||
|
bool init_parser(const char *file, const struct sudoers_parser_config *conf);
|
||||||
void init_parse_tree(struct sudoers_parse_tree *parse_tree, char *lhost, char *shost, struct sudo_nss *nss);
|
void init_parse_tree(struct sudoers_parse_tree *parse_tree, char *lhost, char *shost, struct sudo_nss *nss);
|
||||||
void free_parse_tree(struct sudoers_parse_tree *parse_tree);
|
void free_parse_tree(struct sudoers_parse_tree *parse_tree);
|
||||||
void reparent_parse_tree(struct sudoers_parse_tree *new_tree);
|
|
||||||
bool parser_leak_add(enum parser_leak_types type, void *v);
|
bool parser_leak_add(enum parser_leak_types type, void *v);
|
||||||
bool parser_leak_remove(enum parser_leak_types type, void *v);
|
bool parser_leak_remove(enum parser_leak_types type, void *v);
|
||||||
void parser_leak_init(void);
|
void parser_leak_init(void);
|
||||||
|
void reparent_parse_tree(struct sudoers_parse_tree *new_tree);
|
||||||
|
int sudoersparse(void);
|
||||||
|
uid_t sudoers_file_uid(void);
|
||||||
|
gid_t sudoers_file_gid(void);
|
||||||
|
mode_t sudoers_file_mode(void);
|
||||||
|
bool sudoers_error_recovery(void);
|
||||||
|
bool sudoers_strict(void);
|
||||||
|
|
||||||
/* match_addr.c */
|
/* match_addr.c */
|
||||||
bool addr_matches(char *n);
|
bool addr_matches(char *n);
|
||||||
@@ -440,8 +449,11 @@ int userlist_matches(const struct sudoers_parse_tree *parse_tree, const struct p
|
|||||||
const char *sudo_getdomainname(void);
|
const char *sudo_getdomainname(void);
|
||||||
struct gid_list *runas_getgroups(void);
|
struct gid_list *runas_getgroups(void);
|
||||||
|
|
||||||
/* toke.c */
|
/* toke.l */
|
||||||
void init_lexer(void);
|
YY_DECL;
|
||||||
|
void sudoersrestart(FILE *);
|
||||||
|
extern FILE *sudoersin;
|
||||||
|
extern char *sudoers;
|
||||||
|
|
||||||
/* base64.c */
|
/* base64.c */
|
||||||
size_t base64_decode(const char *str, unsigned char *dst, size_t dsize);
|
size_t base64_decode(const char *str, unsigned char *dst, size_t dsize);
|
||||||
|
@@ -287,8 +287,6 @@ struct timespec;
|
|||||||
/*
|
/*
|
||||||
* Function prototypes
|
* Function prototypes
|
||||||
*/
|
*/
|
||||||
#define YY_DECL int sudoerslex(void)
|
|
||||||
|
|
||||||
/* goodpath.c */
|
/* goodpath.c */
|
||||||
bool sudo_goodpath(const char *path, struct stat *sbp);
|
bool sudo_goodpath(const char *path, struct stat *sbp);
|
||||||
|
|
||||||
@@ -322,23 +320,6 @@ bool set_perms(int);
|
|||||||
bool restore_perms(void);
|
bool restore_perms(void);
|
||||||
int pam_prep_user(struct passwd *);
|
int pam_prep_user(struct passwd *);
|
||||||
|
|
||||||
/* gram.y */
|
|
||||||
int sudoersparse(void);
|
|
||||||
uid_t sudoers_file_uid(void);
|
|
||||||
gid_t sudoers_file_gid(void);
|
|
||||||
mode_t sudoers_file_mode(void);
|
|
||||||
bool sudoers_error_recovery(void);
|
|
||||||
bool sudoers_strict(void);
|
|
||||||
extern bool parse_error;
|
|
||||||
|
|
||||||
/* toke.l */
|
|
||||||
YY_DECL;
|
|
||||||
void sudoersrestart(FILE *);
|
|
||||||
extern FILE *sudoersin;
|
|
||||||
extern char *sudoers;
|
|
||||||
extern char *sudoers_search_path;
|
|
||||||
extern int sudolineno;
|
|
||||||
|
|
||||||
/* defaults.c */
|
/* defaults.c */
|
||||||
void dump_defaults(void);
|
void dump_defaults(void);
|
||||||
void dump_auth_methods(void);
|
void dump_auth_methods(void);
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-License-Identifier: ISC
|
* SPDX-License-Identifier: ISC
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2013, 2015-2016, 2020 Todd C. Miller <Todd.Miller@sudo.ws>
|
* Copyright (c) 2011-2013, 2015-2016, 2020-2023
|
||||||
|
* Todd C. Miller <Todd.Miller@sudo.ws>
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
* Permission to use, copy, modify, and distribute this software for any
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
* purpose with or without fee is hereby granted, provided that the above
|
||||||
@@ -27,13 +28,17 @@ struct sudolinebuf {
|
|||||||
size_t toke_start; /* starting column of current token */
|
size_t toke_start; /* starting column of current token */
|
||||||
size_t toke_end; /* ending column of current token */
|
size_t toke_end; /* ending column of current token */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const char *sudoers_errstr;
|
extern const char *sudoers_errstr;
|
||||||
extern struct sudolinebuf sudolinebuf;
|
extern struct sudolinebuf sudolinebuf;
|
||||||
|
extern int sudolineno;
|
||||||
|
extern char *sudoers_search_path;
|
||||||
|
|
||||||
bool append(const char *, size_t);
|
bool append(const char *, size_t);
|
||||||
bool fill_args(const char *, size_t, int);
|
bool fill_args(const char *, size_t, int);
|
||||||
bool fill_cmnd(const char *, size_t);
|
bool fill_cmnd(const char *, size_t);
|
||||||
bool fill(const char *, size_t);
|
bool fill(const char *, size_t);
|
||||||
|
void init_lexer(void);
|
||||||
bool ipv6_valid(const char *s);
|
bool ipv6_valid(const char *s);
|
||||||
int sudoers_trace_print(const char *);
|
int sudoers_trace_print(const char *);
|
||||||
void sudoerserrorf(const char *, ...) sudo_printf0like(1, 2);
|
void sudoerserrorf(const char *, ...) sudo_printf0like(1, 2);
|
||||||
|
Reference in New Issue
Block a user