Christian Franke | 25 Sep 14:40 2014

[PATCH] Disable AF_UNIX handshake with setsockopt(..., SO_PEERCRED, ...)

This is a workaround for this problem which blocks ITP postfix:

With the patch, this disables the secret+cred handshakes of the AF_UNIX 

int sd = socket(AF_UNIX, SOCK_STREAM, 0);

setsockopt(sd, SOL_SOCKET, SO_PEERCRED, NULL, 0);

Postfix works if socket() calls are replaced by the above.

Calls of getsockopt(..., SO_PEERCRED, ...) and getpeereid() would fail with ENOTSUP then. These are not
used by postfix.


Christian Franke | 23 Sep 18:01 2014

[PATCH] Fix crash of ffs (0x80000000) on 64 bit

This fixes the issue reported here:

On 64 bit, i = 0x80000000 results in x = 0xffffffff80000000 due to sign 


Christian Franke | 7 Aug 22:15 2014

[PATCH] cygcheck -m, --check-mtimes option

Attached is an experimental patch which adds -m, 
--check-mtimes[=SECONDS] option to cygcheck. It provides an IMO useful 
heuristics to find files possibly modified after installation.

"cygcheck -c -m" prints the number of files with st_mtime > 
INSTALL_TIME+SECONDS. INSTALL_TIME is the st_mtime of the 
/etc/setup/PACKAGE.lst.gz file.

With -v, the affected path names are printed. The optional parameter 
SECONDS defaults to 600 to hide files modified by postinstall scripts.

Documentation update and changelog entry are still missing.


Eric Blake | 2 Aug 15:27 2014

docs: improve package maintainer instructions

