Skip to contentSkip to conversation

samhain: upgrade 4.4.10 -> 4.5.2

PATCH New Yi Zhao 1 participant 5 messages Mar 27, 2025

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/5 samhain: upgrade 4.4.10 -> 4.5.2

ChangeLog:
https://fossies.org/linux/samhain/docs/Changelog

* Refresh patches

---
 ...001-Hash-fix-for-MIPS64-and-AARCH64.patch} | 27 ++++---
 ... => 0002-Make-samhainrc-OE-friendly.patch} | 25 ++++---
 ...3-fix-real-path-for-some-files-dirs.patch} | 10 +--
 ...t-the-PID-Lock-path-for-samhain.pid.patch} | 21 +++---
 ...-Fix-sha256-for-big-endian-machines.patch} | 16 ++++-
 ...=> 0006-configure-add-option-for-ps.patch} | 72 +++++++++++--------
 ...avoid-searching-host-for-postgresql.patch} | 27 +++----
 ...riable-for-compiling-samhain_setpwd.patch} |  8 +--
 ...009-fix-build-with-new-version-attr.patch} | 22 +++---
 ...initializer-element-is-not-constant.patch} | 10 ++-
 ...ost-since-we-are-doing-cross-compil.patch} | 13 ++--
 ...=> 0012-Don-t-expose-configure-args.patch} |  4 +-
 recipes-ids/samhain/files/run-ptest           |  0
 recipes-ids/samhain/samhain-standalone.bb     |  7 +-
 recipes-ids/samhain/samhain.inc               | 24 +++----
 15 files changed, 168 insertions(+), 118 deletions(-)
 rename recipes-ids/samhain/files/{samhain-mips64-aarch64-dnmalloc-hash-fix.patch => 0001-Hash-fix-for-MIPS64-and-AARCH64.patch} (70%)
 rename recipes-ids/samhain/files/{samhain-samhainrc.patch => 0002-Make-samhainrc-OE-friendly.patch} (87%)
 rename recipes-ids/samhain/files/{samhain-samhainrc-fix-files-dirs-path.patch => 0003-fix-real-path-for-some-files-dirs.patch} (85%)
 rename recipes-ids/samhain/files/{samhain-pid-path.patch => 0004-Set-the-PID-Lock-path-for-samhain.pid.patch} (54%)
 rename recipes-ids/samhain/files/{samhain-sha256-big-endian.patch => 0005-Fix-sha256-for-big-endian-machines.patch} (50%)
 rename recipes-ids/samhain/files/{samhain-configure-add-option-for-ps.patch => 0006-configure-add-option-for-ps.patch} (67%)
 rename recipes-ids/samhain/files/{samhain-avoid-searching-host-for-postgresql.patch => 0007-configure.ac-avoid-searching-host-for-postgresql.patch} (87%)
 rename recipes-ids/samhain/files/{samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch => 0008-Add-LDFLAGS-variable-for-compiling-samhain_setpwd.patch} (83%)
 rename recipes-ids/samhain/files/{fix-build-with-new-version-attr.patch => 0009-fix-build-with-new-version-attr.patch} (78%)
 rename recipes-ids/samhain/files/{samhain-fix-initializer-element-is-not-constant.patch => 0010-Fix-initializer-element-is-not-constant.patch} (76%)
 rename recipes-ids/samhain/files/{samhain-not-run-ptest-on-host.patch => 0011-not-run-test-on-host-since-we-are-doing-cross-compil.patch} (57%)
 rename recipes-ids/samhain/files/{0001-Don-t-expose-configure-args.patch => 0012-Don-t-expose-configure-args.patch} (94%)
 mode change 100755 => 100644 recipes-ids/samhain/files/run-ptest
recipes-ids/samhain/files/0001-Hash-fix-for-MIPS64-and-AARCH64.patch renamed from recipes-ids/samhain/files/samhain-mips64-aarch64-dnmalloc-hash-fix.patch +16 -11
similarity index 70%
rename from recipes-ids/samhain/files/samhain-mips64-aarch64-dnmalloc-hash-fix.patch
rename to recipes-ids/samhain/files/0001-Hash-fix-for-MIPS64-and-AARCH64.patch
index 0608660..a34c553 100644
@@ -1,28 +1,30 @@
-commit 0f6bdc219e598de08a3f37887efa5dfa50e2b996
-Author: Aws Ismail <[email protected]>
-Date:   Fri Jun 22 15:47:08 2012 -0400
+From 3f6884e711cdbd66ceca8ed13158b11ca2d6ddc1 Mon Sep 17 00:00:00 2001
+From: Aws Ismail <[email protected]>
+Date: Fri, 22 Jun 2012 15:47:08 -0400
+Subject: [PATCH] Hash fix for MIPS64 and AARCH64
 
-Hash fix for MIPS64 and AARCH64
-    
 Samhain uses the addresses of local variables in generating hash
 values.  The hashing function is designed only for 32-bit values.
 For MIPS64 when a 64-bit address is passed in the resulting hash
 exceeds the limits of the underlying mechanism and samhain
-ultimately fails.  The solution is to simply take the lower 
+ultimately fails.  The solution is to simply take the lower
 32-bits of the address and use that in generating hash values.
-    
+
 Signed-off-by: Greg Moffatt <[email protected]>
 
 Upstream-Status: Pending
-    
+
 Signed-off-by: Aws Ismail <[email protected]>
 Signed-off-by: Jackie Huang <[email protected]>
+---
+ src/dnmalloc.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
 
 diff --git a/src/dnmalloc.c b/src/dnmalloc.c
-index da9a5c5..fc91400 100644
+index 9f7bacc..d6e9ec5 100644
 --- a/src/dnmalloc.c
 +++ b/src/dnmalloc.c
