commit 1f054c59ddc349cf5719447bc51eaccde554312a Author: Nicolas Vigier boklm@torproject.org Date: Tue Sep 19 13:28:34 2017 +0200
Bug 23039: fix detection of runc version
In the previous patch, we wrongly assumed that all runc 0.1.1 versions exited with 0 when given an unknown command, and used that to detect the version. It seems it is not true on all systems.
We are now using the 'runc --version' command to find the version of runc.
We don't support versions older than 0.1.1. --- rbm.conf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/rbm.conf b/rbm.conf index ef37575..a93fa1a 100644 --- a/rbm.conf +++ b/rbm.conf @@ -375,11 +375,10 @@ ENV: ( var_p => { # runc100 is true if we are using runc >= 1.0.0 + # we assume that any version that is not 0.1.1 is >= 1.0.0 runc100 => sub { - # runc >= 1.0.0 exits with an error when trying to use an unknown - # command while older versions exit with 0 - my (undef, undef, $success) = capture_exec('sudo', 'runc', 'xyzxyzxyz'); - return !$success; + my ($out) = capture_exec('sudo', 'runc', '--version'); + return !($out =~ m/^runc version 0.1.1/); }, }, )