From 63266fdc6f2014cc6dfd0f983e13de7c378bc708 Mon Sep 17 00:00:00 2001 From: Max Rees Date: Fri, 21 Sep 2018 17:50:27 -0400 Subject: user/physlock: new package --- user/physlock/APKBUILD | 28 ++++++++++++++++++++++++++++ user/physlock/utmps.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 user/physlock/APKBUILD create mode 100644 user/physlock/utmps.patch (limited to 'user') diff --git a/user/physlock/APKBUILD b/user/physlock/APKBUILD new file mode 100644 index 000000000..a2c4e471f --- /dev/null +++ b/user/physlock/APKBUILD @@ -0,0 +1,28 @@ +# Contributor: Max Rees +# Maintainer: Max Rees +pkgname=physlock +pkgver=11 +pkgrel=0 +pkgdesc="Lightweight Linux console-locking tool" +url="https://github.com/muennich/physlock" +arch="all" +options="!check suid" # No test suite. +license="GPL-2.0+" +depends="" +makedepends="linux-headers linux-pam-dev utmps-dev" +subpackages="$pkgname-doc" +source="$pkgname-$pkgver.tar.gz::https://github.com/muennich/physlock/archive/v$pkgver.tar.gz + utmps.patch" + +build() { + cd "$builddir" + make +} + +package() { + cd "$builddir" + make PREFIX="/usr" DESTDIR="$pkgdir" install +} + +sha512sums="d3badf5c99e4e3e16f4e7ec5c59ee8320c845f1b180463900d816206362ce1aa8652f2489453ad5e190cceee2ed61a90acc52e25bb6b4c4a9dc8c4ebd3054938 physlock-11.tar.gz +d461b462dedfb7505f506ce1050d5140b8729f50a383157157e4f65465f63174cc11dc0a46cc1eed57cec0293006c5ec6cc6e96af9acab009ab3c9fe5e2381d5 utmps.patch" diff --git a/user/physlock/utmps.patch b/user/physlock/utmps.patch new file mode 100644 index 000000000..efae166a9 --- /dev/null +++ b/user/physlock/utmps.patch @@ -0,0 +1,33 @@ +--- physlock-11/auth.c 2017-07-13 07:23:52.000000000 +0000 ++++ physlock-11/auth.c 2018-09-21 21:21:36.240024566 +0000 +@@ -16,13 +16,14 @@ + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + ++#define _GNU_SOURCE + #include + #include + #include + #include + #include + #include +-#include ++#include + #include + #include + +@@ -41,12 +42,12 @@ static void get_pam(userinfo_t *uinfo) { + + void get_user(userinfo_t *uinfo, int vt, uid_t owner) { + FILE *uf; +- struct utmp r; ++ struct utmpx r; + struct passwd *pw; + char tty[16], name[UT_NAMESIZE+1]; + + uinfo->name = NULL; +- while ((uf = fopen(_PATH_UTMP, "r")) == NULL && errno == EINTR); ++ while ((uf = fopen(UTMPX_FILE, "r")) == NULL && errno == EINTR); + + if (uf != NULL) { + snprintf(tty, sizeof(tty), "tty%d", vt); -- cgit v1.2.3-70-g09d2