[SCM] Socket Wrapper Repository - branch master updated

2023-06-20 Thread Andreas Schneider
The branch, master has been updated
   via  71a55a6 swrap: Add support for openat64()
   via  6bbf07e tests: Use F_(OFD)SETLK(64) in test_fcntl_lock
   via  cc80f53 cmake: Define large file support for tests
  from  cb5d579 gitlab-ci: Add a 32bit build

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


- Log -
commit 71a55a64d6b6dcba9582cbded86d321ce0318fc0
Author: Andreas Schneider 
Date:   Mon Jun 19 16:23:50 2023 +0200

swrap: Add support for openat64()

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

commit 6bbf07e6c4475928de5a5005c1fb5804e3cebcde
Author: Andreas Schneider 
Date:   Tue May 9 09:19:07 2023 +0200

tests: Use F_(OFD)SETLK(64) in test_fcntl_lock

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

commit cc80f531f439af77590b0f411ed3b38742d5ac08
Author: Andreas Schneider 
Date:   Tue May 9 09:09:01 2023 +0200

cmake: Define large file support for tests

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

---

Summary of changes:
 ConfigureChecks.cmake   |  1 +
 config.h.cmake  |  1 +
 src/CMakeLists.txt  |  6 +
 src/socket_wrapper.c| 68 +
 tests/CMakeLists.txt|  7 -
 tests/test_fcntl_lock.c |  9 ++-
 6 files changed, 90 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index c99e2ae..daaee2b 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -70,6 +70,7 @@ check_function_exists(timerfd_create HAVE_TIMERFD_CREATE)
 check_function_exists(bindresvport HAVE_BINDRESVPORT)
 check_function_exists(accept4 HAVE_ACCEPT4)
 check_function_exists(open64 HAVE_OPEN64)
+check_function_exists(openat64 HAVE_OPENAT64)
 check_function_exists(fopen64 HAVE_FOPEN64)
 check_function_exists(getprogname HAVE_GETPROGNAME)
 check_function_exists(getexecname HAVE_GETEXECNAME)
diff --git a/config.h.cmake b/config.h.cmake
index a637a34..399013e 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -43,6 +43,7 @@
 #cmakedefine HAVE_BINDRESVPORT 1
 #cmakedefine HAVE_ACCEPT4 1
 #cmakedefine HAVE_OPEN64 1
+#cmakedefine HAVE_OPENAT64 1
 #cmakedefine HAVE_FOPEN64 1
 #cmakedefine HAVE_GETPROGNAME 1
 #cmakedefine HAVE_GETEXECNAME 1
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a1dbfaf..19e0d26 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,6 +8,12 @@ target_compile_options(socket_wrapper
PRIVATE
   ${DEFAULT_C_COMPILE_FLAGS}
   -D_GNU_SOURCE)
+if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+target_compile_options(socket_wrapper
+   PRIVATE
+   -D_LARGEFILE64_SOURCE)
+endif()
+
 target_link_libraries(socket_wrapper
   PRIVATE ${SWRAP_REQUIRED_LIBRARIES} 
${CMAKE_THREAD_LIBS_INIT})
 
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index de2f732..dc07b53 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -531,6 +531,9 @@ typedef int (*__libc_open)(const char *pathname, int flags, 
...);
 #ifdef HAVE_OPEN64
 typedef int (*__libc_open64)(const char *pathname, int flags, ...);
 #endif /* HAVE_OPEN64 */
+#ifdef HAVE_OPENAT64
+typedef int (*__libc_openat64)(int dirfd, const char *pathname, int flags, 
...);
+#endif /* HAVE_OPENAT64 */
 typedef int (*__libc_openat)(int dirfd, const char *path, int flags, ...);
 typedef int (*__libc_pipe)(int pipefd[2]);
 typedef int (*__libc_read)(int fd, void *buf, size_t count);
@@ -631,6 +634,9 @@ struct swrap_libc_symbols {
SWRAP_SYMBOL_ENTRY(open);
 #ifdef HAVE_OPEN64
SWRAP_SYMBOL_ENTRY(open64);
+#endif
+#ifdef HAVE_OPENAT64
+   SWRAP_SYMBOL_ENTRY(openat64);
 #endif
SWRAP_SYMBOL_ENTRY(openat);
SWRAP_SYMBOL_ENTRY(pipe);
@@ -1136,6 +1142,29 @@ static int libc_vopen64(const char *pathname, int flags, 
va_list ap)
 }
 #endif /* HAVE_OPEN64 */
 
