diff options
author | pin <pin@pkgsrc.org> | 2022-11-05 18:18:13 +0000 |
---|---|---|
committer | pin <pin@pkgsrc.org> | 2022-11-05 18:18:13 +0000 |
commit | 7a7ae60d2a5618ac70bb1c2c0ce1529400e2967a (patch) | |
tree | d38858a20222bda88ed5db3c75d88378b19ac6b0 /x11 | |
parent | 14d2cf0a227f8a7da0fd026b53bbadfa5ffd9b7c (diff) | |
download | pkgsrc-7a7ae60d2a5618ac70bb1c2c0ce1529400e2967a.tar.gz |
x11/xtrlock: import pkg
xtrlock is a very minimal X display lock program, which uses
nothing except the Xlib library. It doesn't obscure the screen,
it is completely idle while the display is locked and you don't
type at it, and it doesn't do funny things to the X access control
lists.
Original by Matthias Petermann, fixes by Paolo Vincenzo Olivo in wip
Diffstat (limited to 'x11')
-rw-r--r-- | x11/xtrlock/DESCR | 5 | ||||
-rw-r--r-- | x11/xtrlock/MESSAGE | 12 | ||||
-rw-r--r-- | x11/xtrlock/Makefile | 53 | ||||
-rw-r--r-- | x11/xtrlock/PLIST | 3 | ||||
-rw-r--r-- | x11/xtrlock/distinfo | 6 | ||||
-rw-r--r-- | x11/xtrlock/patches/patch-xtrlock.c | 37 |
6 files changed, 116 insertions, 0 deletions
diff --git a/x11/xtrlock/DESCR b/x11/xtrlock/DESCR new file mode 100644 index 00000000000..adb862510a2 --- /dev/null +++ b/x11/xtrlock/DESCR @@ -0,0 +1,5 @@ +xtrlock is a very minimal X display lock program, which uses +nothing except the Xlib library. It doesn't obscure the screen, +it is completely idle while the display is locked and you don't +type at it, and it doesn't do funny things to the X access control +lists. diff --git a/x11/xtrlock/MESSAGE b/x11/xtrlock/MESSAGE new file mode 100644 index 00000000000..3b8390896d3 --- /dev/null +++ b/x11/xtrlock/MESSAGE @@ -0,0 +1,12 @@ +=========================================================================== +$NetBSD: MESSAGE,v 1.1 2022/11/05 18:18:13 pin Exp $ + +By default, xtrlock(1) is installed suid root, this is required to inspect +the user database when locking the screen. + +On Linux and OpenBSD, where the shadow file is generally made group-redable +by a '[_]shadow' group, xtrlock will be installed sgid shadow instead. + +Privileges are dropped at startup and reacquired only upon unlocking. + +=========================================================================== diff --git a/x11/xtrlock/Makefile b/x11/xtrlock/Makefile new file mode 100644 index 00000000000..3076916862f --- /dev/null +++ b/x11/xtrlock/Makefile @@ -0,0 +1,53 @@ +# $NetBSD: Makefile,v 1.1 2022/11/05 18:18:13 pin Exp $ + +DISTNAME= xtrlock-2.15 +CATEGORIES= x11 +MASTER_SITES= ${MASTER_SITE_DEBIAN:=pool/main/x/xtrlock/} +EXTRACT_SUFX= .tar.xz +DISTFILES= xtrlock_2.15.tar.xz + +MAINTAINER= vms@retrobsd.ddns.net +COMMENT= Simple X11 screen lock tool +LICENSE= gnu-gpl-v3 + +USE_IMAKE= yes + +# mitigate CVE-2016-10894 +CFLAGS+= -DMULTITOUCH +LDFLAGS+= -lXi + +.include "../../mk/bsd.prefs.mk" + +.if exists(/etc/shadow) && !(${OPSYS:M*BSD} != "" || ${OPSYS} == "Darwin" || ${OPSYS} == "DragonFly") +MAKE_FLAGS+= CCOPTIONS="${CFLAGS} -DSHADOW_PWD" #getspnam() +.else +MAKE_FLAGS+= CCOPTIONS=${CFLAGS:Q} +.endif +MAKE_FLAGS+= LOCAL_LDFLAGS=${LDFLAGS:Q} + +.if ${OPSYS} == "Linux" +SETUID_ROOT_PERMS?= ${REAL_ROOT_USER} shadow 2555 +.elif ${OPSYS} == "OpenBSD" +SETUID_ROOT_PERMS?= ${REAL_ROOT_USER} _shadow 2555 +.else +SETUID_ROOT_PERMS?= ${REAL_ROOT_USER} ${BINGRP} 4555 +.endif +SPECIAL_PERMS+= bin/xtrlock ${SETUID_ROOT_PERMS} + +INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 + +do-build: + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ + ${MAKE_PROGRAM} ${MAKE_FLAGS} xtrlock + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/xtrlock \ + ${DESTDIR}${PREFIX}/bin/xtrlock + + ${INSTALL_MAN} ${WRKSRC}/xtrlock.man \ + ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/xtrlock.1 + +.include "../../x11/libX11/buildlink3.mk" +.include "../../x11/libXfixes/buildlink3.mk" +.include "../../x11/libXi/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/x11/xtrlock/PLIST b/x11/xtrlock/PLIST new file mode 100644 index 00000000000..33b71fb0c1b --- /dev/null +++ b/x11/xtrlock/PLIST @@ -0,0 +1,3 @@ +@comment $NetBSD: PLIST,v 1.1 2022/11/05 18:18:13 pin Exp $ +bin/xtrlock +man/man1/xtrlock.1 diff --git a/x11/xtrlock/distinfo b/x11/xtrlock/distinfo new file mode 100644 index 00000000000..5d0e2533c43 --- /dev/null +++ b/x11/xtrlock/distinfo @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1 2022/11/05 18:18:13 pin Exp $ + +BLAKE2s (xtrlock_2.15.tar.xz) = 78fa4bbc9f0ab0999db7fc6cb5330aabff241f2b8c0e6c2f5189640adf8034c0 +SHA512 (xtrlock_2.15.tar.xz) = 3047ca57f04c58426c55c68cf711dffe124ba6c221a3659112339b01ec0f1a411d965277bb366bd39d8155fd82f8e49cb00e728a911aa67b4e46fcfcc489f0b1 +Size (xtrlock_2.15.tar.xz) = 21316 bytes +SHA1 (patch-xtrlock.c) = 2fdef6890a285883c82a03ff53dea2cfc22fdaf5 diff --git a/x11/xtrlock/patches/patch-xtrlock.c b/x11/xtrlock/patches/patch-xtrlock.c new file mode 100644 index 00000000000..d6f71b8334a --- /dev/null +++ b/x11/xtrlock/patches/patch-xtrlock.c @@ -0,0 +1,37 @@ +$NetBSD: patch-xtrlock.c,v 1.1 2022/11/05 18:18:13 pin Exp $ + +Portability fixes for BSD systems. + +--- xtrlock.c.orig 2021-02-13 15:34:52.000000000 +0000 ++++ xtrlock.c +@@ -31,11 +31,16 @@ + #include <grp.h> + #include <limits.h> + #include <string.h> ++#include <sys/param.h> ++#ifndef BSD + #include <crypt.h> ++#endif + #include <unistd.h> + #include <math.h> + #include <ctype.h> ++#ifndef BSD + #include <values.h> ++#endif + + #ifdef SHADOW_PWD + #include <shadow.h> +@@ -138,8 +143,12 @@ int main(int argc, char **argv){ + exit(1); + } + } +- ++ ++#ifdef __OpenBSD__ ++ errno=0; pw= getpwuid_shadow(getuid()); ++#else + errno=0; pw= getpwuid(getuid()); ++#endif + if (!pw) { perror("password entry for uid not found"); exit(1); } + #ifdef SHADOW_PWD + sp = getspnam(pw->pw_name); |