Download raw body.
[maintainer update] adjust nethack 5.0 to the new setgid rules
[maintainer update] adjust nethack 5.0 to the new setgid rules
On 2026/10/15 11:09, Marc Espie wrote:
> 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.
This does add it to nethack, but not recover.
$ nm -s lib/nethackdir-5.0/* 2>/dev/null|grep -e ^lib -e setugid
lib/nethackdir-5.0/license:
lib/nethackdir-5.0/nethack:
lib/nethackdir-5.0/nethack:
003cf890 D _permit_setugid
lib/nethackdir-5.0/nhdat:
lib/nethackdir-5.0/pet_mark.xbm:
lib/nethackdir-5.0/pilemark.xbm:
lib/nethackdir-5.0/recover:
lib/nethackdir-5.0/recover:
lib/nethackdir-5.0/rip.xpm:
lib/nethackdir-5.0/save:
lib/nethackdir-5.0/symbols:
lib/nethackdir-5.0/x11tiles:
>
> 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);
> }
>
[maintainer update] adjust nethack 5.0 to the new setgid rules
[maintainer update] adjust nethack 5.0 to the new setgid rules