/usr/lib/ruby/vendor_ruby/specinfra/command/base/group.rb is in ruby-specinfra 2.66.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | class Specinfra::Command::Base::Group < Specinfra::Command::Base
class << self
def check_exists(group)
"getent group #{escape(group)}"
end
def check_has_gid(group, gid)
"getent group #{escape(group)} | cut -f 3 -d ':' | grep -w -- #{escape(gid)}"
end
def get_gid(group)
"getent group #{escape(group)} | cut -f 3 -d ':'"
end
def update_gid(group, gid)
"groupmod -g #{escape(gid)} #{escape(group)}"
end
def add(group, options)
command = ['groupadd']
command << '-g' << escape(options[:gid]) if options[:gid]
command << escape(group)
command.join(' ')
end
end
end
|