From 429f56acedb584233935e06e48976671f85d666f Mon Sep 17 00:00:00 2001 From: Matheus Date: Sat, 8 Jun 2024 14:04:50 -0300 Subject: [PATCH] ports: shadow --- patches/shadow/jinx-working-patch.patch | 69 +++++++++++++++++++++++++ recipes/shadow | 22 ++++++++ source-recipes/shadow | 9 ++++ 3 files changed, 100 insertions(+) create mode 100644 patches/shadow/jinx-working-patch.patch create mode 100644 recipes/shadow create mode 100644 source-recipes/shadow diff --git a/patches/shadow/jinx-working-patch.patch b/patches/shadow/jinx-working-patch.patch new file mode 100644 index 00000000..1a098d24 --- /dev/null +++ b/patches/shadow/jinx-working-patch.patch @@ -0,0 +1,69 @@ +diff --git shadow-clean/lib/freezero.c shadow-workdir/lib/freezero.c +index c565f43..a6adf98 100644 +--- shadow-clean/lib/freezero.c ++++ shadow-workdir/lib/freezero.c +@@ -17,6 +17,7 @@ + + #include + #include ++#include + + void + freezero(void *ptr, size_t sz) +@@ -25,6 +26,6 @@ freezero(void *ptr, size_t sz) + if (ptr == NULL) + return; + +- explicit_bzero(ptr, sz); ++ memzero(ptr, sz); + free(ptr); + } +diff --git shadow-clean/lib/memzero.h shadow-workdir/lib/memzero.h +index 1137e83..bbdcb95 100644 +--- shadow-clean/lib/memzero.h ++++ shadow-workdir/lib/memzero.h +@@ -28,14 +28,14 @@ inline void strzero(char *s); + inline void + memzero(void *ptr, size_t size) + { +-#if defined(HAVE_MEMSET_EXPLICIT) +- memset_explicit(ptr, 0, size); +-#elif defined(HAVE_EXPLICIT_BZERO) +- explicit_bzero(ptr, size); +-#else ++//#if defined(HAVE_MEMSET_EXPLICIT) ++// memset_explicit(ptr, 0, size); ++//#elif defined(HAVE_EXPLICIT_BZERO) ++// explicit_bzero(ptr, size); ++//#else + bzero(ptr, size); + __asm__ __volatile__ ("" : : "r"(ptr) : "memory"); +-#endif ++//#endif + } + + +diff --git shadow-clean/lib/user_busy.c shadow-workdir/lib/user_busy.c +index a622376..f0ef2a4 100644 +--- shadow-clean/lib/user_busy.c ++++ shadow-workdir/lib/user_busy.c +@@ -24,6 +24,7 @@ + #endif /* ENABLE_SUBIDS */ + #include "shadowlog.h" + #include "string/sprintf.h" ++#include + + + #ifdef __linux__ +diff --git shadow-clean/lib/utmp.c shadow-workdir/lib/utmp.c +index 08e9b62..55167c1 100644 +--- shadow-clean/lib/utmp.c ++++ shadow-workdir/lib/utmp.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include "alloc.h" + #include "sizeof.h" diff --git a/recipes/shadow b/recipes/shadow new file mode 100644 index 00000000..fba87e6a --- /dev/null +++ b/recipes/shadow @@ -0,0 +1,22 @@ +name=shadow +revision=1 +from_source=shadow +imagedeps="base-devel" +hostdeps="xgcc xbinutils" +deps="mlibc libxcrypt" + +build() { + cp -rvfp ${source_dir}/* . + sed -i 's/groups$(EXEEXT) //' src/Makefile.in + find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; + find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; + find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; + sed -i 's/1000/999/' src/useradd.c + sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' -e 's:/var/spool/mail:/var/mail:' -i etc/login.defs + ./configure --host=x86_64-astral --prefix=${prefix} --sysconfdir=/etc --with-group-name-max-length=32 --without-libbsd + make -j ${parallelism} +} + +package() { + make install DESTDIR=${dest_dir} +} diff --git a/source-recipes/shadow b/source-recipes/shadow new file mode 100644 index 00000000..66c99665 --- /dev/null +++ b/source-recipes/shadow @@ -0,0 +1,9 @@ +name=shadow +version=4.15.1 +source_method=tarball +tarball_url="https://github.com/shadow-maint/shadow/releases/download/${version}/shadow-${version}.tar.xz" +tarball_sha512="e3ae51bf53bfa1662d81bbe0150ada19c116514f1e56391d877045d48e16776326446561759edbf5006c0f97ab1d5f4bae63521bf1fae67e118ddda0d4a8f6cb" +hostdeps="autoconf automake pkgconfig libtool" +regenerate() { + autoreconf -fvi +}