Name
CatalystX::Usul::Admin - Subroutines that run as the super user
Version
Describes v0.17.$Rev: 1 $
Synopsis
# Setuid root program wrapper
use CatalystX::Usul::Admin;
$ENV{PATH} = q(/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin);
my $app = CatalystX::Usul::Admin->new_with_options
( appclass => 'YourApp' );
$app->exec_setuid or exec $app->untaint_self or die "Exec failed\n";
exit $app->run;
Description
Methods called from the setuid root program wrapper
Configuration and Environment
Defines the following attributes
commands
-
Hash ref of OS commands
exec_setuid
-
A boolean which defaults to false. Becomes true after the program has re-executed itself
paragraph
-
Hash ref of options that makes output appear in separate paragraphs
public_methods
-
List of methods that do not require authorization
server_options
-
Array ref of deployment options
Subroutines/Methods
BUILDARGS
Customize the constructor
account_report
Calls the report method on the user model
authenticate
Calls the authenticate method on the user model
create_account
Calls the create account method on the user model
create_ugrps
Creates the user and group to own the application files
deploy_server
Redispatches the call to one of the server specific methods
delete_account
Calls the delete account method on the user model
dump_user
Retrieves data for the specified user and dumps it using Data::Printer
init_suid
Enable the setuid
root wrapper?
make_default
When installed should this installation become the default for this host? Causes the symbolic link (that hides the version directory from the PATH
environment variable) to be deleted and recreated pointing to this installation
post_install
Runs the post installation methods as defined in the post installation config
populate_account
Calls the populate account method on the user model
read_secure
Reads a key file from the secure directory and prints it to STDOUT
restart_server
Restarts the web server
roles
Returns the identity roles object
roles_update
Calls the roles update method on the user model
run
Modifies the parent method to reject unauthorized calls
set_owner
Set the ownership of the installed files and directories
set_password
Calls "update_password" with a true parameter
set_permissions
Set the permissions on the installed files and directories
set_user
Execs an interactive shell as another user
signal_process
Calls the signal process as root method in the CatalystX::Usul::IPC class
tape_backup
Runs the tape backup command in the appname_cli
program
uninstall
Will uninstall the application
untaint_self
Returns an untainted reconstruction of our own invoking command line
update_account
Calls update_account
in the user model to change attributes of the user account
update_mail_aliases
Updates a mail alias via File::MailAlias
update_password
Changes a users password by calling update_password
on the user model
update_progs
Uses scp
to copy program files from the specified remote server
Private Methods
_deploy_mod_perl_server
Creates the symlinks necessary to deploy the Apache/mod_perl server
_deploy_plack_server
Create the symlink necessary to deploy the Plack server
_is_authorised
Is the user authorised to call the method
_is_setuid
Is the program running suid
Diagnostics
None
Dependencies
- CatalystX::Usul::TraitFor::PostInstallConfig
- Class::Null
- Class::Usul::Programs
- CatalystX::Usul::Moose
- CatalystX::Usul::Constraints
- IO::Interactive
- 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