Class: Specinfra::Command::Solaris::V10::User

Inherits:
Base::User show all
Defined in:
lib/specinfra/command/solaris/v10/user.rb

Class Method Summary collapse

Methods inherited from Base::User

check_has_home_directory, check_has_login_shell

Methods inherited from Base::User

add, check_belongs_to_primary_group, check_exists, check_has_home_directory, check_has_login_shell, check_has_uid, get_encrypted_password, get_gid, get_home_directory, get_login_shell, get_maximum_days_between_password_change, get_minimum_days_between_password_change, get_uid, update_encrypted_password, update_gid, update_home_directory, update_login_shell, update_uid

Methods inherited from Base

create, escape

Class Method Details

.check_belongs_to_group(user, group) ⇒ Object


3
4
5
# File 'lib/specinfra/command/solaris/v10/user.rb', line 3

def check_belongs_to_group(user, group)
  "id -ap #{escape(user)} | grep -- #{escape(group)}"
end

.check_has_authorized_key(user, key) ⇒ Object


7
8
9
10
# File 'lib/specinfra/command/solaris/v10/user.rb', line 7

def check_has_authorized_key(user, key)
  key.sub!(/\s+\S*$/, '') if key.match(/^\S+\s+\S+\s+\S*$/)
  "grep -- #{escape(key)} ~#{escape(user)}/.ssh/authorized_keys"
end