[SCM] Samba Shared Repository - branch master updated

2022-03-02 Thread Andrew Bartlett
The branch, master has been updated
   via  cb10b8704e8 s3:script: Reformat shell scripts
   via  98aed0644ae s3:locale: Reformat shell scripts
   via  1399b2430a0 selftest: Reformat shell scripts
   via  22eb76c6d0b script: Reformat shell scripts
   via  55cd39b92cf release-scripts: Reformat shell scripts
   via  f025cc1a12c python: Reformat shell scripts
  from  0c113e652fe s3: smbd: Rename OpenDir_ntstatus() -> OpenDir().

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit cb10b8704e8640dbbb4b8c3ca876b890833e54ef
Author: Andreas Schneider 
Date:   Mon Feb 21 14:11:19 2022 +0100

s3:script: Reformat shell scripts

shfmt -f source3/script/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Andrew Bartlett 
Autobuild-Date(master): Thu Mar  3 01:53:16 UTC 2022 on sn-devel-184

commit 98aed0644aec14ea7d88b7812cc15bf5f7379815
Author: Andreas Schneider 
Date:   Mon Feb 21 14:10:29 2022 +0100

s3:locale: Reformat shell scripts

shfmt -f source3/locale/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 1399b2430a06f4a4b82f99643bf41b732183b5cb
Author: Andreas Schneider 
Date:   Mon Feb 21 14:06:36 2022 +0100

selftest: Reformat shell scripts

shfmt -f selftest/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 22eb76c6d0bfb9c6858eb0cef4211b4f833e9ae7
Author: Andreas Schneider 
Date:   Mon Feb 21 14:02:15 2022 +0100

script: Reformat shell scripts

shfmt -f script/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit 55cd39b92cf23ccf8f7714df6d269af43855d307
Author: Andreas Schneider 
Date:   Mon Feb 21 14:00:54 2022 +0100

release-scripts: Reformat shell scripts

shfmt -f release-scripts/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

commit f025cc1a12cbcd3619a3f39a25dd8080a7a759c4
Author: Andreas Schneider 
Date:   Mon Feb 21 13:59:33 2022 +0100

python: Reformat shell scripts

shfmt -f python/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 

---

Summary of changes:
 python/samba/tests/krb5/pyasn1_regen.sh|   3 +-
 python/samba/tests/samba_tool/computer_edit.sh |  70 ---
 python/samba/tests/samba_tool/contact_edit.sh  |  75 
 python/samba/tests/samba_tool/group_edit.sh|  97 +-
 python/samba/tests/samba_tool/user_edit.sh |  78 
 python/samba/tests/test_pam_winbind.sh |   8 +-
 python/samba/tests/test_pam_winbind_chauthtok.sh   |  46 ++---
 .../tests/test_pam_winbind_warn_pwd_expire.sh  |  16 +-
 release-scripts/build-docs |  13 +-
 release-scripts/build-htmlman-git  |   3 +-
 release-scripts/build-htmlman-nogit|   3 +-
 release-scripts/build-manpages-git |   3 +-
 release-scripts/build-manpages-nogit   |   3 +-
 script/clean-source-tree.sh|   4 +-
 script/commit_mark.sh  |  10 +-
 script/ctdb-import.tree-filter.sh  |   1 -
 script/find_python.sh  |   4 +-
 script/git-hooks/check-trailing-whitespace |  20 +-
 script/git-hooks/pre-commit-hook   |  10 +-
 script/git-hooks/pre-commit-script |   6 +-
 script/release.sh  | 127 -
 selftest/checkpassword_arg1.sh |   2 +-
 selftest/gdb_backtrace |  91 +
 selftest/gdb_run   |   4 +-
 selftest/in_screen |  91 -
 selftest/ns/add_bridge_iface.sh|   8 +-
 selftest/ns/create_bridge.sh   |   2 -
 selftest/ns/mk_nsenter.sh  |   5 +-
 selftest/ns/nsenter-helper.sh  |  18 +-
 selftest/save.env.sh   |  16 +-
 source3/locale/net/genmsg  |  40 ++--
 source3/script/creategroup |  22 +--
 source3/script/mknissmbpasswd.sh   |  39 ++--
 source3/script/mknissmbpwdtbl.sh   |  63 ---
 source3/script/mksyms.sh   |  33 ++--
 source3/script/smbtar  | 205 +++--
 36 files changed, 661 insertions(+), 578 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/krb5/pyasn1_regen.sh 

