[SCM] Samba Shared Repository - branch master updated

2023-06-29 Thread Stefan Metzmacher
The branch, master has been updated
   via  d720eb2c083 third_party: Update socket_wrapper to version 1.4.2
  from  afbed653526 s3:utils: smbget fix a memory leak

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


- Log -
commit d720eb2c083f3d162e93011d69c4b742cd03f3aa
Author: Andreas Schneider 
Date:   Wed Jun 21 12:40:16 2023 +0200

third_party: Update socket_wrapper to version 1.4.2

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

Autobuild-User(master): Stefan Metzmacher 
Autobuild-Date(master): Thu Jun 29 16:06:11 UTC 2023 on atb-devel-224

---

Summary of changes:
 buildtools/wafsamba/samba_third_party.py|   2 +-
 third_party/socket_wrapper/socket_wrapper.c | 182 
 third_party/socket_wrapper/wscript  |   7 +-
 3 files changed, 189 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_third_party.py 
b/buildtools/wafsamba/samba_third_party.py
index 356b041a2a9..52898486fd9 100644
--- a/buildtools/wafsamba/samba_third_party.py
+++ b/buildtools/wafsamba/samba_third_party.py
@@ -24,7 +24,7 @@ Build.BuildContext.CHECK_CMOCKA = CHECK_CMOCKA
 
 @conf
 def CHECK_SOCKET_WRAPPER(conf):
-return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.4.0')
+return conf.CHECK_BUNDLED_SYSTEM_PKG('socket_wrapper', minversion='1.4.2')
 Build.BuildContext.CHECK_SOCKET_WRAPPER = CHECK_SOCKET_WRAPPER
 
 @conf
diff --git a/third_party/socket_wrapper/socket_wrapper.c 
b/third_party/socket_wrapper/socket_wrapper.c
index bf4a976eaee..c759d350fb1 100644
--- a/third_party/socket_wrapper/socket_wrapper.c
+++ b/third_party/socket_wrapper/socket_wrapper.c
@@ -44,6 +44,12 @@
 
 #include "config.h"
 
+/*
+ * Make sure we do not redirect (f)open(at)() or fcntl() to their 64bit
+ * variants
+ */
+#undef _FILE_OFFSET_BITS
+
 #include 
 #include 
 #include 
@@ -94,6 +100,10 @@
 
 #include "socket_wrapper.h"
 
+#ifdef __USE_FILE_OFFSET64
+#error -D_FILE_OFFSET_BITS=64 should not be set for socket_wrapper!
+#endif
+
 enum swrap_dbglvl_e {
SWRAP_LOG_ERROR = 0,
SWRAP_LOG_WARN,
@@ -507,6 +517,9 @@ typedef int (*__libc_connect)(int sockfd,
 typedef int (*__libc_dup)(int fd);
 typedef int (*__libc_dup2)(int oldfd, int newfd);
 typedef int (*__libc_fcntl)(int fd, int cmd, ...);
+#ifdef HAVE_FCNTL64
+typedef int (*__libc_fcntl64)(int fd, int cmd, ...);
+#endif
 typedef FILE *(*__libc_fopen)(const char *name, const char *mode);
 #ifdef HAVE_FOPEN64
 typedef FILE *(*__libc_fopen64)(const char *name, const char *mode);
@@ -531,6 +544,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);
@@ -612,6 +628,9 @@ struct swrap_libc_symbols {
SWRAP_SYMBOL_ENTRY(dup);
SWRAP_SYMBOL_ENTRY(dup2);
SWRAP_SYMBOL_ENTRY(fcntl);
+#ifdef HAVE_FCNTL64
+   SWRAP_SYMBOL_ENTRY(fcntl64);
+#endif
SWRAP_SYMBOL_ENTRY(fopen);
 #ifdef HAVE_FOPEN64
SWRAP_SYMBOL_ENTRY(fopen64);
@@ -627,6 +646,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);
@@ -983,6 +1005,23 @@ static int libc_vfcntl(int fd, int cmd, va_list ap)
return rc;
 }
 
+#ifdef HAVE_FCNTL64
+DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE
+static int libc_vfcntl64(int fd, int cmd, va_list ap)
+{
+   void *arg;
+   int rc;
+
+   swrap_bind_symbol_all();
+
+   arg = va_arg(ap, void *);
+
+   rc = swrap.libc.symbols._libc_fcntl64.f(fd, cmd, arg);
+
+   return rc;
+}
+#endif
+
 static int libc_getpeername(int sockfd,
struct sockaddr *addr,
socklen_t *addrlen)
@@ -1115,6 +1154,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,
+

[SCM] Socket Wrapper Repository - annotated tag socket_wrapper-1.4.2 created

2023-06-29 Thread Andreas Schneider
The annotated tag, socket_wrapper-1.4.2 has been created
at  877bdaa29842c5d6717d9470c6123337a0649b23 (tag)
   tagging  d07136e8a6934e128b8be6860b7d08966691f8c8 (commit)
  replaces  socket_wrapper-1.4.0
 tagged by  Andreas Schneider
