Rename all hook functions for saner debugging
- Now that the hook functions in plugins no longer need to be uniformly named, rename them to more "natural" pluginname_hookname style so __func__ (and gdb etc) give meaningful, distinct values for them. No functional changes unless I typoed something.
This commit is contained in:
parent
cd7ca60a6c
commit
6fd18f15b3
|
@ -5,7 +5,7 @@
|
|||
#include "lib/rpmchroot.h"
|
||||
#include "debug.h"
|
||||
|
||||
static rpmRC PLUGINHOOK_COLL_POST_ANY_FUNC(rpmPlugin plugin)
|
||||
static rpmRC exec_coll_post_any(rpmPlugin plugin)
|
||||
{
|
||||
rpmRC rc = RPMRC_FAIL;
|
||||
const char *options = rpmPluginOpts(plugin);
|
||||
|
@ -34,5 +34,5 @@ static rpmRC PLUGINHOOK_COLL_POST_ANY_FUNC(rpmPlugin plugin)
|
|||
}
|
||||
|
||||
struct rpmPluginHooks_s exec_hooks = {
|
||||
.coll_post_any = PLUGINHOOK_COLL_POST_ANY_FUNC,
|
||||
.coll_post_any = exec_coll_post_any,
|
||||
};
|
||||
|
|
|
@ -51,7 +51,7 @@ static rpmRC sehandle_init(int open_status)
|
|||
return (sehandle != NULL) ? RPMRC_OK : RPMRC_FAIL;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmPlugin plugin, rpmts ts)
|
||||
static rpmRC selinux_tsm_pre(rpmPlugin plugin, rpmts ts)
|
||||
{
|
||||
rpmRC rc = RPMRC_OK;
|
||||
|
||||
|
@ -68,7 +68,7 @@ static rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmPlugin plugin, rpmts ts)
|
|||
return rc;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmPlugin plugin, rpmts ts, int rc)
|
||||
static rpmRC selinux_tsm_post(rpmPlugin plugin, rpmts ts, int rc)
|
||||
{
|
||||
if (sehandle) {
|
||||
sehandle_fini(1);
|
||||
|
@ -76,7 +76,7 @@ static rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmPlugin plugin, rpmts ts, int rc)
|
|||
return RPMRC_OK;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_PSM_PRE_FUNC(rpmPlugin plugin, rpmte te)
|
||||
static rpmRC selinux_psm_pre(rpmPlugin plugin, rpmte te)
|
||||
{
|
||||
rpmRC rc = RPMRC_OK;
|
||||
|
||||
|
@ -87,7 +87,7 @@ static rpmRC PLUGINHOOK_PSM_PRE_FUNC(rpmPlugin plugin, rpmte te)
|
|||
return rc;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_SCRIPTLET_FORK_POST_FUNC(rpmPlugin plugin,
|
||||
static rpmRC selinux_scriptlet_fork_post(rpmPlugin plugin,
|
||||
const char *path, int type)
|
||||
{
|
||||
rpmRC rc = RPMRC_FAIL;
|
||||
|
@ -136,7 +136,7 @@ exit:
|
|||
return rc;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_FSM_FILE_PREPARE_FUNC(rpmPlugin plugin,
|
||||
static rpmRC selinux_fsm_file_prepare(rpmPlugin plugin,
|
||||
const char *path, const char *dest,
|
||||
mode_t file_mode, rpmFsmOp op)
|
||||
{
|
||||
|
@ -169,9 +169,9 @@ static rpmRC PLUGINHOOK_FSM_FILE_PREPARE_FUNC(rpmPlugin plugin,
|
|||
}
|
||||
|
||||
struct rpmPluginHooks_s selinux_hooks = {
|
||||
.tsm_pre = PLUGINHOOK_TSM_PRE_FUNC,
|
||||
.tsm_post = PLUGINHOOK_TSM_POST_FUNC,
|
||||
.psm_pre = PLUGINHOOK_PSM_PRE_FUNC,
|
||||
.scriptlet_fork_post = PLUGINHOOK_SCRIPTLET_FORK_POST_FUNC,
|
||||
.fsm_file_prepare = PLUGINHOOK_FSM_FILE_PREPARE_FUNC,
|
||||
.tsm_pre = selinux_tsm_pre,
|
||||
.tsm_post = selinux_tsm_post,
|
||||
.psm_pre = selinux_psm_pre,
|
||||
.scriptlet_fork_post = selinux_scriptlet_fork_post,
|
||||
.fsm_file_prepare = selinux_fsm_file_prepare,
|
||||
};
|
||||
|
|
|
@ -620,39 +620,39 @@ static rpmRC sepolAddTE(rpmte te, const char *name)
|
|||
|
||||
|
||||
|
||||
static rpmRC PLUGINHOOK_INIT_FUNC(rpmPlugin plugin, rpmts _ts)
|
||||
static rpmRC sepolicy_init(rpmPlugin plugin, rpmts _ts)
|
||||
{
|
||||
ts = _ts;
|
||||
policiesHead = policiesTail = NULL;
|
||||
return RPMRC_OK;
|
||||
}
|
||||
|
||||
static void PLUGINHOOK_CLEANUP_FUNC(rpmPlugin plugin)
|
||||
static void sepolicy_cleanup(rpmPlugin plugin)
|
||||
{
|
||||
ts = NULL;
|
||||
policiesHead = policiesTail = sepolFree(policiesHead);
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_OPENTE_FUNC(rpmPlugin plugin, rpmte te)
|
||||
static rpmRC sepolicy_opente(rpmPlugin plugin, rpmte te)
|
||||
{
|
||||
return sepolAddTE(te, rpmPluginName(plugin));
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_COLL_POST_ADD_FUNC(rpmPlugin plugin)
|
||||
static rpmRC sepolicy_coll_post_add(rpmPlugin plugin)
|
||||
{
|
||||
return sepolGo();
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_COLL_PRE_REMOVE_FUNC(rpmPlugin plugin)
|
||||
static rpmRC sepolicy_coll_pre_remove(rpmPlugin plugin)
|
||||
{
|
||||
return sepolGo();
|
||||
}
|
||||
|
||||
struct rpmPluginHooks_s sepolicy_hooks = {
|
||||
.init = PLUGINHOOK_INIT_FUNC,
|
||||
.cleanup = PLUGINHOOK_CLEANUP_FUNC,
|
||||
.opente = PLUGINHOOK_OPENTE_FUNC,
|
||||
.coll_post_add = PLUGINHOOK_COLL_POST_ADD_FUNC,
|
||||
.coll_pre_remove = PLUGINHOOK_COLL_PRE_REMOVE_FUNC,
|
||||
.init = sepolicy_init,
|
||||
.cleanup = sepolicy_cleanup,
|
||||
.opente = sepolicy_opente,
|
||||
.coll_post_add = sepolicy_coll_post_add,
|
||||
.coll_pre_remove = sepolicy_coll_pre_remove,
|
||||
};
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ struct logstat {
|
|||
unsigned int pkgfail;
|
||||
};
|
||||
|
||||
static rpmRC PLUGINHOOK_INIT_FUNC(rpmPlugin plugin, rpmts ts)
|
||||
static rpmRC syslog_init(rpmPlugin plugin, rpmts ts)
|
||||
{
|
||||
/* XXX make this configurable? */
|
||||
const char * log_ident = "[RPM]";
|
||||
|
@ -20,14 +20,14 @@ static rpmRC PLUGINHOOK_INIT_FUNC(rpmPlugin plugin, rpmts ts)
|
|||
return RPMRC_OK;
|
||||
}
|
||||
|
||||
static void PLUGINHOOK_CLEANUP_FUNC(rpmPlugin plugin)
|
||||
static void syslog_cleanup(rpmPlugin plugin)
|
||||
{
|
||||
struct logstat * state = rpmPluginGetData(plugin);
|
||||
free(state);
|
||||
closelog();
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmPlugin plugin, rpmts ts)
|
||||
static rpmRC syslog_tsm_pre(rpmPlugin plugin, rpmts ts)
|
||||
{
|
||||
struct logstat * state = rpmPluginGetData(plugin);
|
||||
|
||||
|
@ -53,7 +53,7 @@ static rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmPlugin plugin, rpmts ts)
|
|||
return RPMRC_OK;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmPlugin plugin, rpmts ts, int res)
|
||||
static rpmRC syslog_tsm_post(rpmPlugin plugin, rpmts ts, int res)
|
||||
{
|
||||
struct logstat * state = rpmPluginGetData(plugin);
|
||||
|
||||
|
@ -70,7 +70,7 @@ static rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmPlugin plugin, rpmts ts, int res)
|
|||
return RPMRC_OK;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_PSM_POST_FUNC(rpmPlugin plugin, rpmte te, int res)
|
||||
static rpmRC syslog_psm_post(rpmPlugin plugin, rpmte te, int res)
|
||||
{
|
||||
struct logstat * state = rpmPluginGetData(plugin);
|
||||
|
||||
|
@ -92,7 +92,7 @@ static rpmRC PLUGINHOOK_PSM_POST_FUNC(rpmPlugin plugin, rpmte te, int res)
|
|||
return RPMRC_OK;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_SCRIPTLET_POST_FUNC(rpmPlugin plugin,
|
||||
static rpmRC syslog_scriptlet_post(rpmPlugin plugin,
|
||||
const char *s_name, int type, int res)
|
||||
{
|
||||
struct logstat * state = rpmPluginGetData(plugin);
|
||||
|
@ -105,10 +105,10 @@ static rpmRC PLUGINHOOK_SCRIPTLET_POST_FUNC(rpmPlugin plugin,
|
|||
}
|
||||
|
||||
struct rpmPluginHooks_s syslog_hooks = {
|
||||
.init = PLUGINHOOK_INIT_FUNC,
|
||||
.cleanup = PLUGINHOOK_CLEANUP_FUNC,
|
||||
.tsm_pre = PLUGINHOOK_TSM_PRE_FUNC,
|
||||
.tsm_post = PLUGINHOOK_TSM_POST_FUNC,
|
||||
.psm_post = PLUGINHOOK_PSM_POST_FUNC,
|
||||
.scriptlet_post = PLUGINHOOK_SCRIPTLET_POST_FUNC,
|
||||
.init = syslog_init,
|
||||
.cleanup = syslog_cleanup,
|
||||
.tsm_pre = syslog_tsm_pre,
|
||||
.tsm_post = syslog_tsm_post,
|
||||
.psm_post = syslog_psm_post,
|
||||
.scriptlet_post = syslog_scriptlet_post,
|
||||
};
|
||||
|
|
|
@ -55,7 +55,7 @@ static int inhibit(void)
|
|||
return fd;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmPlugin plugin, rpmts ts)
|
||||
static rpmRC systemd_inhibit_tsm_pre(rpmPlugin plugin, rpmts ts)
|
||||
{
|
||||
if (rpmtsFlags(ts) & (RPMTRANS_FLAG_TEST|RPMTRANS_FLAG_BUILD_PROBS))
|
||||
return RPMRC_OK;
|
||||
|
@ -72,7 +72,7 @@ static rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmPlugin plugin, rpmts ts)
|
|||
return RPMRC_OK;
|
||||
}
|
||||
|
||||
static rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmPlugin plugin, rpmts ts, int res)
|
||||
static rpmRC systemd_inhibit_tsm_post(rpmPlugin plugin, rpmts ts, int res)
|
||||
{
|
||||
if (lock_fd >= 0) {
|
||||
close(lock_fd);
|
||||
|
@ -83,6 +83,6 @@ static rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmPlugin plugin, rpmts ts, int res)
|
|||
}
|
||||
|
||||
struct rpmPluginHooks_s systemd_inhibit_hooks = {
|
||||
.tsm_pre = PLUGINHOOK_TSM_PRE_FUNC,
|
||||
.tsm_post = PLUGINHOOK_TSM_POST_FUNC,
|
||||
.tsm_pre = systemd_inhibit_tsm_pre,
|
||||
.tsm_post = systemd_inhibit_tsm_post,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue