[SCM] Samba Shared Repository - branch master updated

2021-06-25 Thread Ralph Böhme
The branch, master has been updated
   via  c2fde31b1c2 s3: smbd: Cleanup - rename get_ea_names_from_file() -> 
get_ea_names_from_fsp().
   via  e30094e6c03 s3: smbd: Rename get_ea_value() -> get_ea_value_fsp().
   via  a117624bb19 s3: VFS: streams_xattr: Rename get_xattr_size() -> 
get_xattr_size_fsp().
   via  0c210a84dbf s3: VFS: streams_xattr: In streams_xattr_stat() - 
~S_IFMT already removes S_IFDIR.
   via  5f54eb555d0 s3: VFS: streams_xattr: Use openat_pathref_fsp() to 
create a smb_fname->fsp (and the smb_fname->fsp->base_fsp) if the incoming name 
doesn't have one.
   via  33521d2df33 s3: VFS: streams_xattr: In streams_xattr_stat(), make 
use of smb_fname->fsp->base_fsp if it has one.
   via  d1a0e9b81da s3: VFS: streams_xattr: Bring streams_xattr_stat_base() 
inline into streams_xattr_stat().
   via  d515c13ba75 s3: VFS: streams_xattr: Simplify streams_xattr_lstat().
   via  cacce8babf9 s3: VFS: streams_xattr: Use fsp->base_fsp for the fsp 
parameter to get_xattr_size() in streams_xattr_fstat().
   via  520a78d9752 s3: VFS: streams_xattr: Add an fsp parameter to 
get_xattr_size().
   via  3c0594d42eb s3: VFS: streams_xattr: In streams_xattr_openat() we 
can assume fsp->base_fsp != NULL.
   via  82c95d13390 s3: VFS: streams_xattr: In walk_xattr_streams() use 
smb_fname->fsp for get_ea_value().
   via  fa3609fb89f s3: VFS: streams_xattr: In streams_xattr_ftruncate() - 
remove smb_fname_base.
   via  caf61fc8c9a s3: VFS: streams_xattr: In streams_xattr_ftruncate() - 
use the fsp->base_fsp argument for get_ea_value().
   via  5d12971c58b s3: VFS: streams_xattr: In streams_xattr_ftruncate() - 
remove conditional.
   via  435c3f9ec1a s3: VFS: streams_xattr: In streams_xattr_pread() - 
remove smb_fname_base.
   via  fbfd4183d64 s3: VFS: streams_xattr: In streams_xattr_pread() - use 
the fsp->base_fsp argument for get_ea_value().
   via  b8190ce3d87 s3: VFS: streams_xattr: In streams_xattr_pwrite() - 
remove smb_fname_base.
   via  2fdbac2c5fe s3: VFS: streams_xattr: In streams_xattr_pwrite() - use 
the fsp->base_fsp argument for get_ea_value().
   via  28f7846fdd5 s3: VFS: streams_xattr: In streams_xattr_pwrite() - 
remove conditional.
   via  0f04e1a47df s3: VFS: ceph_snapshots: Remove ceph_snap_get_btime().
   via  2298974b3fa s3: VFS: ceph_snapshots: In ceph_snap_gmt_convert_dir() 
- change to use ceph_snap_get_btime_fsp().
   via  8fc84ac100d s3: VFS: ceph_snapshots: In ceph_snap_fill_label(), use 
ceph_snap_get_btime_fsp() instead of ceph_snap_get_btime().
   via  abe3a396e0e s3: VFS: ceph_snapshots: In ceph_snap_fill_label() - 
pass in dirfsp instead of the raw path.
   via  fe9575c88f0 s3: VFS: ceph_snapshots: Add ceph_snap_get_btime_fsp().
   via  da18c67732f s3: VFS: fake_acls: Remove unused 
fake_acls_uid()/fake_acls_gid().
   via  2e518078388 s3: VFS: fake_acls: In fake_acls_stat() - Now we always 
