pkgsrc-WIP-changes archive

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

xtrlock: add OpenBSD support.



Module Name:	pkgsrc-wip
Committed By:	Paolo Vincenzo Olivo <vms%retrobsd.ddns.net@localhost>
Pushed By:	vms
Date:		Mon Oct 31 21:17:00 2022 +0100
Changeset:	4b3d65a937fc1fe1c446abefbd786ee916fdfd48

Modified Files:
	xtrlock/MESSAGE
	xtrlock/Makefile
	xtrlock/distinfo
	xtrlock/patches/patch-xtrlock.c

Log Message:
xtrlock: add OpenBSD support.

Fixes for OpenBSD where contributed by RVP via private mail exchange.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4b3d65a937fc1fe1c446abefbd786ee916fdfd48

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

diffstat:
 xtrlock/MESSAGE                 |  4 ++--
 xtrlock/Makefile                |  2 ++
 xtrlock/distinfo                |  2 +-
 xtrlock/patches/patch-xtrlock.c | 14 ++++++++++++++
 4 files changed, 19 insertions(+), 3 deletions(-)

diffs:
diff --git a/xtrlock/MESSAGE b/xtrlock/MESSAGE
index 53fe0ca8a2..47d2dad966 100644
--- a/xtrlock/MESSAGE
+++ b/xtrlock/MESSAGE
@@ -4,8 +4,8 @@ $NetBSD$
 By default, xtrlock(1) is installed suid root, this is required to inspect
 the user database when locking the screen.
 
-On Linux, where the shadow file is generally made group-redable by the
-`shadow' group, xtrlock will be installed sgid shadow instead.
+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/xtrlock/Makefile b/xtrlock/Makefile
index 3a9b70605b..305055f474 100644
--- a/xtrlock/Makefile
+++ b/xtrlock/Makefile
@@ -28,6 +28,8 @@ 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
diff --git a/xtrlock/distinfo b/xtrlock/distinfo
index db75292ccc..6dc6c8fc41 100644
--- a/xtrlock/distinfo
+++ b/xtrlock/distinfo
@@ -3,4 +3,4 @@ $NetBSD$
 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) = 3fadf9ba5cf6d4f56d127383bcb60394386cfb0f
+SHA1 (patch-xtrlock.c) = 2fdef6890a285883c82a03ff53dea2cfc22fdaf5
diff --git a/xtrlock/patches/patch-xtrlock.c b/xtrlock/patches/patch-xtrlock.c
index cb25044a8b..44724b0acb 100644
--- a/xtrlock/patches/patch-xtrlock.c
+++ b/xtrlock/patches/patch-xtrlock.c
@@ -21,3 +21,17 @@ Portability fixes for BSD systems.
  
  #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