summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-04-26 17:13:23 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2011-04-26 17:13:23 +0200
commitf39c50a93e030fa03a5337b88bb309d569f5b1d0 (patch)
treebd9e4b678939a158db7af22fac5c5a4876060af7
parent6234b1bca8a8abcfff764e41fc157fe8ffa19dd6 (diff)
parent5c734d1077612e58c86866d5d8035d6e4a653155 (diff)
downloadabrt-f39c50a93e030fa03a5337b88bb309d569f5b1d0.tar.gz
abrt-f39c50a93e030fa03a5337b88bb309d569f5b1d0.tar.xz
abrt-f39c50a93e030fa03a5337b88bb309d569f5b1d0.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
-rw-r--r--src/plugins/abrt-action-install-debuginfo.c12
-rw-r--r--src/plugins/abrt-action-trim-files.c2
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,