mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 18:17:09 +00:00
mod_apparmor: whitespace cleanups
This patch is cosmetic; it cleans up a lot of whitespace issues: removing trailing spaces, converting tabs into spaces, and removing unneeded spaces around function arguments. Signed-off-by: Steve Beattie <steve@nxnw.org> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
495b4c2c36
commit
c42bc173ac
@ -52,12 +52,12 @@ static unsigned long magic_token = 0;
|
|||||||
static int inside_default_hat = 0;
|
static int inside_default_hat = 0;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char * hat_name;
|
const char *hat_name;
|
||||||
char * path;
|
char *path;
|
||||||
} apparmor_dir_cfg;
|
} apparmor_dir_cfg;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char * hat_name;
|
const char *hat_name;
|
||||||
int is_initialized;
|
int is_initialized;
|
||||||
} apparmor_srv_cfg;
|
} apparmor_srv_cfg;
|
||||||
|
|
||||||
@ -70,19 +70,20 @@ typedef struct {
|
|||||||
static int
|
static int
|
||||||
aa_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
|
aa_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
|
||||||
{
|
{
|
||||||
apr_file_t * file;
|
apr_file_t *file;
|
||||||
apr_size_t size = sizeof (magic_token);
|
apr_size_t size = sizeof(magic_token);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = apr_file_open (&file, "/dev/urandom", APR_READ, APR_OS_DEFAULT, p);
|
ret = apr_file_open (&file, "/dev/urandom", APR_READ, APR_OS_DEFAULT, p);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
apr_file_read (file, (void *) &magic_token, &size);
|
apr_file_read(file, (void *) &magic_token, &size);
|
||||||
apr_file_close (file);
|
apr_file_close(file);
|
||||||
} else {
|
} else {
|
||||||
ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
|
ap_log_error(APLOG_MARK, APLOG_ERR, errno, ap_server_conf,
|
||||||
"Failed to open /dev/urandom");
|
"Failed to open /dev/urandom");
|
||||||
}
|
}
|
||||||
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf, "Opened /dev/urandom successfully");
|
ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
|
||||||
|
"Opened /dev/urandom successfully");
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -262,7 +263,7 @@ aa_exit_hat(request_rec *r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
aa_cmd_ch_path (cmd_parms * cmd, void * mconfig, const char * parm1)
|
aa_cmd_ch_path(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, "directory config change hat %s",
|
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, "directory config change hat %s",
|
||||||
parm1 ? parm1 : "DEFAULT");
|
parm1 ? parm1 : "DEFAULT");
|
||||||
@ -278,7 +279,7 @@ aa_cmd_ch_path (cmd_parms * cmd, void * mconfig, const char * parm1)
|
|||||||
static int path_warn_once;
|
static int path_warn_once;
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
immunix_cmd_ch_path (cmd_parms * cmd, void * mconfig, const char * parm1)
|
immunix_cmd_ch_path(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
if (path_warn_once == 0) {
|
if (path_warn_once == 0) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "ImmHatName is "
|
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "ImmHatName is "
|
||||||
@ -289,7 +290,7 @@ immunix_cmd_ch_path (cmd_parms * cmd, void * mconfig, const char * parm1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
aa_cmd_ch_srv (cmd_parms * cmd, void * mconfig, const char * parm1)
|
aa_cmd_ch_srv(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, "server config change hat %s",
|
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, "server config change hat %s",
|
||||||
parm1 ? parm1 : "DEFAULT");
|
parm1 ? parm1 : "DEFAULT");
|
||||||
@ -306,7 +307,7 @@ aa_cmd_ch_srv (cmd_parms * cmd, void * mconfig, const char * parm1)
|
|||||||
static int srv_warn_once;
|
static int srv_warn_once;
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
immunix_cmd_ch_srv (cmd_parms * cmd, void * mconfig, const char * parm1)
|
immunix_cmd_ch_srv(cmd_parms *cmd, void *mconfig, const char *parm1)
|
||||||
{
|
{
|
||||||
if (srv_warn_once == 0) {
|
if (srv_warn_once == 0) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "ImmDefaultHatName is "
|
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "ImmDefaultHatName is "
|
||||||
@ -328,7 +329,7 @@ aa_create_dir_config(apr_pool_t *p, char *path)
|
|||||||
"aa_create_dir_config: couldn't alloc dir config");
|
"aa_create_dir_config: couldn't alloc dir config");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
newcfg->path = apr_pstrdup (p, path ? path : ":no path:");
|
newcfg->path = apr_pstrdup(p, path ? path : ":no path:");
|
||||||
|
|
||||||
return newcfg;
|
return newcfg;
|
||||||
}
|
}
|
||||||
@ -336,7 +337,7 @@ aa_create_dir_config(apr_pool_t *p, char *path)
|
|||||||
/* XXX: Should figure out an appropriate action to take here, if any
|
/* XXX: Should figure out an appropriate action to take here, if any
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
aa_merge_dir_config(apr_pool_t * p, void * parent, void * child)
|
aa_merge_dir_config(apr_pool_t *p, void *parent, void *child)
|
||||||
{
|
{
|
||||||
apparmor_dir_cfg *newcfg = (apparmor_dir_cfg *) apr_pcalloc(p, sizeof(*newcfg));
|
apparmor_dir_cfg *newcfg = (apparmor_dir_cfg *) apr_pcalloc(p, sizeof(*newcfg));
|
||||||
|
|
||||||
@ -367,28 +368,28 @@ aa_create_srv_config(apr_pool_t *p, server_rec *srv)
|
|||||||
|
|
||||||
static const command_rec mod_apparmor_cmds[] = {
|
static const command_rec mod_apparmor_cmds[] = {
|
||||||
|
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"ImmHatName",
|
"ImmHatName",
|
||||||
immunix_cmd_ch_path,
|
immunix_cmd_ch_path,
|
||||||
NULL,
|
NULL,
|
||||||
ACCESS_CONF,
|
ACCESS_CONF,
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"ImmDefaultHatName",
|
"ImmDefaultHatName",
|
||||||
immunix_cmd_ch_srv,
|
immunix_cmd_ch_srv,
|
||||||
NULL,
|
NULL,
|
||||||
RSRC_CONF,
|
RSRC_CONF,
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"AAHatName",
|
"AAHatName",
|
||||||
aa_cmd_ch_path,
|
aa_cmd_ch_path,
|
||||||
NULL,
|
NULL,
|
||||||
ACCESS_CONF,
|
ACCESS_CONF,
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
AP_INIT_TAKE1 (
|
AP_INIT_TAKE1(
|
||||||
"AADefaultHatName",
|
"AADefaultHatName",
|
||||||
aa_cmd_ch_srv,
|
aa_cmd_ch_srv,
|
||||||
NULL,
|
NULL,
|
||||||
@ -399,7 +400,7 @@ static const command_rec mod_apparmor_cmds[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
register_hooks (apr_pool_t *p)
|
register_hooks(apr_pool_t *p)
|
||||||
{
|
{
|
||||||
ap_hook_post_config(aa_init, NULL, NULL, APR_HOOK_MIDDLE);
|
ap_hook_post_config(aa_init, NULL, NULL, APR_HOOK_MIDDLE);
|
||||||
ap_hook_child_init(aa_child_init, NULL, NULL, APR_HOOK_MIDDLE);
|
ap_hook_child_init(aa_child_init, NULL, NULL, APR_HOOK_MIDDLE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user