diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/abrt-action-install-debuginfo.c | 12 | ||||
| -rw-r--r-- | src/plugins/abrt-action-trim-files.c | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/abrt-action-install-debuginfo.c b/src/plugins/abrt-action-install-debuginfo.c index 91171301..357762ee 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 <sys/types.h> #include <unistd.h> #include <stdlib.h> #include <string.h> @@ -60,6 +61,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. 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, |
