diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libimcv/os_info/os_info.c | 8 | ||||
-rw-r--r-- | src/libimcv/plugins/imc_os/imc_os.c | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/libimcv/os_info/os_info.c b/src/libimcv/os_info/os_info.c index 05e335fb9..d5fa4b929 100644 --- a/src/libimcv/os_info/os_info.c +++ b/src/libimcv/os_info/os_info.c @@ -159,10 +159,18 @@ METHOD(os_info_t, get_setting, chunk_t, * In order to guarantee privacy, only settings from the * /etc/, /proc/ and /sys/ directories can be retrieved */ + DBG1(DBG_IMC, "not allowed to access \"%s\"", name); + return chunk_empty; } file = fopen(name, "r"); + if (!file) + { + DBG1(DBG_IMC, "failed to open \"%s\"", name); + + return chunk_empty; + } while (i < sizeof(buf) && fread(buf + i, 1, 1, file) == 1) { i++; diff --git a/src/libimcv/plugins/imc_os/imc_os.c b/src/libimcv/plugins/imc_os/imc_os.c index 7510b2619..f8fe7eadd 100644 --- a/src/libimcv/plugins/imc_os/imc_os.c +++ b/src/libimcv/plugins/imc_os/imc_os.c @@ -267,7 +267,6 @@ static void add_settings(enumerator_t *enumerator, imc_msg_t *msg) value = os->get_setting(os, name); if (!value.ptr) { - DBG1(DBG_IMC, " failed to get setting"); continue; } if (first) |