on  Thu Jun 29 14:45:20 2023 +0200

- Log -
socket_wrapper-1.4.2

* Fixed LFS issues on 32bit platforms
-BEGIN PGP SIGNATURE-

iQIzBAABCgAdFiEEjf9T4Y8qvI2PPJIjfuD8TcwBTj0FAmSdfPcACgkQfuD8TcwB
Tj3iVBAAsLX3h2z8peXyj3wmi4h+gIZi+XSzou6xcGUxPQtjTMsO7U+g2wpEyw1t
dSqiMpp2VcccsNWsFIxokLzGfCIyERcopsF+NQiUuQZMq5A3iCLDGHYZmfg5LU/K
E46KzWilHprMM7NeImvQQxUl7uoWcZ1hZkNIvvUAsYVlwunw2V4J7PrD8RVKfYW6
QSYvdqYMN3R8fr/IzuZMwfZw1P1hFP/W5K1XMt3QTvkgFm+ppcIe+hR8fjk4RJGE
yG2c2UziNtevohgGTt4QCx90g6Wu92uoeqQ8vRdOxwTWS9Z/SHf8qXSs6mRBZBaK
u9DhQMgqKoqRs6Y1YHcDH9ylD/bOcP65WJx7HWNIpn0OLDNdofxkcjS/P1guTF0a
rst7SM4VoKYt46tbDketKeIeWa7iLJYcS4Z/9D9/nedyFwY1V2TxBE5U4seztvdo
rrkwX9xIgD2FK3d8cywg9pbrO8rB4EmvrsmWXnEQRdBHbBoqfUjLZLRreaQByKuB
zukAjb01sGZxub6t8YqTpRGpmnhQCLtvogl7+l0zRqV/8zkZp1ho0iErMM8gi87n
dluKhgLECXLdGXnDV/EPhEQRnQI3JIDsvoQY8iSxaZHBSwBPBBkj/0rAEz4Kb7Bx
FfQHUJqNFaVgRvTORt934+w/k0saXopNd7Uu+ngCQVTT4Eaq6PU=
=ID7+
-END PGP SIGNATURE-

Andreas Schneider (14):
  cmake: Fix cmocka >= 1.1.6 find_package() in CONFIG mode
  gitlab-ci: Add a 32bit build
  cmake: Define large file support for tests
  tests: Use F_(OFD)SETLK(64) in test_fcntl_lock
  swrap: Add support for openat64()
  Bump version to 1.4.1
  tests: Do not build test_swrap_unit with LFS support
  swrap: Make sure we do not redirect (f)open(at)() or fcntl()
  tests: Implement test_fcntl_lock correctly
  tests(cmake): Fix handling of LFS support
  swrap: Fix fnctl64()
  swrap: Provide a fcntl64()
  gitlab-ci: Add Ubuntu 32bit build
  Bump version to 1.4.2

Andrew Bartlett (2):
  Add test for F_SETLK as this is needs to be 64-bit aware on 32-bit 
userspace
  Add fix for incorrect mapping of fcntl64() -> fcntl(), causing locking 
failures

Jakub Jelen (2):
  tests: Try larger writes and reads
  tests: New test with poll

---


-- 
Socket Wrapper Repository



[SCM] Socket Wrapper Repository - branch master updated

2023-06-29 Thread Andreas Schneider
The branch, master has been updated
   via  d07136e Bump version to 1.4.2
  from  81a8970 gitlab-ci: Add Ubuntu 32bit build

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


- Log -
commit d07136e8a6934e128b8be6860b7d08966691f8c8
Author: Andreas Schneider 
Date:   Thu Jun 29 13:37:19 2023 +0200

Bump version to 1.4.2

Reviewed-by: Stefan Metzmacher 

---

Summary of changes:
 CHANGELOG  | 3 +++
 CMakeLists.txt | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/CHANGELOG b/CHANGELOG
index 0e1d39c..48192d5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,9 @@
 CHANGELOG
 =
 
