Bug 430987

Summary: smbldap_util.c -> add_new_domain_info doesn't add to the correct suffix
Product: Red Hat Enterprise Linux 4 Reporter: Noam Meltzer <tsnoam>
Component: sambaAssignee: Samba Maint Team <samba-bugs-list>
Status: CLOSED WONTFIX QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: 4.6.zCC: jplans
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-31 12:05:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Noam Meltzer 2008-01-30 22:41:14 UTC
When trying to register a new samba server with a LDAP directory (happens
automatically on startup of smbd) it tries to add the new host directly to the
directory suffix instead of to the machine suffix.

I first encountered this bug in RHEL4.5.
I downloaded and checked for the same bug in samba-3.0.25b-1.el4_6.4 as well.
Bug exists also in the latest (vanila) samba-3.0.28.

Comment 1 Simo Sorce 2008-01-30 22:56:55 UTC
Are referring to the sambaDomain object ?
Can you provide logs, ldifs or any other indication of the problem?

Comment 2 Noam Meltzer 2008-01-31 06:28:51 UTC
I'm referring to the "sambaDomainName" object.

Following is a LDIF of the object created by smbd *after* my patch.
Before my patch smbd tried to create the object directly under dc=test (and not
under ou=SambaHosts,dc=test)

dn: sambaDomainName=RHEL4-U4-ES,ou=SambaHosts,dc=test
sambaDomainName: RHEL4-U4-ES
sambaSID: S-1-5-21-1884737327-3722201558-1353666255
sambaAlgorithmicRidBase: 1000
objectClass: sambaDomain
sambaNextUserRid: 1000

My smbd.conf configuration looks like this:

        workgroup = MYGROUP
        server string = Samba Server
        passdb backend = ldapsam:"ldap://"
        log file = /var/log/samba/%m.log
        max log size = 50
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        printcap name = /etc/printcap
        dns proxy = No
        ldap admin dn = cn=root,dc=test
        ldap machine suffix = ou=SambaHosts
        ldap suffix = dc=test
        ldap user suffix = ou=People
        idmap uid = 16777216-33554431
        idmap gid = 16777216-33554431
        cups options = raw

        comment = Home Directories
        read only = No
        browseable = No

Comment 3 Guenther Deschner 2008-01-31 12:05:11 UTC
For various technical reasons, that LDAP object needs to exist at the top-level
suffix you defined via "ldap suffix". 

As already pointed out at https://bugzilla.samba.org/show_bug.cgi?id=5233 we
can't easily change this. Sorry.