Make sudo pass -Wmissing-prototypes
This commit is contained in:
@@ -49,7 +49,7 @@ static bool verbose;
|
||||
static int _init_symbols(void);
|
||||
static int _unlink_symbols(void);
|
||||
|
||||
void
|
||||
static void
|
||||
create_plugin_options(const char *module_name, const char *class_name, const char *extra_option)
|
||||
{
|
||||
char opt_module_path[PATH_MAX + 256];
|
||||
@@ -65,7 +65,7 @@ create_plugin_options(const char *module_name, const char *class_name, const cha
|
||||
opt_classname, extra_option, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
create_io_plugin_options(const char *log_path)
|
||||
{
|
||||
char opt_logpath[PATH_MAX + 16];
|
||||
@@ -73,19 +73,19 @@ create_io_plugin_options(const char *log_path)
|
||||
create_plugin_options("example_io_plugin", "SudoIOPlugin", opt_logpath);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
create_debugging_plugin_options(void)
|
||||
{
|
||||
create_plugin_options("example_debugging", "DebugDemoPlugin", NULL);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
create_audit_plugin_options(const char *extra_argument)
|
||||
{
|
||||
create_plugin_options("example_audit_plugin", "SudoAuditPlugin", extra_argument);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
create_conversation_plugin_options(void)
|
||||
{
|
||||
char opt_logpath[PATH_MAX + 16];
|
||||
@@ -93,13 +93,13 @@ create_conversation_plugin_options(void)
|
||||
create_plugin_options("example_conversation", "ReasonLoggerIOPlugin", opt_logpath);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
create_policy_plugin_options(void)
|
||||
{
|
||||
create_plugin_options("example_policy_plugin", "SudoPolicyPlugin", NULL);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
init(void)
|
||||
{
|
||||
// always start each test from clean state
|
||||
@@ -134,7 +134,7 @@ init(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
cleanup(int success)
|
||||
{
|
||||
if (!success) {
|
||||
@@ -160,7 +160,7 @@ cleanup(int success)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_io_plugin_version_display(int is_verbose)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -188,7 +188,7 @@ check_example_io_plugin_version_display(int is_verbose)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_io_plugin_command_log(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -233,7 +233,7 @@ check_example_io_plugin_command_log(void)
|
||||
|
||||
typedef struct io_plugin * (io_clone_func)(void);
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_io_plugin_command_log_multiple(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -330,7 +330,7 @@ check_example_io_plugin_command_log_multiple(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_io_plugin_failed_to_start_command(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -358,7 +358,7 @@ check_example_io_plugin_failed_to_start_command(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_io_plugin_fails_with_python_backtrace(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -377,7 +377,7 @@ check_example_io_plugin_fails_with_python_backtrace(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_io_plugin_reports_error(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -445,7 +445,7 @@ check_io_plugin_reports_error(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_group_plugin(void)
|
||||
{
|
||||
create_plugin_options("example_group_plugin", "SudoGroupPlugin", NULL);
|
||||
@@ -463,7 +463,7 @@ check_example_group_plugin(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *
|
||||
static const char *
|
||||
create_debug_config(const char *debug_spec)
|
||||
{
|
||||
char *result = NULL;
|
||||
@@ -493,7 +493,7 @@ cleanup:
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_group_plugin_is_able_to_debug(void)
|
||||
{
|
||||
const char *config_path = create_debug_config("py_calls@diag");
|
||||
@@ -516,7 +516,7 @@ check_example_group_plugin_is_able_to_debug(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_plugin_unload(void)
|
||||
{
|
||||
// You can call this test to avoid having a lot of subinterpreters
|
||||
@@ -528,7 +528,7 @@ check_plugin_unload(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_debugging(const char *debug_spec)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -559,7 +559,7 @@ check_example_debugging(const char *debug_spec)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_loading_fails(const char *name)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -576,7 +576,7 @@ check_loading_fails(const char *name)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_loading_fails_with_missing_path(void)
|
||||
{
|
||||
str_array_free(&data.plugin_options);
|
||||
@@ -584,7 +584,7 @@ check_loading_fails_with_missing_path(void)
|
||||
return check_loading_fails("missing_path");
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_loading_succeeds_with_missing_classname(void)
|
||||
{
|
||||
str_array_free(&data.plugin_options);
|
||||
@@ -605,7 +605,7 @@ check_loading_succeeds_with_missing_classname(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_loading_fails_with_missing_classname(void)
|
||||
{
|
||||
str_array_free(&data.plugin_options);
|
||||
@@ -613,14 +613,14 @@ check_loading_fails_with_missing_classname(void)
|
||||
return check_loading_fails("missing_classname");
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_loading_fails_with_wrong_classname(void)
|
||||
{
|
||||
create_plugin_options("example_debugging", "MispelledPluginName", NULL);
|
||||
return check_loading_fails("wrong_classname");
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_loading_fails_with_wrong_path(void)
|
||||
{
|
||||
str_array_free(&data.plugin_options);
|
||||
@@ -628,7 +628,7 @@ check_loading_fails_with_wrong_path(void)
|
||||
return check_loading_fails("wrong_path");
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_loading_fails_plugin_is_not_owned_by_root(void)
|
||||
{
|
||||
sudo_conf_clear_paths();
|
||||
@@ -638,7 +638,7 @@ check_loading_fails_plugin_is_not_owned_by_root(void)
|
||||
return check_loading_fails("not_owned_by_root");
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_conversation_plugin_reason_log(int simulate_suspend, const char *description)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -667,7 +667,7 @@ check_example_conversation_plugin_reason_log(int simulate_suspend, const char *d
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_conversation_plugin_user_interrupts(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -692,7 +692,7 @@ check_example_conversation_plugin_user_interrupts(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_policy_plugin_version_display(int is_verbose)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -721,7 +721,7 @@ check_example_policy_plugin_version_display(int is_verbose)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_policy_plugin_accepted_execution(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -773,7 +773,7 @@ check_example_policy_plugin_accepted_execution(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_policy_plugin_failed_execution(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -811,7 +811,7 @@ check_example_policy_plugin_failed_execution(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_policy_plugin_denied_execution(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -846,7 +846,7 @@ check_example_policy_plugin_denied_execution(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_policy_plugin_list(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -904,7 +904,7 @@ check_example_policy_plugin_list(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_policy_plugin_validate_invalidate(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -935,7 +935,7 @@ check_example_policy_plugin_validate_invalidate(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_policy_plugin_callbacks_are_optional(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -961,7 +961,7 @@ check_policy_plugin_callbacks_are_optional(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_policy_plugin_reports_error(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -1024,7 +1024,7 @@ check_policy_plugin_reports_error(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_io_plugin_callbacks_are_optional(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -1051,7 +1051,7 @@ check_io_plugin_callbacks_are_optional(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_python_plugins_do_not_affect_each_other(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -1078,7 +1078,7 @@ check_python_plugins_do_not_affect_each_other(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_audit_plugin_receives_accept(void)
|
||||
{
|
||||
create_audit_plugin_options("");
|
||||
@@ -1117,7 +1117,7 @@ check_example_audit_plugin_receives_accept(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_audit_plugin_receives_reject(void)
|
||||
{
|
||||
create_audit_plugin_options(NULL);
|
||||
@@ -1147,7 +1147,7 @@ check_example_audit_plugin_receives_reject(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_audit_plugin_receives_error(void)
|
||||
{
|
||||
create_audit_plugin_options("");
|
||||
@@ -1179,7 +1179,7 @@ check_example_audit_plugin_receives_error(void)
|
||||
|
||||
typedef struct audit_plugin * (audit_clone_func)(void);
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_audit_plugin_workflow_multiple(void)
|
||||
{
|
||||
// verify multiple python audit plugins are available
|
||||
@@ -1247,7 +1247,7 @@ check_example_audit_plugin_workflow_multiple(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_example_audit_plugin_version_display(void)
|
||||
{
|
||||
create_audit_plugin_options(NULL);
|
||||
@@ -1275,7 +1275,7 @@ check_example_audit_plugin_version_display(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_audit_plugin_callbacks_are_optional(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
@@ -1300,7 +1300,7 @@ check_audit_plugin_callbacks_are_optional(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
check_audit_plugin_reports_error(void)
|
||||
{
|
||||
const char *errstr = NULL;
|
||||
|
Reference in New Issue
Block a user