LCFG::Utils::GroupFile::Entry - Unix group file entry
This documentation refers to LCFG::Utils::GroupFile::Entry version 1.2.1
use LCFG::Utils::GroupFile::Entry;
my $entry = LCFG::Utils::GroupFile::Entry->new_from_string(
"root:x:0:0:root:/root:/bin/bash");
$entry->shell("/bin/sh");
print $entry->to_string;
This module provides an object-oriented representation of an entry in the Unix group file. It can parse the traditional, colon-delimited, Unix group file entry format. Fields can be updated and entirely new entries can also be created.
The primary purpose of this module is to be used with the LCFG::Utils::GroupFile class.
This field represents the group name. This is a read-only field, it cannot be altered.
This field represents the group ID (GID). This is a read-only field, it cannot be altered.
This is the password field for the group. Note that this module does not support encrypting the password for you, that needs to be done separately.
This is the members field for the group. It is a comma-separated list.
This creates a new, empty, LCFG::Utils::GroupFile::Entry object.
This method parses the string which contains a Unix group file entry in the standard colon-separated format. The fields are then used to create a new LCFG::Utils::GroupFile::Entry object.
This method will die if too many or too few fields are found in the string.
This will take the stored values for the various fields (see above for details) and return a string in the standard colon-separated format. Any fields which have not been defined will be left empty.
This compares an object to another and returns a boolean which represents whether or not the contents of the two objects are identical.
This compares an object to another and returns a boolean which represents whether or not the contents of the two objects are compatible. The definition of compatible is that the two objects have the same GID and group name (all other fields are allowed to be different).
This method can be used to sort entries, it returns the standard values -1, 0, or 1 to signify which entry should come first. The order is based on numerically sorting on GID and then, if necessary, alphabetically sorting on group name.
This module requires Class::Accessor, List::MoreUtils, and Readonly.
LCFG::Utils::GroupFile, LCFG::Utils::PasswdFile, LCFG::Utils::PasswdFile::Entry, LCFG::Component::Auth
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.
Scientific5, Scientific6, Fedora13
Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.
Alastair Scobie <ascobie@inf.ed.ac.uk>, Stephen Quinney <squinney@inf.ed.ac.uk>
Copyright (C) 2011 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.