[SCM] Samba Shared Repository - branch master updated

2022-03-02 Thread Volker Lendecke
The branch, master has been updated
   via  0c113e652fe s3: smbd: Rename OpenDir_ntstatus() -> OpenDir().
   via  c0bbf6f4119 s3: smbd: Remove now unused OpenDir().
   via  b331082b01a s3: torture: In cmd_vfs, Move two more uses of 
OpenDir() -> OpenDir_nstatus().
   via  e66be49a52e s3: smbd: In form_junctions(), Move one more use of 
OpenDir() -> OpenDir_nstatus()
   via  2aff668e1c5 s3: smbd: In count_dfs_links(), Move one more use of 
OpenDir() -> OpenDir_nstatus()
   via  535b29afdeb s3: smbd: In rmdir_internals(), Move one more use of 
OpenDir() -> OpenDir_nstatus()
   via  51b7475d394 s3: smbd: In recursive_rmdir(), Move one more use of 
OpenDir() -> OpenDir_nstatus()
   via  bc9439a41ee s3: VFS: syncops: Move one more use of OpenDir() -> 
OpenDir_nstatus().
   via  a138d0f2d98 s3: VFS: shadow_copy: Move one more use of OpenDir() -> 
OpenDir_nstatus().
   via  a1f4d74a1a0 s3: VFS: fruit: Move two more uses of OpenDir() -> 
OpenDir_nstatus().
   via  751237a28c3 s3: VFS: ceph_snapshots: Move two more uses of 
OpenDir() -> OpenDir_nstatus().
  from  791be84c3ee s4:kdc: hdb_samba4_audit() is only called once per 
request

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 0c113e652fea17cbbf7644e469abe0980789cf9c
Author: Jeremy Allison 
Date:   Mon Feb 28 14:34:48 2022 -0800

s3: smbd: Rename OpenDir_ntstatus() -> OpenDir().

We now have a single OpenDir() function that returns an NTSTATUS.

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

Autobuild-User(master): Volker Lendecke 
Autobuild-Date(master): Wed Mar  2 21:58:32 UTC 2022 on sn-devel-184

commit c0bbf6f41195dd2af08f303ce3feef3becd79af1
Author: Jeremy Allison 
Date:   Mon Feb 28 14:30:27 2022 -0800

s3: smbd: Remove now unused OpenDir().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit b331082b01a51d57a52b9c2e994724def528c8b4
Author: Jeremy Allison 
Date:   Mon Feb 28 14:28:19 2022 -0800

s3: torture: In cmd_vfs, Move two more uses of OpenDir() -> 
OpenDir_nstatus().

Now we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit e66be49a52e19551edea6b336fbbb46f6a97f3c7
Author: Jeremy Allison 
Date:   Mon Feb 28 14:25:25 2022 -0800

s3: smbd: In form_junctions(), Move one more use of OpenDir() -> 
OpenDir_nstatus()

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit 2aff668e1c5f31d950e30d175b9affe36bb4766f
Author: Jeremy Allison 
Date:   Mon Feb 28 14:24:19 2022 -0800

s3: smbd: In count_dfs_links(), Move one more use of OpenDir() -> 
OpenDir_nstatus()

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit 535b29afdebc2bff1a587a1d5966c789fb6aab42
Author: Jeremy Allison 
Date:   Mon Feb 28 14:22:03 2022 -0800

s3: smbd: In rmdir_internals(), Move one more use of OpenDir() -> 
OpenDir_nstatus()

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit 51b7475d394ab04f73bdc054382f0814a41aaa74
Author: Jeremy Allison 
Date:   Mon Feb 28 14:20:37 2022 -0800

s3: smbd: In recursive_rmdir(), Move one more use of OpenDir() -> 
OpenDir_nstatus()

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit bc9439a41eea66e50ea76275c324596e26999888
Author: Jeremy Allison 
Date:   Mon Feb 28 14:13:04 2022 -0800

s3: VFS: syncops: Move one more use of OpenDir() -> OpenDir_nstatus().

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit a138d0f2d986a8d05ea2e4172871701bdb187770
Author: Jeremy Allison 
Date:   Mon Feb 28 14:11:04 2022 -0800

