From: Todd C. Miller Date: Thu, 21 May 2015 17:26:44 +0000 (-0600) Subject: Get rid of SUDO_MAIN. Modern compilers don't warn about mixing X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04128f598589180ccf7d5298dd162d078ebb9bdd;p=sudo Get rid of SUDO_MAIN. Modern compilers don't warn about mixing extern and auto declarations unless they conflict. --- diff --git a/plugins/sudoers/logging.h b/plugins/sudoers/logging.h index f5659277a..b4d2cafa4 100644 --- a/plugins/sudoers/logging.h +++ b/plugins/sudoers/logging.h @@ -58,11 +58,9 @@ */ #define LOG_INDENT " " -#ifndef SUDO_MAIN /* XXX - needed for auditing */ extern int NewArgc; extern char **NewArgv; -#endif bool sudoers_warn_setlocale(bool restore, int *cookie); bool sudoers_setlocale(int newlocale, int *prevlocale); diff --git a/plugins/sudoers/sudoers.h b/plugins/sudoers/sudoers.h index 744ea3934..72e14498e 100644 --- a/plugins/sudoers/sudoers.h +++ b/plugins/sudoers/sudoers.h @@ -344,6 +344,13 @@ FILE *open_sudoers(const char *, bool, bool *); int sudoers_policy_init(void *info, char * const envp[]); int sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[], void *closure); void sudoers_cleanup(void); +extern struct sudo_user sudo_user; +extern struct passwd *list_pw; +extern int long_list; +extern int sudo_mode; +extern uid_t timestamp_uid; +extern sudo_conv_t sudo_conv; +extern sudo_printf_t sudo_printf; /* sudoers_debug.c */ void sudoers_debug_parse_flags(struct sudo_conf_debug_file_list *debug_files, const char *entry); @@ -362,14 +369,4 @@ void group_plugin_unload(void); int group_plugin_query(const char *user, const char *group, const struct passwd *pwd); -#ifndef SUDO_MAIN -extern struct sudo_user sudo_user; -extern struct passwd *list_pw; -extern int long_list; -extern int sudo_mode; -extern uid_t timestamp_uid; -extern sudo_conv_t sudo_conv; -extern sudo_printf_t sudo_printf; -#endif - #endif /* SUDOERS_SUDOERS_H */