Subject: bug#32305: closed (Re: bug#32305: mingw vs do_chown in gzip)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 05 Aug 2018 03:37:02 +0000

Your bug report

#32305: mingw vs do_chown in gzip

which was filed against the gzip package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
32305: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32305
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#32305: mingw vs do_chown in gzip
From: Paul Eggert <[email-masked]>
To: Bdale Garbee <[email-masked]>
Cc: [email-masked]
Date: Sat, 4 Aug 2018 20:36:42 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for checking the fix; closing the bug report.

Subject: Re: mingw vs do_chown in gzip
From: Paul Eggert <[email-masked]>
To: Bdale Garbee <[email-masked]>
Cc: gzip bugs <[email-masked]>
Date: Sun, 29 Jul 2018 11:31:06 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Bdale Garbee wrote:

> I'm (finally) working on updating the gzip in Debian to something newer
> than 1.6, which caused me to stumble over the addition of the do_chown
> function in gzip.c.  That's because I need to build both native Debian
> and Windows binary packages, the latter in support of a portion of the
> Debian installer system that has something to do with Windows.
> 
> The problem is that mingw doesn't provide uid_t or gid_t definitions,
> perhaps just because there isn't really an equivalent ownership
> construct in Windows?

Yes, that must be it. I installed the attached into gzip master on Savannah; 
does it fix things for you?
From 5405b4046acf80744caf2ba666128f25047b6411 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Sun, 29 Jul 2018 11:27:32 -0700
Subject: [PATCH] gzip: port better to mingw

Problem reported by Bdale Garbee for Debian
* gzip.c (do_chown): Don't assume uid_t and gid_t.
---
 gzip.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gzip.c b/gzip.c
index 429e554..a023d81 100644
--- a/gzip.c
+++ b/gzip.c
@@ -1914,17 +1914,20 @@ local int check_ofname()
    the file and NAME its name.  Change it to user UID and to group GID.
    If UID or GID is -1, though, do not change the corresponding user
    or group.  */
+#ifdef NO_CHOWN
+/* The types uid_t and gid_t do not exist on mingw, so don't assume them.  */
+# define do_chown(fd, name, uid, gid) ((void) 0)
+#else
 static void
 do_chown (int fd, char const *name, uid_t uid, gid_t gid)
 {
-#ifndef NO_CHOWN
 # if HAVE_FCHOWN
   ignore_value (fchown (fd, uid, gid));
 # else
   ignore_value (chown (name, uid, gid));
 # endif
-#endif
 }
+#endif
 
 /* ========================================================================
  * Copy modes, times, ownership from input file to output file.
-- 
2.7.4