Index: src/files.c
--- src/files.c.orig
+++ src/files.c
@@ -224,6 +224,12 @@ STATIC_DCL int FDECL(open_levelfile_exclusively, (cons
 static char *config_section_chosen = (char *) 0;
 static char *config_section_current = (char *) 0;
 
+#ifdef __OpenBSD__
+#include <sys/stat.h>
+/* OpenBSD: set[ug]id binary MUST say so in this var */
+mode_t _permit_setugid = S_ISGID;
+#endif
+
 /*
  * fname_encode()
  *
@@ -1373,6 +1379,7 @@ boolean uncomp;
 #endif
     f = fork();
     if (f == 0) { /* child */
+	int uid, gid;
 #ifdef TTY_GRAPHICS
         /* any error messages from the compression must come out after
          * the first line, because the more() to let the user read
@@ -1397,8 +1404,10 @@ boolean uncomp;
             redirect(filename, RDBMODE, stdin, uncomp);
             redirect(cfn, WRBMODE, stdout, uncomp);
         }
-        (void) setgid(getgid());
-        (void) setuid(getuid());
+	gid = getgid();
+	uid = getuid();
+	(void) setresgid(gid, gid, gid);
+	(void) setresuid(gid, gid, gid);
         (void) execv(args[0], (char *const *) args);
         perror((char *) 0);
         (void) fprintf(stderr, "Exec to %scompress %s failed.\n",
