mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 22:35:35 +00:00
parser: cleanup: drop unused add_local_entry and associated vars
The code for add_local_entry is actually currently unused and will have to change anyways by the time it is. Some drop it and the associated variables. Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
@@ -70,7 +70,6 @@ mnt_rule *do_mnt_rule(struct cond_entry *src_conds, char *src,
|
|||||||
mnt_rule *do_pivot_rule(struct cond_entry *old, char *root,
|
mnt_rule *do_pivot_rule(struct cond_entry *old, char *root,
|
||||||
char *transition);
|
char *transition);
|
||||||
static void abi_features(char *filename, bool search);
|
static void abi_features(char *filename, bool search);
|
||||||
void add_local_entry(Profile *prof);
|
|
||||||
bool add_prefix(struct cod_entry *entry, const prefixes &p, const char *&error);
|
bool add_prefix(struct cod_entry *entry, const prefixes &p, const char *&error);
|
||||||
bool check_x_qualifier(struct cod_entry *entry, const char *&errror);
|
bool check_x_qualifier(struct cod_entry *entry, const char *&errror);
|
||||||
|
|
||||||
@@ -438,7 +437,6 @@ local_profile: TOK_PROFILE profile_base
|
|||||||
|
|
||||||
if ($2)
|
if ($2)
|
||||||
PDEBUG("Matched: local profile %s { ... }\n", prof->name);
|
PDEBUG("Matched: local profile %s { ... }\n", prof->name);
|
||||||
prof->local = 1;
|
|
||||||
$$ = prof;
|
$$ = prof;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -849,7 +847,6 @@ rules: rules local_profile
|
|||||||
if (!$2)
|
if (!$2)
|
||||||
yyerror(_("Assert: 'local_profile rule' returned NULL."));
|
yyerror(_("Assert: 'local_profile rule' returned NULL."));
|
||||||
add_hat_to_policy($1, $2);
|
add_hat_to_policy($1, $2);
|
||||||
add_local_entry($2);
|
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1695,31 +1692,6 @@ struct cod_entry *do_file_rule(char *id, perms_t perms, char *link_id, char *nt)
|
|||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note: NOT currently in use, used for
|
|
||||||
* /foo x -> { /bah, } style transitions
|
|
||||||
*/
|
|
||||||
void add_local_entry(Profile *prof)
|
|
||||||
{
|
|
||||||
/* ugh this has to be called after the hat is attached to its parent */
|
|
||||||
if (prof->local_perms) {
|
|
||||||
struct cod_entry *entry;
|
|
||||||
char *trans = (char *) malloc(strlen(prof->parent->name) +
|
|
||||||
strlen(prof->name) + 3);
|
|
||||||
char *name = strdup(prof->name);
|
|
||||||
if (!trans)
|
|
||||||
yyerror(_("Memory allocation error."));
|
|
||||||
sprintf(name, "%s//%s", prof->parent->name, prof->name);
|
|
||||||
|
|
||||||
entry = new_entry(name, prof->local_perms, NULL);
|
|
||||||
entry->audit = prof->local_audit;
|
|
||||||
entry->nt_name = trans;
|
|
||||||
if (!entry)
|
|
||||||
yyerror(_("Memory allocation error."));
|
|
||||||
|
|
||||||
add_entry_to_policy(prof, entry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static const char *mnt_cond_msg[] = {"",
|
static const char *mnt_cond_msg[] = {"",
|
||||||
" not allowed as source conditional",
|
" not allowed as source conditional",
|
||||||
" not allowed as target conditional",
|
" not allowed as target conditional",
|
||||||
|
@@ -189,9 +189,7 @@ public:
|
|||||||
|
|
||||||
/* char *sub_name; */ /* subdomain name or NULL */
|
/* char *sub_name; */ /* subdomain name or NULL */
|
||||||
/* int default_deny; */ /* TRUE or FALSE */
|
/* int default_deny; */ /* TRUE or FALSE */
|
||||||
int local;
|
bool local;
|
||||||
perms_t local_perms;
|
|
||||||
audit_t local_audit;
|
|
||||||
|
|
||||||
Profile *parent;
|
Profile *parent;
|
||||||
|
|
||||||
@@ -221,10 +219,6 @@ public:
|
|||||||
xattrs.list = NULL;
|
xattrs.list = NULL;
|
||||||
xattrs.name = NULL;
|
xattrs.name = NULL;
|
||||||
|
|
||||||
local_perms = 0;
|
|
||||||
local = 0;
|
|
||||||
local_audit = AUDIT_UNSPECIFIED;
|
|
||||||
|
|
||||||
parent = NULL;
|
parent = NULL;
|
||||||
|
|
||||||
flags = { 0, MODE_UNSPECIFIED, 0, 0 };
|
flags = { 0, MODE_UNSPECIFIED, 0, 0 };
|
||||||
@@ -267,12 +261,10 @@ public:
|
|||||||
else
|
else
|
||||||
printf("Name:\t\t<NULL>\n");
|
printf("Name:\t\t<NULL>\n");
|
||||||
|
|
||||||
if (local) {
|
if (parent)
|
||||||
if (parent)
|
printf("Local To:\t%s\n", parent->name);
|
||||||
printf("Local To:\t%s\n", parent->name);
|
else
|
||||||
else
|
printf("Local To:\t<NULL>\n");
|
||||||
printf("Local To:\t<NULL>\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
flags.dump(cerr);
|
flags.dump(cerr);
|
||||||
caps.dump();
|
caps.dump();
|
||||||
|
Reference in New Issue
Block a user