Bug 14058 - samba-tool create ou does not work with Active Directory
Summary: samba-tool create ou does not work with Active Directory
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.10.4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-29 07:04 UTC by Amit Kumar
Modified: 2019-08-12 06:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Kumar 2019-07-29 07:04:21 UTC
1. Joined system to AD (DC=atest,DC=com)

# /usr/local/samba/bin/net ads join -U Administrator 
Enter Administrator's password:

Using short domain name -- ATEST
Joined 'NETBIOS' to dns domain 'atest.com'
# 

2. Cannot create OU at path:
# /usr/local/samba/bin/samba-tool ou create 'OU=del-ou,DC=atest,DC=com'
ERROR: Invalid ou_dn "OU=del-ou,DC=atest,DC=com": unable to parse dn string
  File "/usr/local/samba/lib64/python3.6/site-packages/samba/netcmd/ou.py", line 204, in run
    full_ou_dn = samdb.normalize_dn_in_domain(ou_dn)
  File "/usr/local/samba/lib64/python3.6/site-packages/samba/samdb.py", line 1132, in normalize_dn_in_domain
    domain_dn = ldb.Dn(self, self.domain_dn())

3. At looking in the code, domain_dn() returns None.
url is correct url=tdb:///usr/local/samba/private/sam.ldb

-> called using ldb object.
    def domain_dn(self):
        '''return the domain DN'''
        return str(self.get_default_basedn())
Comment 1 Amit Kumar 2019-08-12 06:30:49 UTC
On samba-4.10.6-0.fc30.x86_64

Created using 
# samba-tool ou create "OU=del-ou,dc=atest,dc=com" -H 'ldap://DC_SHORT_HOSTNAME' --simple-bind-dn 'CN=Administrator,CN=Users,DC=atest,DC=com' --password <>