pkgsrc-Changes archive

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

CVS commit: pkgsrc/x11/xtrlock



Module Name:    pkgsrc
Committed By:   pin
Date:           Sat Nov  5 18:18:13 UTC 2022

Added Files:
        pkgsrc/x11/xtrlock: DESCR MESSAGE Makefile PLIST distinfo
        pkgsrc/x11/xtrlock/patches: patch-xtrlock.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/x11/xtrlock/DESCR pkgsrc/x11/xtrlock/MESSAGE \
    pkgsrc/x11/xtrlock/Makefile pkgsrc/x11/xtrlock/PLIST \
    pkgsrc/x11/xtrlock/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/x11/xtrlock/patches/patch-xtrlock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/x11/xtrlock/DESCR
diff -u /dev/null pkgsrc/x11/xtrlock/DESCR:1.1
--- /dev/null   Sat Nov  5 18:18:13 2022
+++ pkgsrc/x11/xtrlock/DESCR    Sat Nov  5 18:18:13 2022
@@ -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.
Index: pkgsrc/x11/xtrlock/MESSAGE
diff -u /dev/null pkgsrc/x11/xtrlock/MESSAGE:1.1
--- /dev/null   Sat Nov  5 18:18:13 2022
+++ pkgsrc/x11/xtrlock/MESSAGE  Sat Nov  5 18:18:13 2022
@@ -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.
+
+===========================================================================
Index: pkgsrc/x11/xtrlock/Makefile
diff -u /dev/null pkgsrc/x11/xtrlock/Makefile:1.1
--- /dev/null   Sat Nov  5 18:18:13 2022
+++ pkgsrc/x11/xtrlock/Makefile Sat Nov  5 18:18:13 2022
@@ -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"
Index: pkgsrc/x11/xtrlock/PLIST
diff -u /dev/null pkgsrc/x11/xtrlock/PLIST:1.1
--- /dev/null   Sat Nov  5 18:18:13 2022
+++ pkgsrc/x11/xtrlock/PLIST    Sat Nov  5 18:18:13 2022
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2022/11/05 18:18:13 pin Exp $
+bin/xtrlock
+man/man1/xtrlock.1
Index: pkgsrc/x11/xtrlock/distinfo
diff -u /dev/null pkgsrc/x11/xtrlock/distinfo:1.1
--- /dev/null   Sat Nov  5 18:18:13 2022
+++ pkgsrc/x11/xtrlock/distinfo Sat Nov  5 18:18:13 2022
@@ -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

Index: pkgsrc/x11/xtrlock/patches/patch-xtrlock.c
diff -u /dev/null pkgsrc/x11/xtrlock/patches/patch-xtrlock.c:1.1
--- /dev/null   Sat Nov  5 18:18:13 2022
+++ pkgsrc/x11/xtrlock/patches/patch-xtrlock.c  Sat Nov  5 18:18:13 2022
@@ -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