Blob Blame History Raw
From bade4de1155e41809205ede25ffb99211c72547c Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Mon, 26 Aug 2013 17:08:52 +0200
Subject: [PATCH 5/8] Revert "chmod/chown envs dir when preparing this"

This reverts commit 137e683760707c690df496516432d72d8f7a81d3.
---
 daemon/environment.cpp | 7 +------
 daemon/environment.h   | 2 +-
 daemon/main.cpp        | 2 +-
 3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/daemon/environment.cpp b/daemon/environment.cpp
index 87a78a7..4a4ac94 100644
--- a/daemon/environment.cpp
+++ b/daemon/environment.cpp
@@ -165,7 +165,7 @@ static bool cleanup_directory( const string& directory )
     return true;
 }
 
-bool cleanup_cache( const string &basedir, uid_t user_uid, gid_t user_gid )
+bool cleanup_cache( const string &basedir )
 {
     flush_debug();
 
@@ -181,11 +181,6 @@ bool cleanup_cache( const string &basedir, uid_t user_uid, gid_t user_gid )
             log_perror( "mkdir in cleanup_cache() failed" );
         return false;
     }
-    if ( chown( basedir.c_str(), user_uid, user_gid ) ||
-         chmod( basedir.c_str(), 0775 ) ) {
-        log_perror( "chown/chmod in cleanup_cache() failed" );
-        return false;
-    }
 
     return true;
 }
diff --git a/daemon/environment.h b/daemon/environment.h
index 8e9361f..ecea781 100644
--- a/daemon/environment.h
+++ b/daemon/environment.h
@@ -27,7 +27,7 @@
 #include <unistd.h>
 
 class MsgChannel;
-extern bool cleanup_cache( const std::string &basedir, uid_t user_uid, gid_t user_gid );
+extern bool cleanup_cache( const std::string &basedir );
 extern size_t setup_env_cache(const std::string &basedir, std::string &native_environment,
                     uid_t user_uid, gid_t user_gid,
                     const std::string &compiler, const std::list<std::string> &extrafiles);
diff --git a/daemon/main.cpp b/daemon/main.cpp
index 5d7e430..e08b1e1 100644
--- a/daemon/main.cpp
+++ b/daemon/main.cpp
@@ -1872,7 +1872,7 @@ int main( int argc, char ** argv )
     pidFile << dcc_master_pid << endl;
     pidFile.close();
 
-    if ( !cleanup_cache( d.envbasedir, d.user_uid, d.user_gid ) )
+    if ( !cleanup_cache( d.envbasedir ) )
         return 1;
 
     list<string> nl = get_netnames (200);
-- 
1.8.3.1