
Plugtools::Plugins::Samba - Provides various methods used by the plugins in this.

Version 0.1.1

This module provides a collection of methods used by the Samba plugins for Plugtools.
use Plugtools::Plugins::Samba;
use Plugtools;
my $pt=Plugtools->new;
my $ldap=$pt->connect;
my $pts = Plugtools::Plugins::Samba->new({
pt=>$pt,
ldap=>$ldap
});
...

This initiates it.
This is a Plugtools object that has been successfully initiated.
This is the LDAP connection to use.
my $pts = Plugtools::Plugins::Samba->new({
pt=>$pt,
ldap=>$ldap
});
if($pts->{error}){
print "Error!\n";
}
This check if all the basic stuff is present for it to be useful in regards to Samba. This checks to make sure the objectclass 'sambaSamAccount' and the attributes 'sambaSID' and 'sambaPrimaryGroupSID' are present.
This is the LDAP entry that will be used.
my $returned=$pts->isSambaAccountEntry({entry=>$entry});
if($pts->{error}){
print "Error!\n";
}else{
if($returned){
print "It is!\n";
}
}
If a entry is not already a Samba account, make it one.
If it already is, it will error.
This will not update the entry that is passed to it. That will need to be done upon this returning with out any errors being set.
This is the Net::LDAP::Entry object to work on.
This is the SID to use for the entry.
This is the primary group SID to use.
$pts->makeSambaAccountEntry({ entry=>$entry });
if($pts->{error}){
print "Error!\n";
}
$pts->makeSambaAccountEntry({
entry=>$entry,
sid=>$sid,
pgsid=>$pgsid,
});
if($pts->{error}){
print "Error!\n";
}
Remove the samba stuff from a user.
This is a Net::LDAP::Entry to remove attributes related to sambaSamAccount from.
This sets the password for a Samba account.
This is the Net::LDAP::Entry object to work on.
This is the password to set.
$pts->setPassEntry({
entry=>$entry,
pass=>'somepass',
});
if($pts->{error}){
print "Error!\n";
}
This is the Net::LDAP::Entry object to work on.
This is a internal function and should not be called.

No Plugtools object given.
No LDAP connection specified.
No entry given.
No value for 'sid' defined in the section 'samba' of the config file.
Samba::SIDhelper errored.
The LDAP entry lacks a uidNumber attribute.
Already a samba a account.
The LDAP entry lacks a gidNumber attribute.
No password specified.
The LDAP entry is not a samba account.
The entry lacks a uidNumber attribute.
The entry lacks a uidNumber attribute.

Only one additional setting is needed. That is 'sid' setup in the secion 'samba'.
The SID can be gotten by running 'net getlocalsid'.
pluginUserSetPass=Plugtools::Plugins::Samba::setPass
pluginUserGIDchange=Plugtools::Plugins::Samba::SIDupdate
pluginUserUIDchange=Plugtools::Plugins::Samba::SIDupdate
pluginAddUser=Plugtools::Plugins::Samba::makeSambaAccount
[samba]
sid=S-1-5-21-1234-5678-91011

Zane C. Bowers, <vvelox at vvelox.net>

Please report any bugs or feature requests to bug-plugtools-plugins-samba at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Plugtools-Plugins-Samba. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.
perldoc Plugtools::Plugins::Samba
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Plugtools-Plugins-Samba


Copyright 2009 Zane C. Bowers, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.