summaryrefslogtreecommitdiffstats
path: root/src/daemon
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-03-24 20:59:31 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2011-03-24 20:59:31 +0100
commit38d14ec4d7ec62ff29fa5636d3462c3ae297e917 (patch)
tree87b4972c7304be3be4454003774b1020c224b3e5 /src/daemon
parent14e071507d45f1c1668ddf569b0f285e21ea36b3 (diff)
downloadabrt-38d14ec4d7ec62ff29fa5636d3462c3ae297e917.zip
abrt-38d14ec4d7ec62ff29fa5636d3462c3ae297e917.tar.gz
abrt-38d14ec4d7ec62ff29fa5636d3462c3ae297e917.tar.xz
extend dump_dir to allow creating world-readable directory
- so far used only by kerneloops
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/MiddleWare.cpp20
-rw-r--r--src/daemon/abrt-server.c2
-rw-r--r--src/daemon/abrt.conf2
-rw-r--r--src/daemon/abrt_event.conf3
4 files changed, 17 insertions, 10 deletions
diff --git a/src/daemon/MiddleWare.cpp b/src/daemon/MiddleWare.cpp
index 77e18b0..9bbd2af 100644
--- a/src/daemon/MiddleWare.cpp
+++ b/src/daemon/MiddleWare.cpp
@@ -768,15 +768,21 @@ int DeleteDebugDump(const char *dump_dir_name, long caller_uid)
char caller_uid_str[sizeof(long) * 3 + 2];
sprintf(caller_uid_str, "%ld", caller_uid);
- char *uid = dd_load_text(dd, FILENAME_UID);
- if (strcmp(uid, caller_uid_str) != 0)
+ char *uid = dd_load_text_ext(dd, FILENAME_UID, DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE);
+ /* we assume that the dump_dir can be handled by everyone if uid == NULL
+ * e.g: kerneloops
+ */
+ if (uid != NULL)
{
- char *inform_all = dd_load_text_ext(dd, FILENAME_INFORMALL, DD_FAIL_QUIETLY_ENOENT);
- if (!string_to_bool(inform_all))
+ if (strcmp(uid, caller_uid_str) != 0)
{
- dd_close(dd);
- error_msg("Dump directory '%s' can't be accessed by user with uid %ld", dump_dir_name, caller_uid);
- return 1;
+ char *inform_all = dd_load_text_ext(dd, FILENAME_INFORMALL, DD_FAIL_QUIETLY_ENOENT);
+ if (!string_to_bool(inform_all))
+ {
+ dd_close(dd);
+ error_msg("Dump directory '%s' can't be accessed by user with uid %ld", dump_dir_name, caller_uid);
+ return 1;
+ }
}
}
}
diff --git a/src/daemon/abrt-server.c b/src/daemon/abrt-server.c
index de22f42..0c45e3e 100644
--- a/src/daemon/abrt-server.c
+++ b/src/daemon/abrt-server.c
@@ -114,7 +114,7 @@ static void create_debug_dump()
/* No need to check the path length, as all variables used are limited, and dd_create()
fails if the path is too long. */
- struct dump_dir *dd = dd_create(path, client_uid);
+ struct dump_dir *dd = dd_create(path, client_uid, 0640);
if (!dd)
{
error_msg_and_die("Error creating crash dump %s", path);
diff --git a/src/daemon/abrt.conf b/src/daemon/abrt.conf
index 7f5a9c5..460bf06 100644
--- a/src/daemon/abrt.conf
+++ b/src/daemon/abrt.conf
@@ -33,4 +33,4 @@ MaxCrashReportsSize = 1000
# So far we support only one line here
#
[ LogScanners ]
-abrt-dump-oops = abrt-dump-oops -drw /var/log/messages
+abrt-dump-oops = abrt-dump-oops -drwx /var/log/messages
diff --git a/src/daemon/abrt_event.conf b/src/daemon/abrt_event.conf
index d9b87d5..d127d38 100644
--- a/src/daemon/abrt_event.conf
+++ b/src/daemon/abrt_event.conf
@@ -45,7 +45,8 @@ EVENT=post-create abrt-action-save-package-data
include events.d/*.conf
-EVENT=post-create getent passwd "`cat uid`" | cut -d: -f1 >username
+# uid file doesn't exist for some problems like kerneloops
+EVENT=post-create if [ -e uid ]; then getent passwd "`cat uid`" | cut -d: -f1 >username; fi
EVENT=post-create analyzer=Python abrt-action-analyze-python
EVENT=post-create analyzer=Kerneloops abrt-action-analyze-oops