Sha256: 8628d2e11732d4b2cf7c3fc2d4d459e7a7a0648a67eb72082edd8a0e8a75fa91
Contents?: true
Size: 685 Bytes
Versions: 14
Compression:
Stored size: 685 Bytes
Contents
require 'etc' module Dockerun module UserInfo include TR::CondUtils def user_info(login = nil) login = Etc.getlogin if is_empty?(login) res = { login: login } begin res[:user_id] = Etc.getpwnam(login).uid rescue Exception => ex res[:user_id] = nil end res end def group_info(login = nil) login = Etc.getlogin if is_empty?(login) res = { } begin gnm = Etc.getgrnam(login) res[:group_name] = gnm.name res[:group_id] = gnm.gid rescue Exception => ex p ex res[:group_name] = "" res[:group_id] = nil end res end end end
Version data entries
14 entries across 14 versions & 1 rubygems