mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
- Was previously under the belief that pid="1234" and
magic_token="1245353" were correct syntax from the kernel. It turns out this is not the case.
This commit is contained in:
parent
f4d6d1ab1f
commit
ab87fbfb94
10 changed files with 29 additions and 21 deletions
|
@ -30,6 +30,9 @@
|
|||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
AC_INIT(configure.in)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE(libapparmor1, 2.1)
|
||||
AM_INIT_AUTOMAKE(libapparmor1, 2.2)
|
||||
|
||||
AM_PROG_LEX
|
||||
AC_PROG_YACC
|
||||
|
@ -16,9 +16,14 @@ AC_ARG_WITH(python,
|
|||
[ --with-python enable the python wrapper [[default=no]]],
|
||||
[AC_MSG_RESULT($withval)], [AC_MSG_RESULT(no)])
|
||||
if test "$with_python" = "yes"; then
|
||||
sinclude(m4/ac_python_devel.m4)
|
||||
AC_PYTHON_DEVEL
|
||||
AM_PATH_PYTHON
|
||||
AC_PATH_PROG(PYTHON, python, no)
|
||||
if test x$PYTHON = xno; then
|
||||
enable_python = no
|
||||
else
|
||||
sinclude(m4/ac_python_devel.m4)
|
||||
AC_PYTHON_DEVEL
|
||||
AM_PATH_PYTHON
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(Checking for perl)
|
||||
|
@ -53,6 +58,7 @@ AM_CONDITIONAL(BUILD_ROOTLIB, test x$enable_rootlib = xyes)
|
|||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(unistd.h stdint.h)
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
AC_C_CONST
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
%define _unpackaged_files_terminate_build 0
|
||||
|
||||
Name: libapparmor1
|
||||
Version: 2.1
|
||||
Release: 2
|
||||
Version: 2.2
|
||||
Release: 1
|
||||
License: LGPL
|
||||
Group: Development/Libraries/C and C++
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
@ -24,6 +24,7 @@ Summary: A utility library for AppArmor
|
|||
%package -n libapparmor-devel
|
||||
Requires: %{name} = %{version}
|
||||
Group: Development/Libraries/C and C++
|
||||
Provides: libapparmor:/usr/include/sys/apparmor.h
|
||||
Summary: -
|
||||
|
||||
%description -n libapparmor-devel
|
||||
|
|
|
@ -117,6 +117,7 @@ typedef struct
|
|||
aa_record_event_type event; /* Event type */
|
||||
long pid; /* PID of the program logging the message */
|
||||
long task;
|
||||
long magic_token;
|
||||
|
||||
int bitmask; /* Bitmask containing "r" "w" "x" etc */
|
||||
char *audit_id;
|
||||
|
@ -127,8 +128,7 @@ typedef struct
|
|||
char *name;
|
||||
char *name2;
|
||||
char *attribute;
|
||||
char *parent;
|
||||
char *magic_token;
|
||||
char *parent;
|
||||
char *info;
|
||||
char *active_hat;
|
||||
} aa_log_record;
|
||||
|
|
|
@ -334,12 +334,12 @@ key_list: TOK_KEY_OPERATION TOK_EQUALS TOK_QUOTED_STRING
|
|||
{ ret_record->task = atol($3); free($3);}
|
||||
| TOK_KEY_PARENT TOK_EQUALS TOK_QUOTED_STRING
|
||||
{ ret_record->parent = strdup($3); free($3);}
|
||||
| TOK_KEY_MAGIC_TOKEN TOK_EQUALS TOK_QUOTED_STRING
|
||||
{ ret_record->magic_token = strdup($3); free($3);}
|
||||
| TOK_KEY_MAGIC_TOKEN TOK_EQUALS TOK_DIGITS
|
||||
{ ret_record->magic_token = $3;}
|
||||
| TOK_KEY_INFO TOK_EQUALS TOK_QUOTED_STRING
|
||||
{ ret_record->info = strdup($3); free($3);}
|
||||
| TOK_KEY_PID TOK_EQUALS TOK_QUOTED_STRING
|
||||
{ ret_record->pid = atol($3); free($3);}
|
||||
| TOK_KEY_PID TOK_EQUALS TOK_DIGITS
|
||||
{ ret_record->pid = $3;}
|
||||
| TOK_KEY_PROFILE TOK_EQUALS TOK_QUOTED_STRING
|
||||
{ ret_record->profile = strdup($3); free($3);}
|
||||
;
|
||||
|
|
|
@ -63,8 +63,6 @@ free_record(aa_log_record *record)
|
|||
free(record->attribute);
|
||||
if (record->parent != NULL)
|
||||
free(record->parent);
|
||||
if (record->magic_token != NULL)
|
||||
free(record->magic_token);
|
||||
if (record->info != NULL)
|
||||
free(record->info);
|
||||
if (record->active_hat != NULL)
|
||||
|
@ -88,6 +86,7 @@ _init_log_record(aa_log_record *record)
|
|||
record->pid = 0;
|
||||
record->bitmask = 0;
|
||||
record->task = 0;
|
||||
record->magic_token = 0;
|
||||
|
||||
record->audit_id = NULL;
|
||||
record->operation = NULL;
|
||||
|
@ -98,7 +97,6 @@ _init_log_record(aa_log_record *record)
|
|||
record->name2 = NULL;
|
||||
record->attribute = NULL;
|
||||
record->parent = NULL;
|
||||
record->magic_token = NULL;
|
||||
record->info = NULL;
|
||||
record->active_hat = NULL;
|
||||
return;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
if HAVE_PYTHON
|
||||
|
||||
BUILT_SOURCES = libapparmor_wrap.c
|
||||
|
||||
SWIG_SOURCES = ../SWIG/libapparmor.i
|
||||
|
||||
if HAVE_PYTHON
|
||||
|
||||
pkgpython_PYTHON = LibAppArmor.py
|
||||
pkgpyexec_LTLIBRARIES = _libapparmor.la
|
||||
_libapparmor_la_SOURCES = libapparmor_wrap.c $(SWIG_SOURCES)
|
||||
|
|
|
@ -137,9 +137,9 @@ int print_results(aa_log_record *record)
|
|||
{
|
||||
printf("Parent: %s\n", record->parent);
|
||||
}
|
||||
if (record->magic_token != NULL)
|
||||
if (record->magic_token != 0)
|
||||
{
|
||||
printf("Token: %s\n", record->magic_token);
|
||||
printf("Token: %i\n", record->magic_token);
|
||||
}
|
||||
if (record->info != NULL)
|
||||
{
|
||||
|
|
|
@ -1 +1 @@
|
|||
type=APPARMOR_DENIED msg=audit(1181057184.959:7): operation="exec" denied_mask="x" name="/bin/ping" pid="31938" profile="/bin/ping" name2="ping2" requested_mask="rwx" attribute="attr" task="something" parent="something" magic_token="29493103210" info="Information"
|
||||
type=APPARMOR_DENIED msg=audit(1181057184.959:7): operation="exec" denied_mask="x" name="/bin/ping" pid=31938 profile="/bin/ping" name2="ping2" requested_mask="rwx" attribute="attr" task="something" parent="something" magic_token=29493 info="Information"
|
||||
|
|
|
@ -10,6 +10,6 @@ Name: /bin/ping
|
|||
Name2: ping2
|
||||
Attribute: attr
|
||||
Parent: something
|
||||
Token: 29493103210
|
||||
Token: 29493
|
||||
Info: Information
|
||||
PID: 31938
|
||||
|
|
Loading…
Add table
Reference in a new issue