Move gpg public key to /pubkey instead of /tmp.
This commit is contained in:
parent
221004cc2e
commit
fdce46d15f
|
@ -41,10 +41,14 @@
|
||||||
$uinfo=posix_getpwnam($CONFIG['webserver_user']);
|
$uinfo=posix_getpwnam($CONFIG['webserver_user']);
|
||||||
$cwd = getcwd();
|
$cwd = getcwd();
|
||||||
$webtmp = preg_replace('/spoolnews/','tmp/',$cwd);
|
$webtmp = preg_replace('/spoolnews/','tmp/',$cwd);
|
||||||
|
$keydir = preg_replace('/spoolnews/','pubkey/',$cwd);
|
||||||
|
|
||||||
@mkdir($webtmp,0755,'recursive');
|
@mkdir($webtmp,0755,'recursive');
|
||||||
@chown($webtmp, $uinfo["uid"]);
|
@chown($webtmp, $uinfo["uid"]);
|
||||||
@chgrp($webtmp, $uinfo["gid"]);
|
@chgrp($webtmp, $uinfo["gid"]);
|
||||||
|
@mkdir($keydir,0755,'recursive');
|
||||||
|
@chown($keydir, $uinfo["uid"]);
|
||||||
|
@chgrp($keydir, $uinfo["gid"]);
|
||||||
@mkdir($ssldir,0755);
|
@mkdir($ssldir,0755);
|
||||||
@chown($ssldir, $uinfo["uid"]);
|
@chown($ssldir, $uinfo["uid"]);
|
||||||
@chgrp($ssldir, $uinfo["gid"]);
|
@chgrp($ssldir, $uinfo["gid"]);
|
||||||
|
@ -78,10 +82,10 @@ if(isset($CONFIG['enable_nocem']) && $CONFIG['enable_nocem'] == true) {
|
||||||
}
|
}
|
||||||
// Set up server gpg keys
|
// Set up server gpg keys
|
||||||
if($rslight_gpg['enable'] == '1') {
|
if($rslight_gpg['enable'] == '1') {
|
||||||
if(!is_file($webtmp.'/server_pubkey.txt')) {
|
if(!is_file($keydir.'/server_pubkey.txt')) {
|
||||||
$domain = 'rslight@'.$rslight_gpg['domain_name'];
|
$domain = 'rslight@'.$rslight_gpg['domain_name'];
|
||||||
$pubkey = $webtmp.'/server_pubkey.txt';
|
$pubkey = $keydir.'/server_pubkey.txt';
|
||||||
$fingerprint = $webtmp.'/server_fingerprint.txt';
|
$fingerprint = $keydir.'/server_fingerprint.txt';
|
||||||
$create_gpg_keys = $config_dir.'/scripts/create_gpg_keys.sh "'.$gnupg.'" "'.$pubkey.'" "'.$fingerprint.'" "'.$domain.'"';
|
$create_gpg_keys = $config_dir.'/scripts/create_gpg_keys.sh "'.$gnupg.'" "'.$pubkey.'" "'.$fingerprint.'" "'.$domain.'"';
|
||||||
exec($create_gpg_keys);
|
exec($create_gpg_keys);
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,9 +199,9 @@ function send_keys_to_group($res, $rslight_gpg) {
|
||||||
global $spooldir, $config_name, $mail_update_time, $CONFIG, $rslight_version;
|
global $spooldir, $config_name, $mail_update_time, $CONFIG, $rslight_version;
|
||||||
|
|
||||||
$cwd = getcwd();
|
$cwd = getcwd();
|
||||||
$webtmp = preg_replace('/spoolnews/','tmp/',$cwd);
|
$keydir = preg_replace('/spoolnews/','pubkey/',$cwd);
|
||||||
$key_location = "/tmp/server_pubkey.txt";
|
$key_location = "/pubkey/server_pubkey.txt";
|
||||||
$signing_key = trim(file_get_contents($webtmp.'/server_fingerprint.txt'));
|
$signing_key = trim(file_get_contents($keydir.'/server_fingerprint.txt'));
|
||||||
$fingerprint_clean = preg_replace('/\ /', '', $signing_key);
|
$fingerprint_clean = preg_replace('/\ /', '', $signing_key);
|
||||||
gnupg_addsignkey($res,$fingerprint_clean)."\n";
|
gnupg_addsignkey($res,$fingerprint_clean)."\n";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue