Skip to content

Commit 4a000a4

Browse files
authored
Update regex to work for Rust sudo variant (sudo-rs)
1 parent 0aae629 commit 4a000a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/facter/sudoversion.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
setcode do
99
if Facter::Util::Resolution.which('sudo')
1010
sudoversion = Facter::Util::Resolution.exec('sudo -V 2>&1')
11-
%r{^Sudo version ([\w.]+)}.match(sudoversion)[1]
11+
%r{^(?:Sudo version|sudo-rs)\s+([\w.]+)}i.match(sudoversion)[1]
1212
elsif Facter::Util::Resolution.which('rpm')
1313
Facter::Util::Resolution.exec('rpm -q sudo --qf \'%{VERSION}\'')
1414
elsif Facter::Util::Resolution.which('dpkg-query')

0 commit comments

Comments
 (0)