From b23d005cdc646e02af3c38852f75e4505070768e Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Thu, 30 May 2019 14:55:52 +1200 Subject: selftest: Don't use global dirs when parsing customdc realm When creating the customdc, testparm would default to using /usr/local/samba sub-directories for creating sockets and lock files. Instead, pass in the tmpdir we just created as an option to the command. Normally this didn't cause a noticeable problem, however, if we run the command with UID-wrapper but without socket-wrapper (i.e. USE_NAMESPACES=1), then it fails completely. Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Fri May 31 06:34:36 UTC 2019 on sn-devel-184 --- selftest/target/Samba4.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'selftest') diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index d647a5c29a0..c661a109e64 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -3280,10 +3280,15 @@ sub get_backup_domain_realm return undef, undef; } + # make sure we don't try to create locks/sockets in the default install + # location (i.e. /usr/local/samba/) + my $options = "--option=\"private dir = $tmpdir\""; + $options .= " --option=\"lock dir = $tmpdir\""; + # now use testparm to read the values we're interested in my $testparm = Samba::bindir_path($self, "testparm"); - my $domain = `$testparm $smbconf -sl --parameter-name=WORKGROUP`; - my $realm = `$testparm $smbconf -sl --parameter-name=REALM`; + my $domain = `$testparm $smbconf -sl --parameter-name=WORKGROUP $options`; + my $realm = `$testparm $smbconf -sl --parameter-name=REALM $options`; chomp $realm; chomp $domain; print "Backup-file REALM is $realm, DOMAIN is $domain\n"; -- cgit v1.2.1