Explorar o código

Fix for https://github.com/OpenGamePanel/OGP-Agent-Linux/issues/47

own3mall %!s(int64=3) %!d(string=hai) anos
pai
achega
6352f50b01
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      ogp_agent.pl

+ 4 - 2
ogp_agent.pl

@@ -2139,19 +2139,21 @@ 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 $chmodCommandDir = "chmod -Rf o+rx `find '$path' -type d`";
 	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($chmodCommandDir);
 	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::-";
+	$groupCommand = "find '$path' -type d | xargs setfacl -d -m u::rwX,g::rwX,o::rx";
 	sudo_exec_without_decrypt($groupCommand);
 	
 	# Remove perms for other users
-	$chmodCommand = "chmod -Rf o-rwx '$path'";
+	$chmodCommand = "chmod -Rf o-rwx `find '$path' -type f`";
 	sudo_exec_without_decrypt($chmodCommand);
 		
 	return 0;