let's encrypt output can be a symlink, so always de-reference it https://www.virtualmin.com/node/42419
This commit is contained in:
parent
ceae4b5228
commit
7208412de2
@ -6382,7 +6382,7 @@ foreach my $f (@_) {
|
|||||||
return wantarray ? ($rv, $err) : $rv;
|
return wantarray ? ($rv, $err) : $rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
=head2 copy_source_dest(source, dest)
|
=head2 copy_source_dest(source, dest, [copy-link-target])
|
||||||
|
|
||||||
Copy some file or directory to a new location. Returns 1 on success, or 0
|
Copy some file or directory to a new location. Returns 1 on success, or 0
|
||||||
on failure - also sets $! on failure. If the source is a directory, uses
|
on failure - also sets $! on failure. If the source is a directory, uses
|
||||||
@ -6393,7 +6393,7 @@ and special files.
|
|||||||
sub copy_source_dest
|
sub copy_source_dest
|
||||||
{
|
{
|
||||||
return (1, undef) if (&is_readonly_mode());
|
return (1, undef) if (&is_readonly_mode());
|
||||||
my ($src, $dst) = @_;
|
my ($src, $dst, $copylink) = @_;
|
||||||
my $ok = 1;
|
my $ok = 1;
|
||||||
my ($err, $out);
|
my ($err, $out);
|
||||||
&webmin_debug_log('COPY', "src=$src dst=$dst")
|
&webmin_debug_log('COPY', "src=$src dst=$dst")
|
||||||
@ -6425,7 +6425,7 @@ elsif (-d $src) {
|
|||||||
$err = $out;
|
$err = $out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif (-l $src) {
|
elsif (-l $src && !$copylink) {
|
||||||
# A link .. re-create
|
# A link .. re-create
|
||||||
my $linkdst = readlink($src);
|
my $linkdst = readlink($src);
|
||||||
$ok = &symlink_logged($linkdst, $dst);
|
$ok = &symlink_logged($linkdst, $dst);
|
||||||
|
@ -136,7 +136,7 @@ else {
|
|||||||
if (!$ok) {
|
if (!$ok) {
|
||||||
return &text('letsencrypt_ecsr', $csr);
|
return &text('letsencrypt_ecsr', $csr);
|
||||||
}
|
}
|
||||||
©_source_dest($csr, "/tmp/lets.csr");
|
©_source_dest($csr, "/tmp/lets.csr", 1);
|
||||||
|
|
||||||
# Find a reasonable python version
|
# Find a reasonable python version
|
||||||
my $python = &get_letsencrypt_python_cmd();
|
my $python = &get_letsencrypt_python_cmd();
|
||||||
@ -174,9 +174,9 @@ else {
|
|||||||
my $certfinal = "$module_config_directory/$doms[0].cert";
|
my $certfinal = "$module_config_directory/$doms[0].cert";
|
||||||
my $keyfinal = "$module_config_directory/$doms[0].key";
|
my $keyfinal = "$module_config_directory/$doms[0].key";
|
||||||
my $chainfinal = "$module_config_directory/$doms[0].chain";
|
my $chainfinal = "$module_config_directory/$doms[0].chain";
|
||||||
©_source_dest($cert, $certfinal);
|
©_source_dest($cert, $certfinal, 1);
|
||||||
©_source_dest($key, $keyfinal);
|
©_source_dest($key, $keyfinal, 1);
|
||||||
©_source_dest($chain, $chainfinal);
|
©_source_dest($chain, $chainfinal, 1);
|
||||||
&set_ownership_permissions(undef, undef, 0600, $certfinal);
|
&set_ownership_permissions(undef, undef, 0600, $certfinal);
|
||||||
&set_ownership_permissions(undef, undef, 0600, $keyfinal);
|
&set_ownership_permissions(undef, undef, 0600, $keyfinal);
|
||||||
&set_ownership_permissions(undef, undef, 0600, $chainfinal);
|
&set_ownership_permissions(undef, undef, 0600, $chainfinal);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user