s3: VFS: shadow_copy: Move one more use of OpenDir() -> OpenDir_nstatus().

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit a1f4d74a1a00aa9d91393b0c6f975ffb3db03d55
Author: Jeremy Allison 
Date:   Mon Feb 28 14:08:40 2022 -0800

s3: VFS: fruit: Move two more uses of OpenDir() -> OpenDir_nstatus().

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit 751237a28c3c8feee24818dea0525771e70dd08b
Author: Jeremy Allison 
Date:   Mon Feb 28 13:28:30 2022 -0800

s3: VFS: ceph_snapshots: Move two more uses of OpenDir() -> 
OpenDir_nstatus().

Eventually we can replace OpenDir() with OpenDir_ntatatus().

Signed-off-by: 

[SCM] Samba Shared Repository - branch v4-15-test updated

2022-03-02 Thread Jule Anger
The branch, v4-15-test has been updated
   via  c4b2930a837 smbd: Fix a use-after-free
   via  e19d287cef3 s4:sam: Don't use talloc_steal for msg attributes in 
authsam_make_user_info_dc()
  from  f7e31127e7f waf: re-add missing readlink test

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-15-test


- Log -
commit c4b2930a837d817f3da8c7641b1b7201383ea36c
Author: Volker Lendecke 
Date:   Wed Feb 23 15:56:41 2022 +0100

smbd: Fix a use-after-free

stat_cache_lookup() allocates its result on top of talloc_tos().
filename_convert_smb1_search_path() creates a talloc_stackframe(),
which makes the names which were supposed to be allocated on the "ctx"
parameter of filename_convert_smb1_search_path() go away too
early. Reparent the results from stat_cache_lookup() properly.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14989

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Tue Mar  1 20:59:55 UTC 2022 on sn-devel-184

(cherry picked from commit 8c97743511e4d53f795f2469a28aabfb96da0dfa)

Autobuild-User(v4-15-test): Jule Anger 
Autobuild-Date(v4-15-test): Wed Mar  2 12:27:47 UTC 2022 on sn-devel-184

commit e19d287cef39d137124295331243c019bd56438f
Author: Stefan Metzmacher 
Date:   Fri Feb 25 07:40:17 2022 +0100

s4:sam: Don't use talloc_steal for msg attributes in 
authsam_make_user_info_dc()

This is most likely not a problem for the current callers,
but that it is unexpected and will likely cause problems with future
changes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14993
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit f6fe86924c2ca756083d3628d5dbace0b12d06b0)

---

Summary of changes:
 source3/smbd/filename.c |  7 +++
 source4/auth/sam.c  | 19 ++-
 2 files changed, 21 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 56ebdd9f370..ad9a0e817ff 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -1100,6 +1100,13 @@ NTSTATUS unix_convert(TALLOC_CTX *mem_ctx,
  >name,
  state->smb_fname->twrp,
  >smb_fname->st);
