Index: src/files.c
--- src/files.c.orig
+++ src/files.c
@@ -1373,6 +1373,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 +1398,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",
