summaryrefslogtreecommitdiffstats
path: root/src/Hooks
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-11-11 22:27:52 +0100
committerKarel Klic <kklic@redhat.com>2009-11-11 22:27:52 +0100
commit4bb5f0163c1cf3c65745ea06f1b42545ecaa35d7 (patch)
tree6c29fba2392f9907cbd0fbb5e3a104eb951b298d /src/Hooks
parent7ea8edef92be0c7812699d3e9d9a20bad8227ef3 (diff)
downloadabrt-4bb5f0163c1cf3c65745ea06f1b42545ecaa35d7.tar.gz
abrt-4bb5f0163c1cf3c65745ea06f1b42545ecaa35d7.tar.xz
abrt-4bb5f0163c1cf3c65745ea06f1b42545ecaa35d7.zip
pyhook-helper: uid taken from system instead of command line
Diffstat (limited to 'src/Hooks')
-rw-r--r--src/Hooks/abrt-pyhook-helper.cpp14
-rw-r--r--src/Hooks/abrt_exception_handler.py.in1
2 files changed, 6 insertions, 9 deletions
diff --git a/src/Hooks/abrt-pyhook-helper.cpp b/src/Hooks/abrt-pyhook-helper.cpp
index 818119a6..24f08d35 100644
--- a/src/Hooks/abrt-pyhook-helper.cpp
+++ b/src/Hooks/abrt-pyhook-helper.cpp
@@ -20,6 +20,7 @@
*/
#include <getopt.h>
+#include <unistd.h>
/* We can easily get rid of abrtlib (libABRTUtils.so) usage in this file,
* but DebugDump will pull it in anyway */
#include "abrtlib.h"
@@ -34,7 +35,6 @@ static char *pid;
static char *executable;
static char *uuid;
static char *cmdline;
-static char *loginuid;
int main(int argc, char** argv)
{
@@ -45,7 +45,6 @@ int main(int argc, char** argv)
{ "executable", required_argument, NULL, 'e' },
{ "uuid" , required_argument, NULL, 'u' },
{ "cmdline" , required_argument, NULL, 'c' },
- { "loginuid" , required_argument, NULL, 'l' },
{ 0 },
};
int opt;
@@ -65,9 +64,6 @@ int main(int argc, char** argv)
case 'c':
cmdline = optarg;
break;
- case 'l':
- loginuid = optarg;
- break;
default:
usage:
error_msg_and_die(
@@ -77,7 +73,6 @@ int main(int argc, char** argv)
" -p,--executable PATH absolute path to the program that crashed\n"
" -u,--uuid UUID hash generated from the backtrace\n"
" -c,--cmdline TEXT command line of the crashed program\n"
- " -l,--loginuid UID login UID\n"
);
}
}
@@ -112,8 +107,11 @@ int main(int argc, char** argv)
dd.SaveText("cmdline", cmdline);
if (uuid)
dd.SaveText("uuid", uuid);
- if (loginuid)
- dd.SaveText("uid", loginuid);
+
+ char uid[16];
+ snprintf(uid, 16, "%d", (int)getuid());
+ dd.SaveText("uid", uid);
+
dd.SaveText("backtrace", bt);
free(bt);
dd.Close();
diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in
index 010bf12d..5514f1a4 100644
--- a/src/Hooks/abrt_exception_handler.py.in
+++ b/src/Hooks/abrt_exception_handler.py.in
@@ -114,7 +114,6 @@ def write_dump(pid, tb_uuid, tb):
command.append("--executable=%s" % executable)
command.append("--uuid=%s" % tb_uuid)
command.append("--cmdline=%s" % open("/proc/%s/cmdline" % pid).read().replace('\x00',' '))
- command.append("--loginuid=%s" % open("/proc/%s/loginuid" % pid).readlines()[0])
helper = subprocess.Popen(command, stdin=subprocess.PIPE)
helper.communicate(tb)