+   /*
+* stat_cache_lookup() allocates on talloc_tos() even
+* when !found, reparent correctly
+*/
+   talloc_steal(state->smb_fname, state->smb_fname->base_name);
+   talloc_steal(state->mem_ctx, state->dirpath);
+
if (found) {
goto done;
}
diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index 93b41be3b21..8b233bab3ad 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -454,12 +454,15 @@ _PUBLIC_ NTSTATUS authsam_make_user_info_dc(TALLOC_CTX 
*mem_ctx,
user_info_dc->info = info = talloc_zero(user_info_dc, struct 
auth_user_info);
NT_STATUS_HAVE_NO_MEMORY(user_info_dc->info);
 
-   info->account_name = talloc_steal(info,
-   ldb_msg_find_attr_as_string(msg, "sAMAccountName", NULL));
+   str = ldb_msg_find_attr_as_string(msg, "sAMAccountName", NULL);
+   info->account_name = talloc_strdup(info, str);
+   if (info->account_name == NULL) {
+   TALLOC_FREE(user_info_dc);
+   return NT_STATUS_NO_MEMORY;
+   }
 
-   info->user_principal_name = talloc_steal(info,
-   ldb_msg_find_attr_as_string(msg, "userPrincipalName", NULL));
-   if (info->user_principal_name == NULL && dns_domain_name != NULL) {
+   str = ldb_msg_find_attr_as_string(msg, "userPrincipalName", NULL);
+   if (str == NULL && dns_domain_name != NULL) {
info->user_principal_name = talloc_asprintf(info, "%s@%s",
info->account_name,
dns_domain_name);
@@ -468,6 +471,12 @@ _PUBLIC_ NTSTATUS authsam_make_user_info_dc(TALLOC_CTX 
*mem_ctx,
return NT_STATUS_NO_MEMORY;
}
info->user_principal_constructed = true;
+   } else if (str != NULL) {
+   info->user_principal_name = talloc_strdup(info, str);
+   if (info->user_principal_name == NULL) {
+   TALLOC_FREE(user_info_dc);
+   return NT_STATUS_NO_MEMORY;
+   }
}
 
info->domain_name = talloc_strdup(info, domain_name);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch v4-16-test updated

2022-03-02 Thread Jule Anger
The branch, v4-16-test has been updated
   via  5b6ca18e020 s4:kdc: hdb_samba4_audit() is only called once per 
request
   via  794c717ba75 s4-kdc: Adapt to move from HDB auditing to KDC auditing 
constants
   via  71912b630e9 s4:kdc: Adapt to removal of publicly accessible request 
structure members
   via  12a61bb7416 s4:kdc: Adapt to hdb_entry_ex removal
   via  f90e729e01e s4:kdc: Increment plugin minor version
   via  8ae5ce46e57 third_party/heimdal_build: Don't generate .x source 
files
   via  5493c1a5df6 s4:kdc: Explicitly set plugin minor version
   via  0918e692fac third_party/heimdal_build: Add SFU source file
   via  b6e2028f277 s4:kdc: Adapt to removal of auth audit event types
   via  9e763005266 s4:kdc: Rename windc to kdc plugin
   via  b88d8924980 s4:kdc: Add referral policy callback
   via  cef9e6f8514 s4:kdc: Add 'not authorised' auth events
   via  115d8e493fe s4:kdc: Adapt to removal of auth event details
   via  9627ee616b5 s4:kdc: Refactor HDB API
   via  26880578a5f third_party/heimdal_build: Add source files to build
   via  e26fbf420e4 third_party/heimdal: import 
lorikeet-heimdal-202203010107 (commit 0e7a12404c388e831fe6933fcc3c86e7eb334825)
   via  c9a77ff43e0 third_party/heimdal_build: Define fallthrough macro for 
switch statements
   via  947ad1581a6 third_party/heimdal_build: Determine whether time_t is 
signed
   via  97011aa3ce1 s4:kdc: Don't pass empty PAC buffers to 
krb5_pac_add_buffer()
   via  77ed10e2ff8 third_party/heimdal_build: Add KDC_LIB macro definitions
   via  635c8b730f7 auth: Cope with NULL upn_name in PAC
   via  b668c076722 s4:sam: Don't use talloc_steal for msg attributes in 
authsam_make_user_info_dc()
   via  9fd10105530 smbd: Fix a use-after-free
  from  91c7a2cb662 VERSION: Bump version up to Samba 4.16.0rc5...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-16-test


- Log -
commit 5b6ca18e020416aef105fa13d2e35bbd03c4da45
Author: Stefan Metzmacher 
Date:   Wed Mar 2 10:10:08 2022 +1300

s4:kdc: hdb_samba4_audit() is only called once per request

So we need to restructure the logic a bit.

NOTE: This commit finally works again!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Joseph Sutton 
Autobuild-Date(master): Tue Mar  1 23:28:22 UTC 2022 on sn-devel-184

(cherry picked from commit 791be84c3eecb95e03611458e2305bae272ba267)

Autobuild-User(v4-16-test): Jule Anger 
Autobuild-Date(v4-16-test): Wed Mar  2 11:24:26 UTC 2022 on sn-devel-184

commit 794c717ba75c15e96bdc3a651ddd0715bcd4f92e
Author: Andrew Bartlett 
Date:   Wed Mar 2 10:00:17 2022 +1300

s4-kdc: Adapt to move from HDB auditing to KDC auditing constants

This is to adapt to:

commit 6530021f09a5cab631be19a1b5898a0ba6b32f16
Author: Luke Howard 
Date:   Thu Jan 13 14:37:29 2022 +1100

kdc: move auth event definitions into KDC header

Move KDC auth event macro definitions out of hdb.h and into a new 
KDC header,
kdc-audit.h.

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Andrew Bartlett 
Reviewed-by: Joseph Sutton 
(cherry picked from commit c9b0b4bfc4e2e0b08b21f39bf56fd5395d66d66f)

commit 71912b630e945ab554d2f36f94d879c4ec87cfb9
Author: Joseph Sutton 
Date:   Wed Feb 23 09:53:27 2022 +1300

s4:kdc: Adapt to removal of publicly accessible request structure members

We now have to use the accessor functions instead.

This is an adaptation to Heimdal:

commit ec24edf7005c340018450a202d27ca75fcf322d4
Author: Luke Howard 
Date:   Thu Jan 20 09:15:24 2022 +1100

kdc: add accessor functions for KDC request structure

Add accessor functions for use by Samba and other plugin developers.
Documentation is in kdc/kdc-accessors.h.

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Joseph Sutton 
Reviewed-by: Stefan Metzmacher 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit 9399a15fabb5a1b8470b1069a098132e2fdb7f0f)

commit 12a61bb7416eed3b7fa261791eea926f683ee5f1
Author: Joseph Sutton 
Date:   Tue Feb 22 19:41:14 2022 +1300

s4:kdc: Adapt to hdb_entry_ex removal

Rather than having a 'free_entry' member that can be called to free an
hdb_entry, we now implement the free function in HDB. We perform the
free only if the context pointer is non-NULL.

We also remove the ZERO_STRUCTP() in sdb_entry_to_hdb_entry(), as the
context pointer is now part of the 'hdb_entry' structure itself, 

[SCM] Samba Shared Repository - branch v4-14-test updated

2022-03-02 Thread Jule Anger
The branch, v4-14-test has been updated
   via  c2a3c17da9f s4:sam: Don't use talloc_steal for msg attributes in 
authsam_make_user_info_dc()
  from  992a41e5e74 waf: re-add missing readlink test

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-14-test


- Log -
commit c2a3c17da9ffb90afa09fe7b881ed1859c35481c
Author: Stefan Metzmacher 
Date:   Fri Feb 25 07:40:17 2022 +0100

s4:sam: Don't use talloc_steal for msg attributes in 
authsam_make_user_info_dc()

This is most likely not a problem for the current callers,
but that it is unexpected and will likely cause problems with future
changes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14993
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit f6fe86924c2ca756083d3628d5dbace0b12d06b0)

