sub slapd_start($$)
{
my $count = 0;
- my ($self, $env_vars) = @_;
+ my ($self, $env_vars, $STDIN_READER) = @_;
my $ldbsearch = Samba::bindir_path($self, "ldbsearch");
my $uri = $env_vars->{LDAP_URI};
}
# running slapd in the background means it stays in the same process group, so it can be
# killed by timelimit
- if ($self->{ldap} eq "fedora-ds") {
- system("$ENV{FEDORA_DS_ROOT}/sbin/ns-slapd -D $env_vars->{FEDORA_DS_DIR} -d0 -i $env_vars->{FEDORA_DS_PIDFILE}> $env_vars->{LDAPDIR}/logs 2>&1 &");
- } elsif ($self->{ldap} eq "openldap") {
- system("$ENV{OPENLDAP_SLAPD} -d0 -F $env_vars->{SLAPD_CONF_D} -h $uri > $env_vars->{LDAPDIR}/logs 2>&1 &");
+ my $pid = fork();
+ if ($pid == 0) {
+ open STDOUT, ">$env_vars->{LDAPDIR}/logs";
+ open STDERR, '>&STDOUT';
+ close($env_vars->{STDIN_PIPE});
+ open STDIN, ">&", $STDIN_READER or die "can't dup STDIN_READER to STDIN: $!";
+
+ if ($self->{ldap} eq "fedora-ds") {
+ exec("$ENV{FEDORA_DS_ROOT}/sbin/ns-slapd", "-D", $env_vars->{FEDORA_DS_DIR}, "-d0", "-i", $env_vars->{FEDORA_DS_PIDFILE});
+ } elsif ($self->{ldap} eq "openldap") {
+ exec($ENV{OPENLDAP_SLAPD}, "-dnone", "-F", $env_vars->{SLAPD_CONF_D}, "-h", $uri);
+ }
+ die("Unable to start slapd: $!");
}
+ $env_vars->{SLAPD_PID} = $pid;
+ sleep(1);
while (system("$ldbsearch -H $uri -s base -b \"\" supportedLDAPVersion > /dev/null") != 0) {
$count++;
if ($count > 40) {
sub slapd_stop($$)
{
my ($self, $envvars) = @_;
- if ($self->{ldap} eq "fedora-ds") {
- system("$envvars->{LDAPDIR}/slapd-$envvars->{LDAP_INSTANCE}/stop-slapd");
- } elsif ($self->{ldap} eq "openldap") {
- unless (open(IN, "<$envvars->{OPENLDAP_PIDFILE}")) {
- warn("unable to open slapd pid file: $envvars->{OPENLDAP_PIDFILE}");
- return 0;
- }
- kill 9, <IN>;
- close(IN);
- }
+ kill 9, $envvars->{SLAPD_PID};
return 1;
}
sub check_or_start($$$)
{
my ($self, $env_vars, $process_model) = @_;
+ my $STDIN_READER;
return 0 if $self->check_env($env_vars);
# use a pipe for stdin in the child processes. This allows
# those processes to monitor the pipe for EOF to ensure they
# exit when the test script exits
- pipe(STDIN_READER, $env_vars->{STDIN_PIPE});
+ pipe($STDIN_READER, $env_vars->{STDIN_PIPE});
+
+ # Start slapd before samba, but with the fifo on stdin
+ if (defined($self->{ldap})) {
+ unless($self->slapd_start($env_vars, $STDIN_READER)) {
+ warn("couldn't start slapd (main run)");
+ return undef;
+ }
+ }
print "STARTING SAMBA...";
my $pid = fork();
SocketWrapper::set_default_iface($env_vars->{SOCKET_WRAPPER_DEFAULT_IFACE});
$ENV{KRB5_CONFIG} = $env_vars->{KRB5_CONFIG};
- $ENV{WINBINDD_SOCKET_DIR} = $env_vars->{WINBINDD_SOCKET_DIR};
+ $ENV{SELFTEST_WINBINDD_SOCKET_DIR} = $env_vars->{SELFTEST_WINBINDD_SOCKET_DIR};
$ENV{NMBD_SOCKET_DIR} = $env_vars->{NMBD_SOCKET_DIR};
$ENV{NSS_WRAPPER_PASSWD} = $env_vars->{NSS_WRAPPER_PASSWD};
$ENV{NSS_WRAPPER_GROUP} = $env_vars->{NSS_WRAPPER_GROUP};
- $ENV{NSS_WRAPPER_WINBIND_SO_PATH} = $env_vars->{NSS_WRAPPER_WINBIND_SO_PATH};
+ $ENV{NSS_WRAPPER_HOSTS} = $env_vars->{NSS_WRAPPER_HOSTS};
+ $ENV{NSS_WRAPPER_MODULE_SO_PATH} = $env_vars->{NSS_WRAPPER_MODULE_SO_PATH};
+ $ENV{NSS_WRAPPER_MODULE_FN_PREFIX} = $env_vars->{NSS_WRAPPER_MODULE_FN_PREFIX};
$ENV{UID_WRAPPER} = "1";
}
close($env_vars->{STDIN_PIPE});
- open STDIN, ">&", \*STDIN_READER or die "can't dup STDIN_READER to STDIN: $!";
+ open STDIN, ">&", $STDIN_READER or die "can't dup STDIN_READER to STDIN: $!";
exec(@preargs, Samba::bindir_path($self, "samba"), "-M", $process_model, "-i", "--maximum-runtime=$self->{server_maxtime}", $env_vars->{CONFIGURATION}, @optargs) or die("Unable to start samba: $!");
}
$env_vars->{SAMBA_PID} = $pid;
print "DONE\n";
- close(STDIN_READER);
+ close($STDIN_READER);
return $pid;
}
sub wait_for_start($$)
{
my ($self, $testenv_vars) = @_;
+ my $ret;
# give time for nbt server to register its names
print "delaying for nbt name registration\n";
sleep 2;
system("$nmblookup $testenv_vars->{CONFIGURATION} $testenv_vars->{NETBIOSNAME}");
system("$nmblookup $testenv_vars->{CONFIGURATION} -U $testenv_vars->{SERVER_IP} $testenv_vars->{NETBIOSNAME}");
+ # Ensure we have the first RID Set before we start tests. This makes the tests more reliable.
+ if ($testenv_vars->{SERVER_ROLE} eq "domain controller" and not ($testenv_vars->{NETBIOS_NAME} eq "rodc")) {
+ # Add hosts file for name lookups
+ $ENV{NSS_WRAPPER_HOSTS} = $testenv_vars->{NSS_WRAPPER_HOSTS};
+
+ print "waiting for working LDAP and a RID Set to be allocated\n";
+ my $ldbsearch = Samba::bindir_path($self, "ldbsearch");
+ my $count = 0;
+ my $base_dn = "DC=".join(",DC=", split(/\./, $testenv_vars->{REALM}));
+ my $rid_set_dn = "cn=RID Set,cn=$testenv_vars->{NETBIOSNAME},ou=domain controllers,$base_dn";
+ sleep(1);
+ while (system("$ldbsearch -H ldap://$testenv_vars->{SERVER} -U$testenv_vars->{USERNAME}%$testenv_vars->{PASSWORD} -s base -b \"$rid_set_dn\" rIDAllocationPool > /dev/null") != 0) {
+ $count++;
+ if ($count > 40) {
+ $ret = 1;
+ last;
+ }
+ sleep(1);
+ }
+ }
print $self->getlog_env($testenv_vars);
+
+ return $ret
}
sub write_ldb_file($$$)
my $admincertfile = "$tlsdir/admincert.pem";
my $admincertupnfile = "$tlsdir/admincertupn.pem";
- mkdir($tlsdir, 0777);
+ mkdir($tlsdir, 0700);
+ my $oldumask = umask;
+ umask 0077;
#This is specified here to avoid draining entropy on every run
open(DHFILE, ">$dhfile");
Wfz/8alZ5aMezCQzXJyIaJsCLeKABosSwHcpAFmxlQ==
-----END CERTIFICATE-----
EOF
+
+ umask $oldumask;
}
sub provision_raw_prepare($$$$$$$$$$)
{
my ($self, $prefix, $server_role, $hostname,
$domain, $realm, $functional_level,
- $password, $kdc_ipv4, $use_ntvfs) = @_;
+ $password, $kdc_ipv4) = @_;
my $ctx;
my $netbiosname = uc($hostname);
chomp $unix_name;
$ctx->{unix_name} = $unix_name;
$ctx->{unix_uid} = $>;
+ my @mygid = split(" ", $();
+ $ctx->{unix_gid} = $mygid[0];
$ctx->{unix_gids_str} = $);
@{$ctx->{unix_gids}} = split(" ", $ctx->{unix_gids_str});
$ctx->{ntp_signd_socket_dir} = "$prefix_abs/ntp_signd_socket";
$ctx->{nsswrap_passwd} = "$ctx->{etcdir}/passwd";
$ctx->{nsswrap_group} = "$ctx->{etcdir}/group";
+ $ctx->{nsswrap_hosts} = "$ENV{SELFTEST_PREFIX}/hosts";
$ctx->{tlsdir} = "$ctx->{privatedir}/tls";
my @provision_options = ();
push (@provision_options, "NSS_WRAPPER_PASSWD=\"$ctx->{nsswrap_passwd}\"");
push (@provision_options, "NSS_WRAPPER_GROUP=\"$ctx->{nsswrap_group}\"");
+ push (@provision_options, "NSS_WRAPPER_HOSTS=\"$ctx->{nsswrap_hosts}\"");
if (defined($ENV{GDB_PROVISION})) {
push (@provision_options, "gdb --args");
if (!defined($ENV{PYTHON})) {
if (defined($ENV{PYTHON})) {
push (@provision_options, $ENV{PYTHON});
}
- push (@provision_options, "$self->{srcdir}/source4/setup/provision");
+ push (@provision_options, Samba::bindir_path($self, "samba-tool"));
+ push (@provision_options, "domain");
+ push (@provision_options, "provision");
push (@provision_options, "--configfile=$ctx->{smb_conf}");
push (@provision_options, "--host-name=$ctx->{hostname}");
push (@provision_options, "--host-ip=$ctx->{ipv4}");
push (@provision_options, "--root=$ctx->{unix_name}");
push (@provision_options, "--server-role=\"$ctx->{server_role}\"");
push (@provision_options, "--function-level=\"$ctx->{functional_level}\"");
- push (@provision_options, "--dns-backend=BIND9_DLZ");
-
- if ($use_ntvfs) {
- push (@provision_options, "--use-ntvfs");
- }
@{$ctx->{provision_options}} = @provision_options;
mkdir($_, 0777) foreach (@{$ctx->{directories}});
+ ##
+ ## lockdir and piddir must be 0755
+ ##
+ chmod 0755, $ctx->{lockdir};
+ chmod 0755, $ctx->{piddir};
+
unless (open(CONFFILE, ">$ctx->{smb_conf}")) {
warn("can't open $ctx->{smb_conf}$?");
return undef;
}
- my $acl = "false";
- $acl = "true" if (defined $ENV{WITH_ACL});
print CONFFILE "
[global]
- acl:search = $acl
netbios name = $ctx->{netbiosname}
posix:eadb = $ctx->{statedir}/eadb.tdb
workgroup = $ctx->{domain}
panic action = $RealBin/gdb_backtrace \%d
wins support = yes
server role = $ctx->{server_role}
- server services = +echo +dns +smb -s3fs
+ server services = +echo +smb -s3fs
dcerpc endpoint servers = +winreg +srvsvc
notify:inotify = false
ldb:nosync = true
dreplsrv:periodic_startup_interval = 0
dsdb:schema update allowed = yes
- passdb backend = samba4
-
vfs objects = dfs_samba4 acl_xattr fake_acls xattr_tdb streams_depot
# remove this again, when our smb2 client library
# supports signin on compound related requests
server signing = on
+
+ idmap_ldb:use rfc2307=yes
";
print CONFFILE "
open(PWD, ">$ctx->{nsswrap_passwd}");
print PWD "
root:x:0:0:root gecos:$ctx->{prefix_abs}:/bin/false
+$ctx->{unix_name}:x:$ctx->{unix_uid}:100:$ctx->{unix_name} gecos:$ctx->{prefix_abs}:/bin/false
nobody:x:65534:65533:nobody gecos:$ctx->{prefix_abs}:/bin/false
pdbtest:x:65533:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
+pdbtest2:x:65532:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
+pdbtest3:x:65531:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
+pdbtest4:x:65530:65533:pdbtest gecos:$ctx->{prefix_abs}:/bin/false
";
close(PWD);
+ my $uid_rfc2307test = 65533;
open(GRP, ">$ctx->{nsswrap_group}");
print GRP "
users:x:100:
nobody:x:65533:
nogroup:x:65534:nobody
+$ctx->{unix_name}:x:$ctx->{unix_gid}:
";
close(GRP);
+ my $gid_rfc2307test = 65532;
+
+ my $hostname = lc($ctx->{hostname});
+ open(HOSTS, ">>$ctx->{nsswrap_hosts}");
+ print HOSTS "$ctx->{ipv4} ${hostname}.samba.example.com ${hostname}
+";
+ close(HOSTS);
my $configuration = "--configfile=$ctx->{smb_conf}";
PASSWORD => $ctx->{password},
LDAPDIR => $ctx->{ldapdir},
LDAP_INSTANCE => $ctx->{ldap_instance},
- WINBINDD_SOCKET_DIR => $ctx->{winbindd_socket_dir},
+ SELFTEST_WINBINDD_SOCKET_DIR => $ctx->{winbindd_socket_dir},
NCALRPCDIR => $ctx->{ncalrpcdir},
LOCKDIR => $ctx->{lockdir},
STATEDIR => $ctx->{statedir},
SOCKET_WRAPPER_DEFAULT_IFACE => $ctx->{swiface},
NSS_WRAPPER_PASSWD => $ctx->{nsswrap_passwd},
NSS_WRAPPER_GROUP => $ctx->{nsswrap_group},
+ NSS_WRAPPER_HOSTS => $ctx->{nsswrap_hosts},
SAMBA_TEST_FIFO => "$ctx->{prefix}/samba_test.fifo",
SAMBA_TEST_LOG => "$ctx->{prefix}/samba_test.log",
SAMBA_TEST_LOG_POS => 0,
- NSS_WRAPPER_WINBIND_SO_PATH => Samba::bindir_path($self, "default/nsswitch/libnss-winbind.so"),
- LOCAL_PATH => $ctx->{share}
+ NSS_WRAPPER_MODULE_SO_PATH => Samba::nss_wrapper_winbind_so_path($self),
+ NSS_WRAPPER_MODULE_FN_PREFIX => "winbind",
+ LOCAL_PATH => $ctx->{share},
+ UID_RFC2307TEST => $uid_rfc2307test,
+ GID_RFC2307TEST => $gid_rfc2307test,
+ SERVER_ROLE => $ctx->{server_role}
};
return $ret;
{
my ($self, $prefix, $server_role, $hostname,
$domain, $realm, $functional_level,
- $password, $kdc_ipv4, $extra_smbconf_options, $extra_smbconf_shares, $use_ntvfs) = @_;
+ $password, $kdc_ipv4, $extra_smbconf_options, $extra_smbconf_shares,
+ $extra_provision_options) = @_;
my $ctx = $self->provision_raw_prepare($prefix, $server_role,
$hostname,
$domain, $realm, $functional_level,
- $password, $kdc_ipv4, $use_ntvfs);
+ $password, $kdc_ipv4);
+
+ if (defined($extra_provision_options)) {
+ push (@{$ctx->{provision_options}}, @{$extra_provision_options});
+ } else {
+ push (@{$ctx->{provision_options}}, "--use-ntvfs");
+ }
$ctx->{share} = "$ctx->{prefix_abs}/share";
push(@{$ctx->{directories}}, "$ctx->{share}");
server max protocol = SMB2
host msdfs = $msdfs
lanman auth = yes
+ allow nt4 crypto = yes
$extra_smbconf_options
[sysvol]
path = $ctx->{statedir}/sysvol
- read only = yes
+ read only = no
[netlogon]
path = $ctx->{statedir}/sysvol/$ctx->{dnsname}/scripts
"2008",
"locMEMpass3",
$dcvars->{SERVER_IP},
- "", "", 1);
+ "", "", undef);
unless ($ret) {
return undef;
}
$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} member";
$cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
- $cmd .= " --machinepass=machine$ret->{password}";
+ $cmd .= " --machinepass=machine$ret->{PASSWORD}";
unless (system($cmd) == 0) {
warn("Join failed\n$cmd");
"2008",
"locRPCproxypass4",
$dcvars->{SERVER_IP},
- $extra_smbconf_options, "", 1);
+ $extra_smbconf_options, "", undef);
unless ($ret) {
return undef;
$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} member";
$cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
- $cmd .= " --machinepass=machine$ret->{password}";
+ $cmd .= " --machinepass=machine$ret->{PASSWORD}";
unless (system($cmd) == 0) {
warn("Join failed\n$cmd");
$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$dcvars->{SOCKET_WRAPPER_DEFAULT_IFACE}\" ";
$cmd .= "KRB5_CONFIG=\"$dcvars->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool delegation for-any-protocol '$ret->{NETBIOSNAME}\$' on";
- $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD} $dcvars->{CONFIGURATION}";
+ $cmd .= " $dcvars->{CONFIGURATION}";
+ print $cmd;
unless (system($cmd) == 0) {
warn("Delegation failed\n$cmd");
$cmd .= "SOCKET_WRAPPER_DEFAULT_IFACE=\"$dcvars->{SOCKET_WRAPPER_DEFAULT_IFACE}\" ";
$cmd .= "KRB5_CONFIG=\"$dcvars->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool delegation add-service '$ret->{NETBIOSNAME}\$' cifs/$dcvars->{SERVER}";
- $cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD} $dcvars->{CONFIGURATION}";
+ $cmd .= " $dcvars->{CONFIGURATION}";
unless (system($cmd) == 0) {
warn("Delegation failed\n$cmd");
return $ret;
}
-sub provision_promoted_vampire_dc($$$)
+sub provision_promoted_dc($$$)
{
my ($self, $prefix, $dcvars) = @_;
print "PROVISIONING VAMPIRE DC...";
"samba.example.com",
"2008",
$dcvars->{PASSWORD},
- $dcvars->{SERVER_IP}, 1);
+ $dcvars->{SERVER_IP});
+
+ push (@{$ctx->{provision_options}}, "--use-ntvfs");
$ctx->{smb_conf_extra_options} = "
max xmit = 32K
$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} MEMBER --realm=$dcvars->{REALM}";
$cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
- $cmd .= " --machinepass=machine$ret->{password}";
+ $cmd .= " --machinepass=machine$ret->{PASSWORD}";
unless (system($cmd) == 0) {
warn("Join failed\n$cmd");
$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool domain dcpromo $ret->{CONFIGURATION} $dcvars->{REALM} DC --realm=$dcvars->{REALM}";
$cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD}";
- $cmd .= " --machinepass=machine$ret->{password} --use-ntvfs";
+ $cmd .= " --machinepass=machine$ret->{PASSWORD} --use-ntvfs --dns-backend=BIND9_DLZ";
unless (system($cmd) == 0) {
warn("Join failed\n$cmd");
return undef;
}
- $ret->{PROMOTED_VAMPIRE_DC_SERVER} = $ret->{SERVER};
- $ret->{PROMOTED_VAMPIRE_DC_SERVER_IP} = $ret->{SERVER_IP};
- $ret->{PROMOTED_VAMPIRE_DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
+ $ret->{PROMOTED_DC_SERVER} = $ret->{SERVER};
+ $ret->{PROMOTED_DC_SERVER_IP} = $ret->{SERVER_IP};
+ $ret->{PROMOTED_DC_NETBIOSNAME} = $ret->{NETBIOSNAME};
$ret->{DC_SERVER} = $dcvars->{DC_SERVER};
$ret->{DC_SERVER_IP} = $dcvars->{DC_SERVER_IP};
"samba.example.com",
"2008",
$dcvars->{PASSWORD},
- $dcvars->{SERVER_IP}, 1);
+ $dcvars->{SERVER_IP});
+
+ push (@{$ctx->{provision_options}}, "--use-ntvfs");
$ctx->{smb_conf_extra_options} = "
max xmit = 32K
$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $dcvars->{REALM} DC --realm=$dcvars->{REALM}";
$cmd .= " -U$dcvars->{DC_USERNAME}\%$dcvars->{DC_PASSWORD} --domain-critical-only";
- $cmd .= " --machinepass=machine$ret->{password} --use-ntvfs";
+ $cmd .= " --machinepass=machine$ret->{PASSWORD} --use-ntvfs";
unless (system($cmd) == 0) {
warn("Join failed\n$cmd");
"sub.samba.example.com",
"2008",
$dcvars->{PASSWORD},
- undef, 1);
+ undef);
+
+ push (@{$ctx->{provision_options}}, "--use-ntvfs");
$ctx->{smb_conf_extra_options} = "
max xmit = 32K
$cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
$cmd .= "$samba_tool domain join $ret->{CONFIGURATION} $ctx->{realm} subdomain ";
$cmd .= "--parent-domain=$dcvars->{REALM} -U$dcvars->{DC_USERNAME}\@$dcvars->{REALM}\%$dcvars->{DC_PASSWORD}";
- $cmd .= " --machinepass=machine$ret->{password} --use-ntvfs";
+ $cmd .= " --machinepass=machine$ret->{PASSWORD} --use-ntvfs";
unless (system($cmd) == 0) {
warn("Join failed\n$cmd");
my ($self, $prefix) = @_;
print "PROVISIONING DC...";
- my $extra_conf_options = "netbios aliases = localDC1-a
-allow dns updates = True";
+ my $extra_conf_options = "netbios aliases = localDC1-a";
my $ret = $self->provision($prefix,
"domain controller",
"localdc",
"samba.example.com",
"2008",
"locDCpass1",
- undef, $extra_conf_options, "", 1);
+ undef, $extra_conf_options, "", undef);
return undef unless(defined $ret);
unless($self->add_wins_config("$prefix/private")) {
"samba2000.example.com",
"2000",
"locDCpass5",
- undef, "", "", 1);
+ undef, "", "", undef);
unless($self->add_wins_config("$prefix/private")) {
warn("Unable to add wins configuration");
"samba2003.example.com",
"2003",
"locDCpass6",
- undef, "", "", 1);
+ undef, "allow dns updates = nonsecure and secure", "", undef);
unless($self->add_wins_config("$prefix/private")) {
warn("Unable to add wins configuration");
"samba2008R2.example.com",
"2008_R2",
"locDCpass7",
- undef, "", "", 1);
+ undef, "", "", undef);
unless ($self->add_wins_config("$prefix/private")) {
warn("Unable to add wins configuration");
"samba.example.com",
"2008",
$dcvars->{PASSWORD},
- $dcvars->{SERVER_IP}, 1);
+ $dcvars->{SERVER_IP});
unless ($ctx) {
return undef;
}
+ push (@{$ctx->{provision_options}}, "--use-ntvfs");
+
$ctx->{share} = "$ctx->{prefix_abs}/share";
push(@{$ctx->{directories}}, "$ctx->{share}");
server services = -smb +s3fs
xattr_tdb:file = $prefix_abs/statedir/xattr.tdb
+ dbwrap_tdb_mutexes:* = yes
+
kernel oplocks = no
kernel change notify = no
printing = bsd
printcap name = /dev/null
- max protocol = SMB2
+ max protocol = SMB3
read only = no
server signing = auto
queue pause command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queuepause %p
queue resume command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb queueresume %p
lpq cache time = 0
+ print notify backchannel = yes
";
copy = tmp
hide unreadable = yes
+[durable]
+ copy = tmp
+ kernel share modes = no
+ kernel oplocks = no
+ posix locking = no
+
[print\$]
copy = tmp
"domain controller",
"plugindc",
"PLUGINDOMAIN",
- "plugin.samba.example.com",
+ "plugindc.samba.example.com",
"2008",
"locDCpass1",
undef, $extra_smbconf_options,
- $extra_smbconf_shares, 0);
+ $extra_smbconf_shares, undef);
return undef unless(defined $ret);
unless($self->add_wins_config("$prefix/private")) {
my ($self, $prefix) = @_;
print "PROVISIONING CHGDCPASS...";
+ my $extra_provision_options = undef;
+ push (@{$extra_provision_options}, "--dns-backend=BIND9_DLZ");
my $ret = $self->provision($prefix,
"domain controller",
"chgdcpass",
"chgdcpassword.samba.example.com",
"2008",
"chgDCpass1",
- undef, "", "", 1);
+ undef, "", "",
+ $extra_provision_options);
return undef unless(defined $ret);
unless($self->add_wins_config("$prefix/private")) {
# Remove secrets.tdb from this environment to test that we still start up
# on systems without the new matching secrets.tdb records
- unless (unlink("$ret->{PRIVATEDIR}/secrets.tdb")) {
+ unless (unlink("$ret->{PRIVATEDIR}/secrets.tdb") || unlink("$ret->{PRIVATEDIR}/secrets.ntdb")) {
warn("Unable to remove $ret->{PRIVATEDIR}/secrets.tdb added during provision");
return undef;
}
$count++;
}
- if ($count <= 20 && kill(0, $pid) == 0) {
- return;
- }
-
- kill "TERM", $pid;
+ if ($count > 30 || kill(0, $pid)) {
+ kill "TERM", $pid;
- until ($count > 20) {
- if (Samba::cleanup_child($pid, "samba") == -1) {
- last;
+ until ($count > 40) {
+ if (Samba::cleanup_child($pid, "samba") == -1) {
+ last;
+ }
+ sleep(1);
+ $count++;
}
- sleep(1);
- $count++;
- }
-
- # If it is still around, kill it
- if ($count > 20 && kill(0, $pid) == 0) {
+ # If it is still around, kill it
warn "server process $pid took more than $count seconds to exit, killing\n";
kill 9, $pid;
}
$self->setup_dc("$path/dc");
}
return $self->setup_vampire_dc("$path/vampire_dc", $self->{vars}->{dc});
- } elsif ($envname eq "promoted_vampire_dc") {
+ } elsif ($envname eq "promoted_dc") {
if (not defined($self->{vars}->{dc})) {
$self->setup_dc("$path/dc");
}
- return $self->setup_promoted_vampire_dc("$path/promoted_vampire_dc", $self->{vars}->{dc});
+ return $self->setup_promoted_dc("$path/promoted_dc", $self->{vars}->{dc});
} elsif ($envname eq "subdom_dc") {
if (not defined($self->{vars}->{dc})) {
$self->setup_dc("$path/dc");
return $target3->setup_admember("$path/s3member", $self->{vars}->{dc}, 29);
} elsif ($envname eq "plugin_s4_dc") {
return $self->setup_plugin_s4_dc("$path/plugin_s4_dc");
+ } elsif ($envname eq "s3member_rfc2307") {
+ if (not defined($self->{vars}->{dc})) {
+ $self->setup_dc("$path/dc");
+ }
+ return $target3->setup_admember_rfc2307("$path/s3member_rfc2307",
+ $self->{vars}->{dc}, 34);
} else {
return "UNKNOWN";
}
return $env;
}
-sub setup_promoted_vampire_dc($$$)
+sub setup_promoted_dc($$$)
{
my ($self, $path, $dc_vars) = @_;
- my $env = $self->provision_promoted_vampire_dc($path, $dc_vars);
+ my $env = $self->provision_promoted_dc($path, $dc_vars);
if (defined $env) {
$self->check_or_start($env, "single");
$self->wait_for_start($env);
- $self->{vars}->{promoted_vampire_dc} = $env;
+ $self->{vars}->{promoted_dc} = $env;
# force replicated DC to update repsTo/repsFrom
# for vampired partitions