[Samba] Problems using smbldaptools
Jason Williams
jwilliams at courtesymortgage.com
Tue Nov 25 00:55:15 GMT 2003
Evening everyone.
Im currently having some problems using the smbldap tools to add groups,
users and such.
Im using Samba 3.0.1pre3 with OpenLDAP 2.1.22.
I have setup the required files: /etc/nsswitch.conf, /etc/ldap.conf and
/etc/samba3/smb.conf
I also configured smbldap_conf.pm as well to reflect my setup. (Quick side
note: I have two of these files: one in /etc/samba3 and the other in
/usr/share/samba3/scripts...does one have precedence over the other?)
I also added the inital LDAP tree settings. (Users, computers, etc.)
When I try to use the tools from the command line to add a group or a user,
I get the following errors:
$ smbldap-groupadd3 loanofficers
failed to add entry: modifications require authentication at
/usr/share/samba3/scripts//smbldap_tools.pm line 494, <DATA> line 283.
It complains about authentication. I also took a look at line 494:
$modify->code && die "failed to add entry: ", $modify->error ;
Here is what is above that:
# $gid = group_add($groupname, $group_gid, $force_using_existing_gid)
sub group_add
{
my ($gname, $gid, $force) = @_;
my $nscd_status = system "/etc/init.d/nscd status >/dev/null 2>&1";
if ($nscd_status == 0) {
system "/etc/init.d/nscd stop > /dev/null 2>&1";
}
if (!defined($gid)) {
while (defined(getgrgid($GID_START))) {
$GID_START++;
}
$gid = $GID_START;
} else {
if (!defined($force)) {
if (defined(getgrgid($gid))) {
return undef;
}
}
}
if ($nscd_status == 0) {
system "/etc/init.d/nscd start > /dev/null 2>&1";
}
my $ldap_master=connect_ldap_master();
my $modify = $ldap_master->add ( "cn=$gname,$groupsdn",
attrs
=> [
objectClass
=> 'posixGroup',
cn
=> "$gname",
gidNumber
=> "$gid"
]
);
$modify->code && die "failed to add entry: ", $modify->error ;
Check out this error I get when I try and add a user:
$ smbldap-useradd3 -a testuser
Can't call method "get_value" on an undefined value at
/usr/bin/smbldap-useradd3 line 154, <DATA> line 283.
I've been trying to find some additional documentation to help me resolve
this, but havent found anything concrete to fix this.
Anyone have any suggestions on what I did wrong, or what I missed?
I appreciate it.
Jason
More information about the samba
mailing list