mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
Convert the parser to C++
This conversion is nothing more than what is required to get it to compile. Further improvements will come as the code is refactored. Unfortunately due to C++ not supporting designated initializers, the auto generation of af names needed to be reworked, and "netlink" and "unix" domain socket keywords leaked in. Since these where going to be added in separate patches I have not bothered to do the extra work to replace them with a temporary place holder. Signed-off-by: John Johansen <john.johansen@canonical.com> [tyhicks: merged with dbus changes and memory leak fixes] Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: Seth Arnold <seth.arnold@canonical.com> Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
committed by
Tyler Hicks
parent
b0a1488820
commit
a34059b1e5
@@ -35,12 +35,12 @@ static int file_comp(const void *c1, const void *c2)
|
||||
int res = 0;
|
||||
|
||||
//PERROR("strcmp %s %s\n", (*e1)->name, (*e2)->name);
|
||||
if ((*e1)->namespace) {
|
||||
if ((*e2)->namespace)
|
||||
res = strcmp((*e1)->namespace, (*e2)->namespace);
|
||||
if ((*e1)->ns) {
|
||||
if ((*e2)->ns)
|
||||
res = strcmp((*e1)->ns, (*e2)->ns);
|
||||
else
|
||||
return 1;
|
||||
} else if ((*e2)->namespace) {
|
||||
} else if ((*e2)->ns) {
|
||||
return -1;
|
||||
}
|
||||
if (res)
|
||||
@@ -86,7 +86,7 @@ static int process_file_entries(struct codomain *cod)
|
||||
if (count < 2)
|
||||
return 1;
|
||||
|
||||
table = malloc(sizeof(struct cod_entry *) * (count + 1));
|
||||
table = (struct cod_entry **) malloc(sizeof(struct cod_entry *) * (count + 1));
|
||||
if (!table) {
|
||||
PERROR(_("Couldn't merge entries. Out of Memory\n"));
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user