have a valid fsp, remove the calls to the path-based functions.
   via  243bce41583 s3: VFS: fake_acls: In fake_acls_stat() - use 
openat_pathref_fsp() to always get a pathref fsp.
   via  d2b78728514 s3: VFS: fake_acls: In fake_acls_stat() - if we have a 
pathref fsp, use it.
   via  6e6f532c5fc s3: VFS: fake_acls: In fake_acls_stat() - remove call 
to get_full_smb_filename().
   via  cf51681aac9 s3: VFS: fake_acls: In fake_acls_lstat() - get a 
pathref on whatever the link points to and use the handle-based functions.
   via  13778b4c731 s3: VFS: fake_acls: In fake_acls_lstat() - remove call 
to get_full_smb_filename().
   via  c308ffa41c2 s3: VFS: streams_depot: file_is_valid(), 
SMB_VFS_GETXATTR() -> SMB_VFS_FGETXATTR().
   via  981f714369b s3: lib: adouble: Remove ad_set() - Dead code. Not used 
anywhere.
   via  303d15e14fc s3: lib: adouble: Protect ad_read_meta() from 
accidently using a NULL fsp.
   via  ff09fc77a21 s3: torture: In cmd_getxattr(), SMB_VFS_GETXATTR() -> 
SMB_VFS_FGETXATTR().
   via  198413da763 s3: smbd: get_ea_list_from_fsp(). Make it clear we're 
using only the fsp by replacing the fsp->fsp_name with NULL.
   via  757b7d5c6ae s3: smbd: fload_inherited_info(). Always use 
SMB_VFS_FGETXATTR().
   via  f694b36335e s3: modules: acl_xattr: getxattr_do(). Remove the 
smb_fname parameter.
   via  4670cf1da6f s3: smbd: Temporarily add protection to get_ea_value() 
for fsp==NULL and smb_fname==NULL.
   via  2dd7ac6a6eb s3: smbd: get_ea_value(). If we have an fsp, *always* 
use it for SMB_VFS_FGETXATTR().
   via  b63ac2ed97f s3: smbd: Move the call to fsp_set_fd(conn->cwd_fsp, 
AT_FDCWD) to just after SMB_VFS_CHDIR().
   via  bd0bad6f58a s3: smbd: On startup file_name_hash() can be called 
with an absolute pathname.
   via  a6df051dd5e s3: smbd: In openat_pathref_fsp(), just check we're 
opening the same file type, not dev and inode.
   via  0d78398beea s4: torture: Improve error messages in 

[SCM] Samba Shared Repository - branch master updated

2021-06-25 Thread Amitay Isaacs
The branch, master has been updated
   via  466aa8b6f5a ctdb-scripts: Ignore ShellCheck SC3013 for test -nt
   via  fc0da6b0f87 ctdb-tests: Force stub version of service in 
eventscript tests
   via  23b2fab2c88 ctdb-common: Drop unused include of mkdir_p.h
   via  e40d452722d ctdb-daemon: Close server socket when switching to 
client
  from  62875044ec4 WHATSNEW: Document changes of trusted domains scanning 
and enterpise principals

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


- Log -
commit 466aa8b6f5a61d523d708ceb3d5ab1c409bccc1b
Author: Martin Schwenke 
Date:   Mon Jun 21 20:30:21 2021 +1000

ctdb-scripts: Ignore ShellCheck SC3013 for test -nt

In ShellCheck 0.7.2, POSIX compatibility warnings got their own SC3xxx
error codes, so now both the old and new codes need to be ignored.

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

Autobuild-User(master): Amitay Isaacs 
Autobuild-Date(master): Fri Jun 25 10:06:48 UTC 2021 on sn-devel-184

commit fc0da6b0f878d70ff19a568cbb2e47972b45c0b1
Author: Martin Schwenke 
Date:   Mon Jun 21 15:26:38 2021 +1000

ctdb-tests: Force stub version of service in eventscript tests

Fedora 34 now has a shell function for the which command, which causes
these uses of which to return the enclosing function definition rather
than the executable file as expected.

