diff options
author | Sebastian Kloska <sebastian.kloska@snafu.de> | 2019-12-10 13:34:54 +0100 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2019-12-10 21:34:54 +0900 |
commit | fe9df82ec5eee1da774d0dbe589df2aac0f73e0c (patch) | |
tree | debcd66c128ae41aa34df4b6593d1e3699d316d9 /include/dlt/dlt_offline_trace.h | |
parent | 52c275c51e253223230e235584ab07523a830303 (diff) | |
download | DLT-daemon-fe9df82ec5eee1da774d0dbe589df2aac0f73e0c.tar.gz |
BugFix: SEGFAULT when using AppArmor (#192)
* Symptome: If access to the trace directory is not
granted by AppArmor access(...) still reports otherwise.
dlt_offline_trace_get_total_size(...)
tries to open the dir via opendir(...) and tries a
readdir without any further check, which results in an
SEGFAULT
* Solution: (1) Make dlt_offline_trace_get_total_size return
ssize_t instead of unsigned long, which gives us a
chance to return an error state (2) Check the return value
from opendir(...) and bail out on error. Use this to return
DLT_RETURN_ERROR in dlt_offline_trace_check_size.
* ToDo: (1) Error state is not yet checked and reported
back. On Error we just don't generate any offline
log files without any further complain. (2) Find a replacement
for access(...) which reports properly under AppArmor.
(3) Report the confusing behaviour of access(...) to the
AppArmor team.
Signed-off-by: Sebastian Kloska <seebastian.kloska@snafu.de>
Diffstat (limited to 'include/dlt/dlt_offline_trace.h')
-rw-r--r-- | include/dlt/dlt_offline_trace.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/dlt/dlt_offline_trace.h b/include/dlt/dlt_offline_trace.h index d54e19c..b5e096c 100644 --- a/include/dlt/dlt_offline_trace.h +++ b/include/dlt/dlt_offline_trace.h @@ -128,7 +128,7 @@ extern DltReturnValue dlt_offline_trace_write(DltOfflineTrace *trace, * Get size of currently used offline trace buffer * @return size in bytes */ -extern unsigned long dlt_offline_trace_get_total_size(DltOfflineTrace *trace); +extern ssize_t dlt_offline_trace_get_total_size(DltOfflineTrace *trace); /** * Provides info about the offline logs storage directory |