Blame SOURCES/0002-Drop-the-setuid-wrapper.patch

e6c99c
From b417cfa480d8ff69f1ab5f7a9b957ab0d266ecfe Mon Sep 17 00:00:00 2001
e6c99c
From: Martin Kutlak <mkutlak@redhat.com>
e6c99c
Date: Wed, 29 May 2019 11:32:31 +0200
e6c99c
Subject: [PATCH] Drop the setuid wrapper
e6c99c
e6c99c
The /proc/1 is owned by the UID running the container process (1xxxxxxxxx) so there is no
e6c99c
need to use setuid for CEL to write to /proc/1/fd/2.
e6c99c
e6c99c
Reverts:
e6c99c
https://github.com/abrt/abrt/commit/578317a67c0f30469c28752ea2f40ae87a1a356c
e6c99c
e6c99c
(cherry picked from commit 5caab93decc2e2a3c0abf5dc24bf23482680810e)
e6c99c
e6c99c
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
e6c99c
---
e6c99c
 container-exception-logger.spec  |  2 +-
e6c99c
 src/container-exception-logger.c | 23 +++--------------------
e6c99c
 2 files changed, 4 insertions(+), 21 deletions(-)
e6c99c
e6c99c
diff --git a/container-exception-logger.spec b/container-exception-logger.spec
e6c99c
index 7828667..3a6f1c8 100644
e6c99c
--- a/container-exception-logger.spec
e6c99c
+++ b/container-exception-logger.spec
e6c99c
@@ -35,7 +35,7 @@ mkdir -p %{buildroot}/%{_mandir}/man1
e6c99c
 cp man/container-exception-logger.1 %{buildroot}/%{_mandir}/man1/container-exception-logger.1
e6c99c
 
e6c99c
 %files
e6c99c
-%attr(6755, root, root) %{_bindir}/container-exception-logger
e6c99c
+%{_bindir}/container-exception-logger
e6c99c
 %{_mandir}/man1/container-exception-logger.1.*
e6c99c
 %license COPYING
e6c99c
 
e6c99c
diff --git a/src/container-exception-logger.c b/src/container-exception-logger.c
e6c99c
index 104ef74..d588de5 100644
e6c99c
--- a/src/container-exception-logger.c
e6c99c
+++ b/src/container-exception-logger.c
e6c99c
@@ -60,25 +60,8 @@ int main(int argc, char *argv[])
e6c99c
     FILE *f = fopen(INIT_PROC_STDERR_FD_PATH, "w");
e6c99c
     if (f == NULL)
e6c99c
     {
e6c99c
-        perror("Failed to open '"INIT_PROC_STDERR_FD_PATH"' as root");
e6c99c
-
e6c99c
-        /* Try to open the 'INIT_PROC_STDERR_FD_PATH' as normal user because of
e6c99c
-           https://github.com/minishift/minishift/issues/2058
e6c99c
-        */
e6c99c
-        if (seteuid(getuid()) == 0)
e6c99c
-        {
e6c99c
-            f = fopen(INIT_PROC_STDERR_FD_PATH, "w");
e6c99c
-            if (f == NULL)
e6c99c
-            {
e6c99c
-                perror("Failed to open '"INIT_PROC_STDERR_FD_PATH"' as user");
e6c99c
-                return 2;
e6c99c
-            }
e6c99c
-        }
e6c99c
-        else
e6c99c
-        {
e6c99c
-            perror("Failed to setuid");
e6c99c
-            return 3;
e6c99c
-        }
e6c99c
+        perror("Failed to open '"INIT_PROC_STDERR_FD_PATH"'");
e6c99c
+        return 2;
e6c99c
     }
e6c99c
 
e6c99c
     setvbuf (f, NULL, _IONBF, 0);
e6c99c
@@ -99,7 +82,7 @@ int main(int argc, char *argv[])
e6c99c
         {
e6c99c
             perror("Failed to write to '"INIT_PROC_STDERR_FD_PATH"'");
e6c99c
             fclose(f);
e6c99c
-            return 4;
e6c99c
+            return 3;
e6c99c
         }
e6c99c
     }
e6c99c
     fclose(f);
e6c99c
-- 
e6c99c
2.21.0
e6c99c