Sys::Config::Manage::Ownership - Handles file user/group ownership for files in the configuration directory.
Version 0.0.0
This initiates the object.
One argument is required and it is a hash reference.
This is a initiated Sys::Config::Manage object.
This is the default user ID for a file.
If not specified, the default is '0'.
This is the default group ID for a file.
$foo=Sys::Config::Manage::Ownership->new(\%args); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This syncs the group/user ownership down from the configuration directory to the system.
Two arguments can be used.
The first is the configuration directory. If not specified, it will be automaticallly choosen.
The second is the files to sync. If not specifiedm, all files will be synced.
#sync the specified files $foo->downSync( $configDir, \@files); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); } #syncs all the files $foo->downSync( $configDir ); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This retrieves the GID for a file.
Two arguments are taken.The first is the configuration directory, which if not defined is automatically chosen. The second is the file in question.
my $gid=$foo->getGID( $configDir, $file ); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This retrieves the UID for a file.
my $UID=$foo->getUID( $configDir, $file ); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This lists the various config files that are being tracked that actually have a value specified.
Not all files returned by Sys::Config::Manage->listConfigFiles will have a value specified.
my @files=$foo->listConfigFiles; if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the GID for a file. This does require the numeric value.
Three arguments are taken.
The first one is the configuration directory to use. If none is specified, it will automatically be choosen.
The second is the config file to add the perms for.
The third numeric value for the GID.
$foo->setGID($configDir, $file, $gid); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the UID for a file. This does require the numeric value.
The third numeric value for the UID.
$foo->setUID($configDir, $file, $uid); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the GID for a file, from a already existing file.
$foo->setUIDfromFile($configDir, $file); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
This sets the UID for a file, from a already existing file.
This syncs the file user/group up from the file system to configuration directory.
The second is the files to sync. If not specified, all files will be synced.
#sync the specified files $foo->upSync( $configDir, \@files); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); } #syncs all the files $foo->upSync( $configDir ); if($foo->error){ warn('error:'.$foo->error.': '.$foo->errorString); }
Nothing passed for the Sys::Config::Manage object.
$args{scm} is not a Sys::Config::Manage object.
Invalid configuration directory name.
The configuration directory does not exist.
Sys::Config::Manage->selectConfigDir errored.
Sys::Config::Manage->validConfigDirName errored.
No filename specified.
The specified file does not exist under the configuration directory.
The specified file does not exist on the file system.
The file specified file is under the base directory.
No value for the permissions specified.
The value specified for the [UG]ID does not appear to be valid.
Validity is checked via the regexp below.
/^[0123456789]*$/
The ".SysConfigManage" directory does not exist and could not be created.
The ".SysConfigManage/UID" directory does not exist and could not be created.
Unable to opens the [GU]ID file.
The add command failed.
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-sys-config-manage-perms at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sys-Config-Manage-Ownership. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-sys-config-manage-perms at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Sys::Config::Manage::Ownership
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Sys-Config-Manage
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Sys-Config-Manage
CPAN Ratings
http://cpanratings.perl.org/d/Sys-Config-Manage
Search CPAN
http://search.cpan.org/dist/Sys-Config-Manage/
Copyright 2011 Zane C. Bowers-Hadley.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Sys::Config::Manage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sys::Config::Manage
CPAN shell
perl -MCPAN -e shell install Sys::Config::Manage
For more information on module installation, please visit the detailed CPAN module installation guide.