summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2014-07-12 10:22:09 -0700
committerNick Kralevich <nnk@google.com>2014-07-14 09:10:14 -0700
commit2066a66a2ab0c1b7d691d5a180b0ec1e47b0fb12 (patch)
tree999dde66dead2b826e3b58d08cc8d7f0b6afb92a
parentc71644b06ebd417ef060f3f07472125516f86c41 (diff)
downloadlibsepol-l-preview.tar.gz
They do not retain the neverallow source information so we must not assume that source_filename is set. Either need a new binary module format if we want to propagate this information for modular builds or get rid of binary modules. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Bug: https://code.google.com/p/android/issues/detail?id=73183 (cherry picked from commit d26204e7d0a3be178a97d4920b82007e05a2a632) Change-Id: I88e220816430b57d5cb366f3a1e0c22fc64fffef
-rw-r--r--src/expand.c8
-rw-r--r--src/link.c8
2 files changed, 10 insertions, 6 deletions
diff --git a/src/expand.c b/src/expand.c
index 947bee0..acb6906 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -2651,9 +2651,11 @@ static int copy_neverallow(policydb_t * dest_pol, uint32_t * typemap,
avrule->line = source_rule->line;
avrule->flags = source_rule->flags;
avrule->source_line = source_rule->source_line;
- avrule->source_filename = strdup(source_rule->source_filename);
- if (!avrule->source_filename)
- goto err;
+ if (source_rule->source_filename) {
+ avrule->source_filename = strdup(source_rule->source_filename);
+ if (!avrule->source_filename)
+ goto err;
+ }
if (ebitmap_cpy(&avrule->stypes.types, &stypes))
goto err;
diff --git a/src/link.c b/src/link.c
index ca497a7..c8c510a 100644
--- a/src/link.c
+++ b/src/link.c
@@ -1326,9 +1326,11 @@ static int copy_avrule_list(avrule_t * list, avrule_t ** dst,
}
new_rule->line = cur->line;
new_rule->source_line = cur->source_line;
- new_rule->source_filename = strdup(cur->source_filename);
- if (!new_rule->source_filename)
- goto cleanup;
+ if (cur->source_filename) {
+ new_rule->source_filename = strdup(cur->source_filename);
+ if (!new_rule->source_filename)
+ goto cleanup;
+ }
cur = cur->next;