Skip to content

Commit

Permalink
security/acme-client: fix command failure with gcloud, refs opnsense#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Jan 8, 2024
1 parent f783773 commit e6742e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions security/acme-client/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ WWW: https://github.com/acmesh-official/acme.sh
Plugin Changelog
================

Fixed:
* fix sporadic command failure with gcloud DNS API (#3745)

3.20

Added:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,19 @@ public static function run_shell_command($proc_cmd, $proc_env = array())

// Make sure the resource could be setup properly
if (is_resource($proc)) {
// Close all pipes
// This workaround ensures that the accurate return code
// is reliably returned.
fclose($proc_pipes[0]);
$output = array();
while (!feof($proc_pipes[1])) {
$output[] = rtrim(fgets($proc_pipes[1], 1024), "\n");
}
fclose($proc_pipes[1]);
while (!feof($proc_pipes[2])) {
$output[] = rtrim(fgets($proc_pipes[2], 1024), "\n");
}
fclose($proc_pipes[2]);

// Get exit code
$result = proc_close($proc);
log_error(sprintf("AcmeClient: The shell command returned exit code '%d': '%s'", $result, $proc_cmd));
Expand Down

0 comments on commit e6742e3

Please sign in to comment.