ソースを参照

Feature/fix improper group perms (#51)

* Fix Improper Perms on Files - Should Apply to Directories Only

* Fix Improper Perms on Files - Should Apply to Directories Only

* Fix Improper Perms on Files - Should Apply to Directories Only

* Fix Improper Perms on Files - Should Apply to Directories Only

* Fix Improper Perms on Files - Should Apply to Directories Only
OwN-3m-All 3 年 前
コミット
cbd22e6316
1 ファイル変更14 行追加2 行削除
  1. 14 2
      ogp_agent.pl

+ 14 - 2
ogp_agent.pl

@@ -194,7 +194,13 @@ if ( ! chmod 0777, SCREEN_LOGS_DIR ){
 	exit -1;
 }
 
-my $groupCommandScreenLogs = "chmod -Rf g+s '" . SCREEN_LOGS_DIR . "'";
+my $groupCommandScreenLogs = "chmod -Rf g-s '" . SCREEN_LOGS_DIR . "'";
+sudo_exec_without_decrypt($groupCommandScreenLogs);
+
+$groupCommandScreenLogs = "find '" . SCREEN_LOGS_DIR  . "' -type d | xargs chmod g+s";
+sudo_exec_without_decrypt($groupCommandScreenLogs);
+
+$groupCommandScreenLogs = "find '" . SCREEN_LOGS_DIR  . "' -type d | xargs setfacl -d -m u::rwX,g::rwX,o::-";
 sudo_exec_without_decrypt($groupCommandScreenLogs);
 
 # Check the global shared games folder
@@ -2133,11 +2139,17 @@ sub set_path_ownership
 	# Set owner and perms on it recursivelly as well
 	my $chownCommand = "chown -Rf $owner_uid:$group_uid '$path'";
 	my $chmodCommand = "chmod -Rf ug+rwx '$path'";
-	my $groupCommand = "chmod -Rf g+s '$path'";
+	my $groupCommand = "chmod -Rf g-s '$path'"; # Clean up the mess I made from previous version
 	sudo_exec_without_decrypt($chownCommand);
 	sudo_exec_without_decrypt($chmodCommand);
 	sudo_exec_without_decrypt($groupCommand);
 	
+	$groupCommand = "find '$path' -type d | xargs chmod g+s";
+	sudo_exec_without_decrypt($groupCommand);
+	
+	$groupCommand = "find '$path' -type d | xargs setfacl -d -m u::rwX,g::rwX,o::-";
+	sudo_exec_without_decrypt($groupCommand);
+	
 	# Remove perms for other users
 	$chmodCommand = "chmod -Rf o-rwx '$path'";
 	sudo_exec_without_decrypt($chmodCommand);