Skip to content

Commit 9ceff3c

Browse files
author
Marius Burkard
committed
LE Renewal issue on systems that use the relative symlink option for websites, fixes #5326
1 parent dda2b47 commit 9ceff3c

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

server/lib/classes/letsencrypt.inc.php

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -388,38 +388,26 @@ public function request_certificates($data, $server_type = 'apache') {
388388
$app->system->unlink($key_file);
389389
}
390390

391-
if ($web_config["website_symlinks_rel"] == 'y') {
392-
$app->system->create_relative_link(escapeshellcmd($key_tmp_file), escapeshellcmd($key_file));
393-
} else {
394-
if(@is_link($key_file)) $app->system->unlink($key_file);
395-
if(@file_exists($key_tmp_file)) exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
396-
}
391+
if(@is_link($key_file)) $app->system->unlink($key_file);
392+
if(@file_exists($key_tmp_file)) exec("ln -s ".escapeshellcmd($key_tmp_file)." ".escapeshellcmd($key_file));
397393

398394
if(is_file($crt_file)) {
399395
$app->system->copy($crt_file, $crt_file.'.old.'.$date);
400396
$app->system->chmod($crt_file.'.old.'.$date, 0400);
401397
$app->system->unlink($crt_file);
402398
}
403399

404-
if($web_config["website_symlinks_rel"] == 'y') {
405-
$app->system->create_relative_link(escapeshellcmd($crt_tmp_file), escapeshellcmd($crt_file));
406-
} else {
407-
if(@is_link($crt_file)) $app->system->unlink($crt_file);
408-
if(@file_exists($crt_tmp_file))exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
409-
}
400+
if(@is_link($crt_file)) $app->system->unlink($crt_file);
401+
if(@file_exists($crt_tmp_file))exec("ln -s ".escapeshellcmd($crt_tmp_file)." ".escapeshellcmd($crt_file));
410402

411403
if(is_file($bundle_file)) {
412404
$app->system->copy($bundle_file, $bundle_file.'.old.'.$date);
413405
$app->system->chmod($bundle_file.'.old.'.$date, 0400);
414406
$app->system->unlink($bundle_file);
415407
}
416408

417-
if($web_config["website_symlinks_rel"] == 'y') {
418-
$app->system->create_relative_link(escapeshellcmd($bundle_tmp_file), escapeshellcmd($bundle_file));
419-
} else {
420-
if(@is_link($bundle_file)) $app->system->unlink($bundle_file);
421-
if(@file_exists($bundle_tmp_file)) exec("ln -s ".escapeshellcmd($bundle_tmp_file)." ".escapeshellcmd($bundle_file));
422-
}
409+
if(@is_link($bundle_file)) $app->system->unlink($bundle_file);
410+
if(@file_exists($bundle_tmp_file)) exec("ln -s ".escapeshellcmd($bundle_tmp_file)." ".escapeshellcmd($bundle_file));
423411

424412
return true;
425413
} else {

server/lib/classes/system.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ public function create_relative_link($f, $t) {
918918

919919
// Add ($cnt_to-1) number of "../" elements to left side of $cfrom
920920
for ($c = 0; $c < (count($a2)-1); $c++) { $cfrom = '../'.$cfrom; }
921-
if(strstr($to,'/etc/letsencrypt/archive/')) $to = str_replace('/etc/letsencrypt/archive/','/etc/letsencrypt/live/',$to);
921+
//if(strstr($to,'/etc/letsencrypt/archive/')) $to = str_replace('/etc/letsencrypt/archive/','/etc/letsencrypt/live/',$to);
922922

923923
return symlink($cfrom, $to);
924924
}

0 commit comments

Comments
 (0)