From 979385cd0fd20957d552e64edc07ea2fa0edc0fc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 12 Mar 2015 10:43:57 +0100 Subject: [PATCH] selftest: fix the basedn for local accounts in non-DC environments e.g. s4member open(LDIF, "|$ldbmodify -H $ctx->{privatedir}/sam.ldb"); doesn't generate an error if the command fails... 'testallowed' is a local account here, with a dn of CN=testallowed,CN=Users,DC=S4MEMBER instead of domain user CN=testallowed,CN=Users,DC=samba,DC=example,DC=com Signed-off-by: Stefan Metzmacher Reviewed-by: Michael Adam Reviewed-by: Guenther Deschner --- selftest/target/Samba4.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index b2417b8887e..28462f92e06 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -825,6 +825,11 @@ sub provision_raw_step2($$$) my $ldbmodify = Samba::bindir_path($self, "ldbmodify"); my $base_dn = "DC=".join(",DC=", split(/\./, $ctx->{realm})); + + if ($ctx->{server_role} ne "domain controller") { + $base_dn = "DC=$ctx->{netbiosname}"; + } + my $user_dn = "cn=testallowed,cn=users,$base_dn"; open(LDIF, "|$ldbmodify -H $ctx->{privatedir}/sam.ldb"); print LDIF "dn: $user_dn