I noticed that the main link on the left navbar
( has outdated instructions;
rather than duplicate things, I'd rather have a link to the more
up-to-date page
(  Okay to push?

2014-08-02  Eric Blake  <eblake <at>>

	* setup.html: Modernize, point to package-upload.html


Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library
Attachment (setup.patch): text/x-patch, 18 KiB
Eric Blake | 31 Jul 18:07 2014

namespace safety with attributes

As pointed out here:

any use of __attribute__ in a header that can be included by a user
should be namespace-safe, by decorating the attribute arguments with __
(while gcc does a lousy job at documenting it, ALL attributes have a __
counterpart, precisely so that public headers can use attributes without
risk of collision with macros belonging to user namespace).

2014-07-31  Eric Blake  <eblake <at>>

	* include/pthread.h: Decorate attribute names with __, for
	namespace safety.
	* include/cygwin/core_dump.h: Likewise.
	* include/cygwin/cygwin_dll.h: Likewise.
	* include/sys/cygwin.h: Likewise.
	* include/sys/strace.h: Likewise.


Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library
Attachment (decorate.patch): text/x-patch, 8157 bytes
Yaakov Selkowitz | 14 Jul 01:38 2014

[PATCH] default to normal pthread mutexes

Defaulting to ERRORCHECK mutexes (with the various stringencies it 
implies) does not match the behaviour on Linux, where NORMAL mutexes are 
the default.  I have been testing this locally for some time, and I 
believe it affects a lot of software.  Patch and STC attached.

2014-07-13  Yaakov Selkowitz  <yselkowitz <at> ...>

	* (pthread_mutex::pthread_mutex): Change default type
	(pthread_mutexattr::pthread_mutexattr): Ditto.
	(pthread_mutex_unlock): Do not fail if mutex is a normal mutex
	* include/pthread.h (PTHREAD_MUTEX_INITIALIZER): Redefine as

RCS file: /cvs/src/src/winsup/cygwin/,v
retrieving revision 1.287
diff -u -p -r1.287
---	1 Dec 2013 10:27:16 -0000	1.287
+++	26 Mar 2014 04:24:08 -0000
 <at>  <at>  -1708,7 +1708,7  <at>  <at>  pthread_mutex::pthread_mutex (pthread_mu
   tid (0),
   recursion_counter (0), condwaits (0),
(Continue reading)

Warren Young | 19 Jun 17:51 2014

/packages CGI HTML modernization

The current CGI code that generates the package and file lists for emits highly redundant HTML, and it is laid 
out using a huge slow-to-render table.  The attached patch shows a 
minimal way to use <ul> instead of <table>, along with some CSS and JS 
to style it in a similar way to the current look.

If JavaScript is verboten on, you can empirically find an 
appropriate value for the width of the package name column and put that 
in the CSS:

     ul.pkglist span {
         float: left;
         width: 185px;

All the jQuery code does is find that width value programmatically, 
which makes it robust in the face of different font sizes and such.

I have also attached a simple example HTML and CSS file, which show the 
basic idea of the change with all the distractions of the real /packages 
page stripped away.  Just put packages.* in a directory and open 
packages.html in your favorite browser.

I lack the ability to generate here, but I expect applying 
the same concept to that script as well will have a measurable effect on 
the load time of  I expect it to roughly halve the 
size of the file and measurably reduce the page render time.

The contents of the attached CSS file should be inserted into one of's normal CSS files.
(Continue reading)

Denis Excoffier | 6 Jun 19:08 2014

typo correction in


The following patch (or equivalent) is needed in order for /usr/bin/id to return the full set of groups
in case the user given as argument belongs to more than 10 groups:

diff -uNr cygwin-snapshot-20140523-1.original/winsup/cygwin/ cygwin-snapshot-20140523-1.patched/winsup/cygwin/
--- cygwin-snapshot-20140523-1.original/winsup/cygwin/	2014-05-23 12:31:13.000000000 +0200
+++ cygwin-snapshot-20140523-1.patched/winsup/cygwin/	2014-05-26 15:08:37.542897300 +0200
 <at>  <at>  -656,11 +656,11  <at>  <at> 
 	  groups[cnt] = grp->gr_gid;
-  *ngroups = cnt;
   if (cnt > *ngroups)
     ret = -1;
     ret = cnt;
+  *ngroups = cnt;

   syscall_printf ( "%d = getgrouplist(%s, %u, %p, %d)",
 		  ret, user, gid, groups, *ngroups);

Please apply.


Denis Excoffier.
Christopher Faylor | 25 May 05:53 2014

Re: Rename detached debug info as cygwin1.dll.dbg

On Fri, May 23, 2014 at 04:05:34PM +0200, Corinna Vinschen wrote:
>On May 23 14:40, Jon TURNEY wrote:
>> Not sure if this is wanted, and it obviously has some knock on effects on
>> package and snapshot generation.
>> But, cygport names detached debug info files by appending the .dbg suffix.
>> This is 'obviously correct' as it means that both a foo.exe and foo.dll can
>> exist and have detached debug info.
>> For consistency, the attached patch changes the name of the detached debug
>> info file for cygwin1.dll from cygwin1.dbg to cygwin1.dll.dbg
>As far as releases go, this is ok.  I'll just have to tweak the next
>cygport file slightly.
>Chris might have to tweak the snapshot generation script as well, so
>he probably wants to chime in, too.

It's more than just a tweak.  I've known that there is a discrepancy for
a long time but haven't considered it that big a deal.  I'd prefer that
this change not be made.

David Stacey | 25 May 00:00 2014

[PATCH] cygwin_rexec() returns pointer to deallocated memory

In function cygwin_rexec(), a pointer to local buffer 'ahostbuf' is 
returned through 'ahost'. However, the buffer will have been deallocated 
at the end of the function, and so the contents of 'ahost' will be 
undefined. A trivial patch (attached) fixes the problem by making 
'ahostbuf' static.

This patch fixes Coverity bug ID #60028.

Change Log:
2014-05-24  David Stacey  <drstacey <at>>

         * libc/ (cygwin_rexec):
         Corrected returning a pointer to a buffer that will have gone 
out of



--- cygwin-orig/libc/	2013-04-23 10:44:35.000000000 +0100
+++ cygwin/libc/	2014-05-24 22:37:39.764370000 +0100
 <at>  <at>  -317,7 +317,7  <at>  <at> 
 	u_short port = 0;
 	int s, timo = 1, s3;
 	char c;
-	char ahostbuf[INTERNET_MAX_HOST_NAME_LENGTH + 1];
+	static char ahostbuf[INTERNET_MAX_HOST_NAME_LENGTH + 1];
(Continue reading)

David Stacey | 18 May 21:12 2014

[PATCH] Buffer over-run fix for getusershell(3)

This is the first patch resulting from the Coverity Scan analysis of the 
Cygwin source code. The patch fixes Coverity ID 59932. Note that we 
don't have that many bugs in the Cygwin source code - that's just an ID 
that Coverity assigned to this issue. The patch is only a single line, 
so it falls into our definition of 'trivial'.

getusershell(3) returns the next line from the '/etc/shells' file [1]. 
This contains a path to an executable, so it makes sense for 'buf' to 
contain PATH_MAX characters.

Now, the definition of PATH_MAX is the maximum length of the path, 
including the null terminator [2]. So the for() loop should copy 
PATH_MAX-1 characters, in order to allow for the null terminator.

However, by copying PATH_MAX characters, there is a possible buffer 
over-run when the null terminator is applied. The patch (attached) 
corrects this.

Change Log:
2014-05-18  David Stacey  <drstacey <at>>

         * winsup/cygwin/ :
         Fixed theoretical buffer overrun of 'buf' that would occur if
         /etc/shells contained a line longer than 4095 characters.



(Continue reading)