pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/x11/xtrlock x11/xtrlock: import pkg



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3db5817188d0
branches:  trunk
changeset: 387723:3db5817188d0
user:      pin <pin%pkgsrc.org@localhost>
date:      Sat Nov 05 18:18:13 2022 +0000

description:
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:

 x11/xtrlock/DESCR                   |   5 +++
 x11/xtrlock/MESSAGE                 |  12 ++++++++
 x11/xtrlock/Makefile                |  53 +++++++++++++++++++++++++++++++++++++
 x11/xtrlock/PLIST                   |   3 ++
 x11/xtrlock/distinfo                |   6 ++++
 x11/xtrlock/patches/patch-xtrlock.c |  37 +++++++++++++++++++++++++
 6 files changed, 116 insertions(+), 0 deletions(-)

diffs (140 lines):

diff -r e049eb60cfba -r 3db5817188d0 x11/xtrlock/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xtrlock/DESCR Sat Nov 05 18:18:13 2022 +0000
@@ -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 -r e049eb60cfba -r 3db5817188d0 x11/xtrlock/MESSAGE
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xtrlock/MESSAGE       Sat Nov 05 18:18:13 2022 +0000
@@ -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 -r e049eb60cfba -r 3db5817188d0 x11/xtrlock/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xtrlock/Makefile      Sat Nov 05 18:18:13 2022 +0000
@@ -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@localhost
+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 -r e049eb60cfba -r 3db5817188d0 x11/xtrlock/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xtrlock/PLIST Sat Nov 05 18:18:13 2022 +0000
@@ -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 -r e049eb60cfba -r 3db5817188d0 x11/xtrlock/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xtrlock/distinfo      Sat Nov 05 18:18:13 2022 +0000
@@ -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 -r e049eb60cfba -r 3db5817188d0 x11/xtrlock/patches/patch-xtrlock.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xtrlock/patches/patch-xtrlock.c       Sat Nov 05 18:18:13 2022 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index