NAME

LCFG::Utils::GroupFile::Entry - Unix group file entry

VERSION

This documentation refers to LCFG::Utils::GroupFile::Entry version 1.2.1

SYNOPSIS

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;

DESCRIPTION

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.

ATTRIBUTES

name

This field represents the group name. This is a read-only field, it cannot be altered.

gid

This field represents the group ID (GID). This is a read-only field, it cannot be altered.

passwd

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.

members

This is the members field for the group. It is a comma-separated list.

SUBROUTINES/METHODS

Class Methods

new

This creates a new, empty, LCFG::Utils::GroupFile::Entry object.

new_from_string($entry)

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.

Instance Methods

to_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.

equals($other)

This compares an object to another and returns a boolean which represents whether or not the contents of the two objects are identical.

compatible($other)

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).

compare_to($other)

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.

DEPENDENCIES

This module requires Class::Accessor, List::MoreUtils, and Readonly.

SEE ALSO

LCFG::Utils::GroupFile, LCFG::Utils::PasswdFile, LCFG::Utils::PasswdFile::Entry, LCFG::Component::Auth

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.

Scientific5, Scientific6, Fedora13

BUGS AND LIMITATIONS

Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.

AUTHOR

Alastair Scobie <ascobie@inf.ed.ac.uk>, Stephen Quinney <squinney@inf.ed.ac.uk>

LICENSE AND COPYRIGHT

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.