+#ifdef HAVE_OPENAT64
+static int
+libc_vopenat64(int dirfd, const char *pathname, int flags, va_list ap)
+{
+   int mode = 0;
+   int fd;
+
+   swrap_bind_symbol_all();
+
+   swrap_inject_o_largefile();
+
+   if (flags & O_CREAT) {
+   mode = va_arg(ap, int);
+   }
+   fd = swrap.libc.symbols._libc_openat64.f(dirfd,
+pathname,
+flags,
+(mode_t)mode);
+
+   return fd;
+}
+#endif /* HAVE_OPENAT64 */
+
 static int libc_vopenat(int dirfd, const char *path, int flags, va_list ap)
 {
int mode = 0;
@@ -1441,6 +1470,9 @@ static void __swrap_bind_symbol_all_once(void)
swrap_bind_symbol_libc(open);
 #ifdef HAVE_OPEN64

[SCM] Samba Shared Repository - branch master updated

2023-06-20 Thread Andreas Schneider
The branch, master has been updated
   via  d34ff44d91b s3:winbind: Fix talloc parent in find_dc() leading to a 
segfault
  from  6640cf5e32f samba-tool: add new --dns-directory-partition option to 
dns zonecreate command

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


- Log -
commit d34ff44d91ba4ffad45dfa3e4ee37470498b3f2d
Author: Andreas Schneider 
Date:   Tue Jun 20 11:52:12 2023 +0200

s3:winbind: Fix talloc parent in find_dc() leading to a segfault

[2023/06/16 16:30:18.677249,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../lib/cmdline/cmdline.c:56(_samba_cmdline_talloc_log)
  Bad talloc magic value - unknown value
[2023/06/16 16:30:18.677374,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../lib/util/fault.c:173(smb_panic_log)
  ===
[2023/06/16 16:30:18.677388,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../lib/util/fault.c:177(smb_panic_log)
  INTERNAL ERROR: Bad talloc magic value - unknown value in pid 28112 
(4.18.3)
[2023/06/16 16:30:18.677398,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../lib/util/fault.c:182(smb_panic_log)
  If you are running a recent Samba version, and if you think this problem 
is not yet fixed in the latest versions, please consider reporting this bug, 
see https://wiki.samba.org/index.php/Bug_Reporting
[2023/06/16 16:30:18.677408,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../lib/util/fault.c:183(smb_panic_log)
  ===
[2023/06/16 16:30:18.677420,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../lib/util/fault.c:185(smb_panic_log)
  PANIC (pid 28112): Bad talloc magic value - unknown value in 4.18.3
[2023/06/16 16:30:18.677698,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../lib/util/fault.c:293(log_stack_trace)
  BACKTRACE: 22 stack frames:
   #0 /usr/lib64/samba/libgenrand-samba4.so(log_stack_trace+0x34) 
[0x7fcc04ad35d4]
   #1 /usr/lib64/samba/libgenrand-samba4.so(smb_panic+0xd) [0x7fcc04ad382d]
   #2 /lib64/libtalloc.so.2(+0x3121) [0x7fcc04650121]
   #3 /usr/sbin/winbindd(_wbint_InitConnection+0xe8) [0x55aa1fd79028]
   #4 /usr/sbin/winbindd(+0x59488) [0x55aa1fd7e488]
   #5 /lib64/libdcerpc-server-core.so.0(dcesrv_call_dispatch_local+0x69) 
[0x7fcc05890469]
   #6 /usr/sbin/winbindd(winbindd_dual_ndrcmd+0x3c5) [0x55aa1fd762d5]
   #7 /usr/sbin/winbindd(+0x4d664) [0x55aa1fd72664]
   #8 /lib64/libtevent.so.0(tevent_common_invoke_fd_handler+0x97) 
[0x7fcc03d2e707]
   #9 /lib64/libtevent.so.0(+0xef4f) [0x7fcc03d34f4f]
   #10 /lib64/libtevent.so.0(+0xcf5b) [0x7fcc03d32f5b]
   #11 /lib64/libtevent.so.0(_tevent_loop_once+0x95) [0x7fcc03d2d9b5]
   #12 /usr/sbin/winbindd(+0x4fd14) [0x55aa1fd74d14]
   #13 /usr/sbin/winbindd(+0x505cd) [0x55aa1fd755cd]
   #14 /lib64/libtevent.so.0(tevent_common_invoke_immediate_handler+0x182) 
[0x7fcc03d2ec72]
   #15 /lib64/libtevent.so.0(tevent_common_loop_immediate+0x27) 
[0x7fcc03d2eca7]
   #16 /lib64/libtevent.so.0(+0xed2f) [0x7fcc03d34d2f]
   #17 /lib64/libtevent.so.0(+0xcf5b) [0x7fcc03d32f5b]
   #18 /lib64/libtevent.so.0(_tevent_loop_once+0x95) [0x7fcc03d2d9b5]
   #19 /usr/sbin/winbindd(main+0xd34) [0x55aa1fd402f4]
   #20 /lib64/libc.so.6(__libc_start_main+0xe5) [0x7fcc0339dd85]
   #21 /usr/sbin/winbindd(_start+0x2e) [0x55aa1fd40e8e]
[2023/06/16 16:30:18.677828,  0, pid=28112, effective(0, 0), real(0, 0), 
traceid=35] ../../source3/lib/dumpcore.c:318(dump_core)
  coredump is handled by helper binary specified at 
/proc/sys/kernel/core_pattern

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Stefan Metzmacher 

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Tue Jun 20 11:07:45 UTC 2023 on atb-devel-224

---

Summary of changes:
 source3/winbindd/winbindd_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 264fc1368d6..4aaa67521ee 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1559,7 +1559,7 @@ static bool find_dc(TALLOC_CTX *mem_ctx,
if (*dcnames[fd_index] != '\0' && !is_ipaddress(dcnames[fd_index])) {
/* Ok, we've got a name for the DC */
TALLOC_FREE(domain->dcname);
-   domain->dcname = talloc_strdup(mem_ctx, dcnames[fd_index]);
+   domain->dcname = talloc_strdup(domain, dcnames[fd_index]);
if (domain->dcname == NULL) {
return false;