doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

Blame SOURCES/0111-a-a-i-d-t-a-cache-sanitize-umask.patch

baab13
From 9a4100678fea4d60ec93d35f4c5de2e9ad054f3a Mon Sep 17 00:00:00 2001
baab13
From: Jakub Filak <jfilak@redhat.com>
baab13
Date: Wed, 29 Apr 2015 14:13:57 +0200
baab13
Subject: [ABRT PATCH] a-a-i-d-t-a-cache: sanitize umask
baab13
baab13
We cannot trust anything when running suided program.
baab13
baab13
Related: #1216962
baab13
baab13
Signed-off-by: Jakub Filak <jfilak@redhat.com>
baab13
---
baab13
 src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c | 3 +++
baab13
 1 file changed, 3 insertions(+)
baab13
baab13
diff --git a/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c b/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c
baab13
index eb2f7c5..cd9ee7a 100644
baab13
--- a/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c
baab13
+++ b/src/plugins/abrt-action-install-debuginfo-to-abrt-cache.c
baab13
@@ -182,6 +182,9 @@ int main(int argc, char **argv)
baab13
         if (u != 0)
baab13
             strcpy(path_env, "PATH=/usr/bin:/bin:"BIN_DIR);
baab13
         putenv(path_env);
baab13
+
baab13
+        /* Use safe umask */
baab13
+        umask(0022);
baab13
     }
baab13
 
baab13
     execvp(EXECUTABLE, (char **)args);
baab13
-- 
baab13
1.8.3.1
baab13