The event script unit tests always expect the stub service command to
be used, so the conditional in these functions is unnecessary.
$CTDB_HELPER_BINDIR already conveniently points to the stub directory,
so use it here.

Signed-off-by: Martin Schwenke 
Signed-off-by: Amitay Isaacs 

commit 23b2fab2c886a5cdc72a87aa0d2e14c9e6b96b1c
Author: Martin Schwenke 
Date:   Tue Sep 15 13:54:30 2020 +1000

ctdb-common: Drop unused include of mkdir_p.h

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

commit e40d452722d04d21e1c8cee2af2d175540634070
Author: Martin Schwenke 
Date:   Tue May 19 17:57:35 2020 +1000

ctdb-daemon: Close server socket when switching to client

The socket is set close-on-exec but that doesn't help for processes
that do not exec().  This should be done for all child processes.

This has been seen in testing where "ctdb shutdown" waits for the
socket to close before succeeding.  It appears that lingering
vacuuming processes have not closed the socket when becoming clients
so they cause "ctdb shutdown" to hang even though the main daemon
process has exited.  The cause of the lingering vacuuming processes
has been previously examined but still isn't understood.

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

---

Summary of changes:
 ctdb/common/system.c   |  2 --
 ctdb/config/nfs-linux-kernel-callout   |  2 +-
 ctdb/server/ctdb_daemon.c  |  5 +
 ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local | 16 +++-
 4 files changed, 9 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/common/system.c b/ctdb/common/system.c
index ab1941124d7..650b62bab16 100644
--- a/ctdb/common/system.c
+++ b/ctdb/common/system.c
@@ -41,8 +41,6 @@
 #include 
 #endif
 
-#include "lib/util/mkdir_p.h"
-
 /*
   if possible, make this task real time
  */
