doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

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

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