aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTBK <tbk@jjtc.eu>2020-02-26 00:46:17 +0100
committerLeo <thinkabit.ukim@gmail.com>2020-02-26 19:54:09 -0300
commit94550367e52a2564c0fe967983a9ebd1d34c4e2e (patch)
tree1a7fa32d8f3377b27eadeb51d92a94268e6af163
parent02003887d667c171dd8987b35447197c3ac636e4 (diff)
downloadaports-94550367e52a2564c0fe967983a9ebd1d34c4e2e.tar.gz
aports-94550367e52a2564c0fe967983a9ebd1d34c4e2e.tar.bz2
aports-94550367e52a2564c0fe967983a9ebd1d34c4e2e.tar.xz
main/linux-pam: musl fix u_int types
-rw-r--r--main/linux-pam/APKBUILD16
-rw-r--r--main/linux-pam/libpam-fix-build-with-eglibc-2.16.patch6
-rw-r--r--main/linux-pam/musl-fix_uint.patch247
3 files changed, 258 insertions, 11 deletions
diff --git a/main/linux-pam/APKBUILD b/main/linux-pam/APKBUILD
index f5b28dc900..70a5413e54 100644
--- a/main/linux-pam/APKBUILD
+++ b/main/linux-pam/APKBUILD
@@ -3,9 +3,9 @@
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=linux-pam
pkgver=1.3.1
-pkgrel=1
-pkgdesc="pluggable authentication modules for linux"
-url="http://www.kernel.org/pub/linux/libs/pam"
+pkgrel=2
+pkgdesc="Linux PAM (Pluggable Authentication Modules for Linux)"
+url="https://www.kernel.org/pub/linux/libs/pam"
arch="all"
license="BSD-3-Clause"
depends_dev="gettext-dev"
@@ -16,6 +16,7 @@ source="
https://github.com/linux-pam/linux-pam/releases/download/v$pkgver/Linux-PAM-$pkgver.tar.xz
fix-compat.patch
libpam-fix-build-with-eglibc-2.16.patch
+ musl-fix_uint.patch
musl-fix-pam_exec.patch
base-auth.pamd
@@ -31,15 +32,14 @@ source="
builddir="$srcdir"/Linux-PAM-$pkgver
prepare() {
- cd "$builddir"
default_prepare
# disable insecure modules
sed -e 's/pam_rhosts//g' -i modules/Makefile.am
+
+ autoreconf -vif
}
build() {
- cd "$builddir"
- autoreconf -vif
[ "$CLIBC" = "musl" ] && export ac_cv_search_crypt=no
./configure \
--build=$CBUILD \
@@ -56,7 +56,6 @@ build() {
}
package() {
- cd "$builddir"
make DESTDIR="$pkgdir" install
# install our pam.d files
@@ -77,7 +76,8 @@ package() {
sha512sums="6bc8e2a5b64686f0a23846221c5228c88418ba485b17c53b3a12f91262b5bb73566d6b6a5daa1f63bbae54310aee918b987e44a72ce809b4e7c668f0fadfe08e Linux-PAM-1.3.1.tar.xz
52b97e23084f7b835ce1fa441663f91a50ea797cb38ba2c6662bcdaf0d25ba487118442674ac347fb17353af126dd6b3b696612faa56cac428dd842d14e1c90d fix-compat.patch
-f49edf3876cc6bcb87bbea4e7beaeb0a382d596898c755f5fbaf6c2ed4e0c8f082b2cd16dde8a74af82bb09a1334f463e07a4bb5b8a48f023ff90a67ad2fdd44 libpam-fix-build-with-eglibc-2.16.patch
+24ec4c755b4034189ea05b1af69269e094964efd745b470a6ccb268e80550b56c96027214e918168aa942aa426bfe0b1487801e95ef2bf0c488f47eb49f1d9e1 libpam-fix-build-with-eglibc-2.16.patch
+2bc12415bacdb766c1a8d8aa43c84c17bb2ddc9a9b910d52830259ad18e54465cc077d7b2974a71c40867c90910751339f283731c7298b983acd4ae83d7c98a1 musl-fix_uint.patch
08323428e13f65300d7638233fd8ab25c582a08ffe0a282ed43f69ccb428dea9eb185da3ae9dd2634f021c16592f194f99348758bd9e761c29435652b544f543 musl-fix-pam_exec.patch
ea6a10957ba9ec50d982bfabafb35060426ac797936f874097b4fa7620b89fd2ba3be9757401f9b787956fb23879d8ef73676f7703e75fcef3dca0b9559c4167 base-auth.pamd
85462201a4044c7e170e617d39b0eceb4790abc6c0504999117548030a16d80a9d2078d1ad97690d7d346e6374201f0c52e792ccb08ce2b1c4bbf0cc2be96f5b base-account.pamd
diff --git a/main/linux-pam/libpam-fix-build-with-eglibc-2.16.patch b/main/linux-pam/libpam-fix-build-with-eglibc-2.16.patch
index 1a0716598e..938e92d290 100644
--- a/main/linux-pam/libpam-fix-build-with-eglibc-2.16.patch
+++ b/main/linux-pam/libpam-fix-build-with-eglibc-2.16.patch
@@ -1,6 +1,6 @@
---- Linux-PAM-1.1.5/modules/pam_unix/pam_unix_acct.c.orig
-+++ Linux-PAM-1.1.5/modules/pam_unix/pam_unix_acct.c
-@@ -47,6 +47,7 @@
+--- a/modules/pam_unix/pam_unix_acct.c
++++ b/modules/pam_unix/pam_unix_acct.c
+@@ -48,6 +48,7 @@
#include <time.h> /* for time() */
#include <errno.h>
#include <sys/wait.h>
diff --git a/main/linux-pam/musl-fix_uint.patch b/main/linux-pam/musl-fix_uint.patch
new file mode 100644
index 0000000000..cb40807729
--- /dev/null
+++ b/main/linux-pam/musl-fix_uint.patch
@@ -0,0 +1,247 @@
+--- a/libpamc/include/security/pam_client.h
++++ b/libpamc/include/security/pam_client.h
+@@ -23,7 +23,7 @@
+ typedef struct pamc_handle_s *pamc_handle_t;
+
+ /* binary prompt structure pointer */
+-typedef struct { u_int32_t length; u_int8_t control; } *pamc_bp_t;
++typedef struct { uint32_t length; uint8_t control; } *pamc_bp_t;
+
+ /*
+ * functions provided by libpamc
+@@ -90,10 +90,10 @@
+ # define PAM_BP_FREE free
+ #endif /* PAM_BP_FREE */
+
+-#define __PAM_BP_WOCTET(x,y) (*((y) + (u_int8_t *)(x)))
+-#define __PAM_BP_ROCTET(x,y) (*((y) + (const u_int8_t *)(x)))
++#define __PAM_BP_WOCTET(x,y) (*((y) + (uint8_t *)(x)))
++#define __PAM_BP_ROCTET(x,y) (*((y) + (const uint8_t *)(x)))
+
+-#define PAM_BP_MIN_SIZE (sizeof(u_int32_t) + sizeof(u_int8_t))
++#define PAM_BP_MIN_SIZE (sizeof(uint32_t) + sizeof(uint8_t))
+ #define PAM_BP_MAX_LENGTH 0x20000 /* an advisory limit */
+ #define PAM_BP_WCONTROL(x) (__PAM_BP_WOCTET(x,4))
+ #define PAM_BP_RCONTROL(x) (__PAM_BP_ROCTET(x,4))
+@@ -102,8 +102,8 @@
+ (__PAM_BP_ROCTET(x,2)<< 8)+ \
+ (__PAM_BP_ROCTET(x,3) ))
+ #define PAM_BP_LENGTH(x) (PAM_BP_SIZE(x) - PAM_BP_MIN_SIZE)
+-#define PAM_BP_WDATA(x) (PAM_BP_MIN_SIZE + (u_int8_t *) (x))
+-#define PAM_BP_RDATA(x) (PAM_BP_MIN_SIZE + (const u_int8_t *) (x))
++#define PAM_BP_WDATA(x) (PAM_BP_MIN_SIZE + (uint8_t *) (x))
++#define PAM_BP_RDATA(x) (PAM_BP_MIN_SIZE + (const uint8_t *) (x))
+
+ /* Note, this macro always '\0' terminates renewed packets */
+
+@@ -111,13 +111,13 @@
+ do { \
+ if (old_p) { \
+ if (*(old_p)) { \
+- u_int32_t __size; \
++ uint32_t __size; \
+ __size = PAM_BP_SIZE(*(old_p)); \
+ memset(*(old_p), 0, __size); \
+ PAM_BP_FREE(*(old_p)); \
+ } \
+ if (cntrl) { \
+- u_int32_t __size; \
++ uint32_t __size; \
+ \
+ __size = PAM_BP_MIN_SIZE + data_length; \
+ if ((*(old_p) = PAM_BP_CALLOC(1, 1+__size))) { \
+@@ -140,7 +140,7 @@
+ #define PAM_BP_FILL(prmpt, offset, length, data) \
+ do { \
+ size_t bp_length; \
+- u_int8_t *prompt = (u_int8_t *) (prmpt); \
++ uint8_t *prompt = (uint8_t *) (prmpt); \
+ bp_length = PAM_BP_LENGTH(prompt); \
+ if (bp_length < ((length)+(offset))) { \
+ PAM_BP_ASSERT("attempt to write over end of prompt"); \
+@@ -151,7 +151,7 @@
+ #define PAM_BP_EXTRACT(prmpt, offset, length, data) \
+ do { \
+ size_t __bp_length; \
+- const u_int8_t *__prompt = (const u_int8_t *) (prmpt); \
++ const uint8_t *__prompt = (const uint8_t *) (prmpt); \
+ __bp_length = PAM_BP_LENGTH(__prompt); \
+ if (((offset) < 0) || (__bp_length < ((length)+(offset))) \
+ || ((length) < 0)) { \
+ \
+
+--- a/libpamc/pamc_converse.c
++++ b/libpamc/pamc_converse.c
+@@ -34,8 +34,8 @@ static int __pamc_select_agent(pamc_handle_t pch, char *agent_id)
+
+ int pamc_converse(pamc_handle_t pch, pamc_bp_t *prompt_p)
+ {
+- u_int32_t size, offset=0;
+- u_int8_t control, raw[PAM_BP_MIN_SIZE];
++ uint32_t size, offset=0;
++ uint8_t control, raw[PAM_BP_MIN_SIZE];
+
+ D(("called"));
+
+@@ -110,7 +110,7 @@ int pamc_converse(pamc_handle_t pch, pamc_bp_t *prompt_p)
+ /* pump all of the prompt into the agent */
+ do {
+ int rval = write(pch->current->writer,
+- offset + (const u_int8_t *) (*prompt_p),
++ offset + (const uint8_t *) (*prompt_p),
+ size - offset);
+ if (rval == -1) {
+ switch (errno) {
+@@ -172,7 +172,7 @@ int pamc_converse(pamc_handle_t pch, pamc_bp_t *prompt_p)
+ value from the previous loop */
+
+ while (offset < size) {
+- int rval = read(pch->current->reader, offset + (u_int8_t *) *prompt_p,
++ int rval = read(pch->current->reader, offset + (uint8_t *) *prompt_p,
+ size-offset);
+
+ if (rval == -1) {
+
+--- a/libpamc/test/regress/test.libpamc.c
++++ b/libpamc/test/regress/test.libpamc.c
+@@ -157,7 +157,7 @@ char *create_digest(int length, const char *raw)
+ return temp_packet.buffer;
+ }
+
+-void packet_to_prompt(pamc_bp_t *prompt_p, u_int8_t control,
++void packet_to_prompt(pamc_bp_t *prompt_p, uint8_t control,
+ struct internal_packet *packet)
+ {
+ PAM_BP_RENEW(prompt_p, control, packet->at);
+
+--- a/modules/pam_timestamp/sha1.c
++++ b/modules/pam_timestamp/sha1.c
+@@ -56,34 +56,34 @@
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+
+-static u_int32_t
+-F(u_int32_t b, u_int32_t c, u_int32_t d)
++static uint32_t
++F(uint32_t b, uint32_t c, uint32_t d)
+ {
+ return (b & c) | ((~b) & d);
+ }
+
+-static u_int32_t
+-G(u_int32_t b, u_int32_t c, u_int32_t d)
++static uint32_t
++G(uint32_t b, uint32_t c, uint32_t d)
+ {
+ return b ^ c ^ d;
+ }
+
+-static u_int32_t
+-H(u_int32_t b, u_int32_t c, u_int32_t d)
++static uint32_t
++H(uint32_t b, uint32_t c, uint32_t d)
+ {
+ return (b & c) | (b & d) | (c & d);
+ }
+
+-static u_int32_t
+-RL(u_int32_t n, u_int32_t s)
++static uint32_t
++RL(uint32_t n, uint32_t s)
+ {
+ return (n << s) | (n >> (32 - s));
+ }
+
+-static u_int32_t
+-sha1_round(u_int32_t (*FUNC)(u_int32_t, u_int32_t, u_int32_t),
+- u_int32_t a, u_int32_t b, u_int32_t c, u_int32_t d, u_int32_t e,
+- u_int32_t i, u_int32_t n)
++static uint32_t
++sha1_round(uint32_t (*FUNC)(uint32_t, uint32_t, uint32_t),
++ uint32_t a, uint32_t b, uint32_t c, uint32_t d, uint32_t e,
++ uint32_t i, uint32_t n)
+ {
+ return RL(a, 5) + FUNC(b, c, d) + e + i + n;
+ }
+@@ -100,10 +100,10 @@
+ }
+
+ static void
+-sha1_process(struct sha1_context *ctx, u_int32_t buffer[SHA1_BLOCK_SIZE / 4])
++sha1_process(struct sha1_context *ctx, uint32_t buffer[SHA1_BLOCK_SIZE / 4])
+ {
+- u_int32_t a, b, c, d, e, temp;
+- u_int32_t data[80];
++ uint32_t a, b, c, d, e, temp;
++ uint32_t data[80];
+ int i;
+
+ for (i = 0; i < 16; i++) {
+@@ -150,14 +150,14 @@
+ sha1_update(struct sha1_context *ctx, const unsigned char *data, size_t length)
+ {
+ size_t i = 0, l = length, c, t;
+- u_int32_t count = 0;
++ uint32_t count = 0;
+
+ /* Process any pending + data blocks. */
+ while (l + ctx->pending_count >= SHA1_BLOCK_SIZE) {
+ c = ctx->pending_count;
+ t = SHA1_BLOCK_SIZE - c;
+ memcpy(ctx->pending + c, &data[i], t);
+- sha1_process(ctx, (u_int32_t*) ctx->pending);
++ sha1_process(ctx, (uint32_t*) ctx->pending);
+ i += t;
+ l -= t;
+ ctx->pending_count = 0;
+@@ -188,7 +188,7 @@
+
+ /* Output the sum. */
+ if (out != NULL) {
+- u_int32_t c;
++ uint32_t c;
+ memcpy(&ctx2, ctx, sizeof(ctx2));
+
+ /* Pad this block. */
+@@ -197,10 +197,10 @@
+ padding, SHA1_BLOCK_SIZE - c);
+
+ /* Do we need to process two blocks now? */
+- if (c >= (SHA1_BLOCK_SIZE - (sizeof(u_int32_t) * 2))) {
++ if (c >= (SHA1_BLOCK_SIZE - (sizeof(uint32_t) * 2))) {
+ /* Process this block. */
+ sha1_process(&ctx2,
+- (u_int32_t*) ctx2.pending);
++ (uint32_t*) ctx2.pending);
+ /* Set up another block. */
+ ctx2.pending_count = 0;
+ memset(ctx2.pending, 0, SHA1_BLOCK_SIZE);
+@@ -218,10 +218,10 @@
+ ctx2.counts[0] = htonl(ctx2.counts[0]);
+ ctx2.counts[1] = htonl(ctx2.counts[1]);
+ memcpy(ctx2.pending + 56,
+- &ctx2.counts[1], sizeof(u_int32_t));
++ &ctx2.counts[1], sizeof(uint32_t));
+ memcpy(ctx2.pending + 60,
+- &ctx2.counts[0], sizeof(u_int32_t));
+- sha1_process(&ctx2, (u_int32_t*) ctx2.pending);
++ &ctx2.counts[0], sizeof(uint32_t));
++ sha1_process(&ctx2, (uint32_t*) ctx2.pending);
+
+ /* Output the data. */
+ out[ 3] = (ctx2.a >> 0) & 0xff;
+
+--- a/modules/pam_timestamp/sha1.h
++++ b/modules/pam_timestamp/sha1.h
+@@ -45,9 +45,9 @@
+ struct sha1_context {
+ size_t count;
+ unsigned char pending[SHA1_BLOCK_SIZE];
+- u_int32_t counts[2];
++ uint32_t counts[2];
+ size_t pending_count;
+- u_int32_t a, b, c, d, e;
++ uint32_t a, b, c, d, e;
+ };
+
+ #define SHA1_OUTPUT_SIZE 20