mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 09:15:15 +02:00
Added transfer_mode_user to change owner of local copies files
This commit is contained in:
parent
a3bc7f207b
commit
7eecf38378
@ -149,6 +149,7 @@ my %DefaultConf = (
|
|||||||
'encoding' => 'UTF-8',
|
'encoding' => 'UTF-8',
|
||||||
'server_port' => 41121,
|
'server_port' => 41121,
|
||||||
'transfer_mode' => 'tentacle',
|
'transfer_mode' => 'tentacle',
|
||||||
|
'transfer_mode_user' => 'apache',
|
||||||
'transfer_timeout' => 30,
|
'transfer_timeout' => 30,
|
||||||
'server_user' => 'pandora',
|
'server_user' => 'pandora',
|
||||||
'server_pwd' => '',
|
'server_pwd' => '',
|
||||||
@ -942,7 +943,7 @@ sub send_file {
|
|||||||
quit
|
quit
|
||||||
FEOF1`
|
FEOF1`
|
||||||
} elsif ($Conf{'transfer_mode'} eq 'local') {
|
} elsif ($Conf{'transfer_mode'} eq 'local') {
|
||||||
$output = `cp "$file" "$remote_dir" 2>&1 >$DevNull`;
|
$output = `cp -p "$file" "$remote_dir" 2>&1 >$DevNull`;
|
||||||
}
|
}
|
||||||
alarm (0);
|
alarm (0);
|
||||||
};
|
};
|
||||||
@ -1165,6 +1166,11 @@ sub check_remote_config () {
|
|||||||
print MD5_FILE $conf_md5;
|
print MD5_FILE $conf_md5;
|
||||||
close (MD5_FILE);
|
close (MD5_FILE);
|
||||||
copy ("$ConfDir/$ConfFile", "$Conf{'temporal'}/$RemoteConfFile");
|
copy ("$ConfDir/$ConfFile", "$Conf{'temporal'}/$RemoteConfFile");
|
||||||
|
if ($Conf{'transfer_mode'} eq 'local') {
|
||||||
|
my (undef, undef, $uid, $gid) = getpwnam($Conf{'transfer_mode_user'});
|
||||||
|
chown ($uid, $gid, "$Conf{'temporal'}/$RemoteMD5File");
|
||||||
|
chown ($uid, $gid, "$Conf{'temporal'}/$RemoteConfFile");
|
||||||
|
}
|
||||||
send_file ("$Conf{'temporal'}/$RemoteConfFile", undef, undef, undef, $Conf{'server_path_conf'});
|
send_file ("$Conf{'temporal'}/$RemoteConfFile", undef, undef, undef, $Conf{'server_path_conf'});
|
||||||
send_file ("$Conf{'temporal'}/$RemoteMD5File", undef, undef, undef, $Conf{'server_path_md5'});
|
send_file ("$Conf{'temporal'}/$RemoteMD5File", undef, undef, undef, $Conf{'server_path_md5'});
|
||||||
unlink ("$Conf{'temporal'}/$RemoteConfFile");
|
unlink ("$Conf{'temporal'}/$RemoteConfFile");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user