View | Details | Raw Unified | Return to bug 27027 | Differences between
and this patch

Collapse All | Expand All

(-)samba4-4.0.0~alpha17~git201110100928.orig/source4/scripting/python/samba/join.py (-4 / +4 lines)
 Lines 212-221    Link Here 
212
                               attrs=["msDS-krbTgtLink", "userAccountControl", "serverReferenceBL", "rIDSetReferences"])
212
                               attrs=["msDS-krbTgtLink", "userAccountControl", "serverReferenceBL", "rIDSetReferences"])
213
        if len(res) == 0:
213
        if len(res) == 0:
214
            raise Exception("Could not find domain member account '%s' to promote to a DC, use 'samba-tool domain join' instead'" % ctx.samname)
214
            raise Exception("Could not find domain member account '%s' to promote to a DC, use 'samba-tool domain join' instead'" % ctx.samname)
215
        if "msDS-krbTgtLink" in res[0] or "serverReferenceBL" in res[0] or "rIDSetReferences" in res[0]:
215
        # if "msDS-krbTgtLink" in res[0] or "serverReferenceBL" in res[0] or "rIDSetReferences" in res[0]:
216
            raise Exception("Account '%s' appears to be an active DC, use 'samba-tool domain join' if you must re-create this account" % ctx.samname)
216
        #     raise Exception("Account '%s' appears to be an active DC, use 'samba-tool domain join' if you must re-create this account" % ctx.samname)
217
        if (int(res[0]["userAccountControl"][0]) & (samba.dsdb.UF_WORKSTATION_TRUST_ACCOUNT|samba.dsdb.UF_SERVER_TRUST_ACCOUNT) == 0):
217
        # if (int(res[0]["userAccountControl"][0]) & (samba.dsdb.UF_WORKSTATION_TRUST_ACCOUNT|samba.dsdb.UF_SERVER_TRUST_ACCOUNT) == 0):
218
            raise Exception("Account %s is not a domain member or a bare NT4 BDC, use 'samba-tool domain join' instead'" % ctx.samname)
218
        #     raise Exception("Account %s is not a domain member or a bare NT4 BDC, use 'samba-tool domain join' instead'" % ctx.samname)
219
        
219
        
220
        ctx.promote_from_dn = res[0].dn
220
        ctx.promote_from_dn = res[0].dn
221
221
(-)samba4-4.0.0~alpha17~git201110100928.orig/source4/scripting/python/samba/netcmd/domain.py (-2 / +5 lines)
 Lines 155-160    Link Here 
155
        Option("--domain-critical-only",
155
        Option("--domain-critical-only",
156
               help="only replicate critical domain objects",
156
               help="only replicate critical domain objects",
157
               action="store_true"),
157
               action="store_true"),
158
        Option("--promote-existing",
159
               help="keep the SID during join",
160
               action="store_true"),
158
        Option("--machinepass", type=str, metavar="PASSWORD",
161
        Option("--machinepass", type=str, metavar="PASSWORD",
159
               help="choose machine password (otherwise random)")
162
               help="choose machine password (otherwise random)")
160
        ]
163
        ]
 Lines 188-200    Link Here 
188
            join_DC(server=server, creds=creds, lp=lp, domain=domain,
191
            join_DC(server=server, creds=creds, lp=lp, domain=domain,
189
                    site=site, netbios_name=netbios_name, targetdir=targetdir,
192
                    site=site, netbios_name=netbios_name, targetdir=targetdir,
190
                    domain_critical_only=domain_critical_only,
193
                    domain_critical_only=domain_critical_only,
191
                    machinepass=machinepass)
194
                    machinepass=machinepass, promote_existing=True)
192
            return
195
            return
193
        elif role == "RODC":
196
        elif role == "RODC":
194
            join_RODC(server=server, creds=creds, lp=lp, domain=domain,
197
            join_RODC(server=server, creds=creds, lp=lp, domain=domain,
195
                      site=site, netbios_name=netbios_name, targetdir=targetdir,
198
                      site=site, netbios_name=netbios_name, targetdir=targetdir,
196
                      domain_critical_only=domain_critical_only,
199
                      domain_critical_only=domain_critical_only,
197
                      machinepass=machinepass)
200
                      machinepass=machinepass, promote_existing=True)
198
            return
201
            return
199
        elif role == "SUBDOMAIN":
202
        elif role == "SUBDOMAIN":
200
            netbios_domain = lp.get("workgroup")
203
            netbios_domain = lp.get("workgroup")

Return to bug 27027