Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | SUMMARY = "Virtual Console lock program" |
| 2 | DESCRIPTION = "Sometimes a malicious local user could cause more problems \ |
| 3 | than a sophisticated remote one. vlock is a program that locks one or more \ |
| 4 | sessions on the Linux console to prevent attackers from gaining physical \ |
| 5 | access to the machine. \ |
| 6 | " |
| 7 | SECTION = "utils" |
| 8 | |
| 9 | LICENSE = "GPLv2" |
| 10 | LIC_FILES_CHKSUM = "file://COPYING;md5=a17cb0a873d252440acfdf9b3d0e7fbf" |
| 11 | |
| 12 | SRC_URI = "${GENTOO_MIRROR}/${BP}.tar.gz \ |
| 13 | file://disable_vlockrc.patch \ |
| 14 | file://vlock_pam_tally2_reset.patch \ |
| 15 | file://vlock-no_tally.patch \ |
| 16 | file://vlock_pam \ |
| 17 | " |
| 18 | |
| 19 | SRC_URI[md5sum] = "378175c7692a8f288e65fd4dbf8a38eb" |
| 20 | SRC_URI[sha256sum] = "85aa5aed1ae49351378a0bd527a013078f0f969372a63164b1944174ae1a5e39" |
| 21 | |
| 22 | inherit autotools-brokensep update-alternatives |
| 23 | |
| 24 | # authentification method: either pam or shadow |
| 25 | PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', 'shadow', d)}" |
| 26 | PACKAGECONFIG[pam] = "--enable-pam,,libpam," |
| 27 | PACKAGECONFIG[shadow] = "--enable-shadow,,shadow," |
| 28 | |
| 29 | CFLAGS += "-Wall -W -pedantic -std=gnu99" |
| 30 | |
| 31 | do_configure () { |
| 32 | # The configure tries to use 'getent' to get the group |
| 33 | # info from the host, which should be avoided. |
| 34 | sed -i 's/\(ROOT_GROUP=\).*/\1"root"/' ${CONFIGURE_SCRIPT} |
| 35 | |
| 36 | ${CONFIGURE_SCRIPT} \ |
| 37 | VLOCK_GROUP=root \ |
| 38 | ROOT_GROUP=root \ |
| 39 | CC="${CC}" \ |
| 40 | CFLAGS="${CFLAGS}" \ |
| 41 | LDFLAGS="${LDFLAGS}" \ |
| 42 | --prefix=${prefix} \ |
| 43 | --libdir=${libdir} \ |
| 44 | --mandir=${mandir} \ |
| 45 | --with-modules="all.so new.so nosysrq.so ttyblank.so vesablank.so" \ |
| 46 | --disable-root-password --enable-debug --disable-fail-count \ |
| 47 | ${PACKAGECONFIG_CONFARGS} |
| 48 | } |
| 49 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 50 | do_install:append () { |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 51 | if [ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', '', d)} = yes ]; then |
| 52 | install -d -m 0755 ${D}/${sysconfdir}/pam.d |
| 53 | install -m 0644 ${WORKDIR}/vlock_pam ${D}${sysconfdir}/pam.d/vlock |
| 54 | fi |
| 55 | } |
| 56 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 57 | ALTERNATIVE:${PN} = "vlock" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 58 | ALTERNATIVE_PRIORITY = "60" |
| 59 | ALTERNATIVE_LINK_NAME[vlock] = "${bindir}/vlock" |