The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

CatalystX::Usul::Users::Unix - User data store for the Unix OS

Version

Describes v0.17.$Rev: 1 $

Synopsis

   use CatalystX::Usul::Users::Unix;

   my $class = CatalystX::Usul::Users::Unix;

   my $user_obj = $class->new( $attr );

Description

User storage model for the Unix operating system

Configuration and Environment

Defines the following attributes

field_map

A hash ref which maps the field names used by the user model onto the field names used by the OS

get_features

A hash ref which details the features supported by the OS user data store

passwd_file

A path to a file coerced from an array ref which defaults to /etc/passwd

passwd_obj

An instance of File::UnixAuth

passwd_type

The name of the hashing algorithm to use when creating new accounts. Defaults to SHA-512

role_class

Overrides the attribute in the parent class. This is the name of the class that manages roles (groups). It defaults to CatalystX::Usul::Roles::Unix

shadow_file

A path to a file coerced from an array ref which defaults to /etc/shadow

shadow_obj

An instance of File::UnixAuth

Subroutines/Methods

assert_user

Returns a domain model user object for the specified user or throws an exception if the user does not exist

change_password

Calls the suid wrapper to change the users password

check_password

Calls the suid wrapper to check the users password

create

Calls the suid wrapper to create a new user account, populate the home directory and create a mail alias for the users email address to the new account

delete

Calls the suid wrapper to delete the users mail alias and then delete the account

disable_account

Sets the password to *DISABLED* disabling the account

get_features

Returns a hashref of features supported by this store. Can be checked using supports

get_primary_rid

Returns the users primary role (group) id from the /etc/passwd file

get_user

Returns a hashref containing the data fields for the requested user. Maps the field name specific to the store to those used by the identity model

get_users_by_rid

Returns the list of users the share the given primary role (group) id

is_user

Returns true if the user exists, false otherwise

list

Returns the list of usernames matching the given pattern

set_password

Calls the suid wrapper to set the users password to a given value

update

Calls the suid wrapper to update the user account information

user_report

Calls the suid wrapper to create a report about the user accounts in this store

validate_password

Called by check_password in the parent class. This method execute the external setuid root wrapper to validate the password provided

Diagnostics

None

Dependencies

CatalystX::Usul::Users
CatalystX::Usul::Moose
CatalystX::Usul::Constraints
File::UnixAuth
TryCatch

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Copyright (c) 2014 Peter Flanigan. All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE