added my Recipes
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
Do not use fgetpwent_r
|
||||
|
||||
fgetpwent_r does not exist on musl
|
||||
|
||||
Source: https://git.alpinelinux.org/aports/tree/community/libpwquality/0001-fix-musl-build.patch
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/src/pam_pwquality.c
|
||||
+++ b/src/pam_pwquality.c
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <stdio.h>
|
||||
#include <pwd.h>
|
||||
#include <errno.h>
|
||||
+#include <security/pam_modutil.h>
|
||||
#include "pwquality.h"
|
||||
|
||||
/*
|
||||
@@ -43,8 +44,6 @@ struct module_options {
|
||||
|
||||
#define CO_RETRY_TIMES 1
|
||||
|
||||
-#define PATH_PASSWD "/etc/passwd"
|
||||
-
|
||||
static int
|
||||
_pam_parse (pam_handle_t *pamh, struct module_options *opt,
|
||||
int argc, const char **argv)
|
||||
@@ -98,44 +97,7 @@ static int
|
||||
check_local_user (pam_handle_t *pamh,
|
||||
const char *user)
|
||||
{
|
||||
- struct passwd pw, *pwp;
|
||||
- char buf[4096];
|
||||
- int found = 0;
|
||||
- FILE *fp;
|
||||
- int errn;
|
||||
-
|
||||
- fp = fopen(PATH_PASSWD, "r");
|
||||
- if (fp == NULL) {
|
||||
- pam_syslog(pamh, LOG_ERR, "unable to open %s: %s",
|
||||
- PATH_PASSWD, pam_strerror(pamh, errno));
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- for (;;) {
|
||||
- errn = fgetpwent_r(fp, &pw, buf, sizeof (buf), &pwp);
|
||||
- if (errn == ERANGE) {
|
||||
- pam_syslog(pamh, LOG_WARNING, "%s contains very long lines; corrupted?",
|
||||
- PATH_PASSWD);
|
||||
- /* we can continue here as next call will read further */
|
||||
- continue;
|
||||
- }
|
||||
- if (errn != 0)
|
||||
- break;
|
||||
- if (strcmp(pwp->pw_name, user) == 0) {
|
||||
- found = 1;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- fclose (fp);
|
||||
-
|
||||
- if (errn != 0 && errn != ENOENT) {
|
||||
- pam_syslog(pamh, LOG_ERR, "unable to enumerate local accounts: %s",
|
||||
- pam_strerror(pamh, errn));
|
||||
- return -1;
|
||||
- } else {
|
||||
- return found;
|
||||
- }
|
||||
+ return pam_modutil_check_user_in_passwd(pamh, user, NULL) == PAM_SUCCESS;
|
||||
}
|
||||
|
||||
PAM_EXTERN int
|
||||
@@ -0,0 +1,43 @@
|
||||
From 1ea09e09ab2387c326bb7170835361ece6e25477 Mon Sep 17 00:00:00 2001
|
||||
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Date: Mon, 3 Aug 2015 13:43:14 +0800
|
||||
Subject: [PATCH] setup.py.in: add missing python include dir for cross
|
||||
compiling
|
||||
|
||||
Upstream-Status: Inappropriate [oe-core specific]
|
||||
|
||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||
---
|
||||
python/Makefile.am | 2 +-
|
||||
python/setup.py.in | 3 ++-
|
||||
2 files changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/python/Makefile.am b/python/Makefile.am
|
||||
index 1d00c0c..52816b2 100644
|
||||
--- a/python/Makefile.am
|
||||
+++ b/python/Makefile.am
|
||||
@@ -14,7 +14,7 @@ all-local:
|
||||
CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV)
|
||||
|
||||
install-exec-local:
|
||||
- CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix}
|
||||
+ CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix} --install-lib=${DESTDIR}/${PYTHONSITEDIR}
|
||||
|
||||
clean-local:
|
||||
rm -rf py$(PYTHONREV)
|
||||
diff --git a/python/setup.py.in b/python/setup.py.in
|
||||
index a741b91..6759a95 100755
|
||||
--- a/python/setup.py.in
|
||||
+++ b/python/setup.py.in
|
||||
@@ -33,7 +33,7 @@ class sdist(_sdist):
|
||||
|
||||
pwqmodule = Extension('pwquality',
|
||||
sources = ['pwquality.c'],
|
||||
- include_dirs = ['../src'],
|
||||
+ include_dirs = ['../src', os.path.join(os.environ['STAGING_INCDIR'], os.environ['PYTHON_DIR'])],
|
||||
library_dirs = ['../src/.libs'],
|
||||
libraries = ['pwquality'])
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
DESCRIPTION = "Library for password quality checking and generating random passwords"
|
||||
HOMEPAGE = "https://github.com/libpwquality/libpwquality"
|
||||
SECTION = "devel/lib"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2"
|
||||
|
||||
SRCNAME = "libpwquality"
|
||||
SRC_URI = "https://github.com/${SRCNAME}/${SRCNAME}/releases/download/${SRCNAME}-${PV}/${SRCNAME}-${PV}.tar.bz2 \
|
||||
file://add-missing-python-include-dir-for-cross.patch \
|
||||
"
|
||||
SRC_URI:append:libc-musl = " file://0001-fix-musl-build.patch "
|
||||
|
||||
SRC_URI[md5sum] = "1fe43f6641dbf1e1766e2a02cf68a9c3"
|
||||
SRC_URI[sha256sum] = "d43baf23dc6887fe8f8e9b75cabaabc5f4bbbaa0f9eff44278d276141752a545"
|
||||
|
||||
UPSTREAM_CHECK_URI = "https://github.com/libpwquality/libpwquality/releases"
|
||||
|
||||
S = "${WORKDIR}/${SRCNAME}-${PV}"
|
||||
|
||||
DEPENDS = "cracklib virtual/gettext"
|
||||
|
||||
inherit autotools setuptools3-base gettext
|
||||
|
||||
B = "${S}"
|
||||
|
||||
export PYTHON_DIR
|
||||
export BUILD_SYS
|
||||
export HOST_SYS
|
||||
|
||||
EXTRA_OECONF += "--with-python-rev=${PYTHON_BASEVERSION} \
|
||||
--with-python-binary=${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} \
|
||||
--with-pythonsitedir=${PYTHON_SITEPACKAGES_DIR} \
|
||||
--libdir=${libdir} \
|
||||
--with-securedir=${base_libdir}/security \
|
||||
"
|
||||
|
||||
PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
|
||||
PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
|
||||
|
||||
FILES:${PN} += "${base_libdir}/security/pam_pwquality.so"
|
||||
FILES:${PN}-dbg += "${base_libdir}/security/.debug"
|
||||
FILES:${PN}-staticdev += "${base_libdir}/security/pam_pwquality.a"
|
||||
FILES:${PN}-dev += "${base_libdir}/security/pam_pwquality.la"
|
||||
Reference in New Issue
Block a user