CatalystX::Usul::Users::Suid - Set uid root methods for account manipulation


CatalystX-Usul documentation  | view source Contained in the CatalystX-Usul distribution.

Index


Name

Top

CatalystX::Usul::Users::Suid - Set uid root methods for account manipulation

Version

Top

0.3.$Revision: 577 $

Synopsis

Top

   # In a module executing setuid root
   use base qw(CatalystX::Usul::Programs);
   use CatalystX::Usul::Model::Identity;

   __PACKAGE__->mk_accessors( qw(identity) );

   sub new {
      my ($class, @rest) = @_;
      my $config   = { role_class => q(Unix), user_class => q(Suid) };
      my $id_class = q(CatalystX::Usul::Model::Identity);

      $self->{identity} = $id_class->new( $self, $config );
      return $self;
   }

   sub create_account {
      my $self = shift;

      $self->output( $self->users->create_account( @ARGV ) );
      return 0;
   }

Description

Top

The public methods are called from a program running setuid root. The methods enable the management of OS accounts

Subroutines/Methods

Top

create_account

   $self->create_account( $path );

Creates an OS account. The given path is an XML file containing the account parameters. Account profiles are obtained from the $self->profile_domain object. New entries are added to the passwd file, the shadow file (if it is being used) and the group file

delete_account

   $self->delete_account( $user ):

Deletes an OS account. The accounts home directory is removed, the users entries in the group file are removed as are the entries in the passwd and shadow files

populate_account

   $self->create_account( $path );

Creates the new users home directory and populates it with some "dot" files if templates for such exist in the $self->profdir directory. Does not create a directory if the users homedir matches $self->common_home. Account parameters are read from the XML file given by $path

update_account

   $self->update_account( $path );

Account parameters are read from the XML file given by $path. Updates entries in the passwd file

user_report

   $self->user_report( $path, $format );

Creates a report of user accounts. Outputs to $path or STDOUT if $path is -. Format is either text or csv

Diagnostics

Top

None

Configuration and Environment

Top

None

Dependencies

Top

CatalystX::Usul::Users::Unix
Crypt::PasswdMD5
XML::Simple

Incompatibilities

Top

There are no known incompatibilities in this module

Bugs and Limitations

Top

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

Author

Top

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

License and Copyright

Top


CatalystX-Usul documentation  | view source Contained in the CatalystX-Usul distribution.