+version 1.4.2 (released 2023-06-29)
+  * Fixed LFS issues on 32bit platforms
+
 version 1.4.1 (released 2023-06-21)
   * Fixed issue with fnctl() on 32bit
   * Added openat64() to detect stale fds
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02fe340..5b235d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ list(APPEND CMAKE_MODULE_PATH 
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
 include(DefineCMakeDefaults)
 include(DefineCompilerFlags)
 
-project(socket_wrapper VERSION 1.4.1 LANGUAGES C)
+project(socket_wrapper VERSION 1.4.2 LANGUAGES C)
 
 # global needed variables
 set(APPLICATION_NAME ${PROJECT_NAME})


-- 
Socket Wrapper Repository



[SCM] Socket Wrapper Repository - branch master updated

2023-06-29 Thread Andreas Schneider
The branch, master has been updated
   via  81a8970 gitlab-ci: Add Ubuntu 32bit build
   via  3d318d4 swrap: Provide a fcntl64()
   via  593ab18 swrap: Fix fnctl64()
   via  51fbe21 tests(cmake): Fix handling of LFS support
   via  72d3b3c tests: Implement test_fcntl_lock correctly
   via  bbe14cc swrap: Make sure we do not redirect (f)open(at)() or fcntl()
   via  70ecbaa tests: Do not build test_swrap_unit with LFS support
  from  d8b61a6 Bump version to 1.4.1

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


- Log -
commit 81a897096588acc658f3834f084ea92c3a8c1746
Author: Andreas Schneider 
Date:   Thu Jun 22 18:30:52 2023 +0200

gitlab-ci: Add Ubuntu 32bit build

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

commit 3d318d40907964168cc0fdda9492b80f11c1dddf
Author: Andreas Schneider 
Date:   Fri Jun 23 11:10:45 2023 +0200

swrap: Provide a fcntl64()

We want to run with and without large file support. It depends on if the
application is build with large file support so it will either choose fcntl 
or
fcntl64.

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

commit 593ab1862a1d076f30185f7fc03a1fdcf725be56
Author: Andreas Schneider 
Date:   Thu Jun 22 18:32:30 2023 +0200

swrap: Fix fnctl64()

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

commit 51fbe21156fcb55db6dba3fb329daae24f0fba3d
Author: Andreas Schneider 
Date:   Tue Jun 27 12:02:30 2023 +0200

tests(cmake): Fix handling of LFS support

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

commit 72d3b3c26a51024e35f82673f6d7ce734ccf54bf
Author: Andreas Schneider 
Date:   Fri Jun 23 13:50:03 2023 +0200

tests: Implement test_fcntl_lock correctly

This does:

openat(AT_FDCWD, "/tmp/test_socket_wrapper_Win6aA/file", O_RDWR|O_CREAT, 
0600) = 3
fcntl(3, F_OFD_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, 
l_len=1}) = 0
write(3, "fd=3\n", 5)   = 5
fcntl(3, F_OFD_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0, 
l_len=1}) = 0
unlink("/tmp/test_socket_wrapper_Win6aA/file") = 0  

 close(3)
close(3)= 0

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

commit bbe14cc3200ca553b13ed49357e2e88ba487eeaa
Author: Andreas Schneider 
Date:   Tue Jun 27 12:18:53 2023 +0200

swrap: Make sure we do not redirect (f)open(at)() or fcntl()

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

commit 70ecbaaac38dd47d1b3343ae828a3a7b9ab980c2
Author: Andreas Schneider 
Date:   Tue Jun 27 12:01:46 2023 +0200

tests: Do not build test_swrap_unit with LFS support

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

---

Summary of changes:
 .gitlab-ci.yml  |  20 
 config.h.cmake  |   1 +
 src/socket_wrapper.c| 129 
 tests/CMakeLists.txt|  21 ++--
 tests/test_fcntl_lock.c |  46 -
 5 files changed, 182 insertions(+), 35 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ef98aeb..3643167 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ variables:
   TUMBLEWEED_BUILD: buildenv-tumbleweed
   MINGW_BUILD: buildenv-mingw
   UBUNTU_BUILD: buildenv-ubuntu
+  UBUNTU32_BUILD: buildenv-ubuntu32
 
 stages:
   - build
@@ -307,3 +308,22 @@ ubuntu/x86_64:
 when: on_failure
 paths:
   - obj/
+
+ubuntu/x86:
+  stage: test
+  image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$UBUNTU32_BUILD
+  script:
+- mkdir -p obj && cd obj && cmake
+  -DCMAKE_BUILD_TYPE=RelWithDebInfo
+  -DPICKY_DEVELOPER=ON
+  -DUNIT_TESTING=ON .. &&
+  make -j$(nproc) && ctest --output-on-failure
+  tags:
+- shared
+  except:
+- tags
+  artifacts:
+expire_in: 1 week
+when: on_failure
+paths:
+  - obj/
diff --git a/config.h.cmake b/config.h.cmake
index 399013e..3a5843a 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -45,6 +45,7 @@
 #cmakedefine HAVE_OPEN64 1
 #cmakedefine HAVE_OPENAT64 1
 #cmakedefine HAVE_FOPEN64 1
+#cmakedefine HAVE_FCNTL64 1
 #cmakedefine HAVE_GETPROGNAME 1
 #cmakedefine HAVE_GETEXECNAME 1
 #cmakedefine HAVE_PLEDGE 1
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index dc07b53..c759d35 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -44,6 +44,12 @@
 
 #include "config.h"
 
+/*
+ * Make sure we do not redirect (f)open(at)() or fcntl() to their 64bit
+ * variants
+ */
+#undef _FILE_OFFSET_BITS
+
 #include 
 #include 
 #include