-@@ -2703,11 +2703,19 @@ static void freecilst_add(chunkinfoptr p) {
+@@ -2710,11 +2710,19 @@ static void freecilst_add(chunkinfoptr p) {
  }
  
  /* Calculate the hash table entry for a chunk */
@@ -38,7 +40,10 @@ index da9a5c5..fc91400 100644
  #else
  #define hash(p)  (((unsigned long) p - (unsigned long) startheap) >> 7)
  #endif
-+#endif /* CONFIG_ARCH_MIPS64 */ 
++#endif /* CONFIG_ARCH_MIPS64 */
  
  static void
  hashtable_add (chunkinfoptr ci)
+-- 
+2.34.1
+
recipes-ids/samhain/files/0002-Make-samhainrc-OE-friendly.patch renamed from recipes-ids/samhain/files/samhain-samhainrc.patch +15 -10
similarity index 87%
rename from recipes-ids/samhain/files/samhain-samhainrc.patch
rename to recipes-ids/samhain/files/0002-Make-samhainrc-OE-friendly.patch
index 145700a..5e0cf59 100644
@@ -1,20 +1,22 @@
-commit 4c6658441eb3ffc4e51ed70f78cbdab046957580
-Author: Aws Ismail <[email protected]>
-Date:   Fri Jun 22 16:38:20 2012 -0400
+From 5797a57fd839d4b42c38fec49a6f937ca2e359af Mon Sep 17 00:00:00 2001
+From: Aws Ismail <[email protected]>
+Date: Fri, 22 Jun 2012 16:38:20 -0400
+Subject: [PATCH] Make samhainrc OE-friendly.
 
-Make samhainrc OE-friendly.
-
-Patch the samhainrc that will be installed 
+Patch the samhainrc that will be installed
 as part of the 'make install' step to more
 accurately reflect what will be found, and
 what will be of concern, on a OE install.
-    
+
 Upstream-Status: Inappropriate [configuration]
 
 Signed-off-by: Aws Ismail <[email protected]>
+---
+ samhainrc.linux | 63 +++++++++----------------------------------------
+ 1 file changed, 11 insertions(+), 52 deletions(-)
 
 diff --git a/samhainrc.linux b/samhainrc.linux
-index 9bc5ca4..10a8176 100644
+index 02906bb..5b6ec6a 100644
 --- a/samhainrc.linux
 +++ b/samhainrc.linux
 @@ -74,7 +74,6 @@ dir = 0/
@@ -128,7 +130,7 @@ index 9bc5ca4..10a8176 100644
  
  ## Remote server (yule)
  ##
-@@ -556,7 +513,8 @@ ChecksumTest=check
+@@ -539,7 +496,8 @@ ChecksumTest=check
  ## and I/O limit (kilobytes per second; 0 == off)
  ## to reduce load on host.
  #
@@ -138,7 +140,7 @@ index 9bc5ca4..10a8176 100644
  # SetIOLimit = 0
  
  ## The version string to embed in file signature databases
-@@ -565,13 +523,14 @@ ChecksumTest=check
+@@ -548,13 +506,14 @@ ChecksumTest=check
  
  ## Interval between time stamp messages
  #
@@ -156,3 +158,6 @@ index 9bc5ca4..10a8176 100644
  
  ## Alternative: crontab-like schedule
  #
+-- 
+2.34.1
+
recipes-ids/samhain/files/0003-fix-real-path-for-some-files-dirs.patch renamed from recipes-ids/samhain/files/samhain-samhainrc-fix-files-dirs-path.patch +5 -5
similarity index 85%
rename from recipes-ids/samhain/files/samhain-samhainrc-fix-files-dirs-path.patch
rename to recipes-ids/samhain/files/0003-fix-real-path-for-some-files-dirs.patch
index dad6b15..222e1cf 100644
@@ -1,4 +1,4 @@
-From 00fb527e45da42550156197647e01de9a6b1ad52 Mon Sep 17 00:00:00 2001
+From 041af4897336b0873cbac8d15b434638bf3aaf7e Mon Sep 17 00:00:00 2001
 From: Wenzong Fan <[email protected]>
 Date: Mon, 3 Mar 2014 01:50:01 -0500
 Subject: [PATCH] fix real path for some files/dirs
@@ -7,11 +7,11 @@ Upstream-Status: Inappropriate [configuration]
 
 Signed-off-by: Wenzong Fan <[email protected]>
 ---
- samhainrc.linux |   15 +++++++--------
- 1 file changed, 7 insertions(+), 8 deletions(-)
+ samhainrc.linux | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
 
 diff --git a/samhainrc.linux b/samhainrc.linux
-index e9727b4..7775d83 100644
+index 5b6ec6a..ff6ddf1 100644
 --- a/samhainrc.linux
 +++ b/samhainrc.linux
 @@ -93,7 +93,6 @@ dir = 99/etc
@@ -57,5 +57,5 @@ index e9727b4..7775d83 100644
  [Attributes]
  #
 -- 
-1.7.9.5
+2.34.1
 
recipes-ids/samhain/files/0004-Set-the-PID-Lock-path-for-samhain.pid.patch renamed from recipes-ids/samhain/files/samhain-pid-path.patch +13 -8
similarity index 54%
rename from recipes-ids/samhain/files/samhain-pid-path.patch
rename to recipes-ids/samhain/files/0004-Set-the-PID-Lock-path-for-samhain.pid.patch
index 8fdadd1..0ae4b62 100644
@@ -1,22 +1,24 @@
-commit a932b03b65edeb02ccad2fce06bfa68a8f2fbb04
-Author: Aws Ismail <[email protected]>
-Date:   Thu Jan 10 16:29:05 2013 -0500
+From 942843096e86669492700f49abc2c6489ea9994e Mon Sep 17 00:00:00 2001
+From: Aws Ismail <[email protected]>
+Date: Thu, 10 Jan 2013 16:29:05 -0500
+Subject: [PATCH] Set the PID Lock path for samhain.pid
 
-Set the PID Lock path for samhain.pid
-    
 The explicit path for samhain.pid inorder
 for samhain to work properly after it initial
 database build.
-    
+
 Upstream-Status: Inappropriate [configuration]
 
 Signed-off-by: Aws Ismail <[email protected]>
+---
+ samhainrc.linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/samhainrc.linux b/samhainrc.linux
-index 10a8176..a7b06e6 100644
+index ff6ddf1..d4b71e9 100644
 --- a/samhainrc.linux
 +++ b/samhainrc.linux
-@@ -639,7 +639,7 @@ SetFileCheckTime = 86400
+@@ -621,7 +621,7 @@ SetFileCheckTime = 86400
  
  ## Path to the PID file
  #
@@ -25,3 +27,6 @@ index 10a8176..a7b06e6 100644
  
  
  ## The digest/checksum/hash algorithm
+-- 
+2.34.1
+
recipes-ids/samhain/files/0005-Fix-sha256-for-big-endian-machines.patch renamed from recipes-ids/samhain/files/samhain-sha256-big-endian.patch +13 -3
similarity index 50%
rename from recipes-ids/samhain/files/samhain-sha256-big-endian.patch
rename to recipes-ids/samhain/files/0005-Fix-sha256-for-big-endian-machines.patch
index 3065c73..9467a60 100644
@@ -1,4 +1,7 @@
-samhain: fix sha256 for big-endian machines
+From 54242aa53da0d69c04b76c22120956ac6079ef6f Mon Sep 17 00:00:00 2001
+From: Joe Slater <[email protected]>
+Date: Thu, 27 Mar 2025 11:12:33 +0800
+Subject: [PATCH] Fix sha256 for big-endian machines
 
 After computing the digest, big-endian machines would
 memset() the digest to the first byte of state instead
@@ -7,11 +10,15 @@ of using memcpy() to transfer it.
 Upstream-Status: Pending
 
 Signed-off-by: Joe Slater <[email protected]>
+---
+ src/sh_checksum.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
-
+diff --git a/src/sh_checksum.c b/src/sh_checksum.c
+index e434d5c..dc23738 100644
 --- a/src/sh_checksum.c
 +++ b/src/sh_checksum.c
-@@ -468,7 +468,7 @@ void SHA256_Final(sha2_byte digest[], SH
+@@ -468,7 +468,7 @@ void SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context)
        }
      }
  #else
@@ -20,3 +27,6 @@ Signed-off-by: Joe Slater <[email protected]>
      /* bcopy(context->state, d, SHA256_DIGEST_LENGTH); */
  #endif
    }
+-- 
+2.34.1
+
recipes-ids/samhain/files/0006-configure-add-option-for-ps.patch renamed from recipes-ids/samhain/files/samhain-configure-add-option-for-ps.patch +41 -31

94 lines not on this page · raw message

recipes-ids/samhain/files/0007-configure.ac-avoid-searching-host-for-postgresql.patch renamed from recipes-ids/samhain/files/samhain-avoid-searching-host-for-postgresql.patch +15 -12
similarity index 87%
rename from recipes-ids/samhain/files/samhain-avoid-searching-host-for-postgresql.patch
rename to recipes-ids/samhain/files/0007-configure.ac-avoid-searching-host-for-postgresql.patch
index a84229e..9652c53 100644
@@ -1,4 +1,4 @@
-From 3e2ca7e06b16ceff6d12beb5113312f6525df595 Mon Sep 17 00:00:00 2001
+From 117078cd32ee2c76bbe7d65325fbc0b451c73ace Mon Sep 17 00:00:00 2001
 From: Jackie Huang <[email protected]>
 Date: Thu, 14 Sep 2017 11:02:12 +0800
 Subject: [PATCH] configure.ac: avoid searching host for postgresql
