lib/chef/provider/user/dscl.rb
#
# Returns true if uid is in use by a different account, false otherwise.
#
Returns true if uid is in use by a different account, false otherwise.
Returns true if uid is in use by a different account false otherwise .
def uid_used?(uid)
          return false unless uid
          users_uids = run_dscl("list /Users uid").split("\n")
          uid_map = users_uids.inject({}) do |tmap, tuid|
            x = tuid.split
            tmap[x[1]] = x[0]
            tmap
          end
          if uid_map[uid.to_s]
            unless uid_map[uid.to_s] == @new_resource.username.to_s
              return true
            end
          end
          return false
        end
def uid_used? ( uid ) return false unless uid users_uids = run_dscl ( "list /Users uid" ) . split ( "\n" ) uid_map = users_uids . inject ( { } ) do | tmap , tuid | x = tuid . split tmap [ x [ 1 ] ] = x [ 0 ] tmap end if uid_map [ uid . to_s ] unless uid_map [ uid . to_s ] == @new_resource . username . to_s return true end end return false end
Returns true if uid is in use by a different account, false otherwise.
Returns true if uid is in use by a different account false otherwise .
uid
<not_specific>