summaryrefslogtreecommitdiff
path: root/recipes-support
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-02-24 19:11:18 -0600
committerJohn Klug <john.klug@multitech.com>2021-02-24 19:11:18 -0600
commit10afbca28c9e8f061058df75d919b3ffa5f55706 (patch)
treed3c92f7d2f49f9253ea4f80852d4b2cbf2cbf5ef /recipes-support
parent0f3070b6b8102507e27d9de6fc2b2a93f8de0a70 (diff)
downloadmeta-mlinux-10afbca28c9e8f061058df75d919b3ffa5f55706.tar.gz
meta-mlinux-10afbca28c9e8f061058df75d919b3ffa5f55706.tar.bz2
meta-mlinux-10afbca28c9e8f061058df75d919b3ffa5f55706.zip
Move libpwquality to dunfell
Diffstat (limited to 'recipes-support')
-rw-r--r--recipes-support/libpwquality/files/pwquality_conf.patch8
-rw-r--r--recipes-support/libpwquality/libpwquality_%.bbappend60
-rw-r--r--recipes-support/libpwquality/libpwquality_1.3.0.bb.old (renamed from recipes-support/libpwquality/libpwquality_1.3.0.bb)0
-rw-r--r--recipes-support/libpwquality/libpwquality_1.4.0.bb.new45
4 files changed, 64 insertions, 49 deletions
diff --git a/recipes-support/libpwquality/files/pwquality_conf.patch b/recipes-support/libpwquality/files/pwquality_conf.patch
index 12074ce..c84383b 100644
--- a/recipes-support/libpwquality/files/pwquality_conf.patch
+++ b/recipes-support/libpwquality/files/pwquality_conf.patch
@@ -1,6 +1,6 @@
diff -Naru orig/src/pwquality.conf new/src/pwquality.conf
---- orig/src/pwquality.conf 2018-04-25 09:22:11.713803238 -0500
-+++ new/src/pwquality.conf 2018-04-25 09:37:00.997776911 -0500
+--- orig/src/pwquality.conf 2021-02-24 19:02:56.475452913 -0600
++++ new/src/pwquality.conf 2021-02-24 19:02:24.371454075 -0600
@@ -1,41 +1,51 @@
+# Original values are commented out. Minimum password length can be six
+# characters with this configuration if there is enough complexity.
@@ -61,5 +61,5 @@ diff -Naru orig/src/pwquality.conf new/src/pwquality.conf
# gecoscheck = 0
+gecoscheck = 1
#
- # Path to the cracklib dictionaries. Default is to use the cracklib default.
- # dictpath =
+ # Whether to check for the words from the cracklib dictionary.
+ # The check is enabled if the value is not 0.
diff --git a/recipes-support/libpwquality/libpwquality_%.bbappend b/recipes-support/libpwquality/libpwquality_%.bbappend
new file mode 100644
index 0000000..910929e
--- /dev/null
+++ b/recipes-support/libpwquality/libpwquality_%.bbappend
@@ -0,0 +1,60 @@
+SUMMARY = "Library for password quality checking and generating random passwords"
+HOMEPAGE = "https://launchpad.net/libpwquality"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2"
+FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
+
+SRC_URI += "\
+ file://pwquality_conf.patch \
+ file://pam.configure \
+ "
+
+do_install_append() {
+ install -d -m755 ${D}/${datadir_native}/${PN}
+ install ${WORKDIR}/pam.configure ${D}/${datadir_native}/${PN}
+}
+
+# The postinstall installs libpwquality into PAM.
+# The prerm removes libpwquatlity from PAM.
+# The file we change is /etc/pam.d/common-password,
+# which is a configuration file for libpam-runtime.
+# We ignore failures in the post-install and pre-remove.
+# so if the patch does not apply, pam will not use us.
+pkg_postinst_${PN}() {
+ PAM_CONFIGURE="/${datadir_native}/${PN}/pam.configure"
+ if [[ -n $D ]] ; then
+ LOG='printf %s\n'
+ PAM_CONFIGURE="$D${PAM_CONFIGURE}"
+ cd $D
+ else
+ LOG="logger -s -p user.info -t opkg\ libpwquality"
+ cd /
+ fi
+ # -N busybox option for patch is broken
+ if patch --dry-run -p1 < "$PAM_CONFIGURE" ; then
+ logsave=$(patch -p1 < "$PAM_CONFIGURE" 2>&1 || true)
+ if [[ -n ${logsave} ]] ; then
+ ${LOG} "In directory $(pwd)"
+ ${LOG} "patch -p1 < $PAM_CONFIGURE"
+ ${LOG} "${PN} patch: ${logsave}"
+ fi
+ fi
+}
+
+pkg_prerm_${PN}() {
+ PAM_CONFIGURE="/${datadir_native}/${PN}/pam.configure"
+ if [[ -n $D ]] ; then
+ LOG='printf %s\n'
+ PAM_CONFIGURE="$D${PAM_CONFIGURE}"
+ cd $D
+ else
+ LOG="logger -s -p user.info -t opkg\ libpwquality"
+ cd /
+ fi
+ logsave=$(patch -p1 -R < "$PAM_CONFIGURE" 2>&1 || true)
+ if [[ -n ${logsave} ]] ; then
+ ${LOG} "In directory $(pwd)"
+ ${LOG} "patch -p1 -R < "$PAM_CONFIGURE""
+ ${LOG} "${PN} remove patch: ${logsave}"
+ fi
+}
diff --git a/recipes-support/libpwquality/libpwquality_1.3.0.bb b/recipes-support/libpwquality/libpwquality_1.3.0.bb.old
index d7b04d4..d7b04d4 100644
--- a/recipes-support/libpwquality/libpwquality_1.3.0.bb
+++ b/recipes-support/libpwquality/libpwquality_1.3.0.bb.old
diff --git a/recipes-support/libpwquality/libpwquality_1.4.0.bb.new b/recipes-support/libpwquality/libpwquality_1.4.0.bb.new
deleted file mode 100644
index 2c96063..0000000
--- a/recipes-support/libpwquality/libpwquality_1.4.0.bb.new
+++ /dev/null
@@ -1,45 +0,0 @@
-DESCRIPTION = "Library for password quality checking and generating random passwords"
-HOMEPAGE = "https://github.com/libpwquality/libpwquality"
-SECTION = "devel/lib"
-LICENSE = "GPLv2"
-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[md5sum] = "b8defcc7280a90e9400d6689c93a279c"
-SRC_URI[sha256sum] = "1de6ff046cf2172d265a2cb6f8da439d894f3e4e8157b056c515515232fade6b"
-
-S = "${WORKDIR}/${SRCNAME}-${PV}"
-
-DEPENDS = "cracklib virtual/gettext python3"
-RDEPENDS_python3-libpwquality = "${PN}"
-
-inherit autotools python3native gettext
-
-B = "${S}"
-
-export PYTHON_DIR
-export BUILD_SYS
-export HOST_SYS
-export STAGING_LIBDIR
-export STAGING_INCDIR
-
-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} \
-"
-
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
-PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
-
-PACKAGES += "python3-libpwquality python3-libpwquality-dbg"
-FILES_${PN} += "${libdir}/security/pam_pwquality.so"
-FILES_${PN}-dbg += "${libdir}/security/.debug"
-FILES_${PN}-staticdev += "${libdir}/security/pam_pwquality.a"
-FILES_${PN}-dev += "${libdir}/security/pam_pwquality.la"
-FILES_python3-${PN} = "${PYTHON_SITEPACKAGES_DIR}/*"
-FILES_python3-${PN}-dbg = "${PYTHON_SITEPACKAGES_DIR}/.debug"