Unix-Passwd-File

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    Usage:

     get_max_gid(%args) -> [status, msg, payload, meta]

    Get maximum GID used.

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   etc_dir => *str* (default: "/etc")

        Specify location of passwd files.

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (any)

  get_max_uid
    Usage:

     get_max_uid(%args) -> [status, msg, payload, meta]

    Get maximum UID used.

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   etc_dir => *str* (default: "/etc")

        Specify location of passwd files.

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (any)

  get_user
    Usage:

     get_user(%args) -> [status, msg, payload, meta]

    Get user details by username or uid.

    Either "user" OR "uid" must be specified.

    The function is not dissimilar to Unix's "getpwnam()" or "getpwuid()".

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   etc_dir => *str* (default: "/etc")

        Specify location of passwd files.

    *   uid => *unix::uid*

    *   user => *unix::username*

    *   with_field_names => *bool* (default: 1)

        If false, don't return hash.

        By default, a hashref is returned containing field names and its
        values, e.g. "{user=>"titin", pass=>"x", uid=>500, ...}". With
        "with_field_names=>0", an arrayref is returned instead: "["titin",
        "x", 500, ...]".

    Returns an enveloped result (an array).

    First element (status) is an integer containing HTTP status code (200
    means OK, 4xx caller error, 5xx function error). Second element (msg) is
    a string containing error message, or 'OK' if status is 200. Third
    element (payload) is optional, the actual result. Fourth element (meta)
    is called result metadata and is optional, a hash that contains extra
    information.

    Return value: (any)

  get_user_groups
    Usage:

     get_user_groups(%args) -> [status, msg, payload, meta]

    Return groups which the user belongs to.

    This function is not exported by default, but exportable.

    Arguments ('*' denotes required arguments):

    *   detail => *bool* (default: 0)

        If true, return all fields instead of just group names.

    *   etc_dir => *str* (default: "/etc")

        Specify location of passwd files.

    *   user* => *unix::username*

    *   with_field_names => *bool* (default: 1)

        If false, don't return hash for each entry.

        By default, when "detail=>1", a hashref is returned for each entry
        containing field names and its values, e.g. "{group=>"titin",



( run in 2.329 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )