From 7b3a9880c90fc436510ad69dcee2e10feb7523ad Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 26 Feb 2018 17:05:49 +0100 Subject: [PATCH] selftest/Samba4: create add ${TRUST_DOMSID}-513 to a local group This will allow testing expanding groups on the trust boundary. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13300 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- selftest/target/Samba4.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 608265ca11c8..842cd1e1bb6e 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -399,6 +399,20 @@ sub setup_trust($$$$$) return undef; } + my $groupname = "g_$localenv->{TRUST_DOMAIN}"; + my $groupadd = $cmd_env; + $groupadd .= " $samba_tool group add '$groupname' --group-scope=Domain $cmd_config"; + unless (system($groupadd) == 0) { + warn("Failed to create group \n$groupadd"); + return undef; + } + my $groupmem = $cmd_env; + $groupmem .= " $samba_tool group addmembers '$groupname' '$localenv->{TRUST_DOMSID}-513' $cmd_config"; + unless (system($groupmem) == 0) { + warn("Failed to add group member \n$groupmem"); + return undef; + } + return $localenv } -- 2.34.1