Index | Thread | Search

From:
Marc Espie <marc.espie.openbsd@gmail.com>
Subject:
[maintainer update] adjust nethack 5.0 to the new setgid rules
To:
ports@openbsd.org
Date:
Thu, 15 Oct 2026 11:09:16 +0200

Download raw body.

Thread
Seems like the most logical place to put it, since there's already
a patch for setgid in that file.

If that looks good, I can do the other nethacks and derivatives, or somebody
else can straight adapt the patch.


Index: Makefile
===================================================================
RCS file: /build/data/openbsd/cvs/ports/games/nethack/5.0/Makefile,v
diff -u -p -r1.2 Makefile
--- Makefile	12 Jul 2026 22:42:45 -0000	1.2
+++ Makefile	15 Oct 2026 09:04:03 -0000
@@ -7,6 +7,7 @@ PKGNAME =	${DISTNAME}
 CATEGORIES =	games
 SITES =		https://www.nethack.org/download/$V/
 DISTFILES =	nethack-${V:S/.//g}-src.tgz
+REVISION =	0
 
 HOMEPAGE =	http://nethack.org/
 
Index: patches/patch-src_files_c
===================================================================
RCS file: /build/data/openbsd/cvs/ports/games/nethack/5.0/patches/patch-src_files_c,v
diff -u -p -r1.1.1.1 patch-src_files_c
--- patches/patch-src_files_c	30 Jun 2026 14:59:13 -0000	1.1.1.1
+++ patches/patch-src_files_c	15 Oct 2026 09:06:26 -0000
@@ -1,7 +1,19 @@
 Index: src/files.c
 --- src/files.c.orig
 +++ src/files.c
-@@ -1691,8 +1691,10 @@ docompress_file(const char *filename, boolean uncomp)
+@@ -194,6 +194,11 @@ staticfn FILE *fopen_sym_file(void);
+ staticfn NHFILE *viable_nhfile(NHFILE *);
+ #endif /* !SFCTOOL */
+ 
++#ifdef __OpenBSD__
++#include <sys/stat.h>
++mode_t _permit_setugid = S_ISGID;
++#endif
++
+ /* return a file's name without its path and optionally trailing 'type' */
+ const char *
+ nh_basename(const char *fname, boolean keep_suffix)
+@@ -1691,8 +1696,10 @@ docompress_file(const char *filename, boolean uncomp)
              redirect(filename, RDBMODE, stdin, uncomp);
              redirect(cfn, WRBMODE, stdout, uncomp);
          }