BuzzSaw
view release on metacpan or search on metacpan
lib/BuzzSaw/UserClassifier.pm view on Meta::CPAN
This method returns a boolean which states whether (or not) the
username looks like C<root>. This is done using a case-insensitive
match on the string C<root> and allows either or both of the C<o>
characters to be replaced with a C<0> (zero).
=item is_nonpersonal($username)
This method returns a boolean which states whether (or not) the
username is a non-personal account. If the username matches the
C<is_person> or C<looks_like_person> methods then this method returns
false. Otherwise, if the username exists in the local passwd database
then it will return true. As a final check when nothing else matches
the hash of non-personal account names will be checked. This hash
lookup is particularly useful for known daemon and team names which
are not in the passwd DB for the machine on which the checks are being
run.
=item mangle_username($username)
This method is used to clean and canonicalise the username. It will
lowercase the whole string and strip some undesirable characters. It
also makes an attempt to canonicalise certain common forms of
usernames. For example, any string starting with C<admin> will result
in C<admin> being returned (C<admin1> becomes C<admin>,
C<administrator> becomes C<admin>, etc).
=item classify($username)
This uses the previously described methods to classify the specified
username. If it matches the C<is_root> method then the string C<root>
will be returned. If it matches either of the C<is_person> or
C<looks_like_person> methods then the string C<real> will be
returned. If it matches the C<is_nonpersonal> method then the string
C<nonperson> will be returned. Finally, if nothing matches then the
string C<others> will be returned.
=item in_nonpersonal_users($username)
This method returns a boolean which states whether (or not) the
specified username exists in the non-personal users hash.
=back
=head1 DEPENDENCIES
This module is powered by L<Moose>. You will also need
L<MooseX::Types> and L<MooseX::Log::Log4perl>.
=head1 SEE ALSO
L<BuzzSaw>
=head1 PLATFORMS
This is the list of platforms on which we have tested this
software. We expect this software to work on any Unix-like platform
which is supported by Perl.
ScientificLinux6
=head1 BUGS AND LIMITATIONS
Please report any bugs or problems (or praise!) to bugs@lcfg.org,
feedback and patches are also always very welcome.
=head1 AUTHOR
Stephen Quinney <squinney@inf.ed.ac.uk>
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2013 University of Edinburgh. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the terms of the GPL, version 2 or later.
=cut
( run in 0.496 second using v1.01-cache-2.11-cpan-39bf76dae61 )