From 97311fe0f6970b9c791a872d6bd43c390d54859f Mon Sep 17 00:00:00 2001 From: Nikola Pajkovsky Date: Thu, 26 Nov 2009 19:07:05 +0100 Subject: Kerneloops are reported automaticky now when AutoReportUIDs = root is in Kerneloops.conf Signed-off-by: Nikola Pajkovsky --- lib/Utils/xfuncs.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/Utils/xfuncs.cpp') diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp index 97c2f76..4b208a9 100644 --- a/lib/Utils/xfuncs.cpp +++ b/lib/Utils/xfuncs.cpp @@ -368,3 +368,14 @@ bool string_to_bool(const char *s) return true; return false; } + +bool xgetpwnam(const char* login, uid_t *uid) +{ + struct passwd* pwd = getpwnam(login); + if (pwd == NULL) + return false; + + *uid = pwd->pw_uid; + return true; +} + -- cgit