The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Passwd::Samba

SYNOPSIS

        use Passwd::Samba;
        
        my $ps = Passwd::Samba->new();
        my $err = $ps->passwd("example", "_plain_text_secret_" );
        foreach my $user ($ps->users) {
                print "Username: $user\nUID: ", $ps->uid($user), "\n\n";
        }
        my $uid = $ps->uid('example');
        $ps->rename('example', 'new_example');
        $pu->del('new_example');

        # or 

        use Passwd::Samba qw(del uid maxuid passwd rename users);

        my $err = passwd("example", "_plain_text_secret_" );
        foreach my $user (users()) {
                print "Username: $user\nUID: ", uid($user), "\n\n";
        }
        my $uid = uid('example');
        rename('example', 'new_example');
        del('new_example');

DESCRIPTION

The Passwd::Samba module provides an abstract interface to /etc/samba/smbpasswd format files. It is inspired by Unix::PasswdFile module.

SUBROUTINES/METHODS

new( )

Constructor.

del( USERNAME0, USERNAME1... )

This method will delete the list of users. It has no effect if the supplied user does not exist.

maxuid( )

This method returns the maximum UID in use by all users.

passwd( USERNAME, PASSWD )

Modify a user's password. Returns the result of operation (TRUE or FALSE).

rename( OLDNAME, NEWNAME )

This method changes the username for a user. If NEWNAME corresponds to an existing user, that user will be overwritten. It returns FALSE on failure and TRUE on success.

uid( USERNAME [,UID] )

Read or modify a user's UID. Returns the result of operation (TRUE or FALSE) if UID was specified otherwhise returns the UID.

user()

This alias for passwd. User is created if doesn't exists.

users()

This method returns a list of all existing usernames.

DEPENDENCIES

Crypt::SmbHash
Exporter

INCOMPATIBILITIES

None known.

BUGS AND LIMITATIONS

None known.

AUTHOR

Strzelecki Łukasz <strzelec@rswsystems.com>

LICENCE AND COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://www.perl.com/perl/misc/Artistic.html

1 POD Error

The following errors were encountered while parsing the POD:

Around line 222:

Non-ASCII character seen before =encoding in 'Łukasz'. Assuming UTF-8