Эх сурвалжийг харах

Feature/minor fixes log files (#49)

* Security Changes

* Additional Security - Run Game Servers in Limited User Account

* Apply New Group Right Away

* Apply Proper Permissions to FTP User

* Fix for Home Dirs Under OGP Agent User

* No Return Sudo Command Function

* Minor Fixes
OwN-3m-All 3 жил өмнө
parent
commit
6fded4220b
1 өөрчлөгдсөн 6 нэмэгдсэн , 1 устгасан
  1. 6 1
      ogp_agent.pl

+ 6 - 1
ogp_agent.pl

@@ -832,6 +832,7 @@ sub universal_start_without_decrypt
 	my $owner = SERVER_RUNNER_USER;
 	my $group = SERVER_RUNNER_USER;
 	my $ogpAgentGroup = `whoami`;
+
 	chomp $ogpAgentGroup;
 	
 	if(defined LINUX_USER_PER_GAME_SERVER && LINUX_USER_PER_GAME_SERVER eq "1"){
@@ -1002,6 +1003,9 @@ sub universal_start_without_decrypt
 	logger
 	  "Startup command [ $cli_bin ] will be executed in dir $game_binary_dir.";
 	
+	# Fix permissions one last time (for backup_home_log created folder / files / etc)
+	set_path_ownership($owner, $group, $home_path);
+	
 	# Run before start script
 	$run_before_start = run_before_start_commands($home_id, $home_path, $preStart, $owner);
 	
@@ -2127,10 +2131,11 @@ sub set_path_ownership
 	my $chownCommand = "chown -Rf $owner_uid:$group_uid '$path'";
 	my $chmodCommand = "chmod -Rf ug+rwx '$path'";
 	my $groupCommand = "chmod -Rf g+s '$path'";
+	my $groupCommandScreenLogs = "chmod -Rf g+s '" . SCREEN_LOGS_DIR . "'";
 	sudo_exec_without_decrypt($chownCommand);
 	sudo_exec_without_decrypt($chmodCommand);
 	sudo_exec_without_decrypt($groupCommand);
-	
+	sudo_exec_without_decrypt($groupCommandScreenLogs);
 	
 	# Remove perms for other users
 	$chmodCommand = "chmod -Rf o-rwx '$path'";