@@ -7,16 +7,16 @@ Upstream-Status: Inappropriate [cross compile specific]
 
 Signed-off-by: Jackie Huang <[email protected]>
 ---
- configure.ac | 101 +++--------------------------------------------------------
+ configure.ac | 101 +++------------------------------------------------
  1 file changed, 5 insertions(+), 96 deletions(-)
 
-Index: samhain-4.4.2/configure.ac
-===================================================================
---- samhain-4.4.2.orig/configure.ac
-+++ samhain-4.4.2/configure.ac
-@@ -1290,90 +1290,11 @@ AC_ARG_WITH(database,
-           AC_DEFINE(WITH_POSTGRES)
-           AC_DEFINE(WITH_DATABASE)
+diff --git a/configure.ac b/configure.ac
+index d0e3657..5b8d167 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1351,90 +1351,11 @@ AC_ARG_WITH(database,
+           AC_DEFINE([WITH_POSTGRES], [1], [Use postgres as database])
+           AC_DEFINE([WITH_DATABASE], [1], [Use a database])
  	  #
 -	  PGCONF="no"
 -	  MY_PATH="${PATH}:/usr/local/bin:/usr/local/pgsql/bin"
@@ -103,14 +103,14 @@ Index: samhain-4.4.2/configure.ac
 -            AC_MSG_RESULT(yes)
 -
 +	  if test -z "${PGSQL_LIB_DIR}" ; then
-+            FAIL_MESSAGE("PGSQL_LIB_DIR is not set!")
++	    FAIL_MESSAGE("PGSQL_LIB_DIR is not set!")
 +	  elif test -z "${PGSQL_INC_DIR}" ; then
-+            FAIL_MESSAGE("PGSQL_INC_DIR is not set!")
++	    FAIL_MESSAGE("PGSQL_INC_DIR is not set!")
 +	  else
  	    LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
  	    if test x"$enable_static" = xyes; then
  	      LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lcrypt -lm"
-@@ -1382,18 +1303,6 @@ AC_ARG_WITH(database,
+@@ -1443,18 +1364,6 @@ AC_ARG_WITH(database,
  	    fi
  	    # CFLAGS="$CFLAGS -I${PGSQL_INC_DIR}"
  	    CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}"
@@ -129,3 +129,6 @@ Index: samhain-4.4.2/configure.ac
  	  fi
  	elif test "x${withval}" = "xodbc"; then
  	  AC_MSG_CHECKING(for odbc in /usr /usr/local ODBC_HOME)
+-- 
+2.34.1
+
recipes-ids/samhain/files/0008-Add-LDFLAGS-variable-for-compiling-samhain_setpwd.patch renamed from recipes-ids/samhain/files/samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch +4 -4
similarity index 83%
rename from recipes-ids/samhain/files/samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch
rename to recipes-ids/samhain/files/0008-Add-LDFLAGS-variable-for-compiling-samhain_setpwd.patch
index 088a938..f2691e7 100644
@@ -1,4 +1,4 @@
-From ae79606a6745dbbd429d1d4671dfe3045d735057 Mon Sep 17 00:00:00 2001
+From 7fc1f0a8d4c6a109f7e86853a9136a008c68808a Mon Sep 17 00:00:00 2001
 From: Jackie Huang <[email protected]>
 Date: Thu, 14 Sep 2017 13:26:55 +0800
 Subject: [PATCH] Add LDFLAGS variable for compiling samhain_setpwd
@@ -11,10 +11,10 @@ Signed-off-by: Jackie Huang <[email protected]>
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile.in b/Makefile.in
-index 01de987..49356cf 100644
+index ade0638..1806159 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -1128,7 +1128,7 @@ sh_tiger_i.o: $(srcsrc)/$(TIGER_SRC) Makefile config_xor.h
+@@ -1159,7 +1159,7 @@ sh_tiger_i.o: $(srcsrc)/$(TIGER_SRC) Makefile config_xor.h
  samhain_setpwd: encode config_xor.h $(srcsrc)/samhain_setpwd.c
  	@echo '$(COMPILE)  -o samhain_setpwd $(srcsrc)/samhain_setpwd.c'; \
  	./encode $(XOR_CODE) $(srcsrc)/samhain_setpwd.c; \
@@ -24,5 +24,5 @@ index 01de987..49356cf 100644
  
  samhain_stealth: encode config_xor.h $(srcsrc)/samhain_stealth.c
 -- 
-2.11.0
+2.34.1
 
recipes-ids/samhain/files/0009-fix-build-with-new-version-attr.patch renamed from recipes-ids/samhain/files/fix-build-with-new-version-attr.patch +11 -11
similarity index 78%
rename from recipes-ids/samhain/files/fix-build-with-new-version-attr.patch
rename to recipes-ids/samhain/files/0009-fix-build-with-new-version-attr.patch
index eaf30db..b58eda9 100644
@@ -1,4 +1,4 @@
-From e67acafa62f71f0015ed548918b98ed0b1ded128 Mon Sep 17 00:00:00 2001
+From 9d693fbeb0a14bfe858aed2b46cb9e74a90d00b9 Mon Sep 17 00:00:00 2001
 From: Yi Zhao <[email protected]>
 Date: Sun, 19 Jan 2020 15:53:48 +0800
 Subject: [PATCH] fix build with new version attr
@@ -12,15 +12,15 @@ Upstream-Status: Pending
 
 Signed-off-by: Yi Zhao <[email protected]>
 ---
- aclocal.m4    | 26 +++++++++++---------------
+ acinclude.m4  | 26 +++++++++++---------------
  src/sh_unix.c |  2 +-
  2 files changed, 12 insertions(+), 16 deletions(-)
 
-diff --git a/aclocal.m4 b/aclocal.m4
-index ee5b204..38cef8e 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -1453,23 +1453,19 @@ AC_DEFUN([sh_CHECK_POSIX_ACL],
+diff --git a/acinclude.m4 b/acinclude.m4
+index e2a57e2..bfdd2f6 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1392,23 +1392,19 @@ AC_DEFUN([sh_CHECK_POSIX_ACL],
  
  AC_DEFUN([sh_CHECK_XATTR],
  [
@@ -53,13 +53,13 @@ index ee5b204..38cef8e 100644
 +  LIBS="$OLDLIBS"
 +
    if test x"$sh_fattr" = xyes; then
- 	  AC_DEFINE(USE_XATTR, 1, [Define if you want extended attributes support.])
+ 	  AC_DEFINE([USE_XATTR], [1], [Define if you want extended attributes support.])
  	  LIBS="$LIBS $LIBATTR"
 diff --git a/src/sh_unix.c b/src/sh_unix.c
-index 3ede57f..ef236e9 100644
+index b1c0b75..2469068 100644
 --- a/src/sh_unix.c
 +++ b/src/sh_unix.c
-@@ -3681,7 +3681,7 @@ static char * sh_unix_getinfo_acl (char * path, int fd, struct stat * buf)
+@@ -3682,7 +3682,7 @@ static char * sh_unix_getinfo_acl (char * path, int fd, struct stat * buf)
  
  #ifdef USE_XATTR
  
@@ -69,5 +69,5 @@ index 3ede57f..ef236e9 100644
  {
    char *  out   = NULL;
 -- 
-2.7.4
+2.34.1
 
recipes-ids/samhain/files/0010-Fix-initializer-element-is-not-constant.patch renamed from recipes-ids/samhain/files/samhain-fix-initializer-element-is-not-constant.patch +9 -1
similarity index 76%
rename from recipes-ids/samhain/files/samhain-fix-initializer-element-is-not-constant.patch
rename to recipes-ids/samhain/files/0010-Fix-initializer-element-is-not-constant.patch
index 72cb880..8479165 100644
@@ -1,3 +1,8 @@
+From 77d55c4707395b76e32e07bf0f679b5b6999d568 Mon Sep 17 00:00:00 2001
+From: Kai Kang <[email protected]>
+Date: Thu, 27 Mar 2025 11:43:40 +0800
+Subject: [PATCH] Fix initializer element is not constant
+
 Fix error when compile for powerpc:
 
 | x_sh_dbIO.c: In function 'swap_short':
@@ -13,7 +18,7 @@ Signed-off-by: Kai Kang <[email protected]>
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/src/sh_dbIO.c b/src/sh_dbIO.c
-index b547ac5..23a9621 100644
+index 1f9b152..503456d 100644
 --- a/src/sh_dbIO.c
 +++ b/src/sh_dbIO.c
 @@ -226,7 +226,8 @@ static unsigned short *  swap_short (unsigned short * iptr)
@@ -26,3 +31,6 @@ index b547ac5..23a9621 100644
        unsigned short hi   = (ooop & 0xff00);
        unsigned short lo   = (ooop & 0xff);
        ooop = (lo << 8) | (hi >> 8);
+-- 
+2.34.1
+
recipes-ids/samhain/files/0011-not-run-test-on-host-since-we-are-doing-cross-compil.patch renamed from recipes-ids/samhain/files/samhain-not-run-ptest-on-host.patch +8 -5
similarity index 57%
rename from recipes-ids/samhain/files/samhain-not-run-ptest-on-host.patch
rename to recipes-ids/samhain/files/0011-not-run-test-on-host-since-we-are-doing-cross-compil.patch
index e00fc2a..dc9f42e 100644
@@ -1,17 +1,20 @@
-not run test on host, since we are doing cross-compile
+From 506833786a4ae5b888f12c59b82f7d842cda778c Mon Sep 17 00:00:00 2001
+From: Roy Li <[email protected]>
+Date: Thu, 27 Mar 2025 11:46:20 +0800
+Subject: [PATCH] not run test on host, since we are doing cross-compile
 
 Upstream-Status: Inappropriate [cross compile specific]
 
 Signed-off-by: Roy Li <[email protected]>
 ---
- Makefile.in |    1 -
+ Makefile.in | 1 -
  1 file changed, 1 deletion(-)
 
 diff --git a/Makefile.in b/Makefile.in
-index e1b32a8..74bfdc9 100644
+index 1806159..eccb4f6 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -1234,7 +1234,6 @@ intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/CuTest
+@@ -1219,7 +1219,6 @@ intcutest: internal.h $(OBJECTS) $(CUTEST_OBJECTS) sh_tiger_i.o $(srcsrc)/CuTest
  	rm x_samhain.c; \
  	$(LINK) sh_tiger_i.o $(CUTEST_OBJECTS) CuTestMain.o CuTest.o $(OBJECTS) $(LIBS_TRY); \
  	test -f ./intcutest && mv ./intcutest ./cutest; \
@@ -20,5 +23,5 @@ index e1b32a8..74bfdc9 100644
  runcutest:
  	gdb ./cutest
 -- 
-1.7.10.4
+2.34.1
 
recipes-ids/samhain/files/0012-Don-t-expose-configure-args.patch renamed from recipes-ids/samhain/files/0001-Don-t-expose-configure-args.patch +2 -2
similarity index 94%
rename from recipes-ids/samhain/files/0001-Don-t-expose-configure-args.patch
rename to recipes-ids/samhain/files/0012-Don-t-expose-configure-args.patch
index fedbe5b..f881b5d 100644
@@ -1,4 +1,4 @@
-From 111b1e8f35e989513d8961a45a806767109f6e1e Mon Sep 17 00:00:00 2001
+From 4625ce72e462950cfbbd37ad2a19be625fd081b0 Mon Sep 17 00:00:00 2001
 From: Mingli Yu <[email protected]>
 Date: Thu, 11 Aug 2022 17:15:30 +0800
 Subject: [PATCH] Don't expose configure args
@@ -40,5 +40,5 @@ index 635a746..b9a42e7 100644
  
  	echo '#!/bin/sh' > ./sstrip
 -- 
-2.25.1
+2.34.1
 
recipes-ids/samhain/files/run-ptest +0 -0
old mode 100755
new mode 100644
recipes-ids/samhain/samhain-standalone.bb +4 -3
index ae9ed2b..87df017 100644
@@ -1,7 +1,7 @@
 require samhain.inc
 
-SRC_URI += "file://samhain-not-run-ptest-on-host.patch \
-            file://0001-Don-t-expose-configure-args.patch \
+SRC_URI += "file://0011-not-run-test-on-host-since-we-are-doing-cross-compil.patch \
+            file://0012-Don-t-expose-configure-args.patch \
             file://run-ptest \
 "
 
@@ -28,7 +28,8 @@ do_install:append() {
 
 do_install_ptest() {
 	mkdir -p ${D}${PTEST_PATH}
-	install ${S}/cutest ${D}${PTEST_PATH}
+	install -m 755 ${S}/cutest ${D}${PTEST_PATH}
+	install -m 644 ${S}/COPYING ${D}${PTEST_PATH}
 }
 
 RPROVIDES:${PN} += "samhain"
recipes-ids/samhain/samhain.inc +12 -12
index 65e6734..6b8d30e 100644
@@ -3,25 +3,25 @@ HOMEPAGE    = "http://www.la-samhna.de/samhain/"
 LICENSE     = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=8ca43cbc842c2336e835926c2166c28b"
 
-PV = "4.4.10"
+PV = "4.5.2"
 
 SRC_URI = "https://la-samhna.de/archive/samhain_signed-${PV}.tar.gz \
            file://${INITSCRIPT_NAME}.init \
            file://${INITSCRIPT_NAME}.default \
            file://samhain.service \
-           file://samhain-mips64-aarch64-dnmalloc-hash-fix.patch \
-           file://samhain-samhainrc.patch \
-           file://samhain-samhainrc-fix-files-dirs-path.patch \
-           file://samhain-pid-path.patch \
-           file://samhain-sha256-big-endian.patch \
-           file://samhain-configure-add-option-for-ps.patch \
-           file://samhain-avoid-searching-host-for-postgresql.patch \
-           file://samhain-add-LDFLAGS-variable-for-samhain_setpwd.patch \
-           file://fix-build-with-new-version-attr.patch \
-           file://samhain-fix-initializer-element-is-not-constant.patch \
+           file://0001-Hash-fix-for-MIPS64-and-AARCH64.patch \
+           file://0002-Make-samhainrc-OE-friendly.patch \
+           file://0003-fix-real-path-for-some-files-dirs.patch \
+           file://0004-Set-the-PID-Lock-path-for-samhain.pid.patch \
+           file://0005-Fix-sha256-for-big-endian-machines.patch \
+           file://0006-configure-add-option-for-ps.patch \
+           file://0007-configure.ac-avoid-searching-host-for-postgresql.patch \
+           file://0008-Add-LDFLAGS-variable-for-compiling-samhain_setpwd.patch \
+           file://0009-fix-build-with-new-version-attr.patch \
+           file://0010-Fix-initializer-element-is-not-constant.patch \
            "
 
-SRC_URI[sha256sum] = "ae6ee8eff3cb111b7fc14a57bcc258443dd0bcf1bfacfdf229935ed053c1ce3d"
+SRC_URI[sha256sum] = "0b5d3534fd60ecf45dfd79bd415e81f7a56eba7f1755771735e204f334033578"
 
 UPSTREAM_CHECK_URI = "https://www.la-samhna.de/samhain/archive.html"
 UPSTREAM_CHECK_REGEX = "samhain_signed-(?P<pver>(\d+(\.\d+)+))\.tar"
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/5 libgssglue: upgrade 0.8 -> 0.9

* Drop useless patch libgssglue-canon-name.patch

---
 .../files/libgssglue-canon-name.patch         | 60 -------------------
 .../{libgssglue_0.8.bb => libgssglue_0.9.bb}  |  6 +-
 2 files changed, 2 insertions(+), 64 deletions(-)
 delete mode 100644 recipes-security/libgssglue/files/libgssglue-canon-name.patch
 rename recipes-security/libgssglue/{libgssglue_0.8.bb => libgssglue_0.9.bb} (94%)
recipes-security/libgssglue/files/libgssglue-canon-name.patch deleted +0 -60
deleted file mode 100644
index cb7c47b..0000000
@@ -1,60 +0,0 @@
-fix the bug:
-g_canon_name.c:125:5: warning: passing argument 2 of '__gss_copy_namebuf' from incompatible pointer type [enabled by default]
-
-the 2nd argument of __gss_copy_namebuf should be address of *gss_buffer_t, \
-but a *gss_buffer_t is assigned.
-
-what __gss_copy_namebuf does is to alloc memory for a gss_buffer_desc and \
-copy from src and return its address.
-
-if following code failed, gss_release_name will free \
-union_canon_name->external_name.value if it is not NULL.
-
-OM_uint32 __gss_copy_namebuf(src, dest)
-    gss_buffer_t   src;
-    gss_buffer_t   *dest;
-
-typedef struct gss_union_name_t {
-	gss_mechanism		gss_mech;
-	gss_OID			name_type;
-	gss_buffer_desc		external_name;
-	/*
-	 * These last two fields are only filled in for mechanism
-	 * names.
-	 */
-	gss_OID			mech_type;
-	gss_name_t		mech_name;
-} gss_union_name_desc, *gss_union_name_t;
-
-typedef struct gss_buffer_desc_struct {
-      size_t length;
-      void FAR *value;
-} gss_buffer_desc, FAR *gss_buffer_t;
-
-Upstream-Status: Pending
-Signed-off-by: Yao Zhao <[email protected]>
-
---- a/src/g_canon_name.c
-+++ b/src/g_canon_name.c
-@@ -121,11 +121,17 @@ gss_canonicalize_name (OM_uint32 *minor_
- 
-     union_canon_name->mech_name = mech_name;
- 
--    status = __gss_copy_namebuf(&union_input_name->external_name,
--				&union_canon_name->external_name);
--    if (status != GSS_S_COMPLETE)
--	goto failure;
-+    union_canon_name->external_name.value = (void*) malloc(
-+                      union_input_name->external_name.length + 1);
-+    if (!union_canon_name->external_name.value)
-+        goto failure;
- 
-+    memcpy(union_canon_name->external_name.value, 
-+           union_input_name->external_name.value, 
-+           union_input_name->external_name.length);
-+    union_canon_name->external_name.length = 
-+                      union_input_name->external_name.length; 
-+   
-     if (union_input_name->name_type != GSS_C_NO_OID) {
- 	status = generic_gss_copy_oid(minor_status,
- 				      union_input_name->name_type,
recipes-security/libgssglue/libgssglue_0.9.bb renamed from recipes-security/libgssglue/libgssglue_0.8.bb +2 -4
similarity index 94%
rename from recipes-security/libgssglue/libgssglue_0.8.bb
rename to recipes-security/libgssglue/libgssglue_0.9.bb
index e534615..7e24450 100644
@@ -21,10 +21,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=56871e72a5c475289c0d5e4ba3f2ee3a \
                     file://src/oid_ops.c;beginline=378;endline=398;md5=72457a5cdc0354cb5c25c8b150326364\
 "
 
-SRC_URI = "git://gitlab.com/gsasl/libgssglue.git;protocol=https;branch=master \
-           file://libgssglue-canon-name.patch  \
-"
-SRCREV = "c8b4b2936b854a7d4f7ef12e30d6f519b30dec87"
+SRC_URI = "git://gitlab.com/gsasl/libgssglue.git;protocol=https;branch=master"
+SRCREV = "ada76bdaec665f70505f0b3aefe871b873e7c4b6"
 
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH 3/5 libgssglue: add ptest

In reply to Yi Zhao

Ptest result:
ptest-runner libgssglue
START: ptest-runner
2025-03-27T13:15
BEGIN: /usr/lib64/libgssglue/ptest
PASS: gss_create_empty_oid_set
PASS: gss_test_oid_set_member
PASS: gss_test_oid_set_member n==0
PASS: gss_add_oid_set_member() OK
PASS: gss_test_oid_set_member() OK
OID present in set with the OID added to it => 1
PASS: gss_test_oid_set_member() OK
PASS: gss_test_oid_set_member() OK
Another OID present in set without the OID => 0
PASS: gss_test_oid_set_member() OK
PASS: gss_add_oid_set_member() OK
PASS: gss_test_oid_set_member() OK
Another OID present in set with it added => 1
PASS: gss_test_oid_set_member() OK
PASS: gss_test_oid_set_member() OK
First OID present in set => 1
PASS: gss_test_oid_set_member() OK
PASS: gss_release_oid_set() OK
PASS: gss_indicate_mechs() OK
PASS: gss_release_oid_set() OK
PASS: gss_import_name() OK
PASS: gss_display_name() OK
display_name() => 27: [email protected]@FOO
PASS: gss_release_buffer() OK
PASS: gss_release_name() OK
Basic self tests done with 0 errors
DURATION: 0
END: /usr/lib64/libgssglue/ptest 2025-03-27T13:15
STOP: ptest-runner
TOTAL: 1 FAIL: 0

---
 recipes-security/libgssglue/files/run-ptest   |  4 ++++
 recipes-security/libgssglue/libgssglue_0.9.bb | 15 +++++++++++++--
 2 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 recipes-security/libgssglue/files/run-ptest
recipes-security/libgssglue/files/run-ptest new file +4 -0
new file mode 100644
index 0000000..04d492c
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+current_dir=$(dirname $(readlink -f $0))
+$current_dir/generic
recipes-security/libgssglue/libgssglue_0.9.bb +13 -2
index 7e24450..73e6dec 100644
@@ -21,12 +21,14 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=56871e72a5c475289c0d5e4ba3f2ee3a \
                     file://src/oid_ops.c;beginline=378;endline=398;md5=72457a5cdc0354cb5c25c8b150326364\
 "
 
-SRC_URI = "git://gitlab.com/gsasl/libgssglue.git;protocol=https;branch=master"
+SRC_URI = "git://gitlab.com/gsasl/libgssglue.git;protocol=https;branch=master \
+           file://run-ptest \
+          "
 SRCREV = "ada76bdaec665f70505f0b3aefe871b873e7c4b6"
 
 S = "${WORKDIR}/git"
 
-inherit autotools-brokensep
+inherit autotools-brokensep ptest
 
 do_configure:prepend() {
     cd ${S}
@@ -46,5 +48,14 @@ do_install:append() {
     sed -i -e "s:/usr/lib/libgssapi_krb5.so:libgssapi_krb5.so.2:" ${D}${sysconfdir}/gssapi_mech.conf
 }
 
+do_compile_ptest() {
+    echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${S}/tests/Makefile
+    oe_runmake -C ${S}/tests buildtest-TESTS
+}
+
+do_install_ptest() {
+    install -m 755 ${S}/tests/generic ${D}/${PTEST_PATH}
+}
+
 # gssglue can use krb5, spkm3... as gssapi library, configurable
 RRECOMMENDS:${PN} += "krb5"
Signature · 1 line
2.34.1
author
#3 lore raw

PATCH 4/5 sssd: upgrade 2.9.2 -> 2.10.2

In reply to Yi Zhao

ChangeLog:
https://github.com/SSSD/sssd/releases/tag/2.10.2

* Drop backport patches.
* Update sssd.conf and volatile files.
* Drop PACKAGECONFIG[infopipe] as it has been removed upstream.

---
 .../0001-sssctl-add-error-analyzer.patch      | 318 ------------------
 .../sssd/files/CVE-2023-3758.patch            | 219 ------------
 .../recipes-security/sssd/files/sssd.conf     |   3 +-
 .../sssd/files/volatiles.99_sssd              |   1 -
 .../sssd/{sssd_2.9.2.bb => sssd_2.10.2.bb}    |  36 +-
 5 files changed, 18 insertions(+), 559 deletions(-)
 delete mode 100644 dynamic-layers/networking-layer/recipes-security/sssd/files/0001-sssctl-add-error-analyzer.patch
 delete mode 100644 dynamic-layers/networking-layer/recipes-security/sssd/files/CVE-2023-3758.patch
 delete mode 100644 dynamic-layers/networking-layer/recipes-security/sssd/files/volatiles.99_sssd
 rename dynamic-layers/networking-layer/recipes-security/sssd/{sssd_2.9.2.bb => sssd_2.10.2.bb} (84%)
dynamic-layers/networking-layer/recipes-security/sssd/files/0001-sssctl-add-error-analyzer.patch deleted +0 -318
deleted file mode 100644
index 6880405..0000000
@@ -1,318 +0,0 @@
-Backport patch to fix interpreter of sss_analyze.
-
-Upstream-Status: Backport [https://github.com/SSSD/sssd/commit/ed3726c]
-
-Signed-off-by: Kai Kang <[email protected]>
-
-From ed3726c37fe07aab788404bfa2f9003db15f4210 Mon Sep 17 00:00:00 2001
-From: roy214 <[email protected]>
-Date: Tue, 25 Apr 2023 20:01:24 +0530
-Subject: [PATCH] sssctl: add error analyzer
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Also removing unused variable and import.
-
-Reviewed-by: Justin Stephenson <[email protected]>
-Reviewed-by: Tomáš Halman <[email protected]>
----
- src/tools/analyzer/Makefile.am        |  2 +
- src/tools/analyzer/modules/error.py   | 61 +++++++++++++++++++++++++++
- src/tools/analyzer/modules/request.py | 54 +++++-------------------
- src/tools/analyzer/sss_analyze        |  2 +-
- src/tools/analyzer/sss_analyze.py     |  3 ++
- src/tools/analyzer/util.py            | 44 +++++++++++++++++++
- 6 files changed, 121 insertions(+), 45 deletions(-)
- create mode 100644 src/tools/analyzer/modules/error.py
- create mode 100644 src/tools/analyzer/util.py
-
-diff --git a/src/tools/analyzer/Makefile.am b/src/tools/analyzer/Makefile.am
-index b40043d043..7692af8528 100644
---- a/src/tools/analyzer/Makefile.am
-+++ b/src/tools/analyzer/Makefile.am
-@@ -13,10 +13,12 @@ dist_pkgpython_DATA = \
-     source_reader.py \
-     parser.py \
-     sss_analyze.py \
-+    util.py \
-     $(NULL)
- 
- modulesdir = $(pkgpythondir)/modules
- dist_modules_DATA = \
-     modules/__init__.py \
-     modules/request.py \
-+    modules/error.py \
-     $(NULL)
-diff --git a/src/tools/analyzer/modules/error.py b/src/tools/analyzer/modules/error.py
-new file mode 100644
-index 0000000000..71173670c5
---- /dev/null
-+++ b/src/tools/analyzer/modules/error.py
-@@ -0,0 +1,61 @@
-+from sssd import util
-+from sssd.parser import SubparsersAction
-+from sssd import sss_analyze
-+
-+class ErrorAnalyzer:
-+    """
-+    An error analyzer module, list if there is any error reported by sssd_be
-+    """
-+    module_parser = None
-+    print_opts = []
-+
-+    def print_module_help(self, args):
-+        """
-+        Print the module parser help output
-+
-+        Args:
-+            args (Namespace): argparse parsed arguments
-+        """
-+        self.module_parser.print_help()
-+
-+    def setup_args(self, parser_grp, cli):
-+        """
-+        Setup module parser, subcommands, and options
-+
-+        Args:
-+            parser_grp (argparse.Action): Parser group to nest
-+               module and subcommands under
-+        """
-+        desc = "Analyze error check module"
-+        self.module_parser = parser_grp.add_parser('error',
-+                                                   description=desc,
-+                                                   help='Error checker')
-+
-+        subparser = self.module_parser.add_subparsers(title=None,
-+                                                      dest='subparser',
-+                                                      action=SubparsersAction,
-+                                                      metavar='COMMANDS')
-+
-+        subcmd_grp = subparser.add_parser_group('Operation Modes')
-+        cli.add_subcommand(subcmd_grp, 'list', 'Print error messages found in backend',
-+                           self.print_error, self.print_opts)
-+
-+        self.module_parser.set_defaults(func=self.print_module_help)
-+
-+        return self.module_parser
-+
-+    def print_error(self, args):
-+        err = 0
-+        utl = util.Utils()
-+        source = utl.load(args)
-+        component = source.Component.BE
-+        source.set_component(component, False)
-+        patterns = ['sdap_async_sys_connect request failed', 'terminated by own WATCHDOG',
-+            'ldap_sasl_interactive_bind_s failed', 'Communication with KDC timed out', 'SSSD is offline', 'Backend is offline',
-+            'tsig verify failure', 'ldap_install_tls failed', 's2n exop request failed']
-+        for line in utl.matched_line(source, patterns):
-+            err +=1
-+            print(line)
-+        if err > 0:
-+            print("For possible solutions please refer to https://sssd.io/troubleshooting/errors.html")
-+        return
-diff --git a/src/tools/analyzer/modules/request.py b/src/tools/analyzer/modules/request.py
-index d661dddb84..e4d5f060c7 100644
---- a/src/tools/analyzer/modules/request.py
-+++ b/src/tools/analyzer/modules/request.py
-@@ -1,6 +1,6 @@
- import re
- import logging
--
-+from sssd import util
- from sssd.parser import SubparsersAction
- from sssd.parser import Option
- 
-@@ -38,7 +38,6 @@ def print_module_help(self, args):
-     def setup_args(self, parser_grp, cli):
-         """
-         Setup module parser, subcommands, and options
--
-         Args:
-             parser_grp (argparse.Action): Parser group to nest
-                module and subcommands under
-@@ -63,42 +62,6 @@ def setup_args(self, parser_grp, cli):
- 
-         return self.module_parser
- 
--    def load(self, args):
--        """
--        Load the appropriate source reader.
--
--        Args:
--            args (Namespace): argparse parsed arguments
--
--        Returns:
--            Instantiated source object
--        """
--        if args.source == "journald":
--            from sssd.source_journald import Journald
--            source = Journald()
--        else:
--            from sssd.source_files import Files
--            source = Files(args.logdir)
--        return source
--
--    def matched_line(self, source, patterns):
--        """
--        Yield lines which match any number of patterns (OR) in
--        provided patterns list.
--
--        Args:
--            source (Reader): source Reader object
--        Yields:
--            lines matching the provided pattern(s)
--        """
--        for line in source:
--            for pattern in patterns:
--                re_obj = re.compile(pattern)
--                if re_obj.search(line):
--                    if line.startswith('   *  '):
--                        continue
--                    yield line
--
-     def get_linked_ids(self, source, pattern, regex):
-         """
-         Retrieve list of associated REQ_TRACE ids. Filter
-@@ -114,8 +77,9 @@ def get_linked_ids(self, source, pattern, regex):
-         Returns:
-             List of linked ids discovered
-         """
-+        utl = util.Utils()
-         linked_ids = []
--        for match in self.matched_line(source, pattern):
-+        for match in utl.matched_line(source, pattern):
-             id_re = re.compile(regex)
-             match = id_re.search(match)
-             if match:
-@@ -250,7 +214,8 @@ def list_requests(self, args):
-         Args:
-             args (Namespace):  populated argparse namespace
-         """
--        source = self.load(args)
-+        utl = util.Utils()
-+        source = utl.load(args)
-         component = source.Component.NSS
-         resp = "nss"
-         # Log messages matching the following regex patterns contain
-@@ -266,7 +231,7 @@ def list_requests(self, args):
-         if args.verbose:
-             self.print_formatted_verbose(source)
-         else:
--            for line in self.matched_line(source, patterns):
-+            for line in utl.matched_line(source, patterns):
-                 if type(source).__name__ == 'Journald':
-                     print(line)
-                 else:
-@@ -279,7 +244,8 @@ def track_request(self, args):
-         Args:
-             args (Namespace):  populated argparse namespace
-         """
--        source = self.load(args)
-+        utl = util.Utils()
-+        source = utl.load(args)
-         cid = args.cid
-         resp_results = False
-         be_results = False
-@@ -294,7 +260,7 @@ def track_request(self, args):
-         logger.info(f"******** Checking {resp} responder for Client ID"
-                     f" {cid} *******")
-         source.set_component(component, args.child)
--        for match in self.matched_line(source, pattern):
-+        for match in utl.matched_line(source, pattern):
-             resp_results = self.consume_line(match, source, args.merge)
- 
-         logger.info(f"********* Checking Backend for Client ID {cid} ********")
-@@ -307,7 +273,7 @@ def track_request(self, args):
-         pattern.clear()
-         [pattern.append(f'\\{id}') for id in be_ids]
- 
--        for match in self.matched_line(source, pattern):
-+        for match in utl.matched_line(source, pattern):
-             be_results = self.consume_line(match, source, args.merge)
- 
-         if args.merge:
-diff --git a/src/tools/analyzer/sss_analyze b/src/tools/analyzer/sss_analyze
-index 3f1beaf38b..6d4b5b30c6 100755
---- a/src/tools/analyzer/sss_analyze
-+++ b/src/tools/analyzer/sss_analyze
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- 
- from sssd import sss_analyze
- 
-diff --git a/src/tools/analyzer/sss_analyze.py b/src/tools/analyzer/sss_analyze.py
-index 18b998f380..dafc84fc03 100644
---- a/src/tools/analyzer/sss_analyze.py
-+++ b/src/tools/analyzer/sss_analyze.py
-@@ -1,6 +1,7 @@
- import argparse
- 
- from sssd.modules import request
-+from sssd.modules import error
- from sssd.parser import SubparsersAction
- 
- 
-@@ -55,9 +56,11 @@ def load_modules(self, parser, parser_grp):
-         """
-         # Currently only the 'request' module exists
-         req = request.RequestAnalyzer()
-+        err = error.ErrorAnalyzer()
-         cli = Analyzer()
- 
-         req.setup_args(parser_grp, cli)
-+        err.setup_args(parser_grp, cli)
- 
-     def setup_args(self):
-         """
-diff --git a/src/tools/analyzer/util.py b/src/tools/analyzer/util.py
-new file mode 100644
-index 0000000000..2a8d153a71
---- /dev/null
-+++ b/src/tools/analyzer/util.py
-@@ -0,0 +1,44 @@
-+import re
-+import logging
-+
-+from sssd.source_files import Files
-+from sssd.source_journald import Journald
-+
-+logger = logging.getLogger()
-+
-+
-+class Utils:
-+
-+    def load(self, args):
-+        """
-+        Load the appropriate source reader.
-+
-+        Args:
-+            args (Namespace): argparse parsed arguments
-+
-+        Returns:
-+            Instantiated source object
-+        """
-+        if args.source == "journald":
-+            source = Journald()
-+        else:
-+            source = Files(args.logdir)
-+        return source
-+
-+    def matched_line(self, source, patterns):
-+        """
-+        Yield lines which match any number of patterns (OR) in
-+        provided patterns list.
-+
-+        Args:
-+            source (Reader): source Reader object
-+        Yields:
-+            lines matching the provided pattern(s)
-+        """
-+        for line in source:
-+            for pattern in patterns:
-+                re_obj = re.compile(pattern)
-+                if re_obj.search(line):
-+                    if line.startswith('   *  '):
-+                        continue
-+                    yield line
dynamic-layers/networking-layer/recipes-security/sssd/files/CVE-2023-3758.patch deleted +0 -219

219 lines not on this page · raw message

dynamic-layers/networking-layer/recipes-security/sssd/files/sssd.conf +2 -1
index 1e8b537..2c9c6fc 100644
@@ -7,7 +7,8 @@ domains = shadowutils
 [pam]
 
 [domain/shadowutils]
-id_provider = files
+id_provider = proxy
+proxy_lib_name = files
 
 auth_provider = proxy
 proxy_pam_target = sssd-shadowutils
dynamic-layers/networking-layer/recipes-security/sssd/files/volatiles.99_sssd deleted +0 -1
deleted file mode 100644
index 2a82413..0000000
@@ -1 +0,0 @@
-d root root 0750 /var/log/sssd none
dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb renamed from dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.9.2.bb +16 -20
similarity index 84%
rename from dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.9.2.bb
rename to dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb
index f35d0c8..0ed62b8 100644
@@ -18,16 +18,13 @@ DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'nss', '', \
 
 SRC_URI = "https://github.com/SSSD/sssd/releases/download/${PV}/${BP}.tar.gz \
            file://sssd.conf \
-           file://volatiles.99_sssd \
            file://no_gen.patch \
            file://fix_gid.patch \
            file://drop_ntpdate_chk.patch \
            file://fix-ldblibdir.patch \
            file://musl_fixup.patch \
-           file://0001-sssctl-add-error-analyzer.patch \
-           file://CVE-2023-3758.patch \
            "
-SRC_URI[sha256sum] = "827bc65d64132410e6dd3df003f04829d60387ec30e72b2d4e22d93bb6f762ba"
+SRC_URI[sha256sum] = "e8aa5e6b48ae465bea7064048715ce7e9c53b50ec6a9c69304f59e0d35be40ff"
 
 UPSTREAM_CHECK_URI = "https://github.com/SSSD/${BPN}/releases"
 
@@ -42,24 +39,23 @@ CACHED_CONFIGUREVARS = "ac_cv_member_struct_ldap_conncb_lc_arg=no \
     ac_cv_prog_HAVE_PYTHON3=yes \
     "
 
-PACKAGECONFIG ?= "nss autofs sudo infopipe"
+PACKAGECONFIG ?= "nss autofs sudo"
 PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}"
 PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
 
 PACKAGECONFIG[autofs] = "--with-autofs, --with-autofs=no"
 PACKAGECONFIG[crypto] = ", , libcrypto"
 PACKAGECONFIG[curl] = "--with-kcm, --without-kcm, curl jansson"
-PACKAGECONFIG[infopipe] = "--with-infopipe, --with-infopipe=no, "
 PACKAGECONFIG[manpages] = "--with-manpages, --with-manpages=no, libxslt-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
 PACKAGECONFIG[nl] = "--with-libnl, --with-libnl=no, libnl"
 PACKAGECONFIG[nss] = ", ,nss,"
 PACKAGECONFIG[oidc_child] = "--with-oidc-child, --without-oidc-child"
 PACKAGECONFIG[python3] = "--with-python3-bindings, --without-python3-bindings python3dir=${PYTHON_SITEPACKAGES_DIR}, python3-setuptools-native"
 PACKAGECONFIG[samba] = "--with-samba, --with-samba=no, samba"
-PACKAGECONFIG[selinux] = "--with-selinux, --with-selinux=no --with-semanage=no, libselinux"
+PACKAGECONFIG[selinux] = "--with-selinux, --with-selinux=no, libselinux"
 PACKAGECONFIG[ssh] = "--with-ssh, --with-ssh=no, "
 PACKAGECONFIG[sudo] = "--with-sudo, --with-sudo=no, "
-PACKAGECONFIG[systemd] = "--with-initscript=systemd,--with-initscript=sysv,,python3-systemd"
+PACKAGECONFIG[systemd] = "--with-initscript=systemd --with-systemdunitdir=${systemd_system_unitdir} --with-systemdconfdir=${sysconfdir}/systemd/system, --with-initscript=sysv,,python3-systemd"
 
 EXTRA_OECONF += " \
     --disable-cifs-idmap-plugin \
@@ -68,11 +64,11 @@ EXTRA_OECONF += " \
     --without-python2-bindings \
     --enable-pammoddir=${base_libdir}/security \
     --with-xml-catalog-path=${STAGING_ETCDIR_NATIVE}/xml/catalog \
-    --with-pid-path=/run \
+    --with-pid-path=/run/sssd \
     --with-os=fedora \
 "
 
-do_configure:prepend() {
+do_configure:prepend () {
     mkdir -p ${AUTOTOOLS_AUXDIR}/build
     cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/build/
 
@@ -84,6 +80,7 @@ do_compile:prepend () {
      sed -i -e "s/__useconds_t/useconds_t/g" ${S}/src/tools/tools_mc_util.c
      echo '#define NSUPDATE_PATH "${bindir}"' >> ${B}/config.h
 }
+
 do_install () {
     oe_runmake install  DESTDIR="${D}"
     rmdir --ignore-fail-on-non-empty "${D}/${bindir}"
@@ -99,12 +96,14 @@ do_install () {
 
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
         install -d ${D}${sysconfdir}/tmpfiles.d
-        echo "d /var/log/sssd 0750 - - - -" > ${D}${sysconfdir}/tmpfiles.d/sss.conf
+        echo "d /var/log/sssd 0750 ${SSSD_UID} ${SSSD_GID} - -" > ${D}${sysconfdir}/tmpfiles.d/sssd.conf
+        echo "d /run/sssd 0750 ${SSSD_UID} ${SSSD_GID} - -" >> ${D}${sysconfdir}/tmpfiles.d/sssd.conf
     fi
 
     if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
         install -d ${D}${sysconfdir}/default/volatiles
-        echo "d ${SSSD_UID}:${SSSD_GID} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
+        echo "d ${SSSD_UID}:${SSSD_GID} 0750 ${localstatedir}/log/sssd none" > ${D}${sysconfdir}/default/volatiles/99_sssd
+        echo "d ${SSSD_UID}:${SSSD_GID} 0750 ${localstatedir}/run/sssd none" >> ${D}${sysconfdir}/default/volatiles/99_sssd
     fi
 
     if ${@bb.utils.contains('PACKAGECONFIG', 'python3', 'true', 'false', d)}; then
@@ -112,15 +111,13 @@ do_install () {
     fi
 
     # Remove /run as it is created on startup
-    rm -rf ${D}/run
-
-    rm -f ${D}${systemd_system_unitdir}/sssd-secrets.*
+    rm -rf ${D}/run ${D}/var/run
 }
 
 pkg_postinst_ontarget:${PN} () {
-if [ -e /etc/init.d/populate-volatile.sh ] ; then
-    ${sysconfdir}/init.d/populate-volatile.sh update
-fi
+    if [ -e /etc/init.d/populate-volatile.sh ] ; then
+        ${sysconfdir}/init.d/populate-volatile.sh update
+    fi
     chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf
 }
 
@@ -131,12 +128,11 @@ INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
 SYSTEMD_SERVICE:${PN} = " \
     ${@bb.utils.contains('PACKAGECONFIG', 'autofs', 'sssd-autofs.service sssd-autofs.socket', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'curl', 'sssd-kcm.service sssd-kcm.socket', '', d)} \
-    ${@bb.utils.contains('PACKAGECONFIG', 'infopipe', 'sssd-ifp.service ', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'ssh', 'sssd-ssh.service sssd-ssh.socket', '', d)} \
     ${@bb.utils.contains('PACKAGECONFIG', 'sudo', 'sssd-sudo.service sssd-sudo.socket', '', d)} \
+    sssd-ifp.service \
     sssd-nss.service \
     sssd-nss.socket \
-    sssd-pam-priv.socket \
     sssd-pam.service \
     sssd-pam.socket \
     sssd.service \
Signature · 1 line
2.34.1
author
#4 lore raw

PATCH 5/5 sssd: enable unprivileged service user feature

In reply to Yi Zhao

The unprivileged service user feature has been improved in 2.10 to allow running the sssd service as an unprivileged user [1]. So enable this feature, and then we can run the service as the unprivileged user sssd.

[1] https://github.com/SSSD/sssd/releases/tag/2.10.0

---
 .../recipes-security/sssd/sssd_2.10.2.bb           | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb +10 -4
index 0ed62b8..b02710e 100644
@@ -28,12 +28,16 @@ SRC_URI[sha256sum] = "e8aa5e6b48ae465bea7064048715ce7e9c53b50ec6a9c69304f59e0d35
 
 UPSTREAM_CHECK_URI = "https://github.com/SSSD/${BPN}/releases"
 
-inherit autotools pkgconfig gettext python3native features_check systemd
+inherit autotools pkgconfig gettext python3native features_check systemd useradd
 
 REQUIRED_DISTRO_FEATURES = "pam"
 
-SSSD_UID ?= "root"
-SSSD_GID ?= "root"
+SSSD_UID ?= "sssd"
+SSSD_GID ?= "sssd"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM:${PN} = "--system sssd"
+USERADD_PARAM:${PN} = "--system --home /run/sssd --no-create-home -g sssd --shell /sbin/nologin sssd"
 
 CACHED_CONFIGUREVARS = "ac_cv_member_struct_ldap_conncb_lc_arg=no \
     ac_cv_prog_HAVE_PYTHON3=yes \
@@ -66,6 +70,7 @@ EXTRA_OECONF += " \
     --with-xml-catalog-path=${STAGING_ETCDIR_NATIVE}/xml/catalog \
     --with-pid-path=/run/sssd \
     --with-os=fedora \
+    --with-sssd-user=sssd \
 "
 
 do_configure:prepend () {
@@ -87,6 +92,7 @@ do_install () {
 
     install -d ${D}/${sysconfdir}/${BPN}
     install -m 600 ${UNPACKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN}
+    chown -R root:${SSSD_GID} ${D}/${sysconfdir}/${BPN}
 
     # /var/log/sssd needs to be created in runtime. Use rmdir to catch if
     # upstream stops creating /var/log/sssd, or adds something else in
@@ -118,7 +124,6 @@ pkg_postinst_ontarget:${PN} () {
     if [ -e /etc/init.d/populate-volatile.sh ] ; then
         ${sysconfdir}/init.d/populate-volatile.sh update
     fi
-    chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf
 }
 
 CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf"
@@ -146,6 +151,7 @@ FILES:${PN} += "${base_libdir}/security/pam_sss*.so  \
                 ${nonarch_libdir}/tmpfiles.d \
                 ${datadir}/dbus-1/system.d/*.conf \
                 ${datadir}/dbus-1/system-services/*.service \
+                ${datadir}/polkit-1/* \
                 ${libdir}/krb5/* \
                 ${libdir}/ldb/* \
                 ${PYTHON_SITEPACKAGES_DIR}/sssd \
Signature · 1 line
2.34.1