Wed Oct 21 17:34:09 2020 UTC ()
doas: Use setusercontext(3)

Calling setusercontext(3) makes per-user temporary storage work (see
per_user_tmp in security(7) and rc.conf(5)).

May as well use our reallocarray(3) instead of the bundled compat code.


(kim)
diff -r1.10 -r1.11 pkgsrc/security/doas/Makefile
diff -r1.5 -r1.6 pkgsrc/security/doas/distinfo
diff -r0 -r1.1 pkgsrc/security/doas/patches/patch-Makefile
diff -r0 -r1.1 pkgsrc/security/doas/patches/patch-compat_compat.h

cvs diff -r1.10 -r1.11 pkgsrc/security/doas/Makefile (expand / switch to unified diff)

--- pkgsrc/security/doas/Makefile 2020/10/21 15:25:23 1.10
+++ pkgsrc/security/doas/Makefile 2020/10/21 17:34:09 1.11
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.10 2020/10/21 15:25:23 kim Exp $ 1# $NetBSD: Makefile,v 1.11 2020/10/21 17:34:09 kim Exp $
2 2
3DISTNAME= doas-6.2p4 3DISTNAME= doas-6.2p4
4PKGREVISION= 2 4PKGREVISION= 3
5CATEGORIES= security 5CATEGORIES= security
6MASTER_SITES= ${MASTER_SITE_GITHUB:=slicer69/} 6MASTER_SITES= ${MASTER_SITE_GITHUB:=slicer69/}
7 7
8MAINTAINER= nikita@NetBSD.org 8MAINTAINER= nikita@NetBSD.org
9HOMEPAGE= https://github.com/slicer69/doas/ 9HOMEPAGE= https://github.com/slicer69/doas/
10COMMENT= Execute commands as another user 10COMMENT= Execute commands as another user
11LICENSE= 2-clause-bsd AND isc AND modified-bsd 11LICENSE= 2-clause-bsd AND isc AND modified-bsd
12 12
13USE_TOOLS+= gmake yacc 13USE_TOOLS+= gmake yacc
14 14
15# XXX: Upstream supports only NetBSD, FreeBSD, Linux, 15# XXX: Upstream supports only NetBSD, FreeBSD, Linux,
16# illumos, SmartOS, OpenIndiana. 16# illumos, SmartOS, OpenIndiana.
17# Add any failing platforms as BROKEN_ON_PLATFORM. 17# Add any failing platforms as BROKEN_ON_PLATFORM.

cvs diff -r1.5 -r1.6 pkgsrc/security/doas/distinfo (expand / switch to unified diff)

--- pkgsrc/security/doas/distinfo 2020/01/01 01:30:19 1.5
+++ pkgsrc/security/doas/distinfo 2020/10/21 17:34:09 1.6
@@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
1$NetBSD: distinfo,v 1.5 2020/01/01 01:30:19 ng0 Exp $ 1$NetBSD: distinfo,v 1.6 2020/10/21 17:34:09 kim Exp $
2 2
3SHA1 (doas-6.2p4.tar.gz) = dd90972c3a120ae2b96432bae2c7a78c4c729166 3SHA1 (doas-6.2p4.tar.gz) = dd90972c3a120ae2b96432bae2c7a78c4c729166
4RMD160 (doas-6.2p4.tar.gz) = a8ed8677fbffd48bf87b4fa5c6b0dd98f0c5e428 4RMD160 (doas-6.2p4.tar.gz) = a8ed8677fbffd48bf87b4fa5c6b0dd98f0c5e428
5SHA512 (doas-6.2p4.tar.gz) = 951686a58300ab6ffcdd7b98502df832b35c43787234c52c71c42eaca9e4dbeb1c2e33e7535a9b8babdb2f38840f6cff1045f6a90fa609029590e7c1384b8a75 5SHA512 (doas-6.2p4.tar.gz) = 951686a58300ab6ffcdd7b98502df832b35c43787234c52c71c42eaca9e4dbeb1c2e33e7535a9b8babdb2f38840f6cff1045f6a90fa609029590e7c1384b8a75
6Size (doas-6.2p4.tar.gz) = 26098 bytes 6Size (doas-6.2p4.tar.gz) = 26098 bytes
 7SHA1 (patch-Makefile) = 710303b7c858f0d94f0f8bdd873a87e2600f72d0
 8SHA1 (patch-compat_compat.h) = b49d6a64f5ee6308446184891b8ece32c919b95a

File Added: pkgsrc/security/doas/patches/patch-Makefile
$NetBSD: patch-Makefile,v 1.1 2020/10/21 17:34:09 kim Exp $

Enable HAVE_LOGIN_CAP_H and reallocarray() on NetBSD.

--- Makefile
+++ Makefile
@@ -24,6 +24,11 @@ ifeq ($(UNAME_S),FreeBSD)
     CFLAGS+=-DHAVE_LOGIN_CAP_H
     LDFLAGS+=-lutil
 endif
+ifeq ($(UNAME_S),NetBSD)
+    CFLAGS+=-DHAVE_LOGIN_CAP_H -D_OPENBSD_SOURCE
+    OBJECTS=doas.o env.o y.tab.o
+    LDFLAGS+=-lutil
+endif
 ifeq ($(UNAME_S),SunOS)
     SAFE_PATH?=/bin:/sbin:/usr/bin:/usr/sbin:$(PREFIX)/bin:$(PREFIX)/sbin
     GLOBAL_PATH?=/bin:/sbin:/usr/bin:/usr/sbin:$(PREFIX)/bin:$(PREFIX)/sbin

File Added: pkgsrc/security/doas/patches/patch-compat_compat.h
$NetBSD: patch-compat_compat.h,v 1.1 2020/10/21 17:34:09 kim Exp $

Do not provide a prototype for reallocarray(3) on NetBSD.

--- compat/compat.h
+++ compat/compat.h
@@ -13,7 +13,9 @@ extern const char *__progname;
 
 const char *getprogname(void);
 
+#if !defined(__NetBSD__)
 void *reallocarray(void *optr, size_t nmemb, size_t size);
+#endif
 
 void setprogname(const char *progname);