From cf17c54d66bf0fc799957ffa675d0ab2e2c8fbed Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 26 Apr 2011 16:00:30 +0200 Subject: abrt-action-install-debuginfo: set real uid/gid to euid/gid Fixes EPERM when abrt-action-install-debuginfo runs under root. Tested to work both under root and non-root Signed-off-by: Denys Vlasenko --- src/plugins/abrt-action-install-debuginfo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/abrt-action-install-debuginfo.c b/src/plugins/abrt-action-install-debuginfo.c index cd5cb9df..b60c4321 100644 --- a/src/plugins/abrt-action-install-debuginfo.c +++ b/src/plugins/abrt-action-install-debuginfo.c @@ -16,6 +16,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include #include #include #include @@ -58,6 +59,17 @@ int main(int argc, char **argv) error_msg_and_die("bad option", arg); } + /* Switch real user/group to effective ones. + * Otherwise yum library gets confused - gets EPERM (why??). + */ + gid_t g = getegid(); + /* do setregid only if we have to, to not upset selinux needlessly */ + if (g != getgid()) + setregid(g, g); + uid_t u = geteuid(); + if (u != getuid()) + setreuid(u, u); + /* We use full path, and execv instead of execvp in order to * disallow user to execute his own abrt-action-install-debuginfo.py * in his dir by setting up corresponding malicious $PATH. -- cgit From 5c734d1077612e58c86866d5d8035d6e4a653155 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 26 Apr 2011 16:27:40 +0200 Subject: abrt-action-trim-files: use correct PROGNAME Signed-off-by: Denys Vlasenko --- src/plugins/abrt-action-trim-files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/abrt-action-trim-files.c b/src/plugins/abrt-action-trim-files.c index f2bc280d..dd7366ed 100644 --- a/src/plugins/abrt-action-trim-files.c +++ b/src/plugins/abrt-action-trim-files.c @@ -19,7 +19,7 @@ #include "abrtlib.h" #include "parse_options.h" -#define PROGNAME "abrt-action-trim" +#define PROGNAME "abrt-action-trim-files" static double get_dir_size(const char *dirname, char **worst_file, -- cgit