my $dfree_share_dir="$share_dir/dfree";
push(@dirs, $dfree_share_dir);
+ push(@dirs, "$dfree_share_dir/subdir1");
+ push(@dirs, "$dfree_share_dir/subdir2");
my $valid_users_sharedir="$share_dir/valid_users";
push(@dirs,$valid_users_sharedir);
+ my $offline_sharedir="$share_dir/offline";
+ push(@dirs,$offline_sharedir);
+
my $fileserver_options = "
[lowercase]
path = $lower_case_share_dir
[valid-users-access]
path = $valid_users_sharedir
valid users = +userdup
+[offline]
+ path = $offline_sharedir
+ vfs objects = offline
";
my $vars = $self->provision($path,
$ENV{NSS_WRAPPER_HOSTNAME} = $env_vars->{NSS_WRAPPER_HOSTNAME};
$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_ROOT} = "1";
$ENV{ENVNAME} = "$ENV{ENVNAME}.nmbd";
} else {
$ENV{RESOLV_WRAPPER_HOSTS} = $env_vars->{RESOLV_WRAPPER_HOSTS};
}
+ $ENV{UID_WRAPPER_ROOT} = "1";
$ENV{ENVNAME} = "$ENV{ENVNAME}.winbindd";
} else {
$ENV{RESOLV_WRAPPER_HOSTS} = $env_vars->{RESOLV_WRAPPER_HOSTS};
}
+ $ENV{UID_WRAPPER_ROOT} = "1";
$ENV{ENVNAME} = "$ENV{ENVNAME}.smbd";
my $manglenames_shrdir="$shrdir/manglenames";
push(@dirs,$manglenames_shrdir);
+ my $widelinks_shrdir="$shrdir/widelinks";
+ push(@dirs,$widelinks_shrdir);
+
+ my $widelinks_linkdir="$shrdir/widelinks_foo";
+ push(@dirs,$widelinks_linkdir);
+
# this gets autocreated by winbindd
my $wbsockdir="$prefix_abs/winbindd";
my $wbsockprivdir="$lockdir/winbindd_privileged";
my $manglename_target = "$manglenames_shrdir/foo:bar";
mkdir($manglename_target, 0777);
+ ##
+ ## create symlinks for widelinks tests.
+ ##
+ my $widelinks_target = "$widelinks_linkdir/target";
+ unless (open(WIDELINKS_TARGET, ">$widelinks_target")) {
+ warn("Unable to open $widelinks_target");
+ return undef;
+ }
+ close(WIDELINKS_TARGET);
+ chmod 0666, $widelinks_target;
+ ##
+ ## This link should get ACCESS_DENIED
+ ##
+ symlink "$widelinks_target", "$widelinks_shrdir/source";
+ ##
+ ## This link should be allowed
+ ##
+ symlink "$widelinks_shrdir", "$widelinks_shrdir/dot";
+
my $conffile="$libdir/server.conf";
my $nss_wrapper_pl = "$ENV{PERL} $self->{srcdir}/lib/nss_wrapper/nss_wrapper.pl";
my ($max_uid, $max_gid);
my ($uid_nobody, $uid_root, $uid_pdbtest, $uid_pdbtest2, $uid_userdup);
+ my ($uid_pdbtest_wkn);
my ($gid_nobody, $gid_nogroup, $gid_root, $gid_domusers, $gid_domadmins);
- my ($gid_userdup);
+ my ($gid_userdup, $gid_everyone);
if ($unix_uid < 0xffff - 5) {
$max_uid = 0xffff;
$uid_pdbtest = $max_uid - 3;
$uid_pdbtest2 = $max_uid - 4;
$uid_userdup = $max_uid - 5;
+ $uid_pdbtest_wkn = $max_uid - 6;
- if ($unix_gids[0] < 0xffff - 6) {
+ if ($unix_gids[0] < 0xffff - 7) {
$max_gid = 0xffff;
} else {
$max_gid = $unix_gids[0];
$gid_domusers = $max_gid - 4;
$gid_domadmins = $max_gid - 5;
$gid_userdup = $max_gid - 6;
+ $gid_everyone = $max_gid - 7;
##
## create conffile
create mask = 755
dos filemode = yes
strict rename = yes
+ strict sync = yes
vfs objects = acl_xattr fake_acls xattr_tdb streams_depot
printing = vlp
force user = $unix_name
guest ok = yes
[forceuser_unixonly]
+ comment = force a user with unix user SID and group SID
path = $shrdir
force user = pdbtest
guest ok = yes
+[forceuser_wkngroup]
+ comment = force a user with well-known group SID
+ path = $shrdir
+ force user = pdbtest_wkn
+ guest ok = yes
[forcegroup]
path = $shrdir
force group = nogroup
path = $shrdir/%R
guest ok = yes
+[widelinks_share]
+ path = $widelinks_shrdir
+ wide links = no
+ guest ok = yes
+
[fsrvp_share]
path = $shrdir
comment = fake shapshots using rsync
pdbtest:x:$uid_pdbtest:$gid_nogroup:pdbtest gecos:$prefix_abs:/bin/false
pdbtest2:x:$uid_pdbtest2:$gid_nogroup:pdbtest gecos:$prefix_abs:/bin/false
userdup:x:$uid_userdup:$gid_userdup:userdup gecos:$prefix_abs:/bin/false
+pdbtest_wkn:x:$uid_pdbtest_wkn:$gid_everyone:pdbtest_wkn gecos:$prefix_abs:/bin/false
";
if ($unix_uid != 0) {
print PASSWD "root:x:$uid_root:$gid_root:root gecos:$prefix_abs:/bin/false
domusers:X:$gid_domusers:
domadmins:X:$gid_domadmins:
userdup:x:$gid_userdup:$unix_name
+everyone:x:$gid_everyone:
";
if ($unix_gids[0] != 0) {
print GROUP "root:x:$gid_root:
if ($ret != 0) {
return 1;
}
+ $ret = system(Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} groupmap add sid=S-1-1-0 unixgroup=everyone type=builtin");
+ if ($ret != 0) {
+ return 1;
+ }
if ($winbindd eq "yes") {
# note: creating builtin groups requires winbindd for the