diff --git a/ctdb/config/nfs-linux-kernel-callout 
b/ctdb/config/nfs-linux-kernel-callout
index 6a372d4b4fd..9c2d0418e55 100755
--- a/ctdb/config/nfs-linux-kernel-callout
+++ b/ctdb/config/nfs-linux-kernel-callout
@@ -329,7 +329,7 @@ nfs_monitor_list_shares ()
 {
 _cache_file="${CTDB_NFS_CALLOUT_STATE_DIR}/list_shares_cache"
 # -nt operator is well supported in Linux: dash, bash, ksh, ...
-# shellcheck disable=SC2039
+# shellcheck disable=SC2039,SC3013
 if  [ ! -r "$nfs_exports_file" ] || [ ! -r "$_cache_file" ] || \
[ "$nfs_exports_file" -nt "$_cache_file" ] ; then
mkdir -p "$CTDB_NFS_CALLOUT_STATE_DIR"
diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c
index 9035f5b4748..57f80235e7c 100644
--- a/ctdb/server/ctdb_daemon.c
+++ b/ctdb/server/ctdb_daemon.c
@@ -2179,6 +2179,11 @@ int switch_from_server_to_client(struct ctdb_context 
*ctdb)
 {
int ret;
 
+   if (ctdb->daemon.sd != -1) {
+   close(ctdb->daemon.sd);
+   ctdb->daemon.sd = -1;
+   }
+
/* get a new event context */
ctdb->ev = tevent_context_init(ctdb);
if (ctdb->ev == NULL) {
diff --git a/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local 
b/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local
index e9a7f99829a..2f506e907a2 100755
--- a/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local
+++ b/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local
@@ -1,24 +1,14 @@
 # Hey Emacs, 

[SCM] pam wrapper repository - branch master updated

2021-06-25 Thread Andreas Schneider
The branch, master has been updated
   via  4efe631 cmake: Remove configure check for pam_modutil_search_key
   via  beba95f Revert "pwrap: Add back pso_copy for openSUSE Tumbleweed"
  from  71253c1 libpamtest: Fix missing pam_handle argument in 
run_pamtest_conv macro

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


- Log -
commit 4efe631246d9b1475b6e8836d68e71f482493f6a
Author: Andreas Schneider 
Date:   Fri Oct 23 18:37:57 2020 +0200

cmake: Remove configure check for pam_modutil_search_key

This was just temporary for openSUSE Tumbleweed.

Signed-off-by: Andreas Schneider 
Reviewed-by: Samuel Cabrero 

commit beba95f1eac18d08c8821be131fb879a16c692fe
Author: Andreas Schneider 
Date:   Fri Oct 23 18:37:08 2020 +0200

Revert "pwrap: Add back pso_copy for openSUSE Tumbleweed"

Tumbleweed has pam 1.4.0 now!

This reverts commit 97fdcec92ee34cf061222e3d12c2624ec7ab4ff7.

Reviewed-by: Samuel Cabrero 

---

Summary of changes:
 ConfigureChecks.cmake |   3 --
 config.h.cmake|   1 -
 src/pam_wrapper.c | 125 --
 3 files changed, 129 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index dcf5f31..d28cf66 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -77,9 +77,6 @@ set(CMAKE_REQUIRED_LIBRARIES ${PAM_LIBRARY})
 check_function_exists(pam_syslog HAVE_PAM_SYSLOG)
 check_function_exists(pam_vsyslog HAVE_PAM_VSYSLOG)
 check_function_exists(pam_start_confdir HAVE_PAM_START_CONFDIR)
-# This is available in current PAM master and will be used as a workaround
-# till pam_start_confdir() is available.
-check_function_exists(pam_modutil_search_key HAVE_PAM_MODUTIL_SEARCH_KEY)
 unset(CMAKE_REQUIRED_LIBRARIES)
 
 # OPTIONS
diff --git a/config.h.cmake b/config.h.cmake
index 80208aa..7d6ee24 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -21,7 +21,6 @@
 #cmakedefine HAVE_PAM_VSYSLOG 1
 #cmakedefine HAVE_PAM_SYSLOG 1
 #cmakedefine HAVE_PAM_START_CONFDIR 1
-#cmakedefine HAVE_PAM_MODUTIL_SEARCH_KEY 1
 
 #cmakedefine HAVE_PAM_VPROMPT_CONST 1
 #cmakedefine HAVE_PAM_PROMPT_CONST 1
diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c
index efa7cbb..da2c738 100644
--- a/src/pam_wrapper.c
+++ b/src/pam_wrapper.c
@@ -948,130 +948,6 @@ static void pwrap_init(void)
 
 #else /* HAVE_PAM_START_CONFDIR */
 
-#ifdef HAVE_PAM_MODUTIL_SEARCH_KEY
-/*
- * This is needed to workaround Tumbleweed which packages a libpam git version.
- */
-static int pso_copy(const char *src, const char *dst, const char *pdir, mode_t 
mode)
-{
-#define PSO_COPY_READ_SIZE 16
-   int srcfd = -1;
-   int dstfd = -1;
-   int rc = -1;
-   ssize_t bread, bwritten;
-   struct stat sb;
-   char buf[PSO_COPY_READ_SIZE + 1];
-   size_t pso_copy_read_size = PSO_COPY_READ_SIZE;
-   int cmp;
-   size_t to_read;
-   bool found_slash;
-
-   cmp = strcmp(src, dst);
-   if (cmp == 0) {
-   return -1;
-   }
-
-   srcfd = open(src, O_RDONLY, 0);
-   if (srcfd < 0) {
-   return -1;
-   }
-
-   if (mode == 0) {
-   rc = fstat(srcfd, );
-   if (rc != 0) {
-   rc = -1;
-   goto out;
-   }
-   mode = sb.st_mode;
-   }
-
-   dstfd = open(dst, O_CREAT|O_WRONLY|O_TRUNC, mode);
-   if (dstfd < 0) {
-   rc = -1;
-   goto out;
-   }
-
-   found_slash = false;
-   to_read = 1;
-
-   for (;;) {
-   bread = read(srcfd, buf, to_read);
-   if (bread == 0) {
-   /* done */
-   break;
-   } else if (bread < 0) {
-   errno = EIO;
-   rc = -1;
-   goto out;
-   }
-
-   to_read = 1;
-   if (!found_slash && buf[0] == '/') {
-   found_slash = true;
-   to_read = pso_copy_read_size;
-   }
-
-   if (found_slash && bread == PSO_COPY_READ_SIZE) {
-   cmp = memcmp(buf, "usr/etc/pam.d/%s", 16);
-   if (cmp == 0) {
-   char tmp[16] = {0};
-
-   snprintf(tmp, sizeof(tmp), "%s/%%s", pdir + 1);
-
-   memcpy(buf, tmp, 12);
-   memset([12], '\0', 4);
-
-   /*
-* If we found this string, we need to reduce
-* the read size to not miss, the next one.
-*/
-   pso_copy_read_size = 13;
-   } else {
- 

[SCM] pam wrapper repository - branch master updated

2021-06-25 Thread Andreas Schneider
The branch, master has been updated
   via  71253c1 libpamtest: Fix missing pam_handle argument in 
run_pamtest_conv macro
  from  3508ad2 Accept whole range of supported pids

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


- Log -
commit 71253c15cced205e58e3ae0e1220e95b49e38695
Author: Samuel Cabrero 
Date:   Fri Jun 25 10:06:09 2021 +0200

libpamtest: Fix missing pam_handle argument in run_pamtest_conv macro

Signed-off-by: Samuel Cabrero 
Reviewed-by: Andreas Schneider 

---

Summary of changes:
 include/libpamtest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/include/libpamtest.h b/include/libpamtest.h
index 4ebe83f..4b4a50e 100644
--- a/include/libpamtest.h
+++ b/include/libpamtest.h
@@ -180,7 +180,7 @@ enum pamtest_err run_pamtest_conv(const char *service,
  struct pam_testcase test_cases[],
  pam_handle_t *pam_handle);
 #else
-#define run_pamtest_conv(service, user, conv_fn, conv_data, test_cases) \
+#define run_pamtest_conv(service, user, conv_fn, conv_data, test_cases, 
pam_handle) \
_pamtest_conv(service, user, conv_fn, conv_data, test_cases, 
sizeof(test_cases)/sizeof(test_cases[0], pam_handle)
 #endif
 


-- 
pam wrapper repository



[SCM] pam wrapper repository - branch master updated

2021-06-25 Thread Andreas Schneider
The branch, master has been updated
   via  3508ad2 Accept whole range of supported pids
  from  88b9921 cmake: Silence warning with gcc version >= 8

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


- Log -
commit 3508ad2704103e863fca8c45ecda25021850befc
Author: Jakub Jelen 
Date:   Thu Jun 24 10:24:31 2021 +0200

Accept whole range of supported pids

Signed-off-by: Jakub Jelen 
Reviewed-by: Samuel Cabrero 
Reviewed-by: Andreas Schneider 

---

Summary of changes:
 src/pam_wrapper.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c
index 6801d7b..efa7cbb 100644
--- a/src/pam_wrapper.c
+++ b/src/pam_wrapper.c
@@ -791,14 +791,20 @@ static void pwrap_clean_stale_dirs(const char *dir)
buf[sizeof(buf) - 1] = '\0';
 
tmp = strtol(buf, NULL, 10);
-   if (tmp == 0 || tmp > 0x || errno == ERANGE) {
+   if (tmp == 0 || errno == ERANGE) {
PWRAP_LOG(PWRAP_LOG_ERROR,
  "Failed to parse pid, buf=%s",
  buf);
return;
}
 
-   pid = (pid_t)(tmp & 0x);
+   pid = (pid_t)tmp;
+   /* Check if we are out of pid_t range on this system */
+   if ((long)pid != tmp) {
+   PWRAP_LOG(PWRAP_LOG_ERROR,
+ "pid out of range: %ld", tmp);
+   return;
+   }
 
rc = kill(pid, 0);
if (rc == -1) {


-- 
pam wrapper repository