diff options
author | Andreas Schneider <asn@samba.org> | 2018-04-20 09:38:24 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-05-24 11:29:22 +0200 |
commit | 5c946ebf9f4141db5e2b6eec6a9912919e712874 (patch) | |
tree | 779991411b6df006482b2d2adf811b37455a5aaf /selftest/target | |
parent | 40a13413eb27f261d608c8071f86175c77e31ce4 (diff) | |
download | samba-5c946ebf9f4141db5e2b6eec6a9912919e712874.tar.gz |
selftest: Add a user with a different userPrincipalName
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13369
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 5319cae00096dcecc29aa9fa675a983352ad64d8)
Diffstat (limited to 'selftest/target')
-rwxr-xr-x | selftest/target/Samba4.pm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index c161ee082a0..d6d67f5a5ab 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -847,7 +847,7 @@ userPrincipalName: testdenied_upn\@$ctx->{realm}.upn } # Create to users alice and bob! - my $user_account_array = ["alice", "bob"]; + my $user_account_array = ["alice", "bob", "jane"]; foreach my $user_account (@{$user_account_array}) { my $samba_tool_cmd = ""; @@ -862,6 +862,23 @@ userPrincipalName: testdenied_upn\@$ctx->{realm}.upn } } + my $ldbmodify = ""; + $ldbmodify .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" "; + $ldbmodify .= "KRB5CCNAME=\"$ret->{KRB5_CCACHE}\" "; + $ldbmodify .= Samba::bindir_path($self, "ldbmodify"); + + my $base_dn = "DC=".join(",DC=", split(/\./, $ctx->{realm})); + my $user_dn = "cn=jane,cn=users,$base_dn"; + + open(LDIF, "|$ldbmodify -H $ctx->{privatedir}/sam.ldb"); + print LDIF "dn: $user_dn +changetype: modify +replace: userPrincipalName +userPrincipalName: jane.doe\@$ctx->{realm} +- +"; + close(LDIF); + return $ret; } |