Autobuild-User(v4-14-test): Jule Anger 
Autobuild-Date(v4-14-test): Wed Mar  2 11:13:02 UTC 2022 on sn-devel-184

---

Summary of changes:
 source4/auth/sam.c | 19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index 93b41be3b21..8b233bab3ad 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -454,12 +454,15 @@ _PUBLIC_ NTSTATUS authsam_make_user_info_dc(TALLOC_CTX 
*mem_ctx,
user_info_dc->info = info = talloc_zero(user_info_dc, struct 
auth_user_info);
NT_STATUS_HAVE_NO_MEMORY(user_info_dc->info);
 
-   info->account_name = talloc_steal(info,
-   ldb_msg_find_attr_as_string(msg, "sAMAccountName", NULL));
+   str = ldb_msg_find_attr_as_string(msg, "sAMAccountName", NULL);
+   info->account_name = talloc_strdup(info, str);
+   if (info->account_name == NULL) {
+   TALLOC_FREE(user_info_dc);
+   return NT_STATUS_NO_MEMORY;
+   }
 
-   info->user_principal_name = talloc_steal(info,
-   ldb_msg_find_attr_as_string(msg, "userPrincipalName", NULL));
-   if (info->user_principal_name == NULL && dns_domain_name != NULL) {
+   str = ldb_msg_find_attr_as_string(msg, "userPrincipalName", NULL);
+   if (str == NULL && dns_domain_name != NULL) {
info->user_principal_name = talloc_asprintf(info, "%s@%s",
info->account_name,
dns_domain_name);
@@ -468,6 +471,12 @@ _PUBLIC_ NTSTATUS authsam_make_user_info_dc(TALLOC_CTX 
*mem_ctx,
return NT_STATUS_NO_MEMORY;
}
info->user_principal_constructed = true;
+   } else if (str != NULL) {
+   info->user_principal_name = talloc_strdup(info, str);
+   if (info->user_principal_name == NULL) {
+   TALLOC_FREE(user_info_dc);
+   return NT_STATUS_NO_MEMORY;
+   }
}
 
info->domain_name = talloc_strdup(info, domain_name);


-- 
Samba Shared Repository