de573ca
From a38c813764c36f24bbfdc3713c4d5db262e984bb Mon Sep 17 00:00:00 2001
ca199d1
From: Michal Schmidt <mschmidt@redhat.com>
ca199d1
Date: Mon, 26 Aug 2013 17:08:52 +0200
3e9b2a5
Subject: [PATCH 1/4] Revert "chmod/chown envs dir when preparing this"
ca199d1
ca199d1
This reverts commit 137e683760707c690df496516432d72d8f7a81d3.
d711b60
d711b60
In Fedora our basedir is /var/cache/icecream, it's shipped in the rpm
d711b60
and its owned by root:icecc. We cannot and do not want to chown/chmod it.
ca199d1
---
ca199d1
 daemon/environment.cpp | 7 +------
ca199d1
 daemon/environment.h   | 2 +-
ca199d1
 daemon/main.cpp        | 2 +-
ca199d1
 3 files changed, 3 insertions(+), 8 deletions(-)
ca199d1
ca199d1
diff --git a/daemon/environment.cpp b/daemon/environment.cpp
de573ca
index 65cad30270..37079bb94b 100644
ca199d1
--- a/daemon/environment.cpp
ca199d1
+++ b/daemon/environment.cpp
de573ca
@@ -203,7 +203,7 @@ static bool cleanup_directory(const string &directory)
ca199d1
     return true;
ca199d1
 }
ca199d1
 
c61b150
-bool cleanup_cache(const string &basedir, uid_t user_uid, gid_t user_gid)
c61b150
+bool cleanup_cache(const string &basedir)
ca199d1
 {
ca199d1
     flush_debug();
ca199d1
 
de573ca
@@ -222,11 +222,6 @@ bool cleanup_cache(const string &basedir, uid_t user_uid, gid_t user_gid)
ca199d1
         return false;
ca199d1
     }
c61b150
 
c61b150
-    if (chown(basedir.c_str(), user_uid, user_gid) || chmod(basedir.c_str(), 0775)) {
de573ca
-        log_perror("chown/chmod in cleanup_cache() failed") << "\t" << basedir << endl;;
ca199d1
-        return false;
ca199d1
-    }
c61b150
-
ca199d1
     return true;
ca199d1
 }
c61b150
 
ca199d1
diff --git a/daemon/environment.h b/daemon/environment.h
de573ca
index cae6fbd808..dd37005201 100644
ca199d1
--- a/daemon/environment.h
ca199d1
+++ b/daemon/environment.h
c61b150
@@ -29,7 +29,7 @@
ca199d1
 #include <unistd.h>
ca199d1
 
ca199d1
 class MsgChannel;
c61b150
-extern bool cleanup_cache(const std::string &basedir, uid_t user_uid, gid_t user_gid);
c61b150
+extern bool cleanup_cache(const std::string &basedir);
c61b150
 extern int start_create_env(const std::string &basedir,
c61b150
                             uid_t user_uid, gid_t user_gid,
c61b150
                             const std::string &compiler, const std::list<std::string> &extrafiles);
ca199d1
diff --git a/daemon/main.cpp b/daemon/main.cpp
de573ca
index f87a799d28..00dfab7fe2 100644
ca199d1
--- a/daemon/main.cpp
ca199d1
+++ b/daemon/main.cpp
de573ca
@@ -2326,7 +2326,7 @@ int main(int argc, char **argv)
ca199d1
     pidFile << dcc_master_pid << endl;
ca199d1
     pidFile.close();
ca199d1
 
c61b150
-    if (!cleanup_cache(d.envbasedir, d.user_uid, d.user_gid)) {
c61b150
+    if (!cleanup_cache(d.envbasedir)) {
ca199d1
         return 1;
c61b150
     }
ca199d1
 
ca199d1
-- 
de573ca
2.13.0
ca199d1