Attn gawk and man-db maintainers: 3am pages shadowing 3p

2015-10-22 Thread Warren Young
Several gawk module manual pages (fnmatch, fork, readdir, and time(3am)) 
currently shadow pages of the same name in section 3p, owned by 
man-pages-posix.  These are currently dumped into the generic man3 directory, 
which causes them to take precedence over 3p because of this line in 
/etc/man_db.conf:

  SECTION 1 1p 8 2 3 3p 4 5 6 7 9 0p n

This causes “man readdir” to return the gawk page, not the POSIX page, as the 
user almost certainly intended.

To fix this, the man_db maintainer should add a 3am after 3p here, and the gawk 
maintainer should install the pages into the man3am directory.

Alternately, 3p could move in front of 3, since it’s more specific.  (You could 
say that man3p subclasses man3.)

Re: Bash unable to print epoch timestamp

2015-10-22 Thread Corinna Vinschen
Hi Brian,

On Oct 22 07:03, Brian Inglis wrote:
> Brian Inglis  SystematicSw.ab.ca> writes:
> 
> > 
> > Don Harrop  effx.us> writes:
> > > Bash outputs no value when using it's built in method of printing an 
> > > "epoch" timestamp.
> > > BashCommandLine#: printf '%(%s)T' -1
> > 
> > bash printf depends on underlying strftime in newlib, which does not support
> > %s, as it is conditional on _WANT_C99_TIME_FORMATS being defined, and that
> > is presumably not defined in the config, as %s is not shown in man 
> > strftime. 
> > Workaround for now is use 
> > date +%s 
> > for current time, and 
> >date -d $(printf '%(%T)T' -2) +%s
> > for shell invocation time.
> 
> > %s, as it is conditional on _WANT_C99_TIME_FORMATS being defined, and that
> Wrong! Misread the code, strftime %s is not supported! 
> 
> STC and suggested patch appended (posting from gmane), compiles, but can't
> build STC as ld fails with undef refs, and I don't know all the correct
> LD..., -L and -l incantations. Email me for original files. 

Cool, thanks for the patch.  Unfortunately it doesn't apply cleanly.
There are several unexpected line wraps and there's this:

> --- a/newlib/time/strftime.c2015-08-20 03:39:24.0 -0600
> +++ b/newlib/time/strftime.c2015-10-21 20:15:22.367453000 -0600

How did this happen?  If you checkout the newlib-cygwin git repo,
strftime.c is under newlib/libc/time, not under newlib/time :o

Would you mind to attach a patch generated with git format-patch?


Thanks in advance,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgpDADcG5qWZg.pgp
Description: PGP signature


Re: Bash unable to print epoch timestamp

2015-10-22 Thread Brian Inglis
Brian Inglis  SystematicSw.ab.ca> writes:

> 
> Don Harrop  effx.us> writes:
> > Bash outputs no value when using it's built in method of printing an 
> > "epoch" timestamp.
> > BashCommandLine#: printf '%(%s)T' -1
> 
> bash printf depends on underlying strftime in newlib, which does not support
> %s, as it is conditional on _WANT_C99_TIME_FORMATS being defined, and that
> is presumably not defined in the config, as %s is not shown in man strftime. 
> Workaround for now is use 
> date +%s 
> for current time, and 
>date -d $(printf '%(%T)T' -2) +%s
> for shell invocation time.

> %s, as it is conditional on _WANT_C99_TIME_FORMATS being defined, and that
Wrong! Misread the code, strftime %s is not supported! 

STC and suggested patch appended (posting from gmane), compiles, but can't
build STC as ld fails with undef refs, and I don't know all the correct
LD..., -L and -l incantations. Email me for original files. 

/* newlib/time/strftime.c %s format STC */
#include 
#include 

int main( int argc, char **argv) {
char ss[BUFSIZ] = "";
time_t tt   = time( NULL );
struct tm *tp   = gmtime(  );
tt  = mktime( tp );
size_t st   = strftime( ss, sizeof ss, "%s", tp);
int rc  = puts( ss );
st  = strftime( ss, sizeof ss, "%T", tp);
rc  = puts( ss );
return rc;
}

--- 8< ---
2015-10-12  Brian Inglis  
* newlib/time/strftime.c (__strftime): add support for %s (seconds from Unix
epoch)

--- a/newlib/time/strftime.c2015-08-20 03:39:24.0 -0600
+++ b/newlib/time/strftime.c2015-10-21 20:15:22.367453000 -0600
@@ -166,6 +166,10 @@ notations, the result is an empty string
 o %R
 The 24-hour time, to the minute.  Equivalent to "%H:%M". [tm_min, tm_hour]

+o %s
+The time elapsed, in seconds, since the start of the Unix epoch at
+1970-01-01 00:00:00 UTC.
+
 o %S
 The second, formatted with two digits (from `<<00>>' to `<<60>>').  The
 value 60 accounts for the occasional leap second. [tm_sec]
@@ -1109,6 +1113,74 @@ recurse:
  tim_p->tm_hour, tim_p->tm_min);
   CHECK_LENGTH ();
   break;
+   case CQ('s'):
+/*
+ * From:
+ * The Open Group Base Specifications Issue 7
+ * IEEE Std 1003.1, 2013 Edition
+ * Copyright (c) 2001-2013 The IEEE and The Open Group
+ * XBD Base Definitions
+ * 4. General Concepts
+ * 4.15 Seconds Since the Epoch
+ * A value that approximates the number of seconds that have elapsed since the
+ * Epoch. A Coordinated Universal Time name (specified in terms of seconds
+ * (tm_sec), minutes (tm_min), hours (tm_hour), days since January 1 of the
year
+ * (tm_yday), and calendar year minus 1900 (tm_year)) is related to a time
+ * represented as seconds since the Epoch, according to the expression below.
+ * If the year is <1970 or the value is negative, the relationship is
undefined.
+ * If the year is >=1970 and the value is non-negative, the value is
related to a
+ * Coordinated Universal Time name according to the C-language expression,
where
+ * tm_sec, tm_min, tm_hour, tm_yday, and tm_year are all integer types:
+ * tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
+ * (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
+ * ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400
+ * OR
+ * tm_year-69)/4 - (tm_year-1)/100 + (tm_year+299)/400 +
+ * (tm_year-70)*365 + tm_yday)*24 + tm_hour)*60 + tm_min)*60 + tm_sec
+ */
+/* modified from %z case by hoisting offset outside if block and
initializing */
+ {
+   long offset;/* offset < 0 => W of GMT, > 0 => E of GMT:
+   offset = 0;subtract to get UTC */
+
+   if (tim_p->tm_isdst >= 0)
+ {
+   TZ_LOCK;
+   if (!tzset_called)
+ {
+   _tzset_unlocked ();
+   tzset_called = 1;
+ }
+
+#if defined (__CYGWIN__)
+   /* Cygwin must check if the application has been built with or
+  without the extra tm members for backward compatibility, and
+  then use either that or the old method fetching from tzinfo.
+  Rather than pulling in the version check infrastructure, we
+  just call a Cygwin function. */
+   extern long __cygwin_gettzoffset (const struct tm *tmp);
+   offset = __cygwin_gettzoffset (tim_p);
+#elif defined (__TM_GMTOFF)
+   offset = tim_p->__TM_GMTOFF;
+#else
+   __tzinfo_type *tz = __gettzinfo ();
+   /* The sign of this is exactly opposite the envvar TZ.  We
+  could directly use the global _timezone for tm_isdst==0,
+  but have to use __tzrule for daylight savings.  */
+   offset = -tz->__tzrule[tim_p->tm_isdst > 0].offset;
+#endif
+   TZ_UNLOCK;
+ }
+   len = snprintf 

Re: Error accessing mapped drive >2TB?

2015-10-22 Thread Corinna Vinschen
On Oct 21 11:26, Warren Young wrote:
> On Oct 21, 2015, at 10:22 AM, Corinna Vinschen wrote:
> > 
> > On Oct 21 09:52, Warren Young wrote:
> >> 
> >> I mean, I know how to snag a stream of SMB packets with Wireshark, but
> >> I don’t know what I’d be looking for in the dump.
> > 
> > Me neither, the Samba guys might be able to help there, perhaps.
> 
> Apple hasn’t shipped Samba as part of OS X since 10.6, quite a few
> years ago now.  In 10.7, they switched to an internally-developed SMB
> server.

Yes, but the SMB guys can recite the wire format of SMB asleep, probably.
There's also
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365233%28v=vs.85%29.aspx

> [...]
> >  HANDLE handle = CreateFile ("P:\\", ...);
> 
> I guess I’m not seeing what values to pass to CreateFile() because I
> get an error with the values I’m trying here.  I’ve put my fleshed-out
> test program here:
> 
>   http://pastebin.com/BfN2fNBQ
> 
> Its complaint is:
> 
>   Bad handle: The filename, directory name, or volume label syntax is
>   incorrect.  (0x7b)
> 
> I double-checked, and P: is still mapped.

Opening a directory requires to use the FILE_FLAG_BACKUP_SEMANTICS flag.
See the Remarks section of
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx

Oh and, you have to use the FILE_FLAG_OPEN_REPARSE_POINT flag, of
course.

This might be the difference to Explorer.  If the server accidentally
returns the FILE_ATTRIBUTE_REPARSE_POINT flag only if the dir has been
opened with FILE_FLAG_OPEN_REPARSE_POINT, Explorer would never see
this.  In contrast to Cygwin it's not interested in the fact whether
the dir is a reparse point or not.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgpI_Wz36gFMY.pgp
Description: PGP signature


Re: loading VT100 Font in stand alone program

2015-10-22 Thread Ken Brown

On 10/22/2015 12:20 PM, reinhard.ne...@fau.de wrote:

I do have the links in /etc/X11/fontpath.d
xorg-x11-fonts-75dpi:unscaled:pri=20 -> /usr/share/X11/fonts/75dpi
and they work fine within cygwin.

I tried to create corresponding links within windows by
mklink "xorg-x11-fonts-75dpi:unscaled:pri=20" ..\..\..\usr\share\X11\fonts\75dpi
but I the a message the the file name syntax is illeagal.
A quick search told me that a colon is a really forbidden file name component in
WINDOWS and the mask with " " did not help.


Right.  But Cygwin does allow colons in file names, in such a way that Windows 
doesn't see them as colons.  See


  
https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars


So why are there colon in the name of the symbolic link, which program reads 
these links


The X server reads them.  See the fontpath.d section of the Xserver man page:

  http://x.cygwin.com/docs/man1/Xserver.1.html#lbAN


and is there a way for me to change my system to use a different link name ?


I don't know.

Ken

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[newlib-cygwin] winsup/utils: add CPU cache variables to getconf(1)

2015-10-22 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=505812d04283d9276bb462683bbfaf52b241ac05

commit 505812d04283d9276bb462683bbfaf52b241ac05
Author: Yaakov Selkowitz 
Date:   Thu Oct 22 12:33:37 2015 -0500

winsup/utils: add CPU cache variables to getconf(1)

* getconf.c (conf_table): Add LEVEL*_CACHE_* variables.

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 winsup/utils/ChangeLog |  4 
 winsup/utils/getconf.c | 15 +++
 2 files changed, 19 insertions(+)

diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 66bfcb0..ac6eb98 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-22  Yaakov Selkowitz  
+
+   * getconf.c (conf_table): Add LEVEL*_CACHE_* variables.
+
 2015-08-30  Corinna Vinschen  
 
* cygcheck.cc (dump_sysinfo): Fix missing commas in products array.
diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c
index 7e0b5f5..8732be1 100644
--- a/winsup/utils/getconf.c
+++ b/winsup/utils/getconf.c
@@ -357,6 +357,21 @@ static const struct conf_variable conf_table[] =
   { "POSIX2_UPE",  SYSCONF,_SC_2_UPE   
},
   { "POSIX2_VERSION",  SYSCONF,_SC_2_VERSION   
},
   /* implementation-specific values */
+  { "LEVEL1_ICACHE_SIZE",  SYSCONF,_SC_LEVEL1_ICACHE_SIZE  
},
+  { "LEVEL1_ICACHE_ASSOC", SYSCONF,_SC_LEVEL1_ICACHE_ASSOC 
},
+  { "LEVEL1_ICACHE_LINESIZE",  SYSCONF,
_SC_LEVEL1_ICACHE_LINESIZE  },
+  { "LEVEL1_DCACHE_SIZE",  SYSCONF,_SC_LEVEL1_DCACHE_SIZE  
},
+  { "LEVEL1_DCACHE_ASSOC", SYSCONF,_SC_LEVEL1_DCACHE_ASSOC 
},
+  { "LEVEL1_DCACHE_LINESIZE",  SYSCONF,
_SC_LEVEL1_DCACHE_LINESIZE  },
+  { "LEVEL2_CACHE_SIZE",   SYSCONF,_SC_LEVEL2_CACHE_SIZE   
},
+  { "LEVEL2_CACHE_ASSOC",  SYSCONF,_SC_LEVEL2_CACHE_ASSOC  
},
+  { "LEVEL2_CACHE_LINESIZE",   SYSCONF,
_SC_LEVEL2_CACHE_LINESIZE   },
+  { "LEVEL3_CACHE_SIZE",   SYSCONF,_SC_LEVEL3_CACHE_SIZE   
},
+  { "LEVEL3_CACHE_ASSOC",  SYSCONF,_SC_LEVEL3_CACHE_ASSOC  
},
+  { "LEVEL3_CACHE_LINESIZE",   SYSCONF,
_SC_LEVEL3_CACHE_LINESIZE   },
+  { "LEVEL4_CACHE_SIZE",   SYSCONF,_SC_LEVEL4_CACHE_SIZE   
},
+  { "LEVEL4_CACHE_ASSOC",  SYSCONF,_SC_LEVEL4_CACHE_ASSOC  
},
+  { "LEVEL4_CACHE_LINESIZE",   SYSCONF,
_SC_LEVEL4_CACHE_LINESIZE   },
   { "_NPROCESSORS_CONF",   SYSCONF,_SC_NPROCESSORS_CONF
},
   { "_NPROCESSORS_ONLN",   SYSCONF,_SC_NPROCESSORS_ONLN
},
   { "_AVPHYS_PAGES",   SYSCONF,_SC_AVPHYS_PAGES
},


[PATCH] winsup/utils: add CPU cache variables to getconf(1)

2015-10-22 Thread Yaakov Selkowitz
* getconf.c (conf_table): Add LEVEL*_CACHE_* variables.
---
 winsup/utils/ChangeLog |  4 
 winsup/utils/getconf.c | 15 +++
 2 files changed, 19 insertions(+)

diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 66bfcb0..ac6eb98 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-22  Yaakov Selkowitz  
+
+   * getconf.c (conf_table): Add LEVEL*_CACHE_* variables.
+
 2015-08-30  Corinna Vinschen  
 
* cygcheck.cc (dump_sysinfo): Fix missing commas in products array.
diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c
index 7e0b5f5..8732be1 100644
--- a/winsup/utils/getconf.c
+++ b/winsup/utils/getconf.c
@@ -357,6 +357,21 @@ static const struct conf_variable conf_table[] =
   { "POSIX2_UPE",  SYSCONF,_SC_2_UPE   
},
   { "POSIX2_VERSION",  SYSCONF,_SC_2_VERSION   
},
   /* implementation-specific values */
+  { "LEVEL1_ICACHE_SIZE",  SYSCONF,_SC_LEVEL1_ICACHE_SIZE  
},
+  { "LEVEL1_ICACHE_ASSOC", SYSCONF,_SC_LEVEL1_ICACHE_ASSOC 
},
+  { "LEVEL1_ICACHE_LINESIZE",  SYSCONF,
_SC_LEVEL1_ICACHE_LINESIZE  },
+  { "LEVEL1_DCACHE_SIZE",  SYSCONF,_SC_LEVEL1_DCACHE_SIZE  
},
+  { "LEVEL1_DCACHE_ASSOC", SYSCONF,_SC_LEVEL1_DCACHE_ASSOC 
},
+  { "LEVEL1_DCACHE_LINESIZE",  SYSCONF,
_SC_LEVEL1_DCACHE_LINESIZE  },
+  { "LEVEL2_CACHE_SIZE",   SYSCONF,_SC_LEVEL2_CACHE_SIZE   
},
+  { "LEVEL2_CACHE_ASSOC",  SYSCONF,_SC_LEVEL2_CACHE_ASSOC  
},
+  { "LEVEL2_CACHE_LINESIZE",   SYSCONF,
_SC_LEVEL2_CACHE_LINESIZE   },
+  { "LEVEL3_CACHE_SIZE",   SYSCONF,_SC_LEVEL3_CACHE_SIZE   
},
+  { "LEVEL3_CACHE_ASSOC",  SYSCONF,_SC_LEVEL3_CACHE_ASSOC  
},
+  { "LEVEL3_CACHE_LINESIZE",   SYSCONF,
_SC_LEVEL3_CACHE_LINESIZE   },
+  { "LEVEL4_CACHE_SIZE",   SYSCONF,_SC_LEVEL4_CACHE_SIZE   
},
+  { "LEVEL4_CACHE_ASSOC",  SYSCONF,_SC_LEVEL4_CACHE_ASSOC  
},
+  { "LEVEL4_CACHE_LINESIZE",   SYSCONF,
_SC_LEVEL4_CACHE_LINESIZE   },
   { "_NPROCESSORS_CONF",   SYSCONF,_SC_NPROCESSORS_CONF
},
   { "_NPROCESSORS_ONLN",   SYSCONF,_SC_NPROCESSORS_ONLN
},
   { "_AVPHYS_PAGES",   SYSCONF,_SC_AVPHYS_PAGES
},
-- 
2.5.3



Re: Error accessing mapped drive >2TB?

2015-10-22 Thread Warren Young
On Oct 22, 2015, at 2:34 AM, Corinna Vinschen wrote:
> 
> On Oct 21 11:26, Warren Young wrote:
>> On Oct 21, 2015, at 10:22 AM, Corinna Vinschen wrote:
>>> 
>>> On Oct 21 09:52, Warren Young wrote:
 
 I mean, I know how to snag a stream of SMB packets with Wireshark, but
 I don’t know what I’d be looking for in the dump.
>>> 
>>> Me neither, the Samba guys might be able to help there, perhaps.
>> 
>> Apple hasn’t shipped Samba as part of OS X since 10.6, quite a few
>> years ago now.  In 10.7, they switched to an internally-developed SMB
>> server.
> 
> Yes, but the SMB guys can recite the wire format of SMB asleep, probably.

Why would the Samba project’s wizards be motivated to help debug a 
closed-source piece of software they didn’t write?

If anything, I’d expect them to give Apple the finger for booting Samba out of 
OS X in the first place.

> There's also
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa365233%28v=vs.85%29.aspx

Now we’re talking about *my* motivation, which has only been to test the 
original report and the fix.  I never had this problem — I don’t export whole 
drives as a matter of principle — and the symptom is now fixed, leaving me 
without a motivation to learn the SMB protocol.

The only people left with both means and motivation would be at Apple, and then 
only if they had important software that broke because of their implementation 
choices.  You just fixed the only other known piece of software that breaks.

(Please don’t back out the fix just to put pressure on Apple! :) )

>> [...]
>>> HANDLE handle = CreateFile ("P:\\", ...);
>> 
>> I guess I’m not seeing what values to pass to CreateFile()
> 
> Opening a directory requires to use the FILE_FLAG_BACKUP_SEMANTICS flag.

Yes, silly me for not guessing that Windows requires that I tell it I am about 
to do a backup before I attempt to open a directory for reading.  What was so 
wrong about the design of opendir() that MS had to reinvent it this way?

I also had to fix an error in your original code: GetFileAttributes() takes a 
path string, not a HANDLE.

After doing both of these things, I now get a new complaint:

Failed to get reparse point: The file or directory is not a reparse point.
 (0x1126)

I’m reporting this in case it affects the way you want your patch for this 
problem to react.

Here’s the new program: http://pastebin.com/kUwPrk8v

> Oh and, you have to use the FILE_FLAG_OPEN_REPARSE_POINT flag, of
> course.

Adding that doesn’t affect the error I get from the program, so I left it out 
in the Pastebin version.
--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Updated: mkvtoolnix-8.5.1-1

2015-10-22 Thread David Stacey

The following packages have been updated in the Cygwin distribution:

* mkvtoolnix-8.5.1-1
* mkvtoolnix-gui-8.5.1-1

MKVToolNix is a set of tools to create, alter and inspect Matroska
files (*.mkv, *.mka).

This is an update to the latest upstream release.

Dave.



[ANNOUNCEMENT] Updated: mkvtoolnix-8.5.1-1

2015-10-22 Thread David Stacey

The following packages have been updated in the Cygwin distribution:

* mkvtoolnix-8.5.1-1
* mkvtoolnix-gui-8.5.1-1

MKVToolNix is a set of tools to create, alter and inspect Matroska
files (*.mkv, *.mka).

This is an update to the latest upstream release.

Dave.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: gawk: Bad File Descriptor error with concurrent readonly access to a network file

2015-10-22 Thread Vermessung AVT - Wolfgang Rieger
Marco suggested I should wait for Corinna being back for that issue. Did you 
ever look into that, Corinna? For your info, my first mail in that thread 
contains a description and test case.

Thanks,
Wolfgang

-Original Message-
From: Vermessung AVT - Wolfgang Rieger 
Sent: Sa, 26. September 2015 12:01
To: 'cygwin@cygwin.com'
Subject: Re: gawk: Bad File Descriptor error with concurrent readonly access to 
a network file

On Fri, 25 Sep 2015 18:58:57 +0200, Marco Atzeri wrote:
>> "Bad file descriptor" just arose recently in another problem 
>> https://cygwin.com/ml/cygwin/2015-09/msg00374.html
>> https://cygwin.com/ml/cygwin/2015-09/msg00436.html
>>
I don't think this applies to our case. We use massive parallel processing, and 
the problem is related to that as the test case shows in our environment. In 
single thread operation we don't have any problems at all. I don't use fork or 
other of the tools mentioned. We don't have Chrome or Comodo or so installed. 
We have an encapsulated environment with not even an anti-virus sw running in 
the power workstations and as little stuff as possible because computing speed 
is our main issue.

>> Have you by chance some potential suspect like usual ones
>>   https://cygwin.com/faq/faq.html#faq.using.bloda
I did not find there anything that seems related to our problem.

>> On your cygcheck output I notice nothing strange.
I do not think there is anything strange. I have been using Cygwin for 15+ 
years now. We started parallelizing our jobs some 12 years ago. Of course, 
hardware was not comparable then to what we have today. But the Bad File 
Descriptor issues only started some 3 or 4 years ago with an update of Cygwin 
(I really don't remember when; there must have been some major change in the 
Cygwin-dll: E. g., since then the type-ahead buffer of cmd.exe is no longer 
useable when Cygwin programs run in the shell). Since these errors were fairly 
rare (say, 1 in >1000 tiles), we did not dig into it deeper. However, it is an 
ongoing issue.

With raising workload at the file server and new workstations with more cores 
(allowing for more parallel processes) it became more frequent during last 
years. A server upgrade last winter reduced the problem, but with recently 
massively increasing work load it raise again.

>> Can you provide the type of network disk with 
>> /usr/lib/csih/getVolInfo 
I am sorry, I have a very small installation of Cygwin running with no 
getVolInfo. In which package can I find that? We have MS Windows Server 2008 
that provides network shares.


Again I want to stress: Running the jobs in single thread we never experienced 
any such problems at all. Only with several jobs running in parallel (the same 
batch job is started in several cmd-shell windows independently) we have these 
errors. The reason is obviously when by chance two processes try to access the 
same file at the same time which happens not often, but it happens. I assume 
access to local files is better synchronized by the CPU, whereas at the server 
there may arise these conflicts.

The major question is, what is the underlying access problem within Cygwin? As 
mentioned, the MS programs (e. g. copy) never show a similar problem.
 
Thanks for your help,
Wolfgang


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Bad Address with /cygdrive paths

2015-10-22 Thread Barry Roberts
On Thu, Oct 22, 2015 at 7:48 AM, Corinna Vinschen
 wrote:
> I could reproduce this and applied a patch which allows to proceed.
>
> However.
>
> The problem was that the SID S-1-0 has a subauthority count of 0, which
> is really weird.  S-1-0-0 would be the NULL SID, but while S-1-0 is a
> valid SID (the so-called NULL SID authority), it's no valid account and
> as such can't be converted to a valid account.
>
> And the user SID isn't much better.  S-1-81 is no well known SID
> authority at all.  It's handled by Cygwin without much problems,
> but of course that SID can't be converted to an account either.
>
> Do you have any explanation where these broken SIDs are coming from?
>

First a disclaimer: I am not a Windows expert.  I only use it when
forced to (and then under strenuous protest).

These servers were handed to me by the operations team, and cfengine
was probably used to configure them and install cygwin.  I'll forward
this to them and see if they can identify an issue with their process.

Thanks,
Barry

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[newlib-cygwin] Avoid SEGV when handling SIDs with 0 subauthorities

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e01381afde33020522fe692e0a1a791c99b6f049

commit e01381afde33020522fe692e0a1a791c99b6f049
Author: Corinna Vinschen 
Date:   Thu Oct 22 15:38:42 2015 +0200

Avoid SEGV when handling SIDs with 0 subauthorities

* sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing
subauthorities.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog | 5 +
 winsup/cygwin/release/2.3.0 | 3 +++
 winsup/cygwin/sec_helper.cc | 5 -
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7cd19b5..f09c3d7 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
 2015-10-22  Corinna Vinschen  
 
+   * sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing
+   subauthorities.
+
+2015-10-22  Corinna Vinschen  
+
* strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes
without trailing NUL as the documentation implies.  Throughout Cygwin,
fix usage to align to this pattern.
diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index f505040..1fc92d2 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -43,3 +43,6 @@ Bug Fixes
 - Fix memory leak in calls to pthread_getattr_np.
 
 - Fix output of /proc//winexename.
+
+- Avoid SEGV when handling SIDs with 0 subauthorities.
+  Addresses: https://cygwin.com/ml/cygwin/2015-10/msg00141.html
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index 0c3a51c..8067385 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -218,7 +218,10 @@ cygsid::get_sid (DWORD s, DWORD cnt, DWORD *r, bool 
well_known)
   SID_IDENTIFIER_AUTHORITY sid_auth = { SECURITY_NULL_SID_AUTHORITY };
 # define SECURITY_NT_AUTH 5
 
-  if (s > 255 || cnt < 1 || cnt > SID_MAX_SUB_AUTHORITIES)
+  /* 2015-10-22: Note that we let slip SIDs with a subauthority count of 0.
+ There are systems, which generate the SID S-1-0 as group ownership SID,
+ see https://cygwin.com/ml/cygwin/2015-10/msg00141.html. */
+  if (s > 255 || cnt > SID_MAX_SUB_AUTHORITIES)
 {
   psid = NO_SID;
   return NULL;


[newlib-cygwin] Add release message for previous Cygwin patch

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6599fad55dfa08882ff07f11132e772af5f152b3

commit 6599fad55dfa08882ff07f11132e772af5f152b3
Author: Corinna Vinschen 
Date:   Thu Oct 22 15:35:46 2015 +0200

Add release message for previous Cygwin patch

Diff:
---
 winsup/cygwin/release/2.3.0 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index d6fda3b..f505040 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -41,3 +41,5 @@ Bug Fixes
   Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00229.html
 
 - Fix memory leak in calls to pthread_getattr_np.
+
+- Fix output of /proc//winexename.


Re: Bad Address with /cygdrive paths

2015-10-22 Thread Corinna Vinschen
On Oct 21 18:06, Corinna Vinschen wrote:
> On Oct 21 08:24, Barry Roberts wrote:
> > Attached is the strace output.
> 
> Thanks.
> 
> The culprit are apparently some weird User and Group SIDs.
> 
> 34   22501 [main] ls 3428 build_fh_pc: fh 0x180329B20, dev 00C3
>26   22527 [main] ls 3428 stat_worker: (\??\M:\install, 0x600039B40, 
> 0x180329B20), file_attributes 16
>   539   23066 [main] ls 3428 cygpsid::debug_print: get_sids_info: owner SID = 
> S-1-81-0-0
>39   23105 [main] ls 3428 cygpsid::debug_print: get_sids_info: group SID = 
> S-1-0
>   227   23332 [main] ls 3428 pwdgrp::fetch_account_from_windows: 
> LookupAccountSid(S-1-81-0-0), Win32 error 1332
>36   23368 [main] ls 3428 pwdgrp::fetch_account_from_windows: line: 
> 
>   198   23566 [main] ls 3428 pwdgrp::fetch_account_from_windows: 
> LookupAccountSid(S-1-0), Win32 error 1332
>34   23600 [main] ls 3428 pwdgrp::fetch_account_from_windows: line: 
> 
> --- Process 3428, exception c005 at 7FFA1856A774
> 
> Granted, it's not nice of Cygwin to SEGV here, but I do wonder where
> the SIDs S-1-81-0-0 and S-1-0 are coming from.  They are both invalid
> as far as I can see.
> 
> Hmm.  The problem is to reproduce this to find out where this happens.
> The exception address is inside a Windows DLL :-P

I could reproduce this and applied a patch which allows to proceed.

However.

The problem was that the SID S-1-0 has a subauthority count of 0, which
is really weird.  S-1-0-0 would be the NULL SID, but while S-1-0 is a
valid SID (the so-called NULL SID authority), it's no valid account and
as such can't be converted to a valid account.

And the user SID isn't much better.  S-1-81 is no well known SID
authority at all.  It's handled by Cygwin without much problems,
but of course that SID can't be converted to an account either.

Do you have any explanation where these broken SIDs are coming from?


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgpcRiy_4ck32.pgp
Description: PGP signature


[newlib-cygwin] Export aligned_alloc, at_quick_exit, quick_exit.

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6b457615e6bee7d88da6e5b88428d2fc58cdf1be

commit 6b457615e6bee7d88da6e5b88428d2fc58cdf1be
Author: Corinna Vinschen 
Date:   Thu Oct 22 16:21:17 2015 +0200

Export aligned_alloc, at_quick_exit, quick_exit.

* common.din (aligned_alloc): Export.
(at_quick_exit): Export.
(quick_exit): Export.

* posix.xml (std-iso): New section.
(std-deprec): Rearrange title text.
* new-features.xml (ov-new2.3): Document aligned_alloc, at_quick_exit,

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog|  6 ++
 winsup/cygwin/common.din   |  3 +++
 winsup/cygwin/include/cygwin/version.h |  3 ++-
 winsup/cygwin/release/2.3.0|  2 ++
 winsup/doc/ChangeLog   |  7 +++
 winsup/doc/new-features.xml|  4 
 winsup/doc/posix.xml   | 12 +++-
 7 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f09c3d7..15e4902 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
 2015-10-22  Corinna Vinschen  
 
+   * common.din (aligned_alloc): Export.
+   (at_quick_exit): Export.
+   (quick_exit): Export.
+
+2015-10-22  Corinna Vinschen  
+
* sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing
subauthorities.
 
diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 71a0c9b..5d22e97 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -130,6 +130,7 @@ acosf NOSIGFE
 acosh NOSIGFE
 acoshf NOSIGFE
 alarm SIGFE
+aligned_alloc SIGFE
 alphasort NOSIGFE
 arc4random NOSIGFE
 arc4random_addrandom NOSIGFE
@@ -168,6 +169,7 @@ atoff SIGFE
 atoi NOSIGFE
 atol NOSIGFE
 atoll NOSIGFE
+at_quick_exit SIGFE
 basename NOSIGFE
 bcmp NOSIGFE
 bcopy NOSIGFE
@@ -957,6 +959,7 @@ putwc_unlocked SIGFE
 putwchar SIGFE
 putwchar_unlocked SIGFE
 pwrite SIGFE
+quick_exit SIGFE
 qsort NOSIGFE
 qsort_r NOSIGFE
 quotactl SIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h 
b/winsup/cygwin/include/cygwin/version.h
index 3b14ff4..fde82e9 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -472,13 +472,14 @@ details. */
   288: Export getcontext, makecontext, setcontext, swapcontext.
   289: Export sigsetjmp, siglongjmp.
   290: Add sysconf cache handling.
+  291: Export aligned_alloc, at_quick_exit, quick_exit.
  */
 
  /* Note that we forgot to bump the api for ualarm, strtoll, strtoull,
sigaltstack, sethostname. */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 290
+#define CYGWIN_VERSION_API_MINOR 291
 
  /* There is also a compatibity version number associated with the
shared memory regions.  It is incremented when incompatible
diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index 1fc92d2..14ca3d4 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -14,6 +14,8 @@ What's new:
   _SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC, _SC_LEVEL3_CACHE_LINESIZE,
   _SC_LEVEL4_CACHE_SIZE, _SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE
 
+- New API: aligned_alloc, at_quick_exit, quick_exit.
+
 
 What changed:
 -
diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog
index 7e85a76..cd6563b 100644
--- a/winsup/doc/ChangeLog
+++ b/winsup/doc/ChangeLog
@@ -1,3 +1,10 @@
+2015-10-22  Corinna Vinschen  
+
+   * posix.xml (std-iso): New section.
+   (std-deprec): Rearrange title text.
+   * new-features.xml (ov-new2.3): Document aligned_alloc, at_quick_exit,
+   quick_exit.
+
 2015-10-06  Ken Brown  
 
* faq-using.xml (faq.using.same-with-permissions): New entry.
diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml
index fc53b01..4e0f3e2 100644
--- a/winsup/doc/new-features.xml
+++ b/winsup/doc/new-features.xml
@@ -27,6 +27,10 @@ sysconf() now supports returning CPU cache information:
   
 
 
+
+New API: aligned_alloc, at_quick_exit, quick_exit.
+
+
 
 
 
diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml
index 112ddc8..dc6c148 100644
--- a/winsup/doc/posix.xml
+++ b/winsup/doc/posix.xml
@@ -1306,9 +1306,19 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).
 xdrstdio_create(available in external "libtirpc" library)
 
 
+System interfaces not in POSIX but compatible with 
ISO C requirements:
+
+
+aligned_alloc  (ISO C11)
+at_quick_exit  (ISO C11)
+quick_exit (ISO C11)
+
+
+
+
 
 
-Other UNIX system interfaces, deprecated or not 
in POSIX.1-2008:
+Other UNIX system interfaces, not in 
POSIX.1-2008 or deprecated:
 
 
 bcmp   (POSIX.1-2001, SUSv3)


Install Bug on Windows XP

2015-10-22 Thread Thomas Dineen

Gentle People:

   When I install the newest Cygwin 32 on Windows XP the
install process hangs on cmake-debuginfo-3.3.2-1.
The system seems to hang in an infinite loop with
setup.exe drawing 99% of the CPU.

   Please note that the download and SHA checksum
check seem to complete successfully.

   Please note that I am running Windows XP SP3 with
with the current updates installed.

Is there a way to work around this bug and complete
the install manually?

Thank You.
Thomas Dineen




--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] Updated: ncurses-6.0-1.20151017

2015-10-22 Thread Yaakov Selkowitz
The following packages have been updated in the Cygwin distribution:

* ncurses-6.0-1.20151017
* ncurses-demo-6.0-1.20151017
* libncursesw10-6.0-1.20151017
* libncurses-devel-6.0-1.20151017
* terminfo-6.0-1.20151017
* terminfo-extra-6.0-1.20151017

Ncurses (new curses) started as a freely distributable clone of SVr4
curses. It has outgrown the clone description, and now contains many
features which are not in SVr4 curses. Curses is a pun on the term
"cursor optimization". It is a library of functions that manage an
application's display on character-cell terminals.

This is an update to the latest major release with new features:

http://invisible-island.net/ncurses/announce-6.0.html

As we have already been using "ABI 6" for some time, this update remains
ABI compatible with our 5.9 packages.

--
Yaakov

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] Updated: rxvt-unicode-9.21-1

2015-10-22 Thread Yaakov Selkowitz
The following package has been updated in the Cygwin distribution:

* rxvt-unicode-9.21-1

rxvt-unicode is a colour vt102 terminal emulator intended as an xterm(1)
replacement for users who do not require features such as Tektronix 4014
emulation and toolkit-style configurability. As a result, rxvt-unicode
uses much less swap space -- a significant advantage on a machine
serving many X sessions.

This is an update to the latest upstream release.

--
Yaakov

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



New: libofx-0.9.9-1

2015-10-22 Thread Yaakov Selkowitz
The following packages have been added to the Cygwin distribution:

* libofx6-0.9.9-1
* libofx-common-0.9.9-1
* libofx-devel-0.9.9-1
* libofx-tools-0.9.9-1

LibOFX is an API designed to allow applications to very easily support
OFX command responses, usually provided by financial institutions.

--
Yaakov




[ANNOUNCEMENT] New: libofx-0.9.9-1

2015-10-22 Thread Yaakov Selkowitz
The following packages have been added to the Cygwin distribution:

* libofx6-0.9.9-1
* libofx-common-0.9.9-1
* libofx-devel-0.9.9-1
* libofx-tools-0.9.9-1

LibOFX is an API designed to allow applications to very easily support
OFX command responses, usually provided by financial institutions.

--
Yaakov

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Install Bug on Windows XP

2015-10-22 Thread Yaakov Selkowitz
On Thu, 2015-10-22 at 18:52 -0700, Thomas Dineen wrote:
> When I install the newest Cygwin 32 on Windows XP the
> install process hangs on cmake-debuginfo-3.3.2-1.
> The system seems to hang in an infinite loop with
> setup.exe drawing 99% of the CPU.
> 
> Please note that the download and SHA checksum
> check seem to complete successfully.
> 
> Please note that I am running Windows XP SP3 with
> with the current updates installed.
> 
>  Is there a way to work around this bug and complete
> the install manually?

I was unable to reproduce this.  Is there sufficient disk space on the
drive on which you are installing Cygwin?

--
Yaakov



--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Updated: ncurses-6.0-1.20151017

2015-10-22 Thread Yaakov Selkowitz
The following packages have been updated in the Cygwin distribution:

* ncurses-6.0-1.20151017
* ncurses-demo-6.0-1.20151017
* libncursesw10-6.0-1.20151017
* libncurses-devel-6.0-1.20151017
* terminfo-6.0-1.20151017
* terminfo-extra-6.0-1.20151017

Ncurses (new curses) started as a freely distributable clone of SVr4
curses. It has outgrown the clone description, and now contains many
features which are not in SVr4 curses. Curses is a pun on the term
"cursor optimization". It is a library of functions that manage an
application's display on character-cell terminals.

This is an update to the latest major release with new features:

http://invisible-island.net/ncurses/announce-6.0.html

As we have already been using "ABI 6" for some time, this update remains
ABI compatible with our 5.9 packages.

--
Yaakov




BUG: /bin/pwd -P doesn't expand all symlinks

2015-10-22 Thread Mark O'Keefe
Hi,

While using /bin/pwd -P to expand directories to get the absolute, 
non-symlinked version of the directory I discovered that this doesn't work on 
Cygwin as I believe it is meant to work.


$ cd /tmp
$ /bin/pwd -P
/tmp
$ ln -s /home .
$ cd home
$ /bin/pwd -P
/home
$ pwd
/tmp/home
$ mkdir dummy
$ cd dummy
$ pwd
/tmp/home/dummy
$ /bin/pwd -P
/tmp/home/dummy

NOTE:  That last command should have returned "/home/dummy".  It hasn't 
expanded the parent symbolic link as you would have expected it to do.

For what I'm doing I need the physical path, not the symbolic path (which is 
what the -P is meant to provide).

Please confirm if I'm correct in my understanding?  I've tested this on Ubuntu 
and it works as I'd expect it...

Now having to create an alternative approach to get the correct answer while I 
wait for this to be fixed (assuming it is a bug as I believe it is).

Thanks in advance for any help in resolving this.

Cheers,
Mark.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



New: geany-1.25-1

2015-10-22 Thread Yaakov Selkowitz
The following packages have been added to the Cygwin distribution:

* geany-1.25-1
* geany-devel-1.25-1
* geany-plugins-*-1.25-1

Geany is a text editor using the GTK+ toolkit with basic features of an
integrated development environment. It was developed to provide a small
and fast IDE, which has only a few dependencies from other packages. It
supports many filetypes and has some nice features.

--
Yaakov




[ANNOUNCEMENT] New: geany-1.25-1

2015-10-22 Thread Yaakov Selkowitz
The following packages have been added to the Cygwin distribution:

* geany-1.25-1
* geany-devel-1.25-1
* geany-plugins-*-1.25-1

Geany is a text editor using the GTK+ toolkit with basic features of an
integrated development environment. It was developed to provide a small
and fast IDE, which has only a few dependencies from other packages. It
supports many filetypes and has some nice features.

--
Yaakov

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANNOUNCEMENT] New: aqbanking-5.5.1-1, gwenhywfar-4.13.1-1

2015-10-22 Thread Yaakov Selkowitz
The following packages have been added to the Cygwin distribution:

* aqbanking-5.5.1-1
* libaqbanking34-5.5.1-1
* libaqbanking-common-5.5.1-1
* libaqbanking-devel-5.5.1-1
* libaqbankingpp0-5.5.1-1
* libaqebics0-5.5.1-1
* libaqhbci22-5.5.1-1
* libaqofxconnect7-5.5.1-1
* gwenhywfar-4.13.1-1
* libgwenhywfar60-4.13.1-1
* libgwenhywfar-devel-4.13.1-1
* libgwengui-gtk2_0-4.13.1-1
* libgwengui-gtk2-devel-4.13.1-1
* libgwengui-qt4_0-4.13.1-1
* libgwengui-qt4-devel-4.13.1-1

AqBanking is a free library for online banking.  It provides an
interface to general online banking tasks (balance retrieval, transfers,
direct debits, etc.), bank information for Germany, USA, Austria and
Switzerland, and currency information.

--
Yaakov

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



New: aqbanking-5.5.1-1, gwenhywfar-4.13.1-1

2015-10-22 Thread Yaakov Selkowitz
The following packages have been added to the Cygwin distribution:

* aqbanking-5.5.1-1
* libaqbanking34-5.5.1-1
* libaqbanking-common-5.5.1-1
* libaqbanking-devel-5.5.1-1
* libaqbankingpp0-5.5.1-1
* libaqebics0-5.5.1-1
* libaqhbci22-5.5.1-1
* libaqofxconnect7-5.5.1-1
* gwenhywfar-4.13.1-1
* libgwenhywfar60-4.13.1-1
* libgwenhywfar-devel-4.13.1-1
* libgwengui-gtk2_0-4.13.1-1
* libgwengui-gtk2-devel-4.13.1-1
* libgwengui-qt4_0-4.13.1-1
* libgwengui-qt4-devel-4.13.1-1

AqBanking is a free library for online banking.  It provides an
interface to general online banking tasks (balance retrieval, transfers,
direct debits, etc.), bank information for Germany, USA, Austria and
Switzerland, and currency information.

--
Yaakov




[newlib-cygwin] Fix length returned from sys_cp_wcstombs in case nwc > # of wchars

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ef75017378c2b6ae62cb8bdb196a4d188302f930

commit ef75017378c2b6ae62cb8bdb196a4d188302f930
Author: Corinna Vinschen 
Date:   Thu Oct 22 14:22:07 2015 +0200

Fix length returned from sys_cp_wcstombs in case nwc > # of wchars

* strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes
without trailing NUL as the documentation implies.  Throughout Cygwin,
fix usage to align to this pattern.
* fhandler_process.cc (format_process_winexename): Drop trailing NUL
and LF from output.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog| 8 
 winsup/cygwin/dcrt0.cc | 2 +-
 winsup/cygwin/environ.cc   | 2 +-
 winsup/cygwin/fhandler_process.cc  | 6 +++---
 winsup/cygwin/fhandler_registry.cc | 7 ---
 winsup/cygwin/net.cc   | 2 +-
 winsup/cygwin/path.cc  | 6 +++---
 winsup/cygwin/strfuncs.cc  | 2 +-
 winsup/cygwin/uinfo.cc | 2 +-
 9 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4cbbd0b..7cd19b5 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2015-10-22  Corinna Vinschen  
+
+   * strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes
+   without trailing NUL as the documentation implies.  Throughout Cygwin,
+   fix usage to align to this pattern.
+   * fhandler_process.cc (format_process_winexename): Drop trailing NUL
+   and LF from output.
+
 2015-10-21  Corinna Vinschen  
 
* thread.cc (pthread_getattr_np): Fix memory leak, remove usage of
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 8ac7f4c..3d293f6 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -952,7 +952,7 @@ dll_crt0_1 (void *)
   if (!__argc)
 {
   PWCHAR wline = GetCommandLineW ();
-  size_t size = sys_wcstombs (NULL, 0, wline);
+  size_t size = sys_wcstombs (NULL, 0, wline) + 1;
   char *line = (char *) alloca (size);
   sys_wcstombs (line, size, wline);
 
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 8f25fb1..ab6511b 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -895,7 +895,7 @@ getwinenveq (const char *name, size_t namelen, int x)
   int totlen = GetEnvironmentVariableW (name0, valbuf, 32768);
   if (totlen > 0)
 {
-  totlen = sys_wcstombs (NULL, 0, valbuf);
+  totlen = sys_wcstombs (NULL, 0, valbuf) + 1;
   if (x == HEAP_1_STR)
totlen += namelen;
   else
diff --git a/winsup/cygwin/fhandler_process.cc 
b/winsup/cygwin/fhandler_process.cc
index d3ee874..516fbe3 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -568,9 +568,9 @@ format_process_winexename (void *data, char *)
   _pinfo *p = (_pinfo *) data;
   size_t len = sys_wcstombs (NULL, 0, p->progname);
   destbuf = (char *) crealloc_abort (destbuf, len + 1);
-  sys_wcstombs (destbuf, len, p->progname);
-  destbuf[len] = '\n';
-  return len + 1;
+  /* With trailing \0 for backward compat reasons. */
+  sys_wcstombs (destbuf, len + 1, p->progname);
+  return len;
 }
 
 struct heap_info
diff --git a/winsup/cygwin/fhandler_registry.cc 
b/winsup/cygwin/fhandler_registry.cc
index fbdb440..6663637 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -286,7 +286,7 @@ multi_wcstombs (char *dst, size_t len, const wchar_t *src, 
size_t nwc)
 
   while (nwc)
 {
-  siz = sys_wcstombs (dst, len, src, nwc);
+  siz = sys_wcstombs (dst, len, src, nwc) + 1;
   sum += siz;
   if (dst)
{
@@ -555,7 +555,8 @@ fhandler_registry::fstat (struct stat *buf)
  else
buf->st_size = sys_wcstombs (NULL, 0,
 (wchar_t *) tmpbuf,
-dwSize / sizeof (wchar_t));
+dwSize / sizeof (wchar_t))
+  + 1;
  if (tmpbuf)
free (tmpbuf);
}
@@ -972,7 +973,7 @@ fhandler_registry::fill_filebuf ()
}
   if (type == REG_SZ || type == REG_EXPAND_SZ || type == REG_LINK)
bufalloc = sys_wcstombs (NULL, 0, (wchar_t *) tmpbuf,
-size / sizeof (wchar_t));
+size / sizeof (wchar_t)) + 1;
   else if (type == REG_MULTI_SZ)
bufalloc = multi_wcstombs (NULL, 0, (wchar_t *) tmpbuf,
   size / sizeof (wchar_t));
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 20b4d3c..0f3946a 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ 

Re: setup.exe a mystery

2015-10-22 Thread Ken Brown

On 10/22/2015 6:28 AM, Tom Axehult wrote:

I lost bash weeks ago and hence cygwin which I used to start from Cywin.bat as
administrator, by the well known
bash --login -i
For reasons beyond me, I can run Xemacs and reach bash functionality from
(Tools/shell command) and thus produce cygcheck.
Using setup for updating Cygwin a warning is issued:
Package: _/_update-info-dir
 update-info-dir.sh exit code -6
Package: _/Unknown package
 cygutils.sh exit code -6
 dejavu-fonts.sh exit code -6
 hicolor-icon-theme.sh exit code -6
 libtirpc.sh exit code -6
 texlive-collection-basic.sh exit code -6
 texlive-collection-latex.sh exit code -6
 texlive-collection-mathextra.sh exit code -6
 WindowMaker.sh exit code -6
 xfig.sh exit code -6
 xinit.sh exit code -6
 xorg-server.sh exit code -6
 xorg-x11-fonts-Type1.sh exit code -6
 xpdf.sh exit code -6


Without bash, the postinstall scripts can't run.


In the attached cygcheck the setup failure turns up as 'incomplete' 
installations.


I suggest that you start by running setup and reinstalling all the packages that 
show as incomplete.  Be sure to use the latest setup; a new version was just 
made available a few days ago.


Ken

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[newlib-cygwin/cygwin-acl] Cygwin 2.3.0: Add missing release message

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=bbabe37840f73a0c15a40f4abaddafc67b514d7c

commit bbabe37840f73a0c15a40f4abaddafc67b514d7c
Author: Corinna Vinschen 
Date:   Tue Sep 8 22:53:54 2015 +0200

Cygwin 2.3.0: Add missing release message

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/release/2.3.0 | 4 
 1 file changed, 4 insertions(+)

diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index dc807c9..7b0cb61 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -35,3 +35,7 @@ Bug Fixes
 
 - sysconf _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN now handle more than
   64 CPUs on Windows 7 and later.
+
+- Fix a potential crash in advisory file locking due to usage of stack space
+  out of scope.
+  Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00079.html


[newlib-cygwin/cygwin-acl] Fix memory leak in pthread_getattr_np

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c173cb0805b81b20a4b2c5efe271e2f3f9ac61fb

commit c173cb0805b81b20a4b2c5efe271e2f3f9ac61fb
Author: Corinna Vinschen 
Date:   Wed Oct 21 12:46:32 2015 +0200

Fix memory leak in pthread_getattr_np

* thread.cc (pthread_getattr_np): Fix memory leak, remove usage of
malloc for small local buffer.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog | 5 +
 winsup/cygwin/release/2.3.0 | 2 ++
 winsup/cygwin/thread.cc | 8 +++-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b883cb4..41a02ef 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
 2015-10-21  Corinna Vinschen  
 
+   * thread.cc (pthread_getattr_np): Fix memory leak, remove usage of
+   malloc for small local buffer.
+
+2015-10-21  Corinna Vinschen  
+
* path.cc (symlink_info::check_reparse_point): Don't generate an EIO
error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT.
 
diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index ad34671..ad5cfd0 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -42,3 +42,5 @@ Bug Fixes
 
 - Fix EIO error accessing certain (OS X SMB?) drives
   Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00229.html
+
+- Fix memory leak in calls to pthread_getattr_np.
diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc
index b92a806..d9b6211 100644
--- a/winsup/cygwin/thread.cc
+++ b/winsup/cygwin/thread.cc
@@ -2485,8 +2485,7 @@ pthread::resume (pthread_t *thread)
 extern "C" int
 pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
 {
-  const size_t sizeof_tbi = sizeof (THREAD_BASIC_INFORMATION);
-  PTHREAD_BASIC_INFORMATION tbi;
+  THREAD_BASIC_INFORMATION tbi;
   NTSTATUS status;
 
   if (!pthread::is_good_object ())
@@ -2506,13 +2505,12 @@ pthread_getattr_np (pthread_t thread, pthread_attr_t 
*attr)
   (*attr)->schedparam = thread->attr.schedparam;
   (*attr)->guardsize = thread->attr.guardsize;
 
-  tbi = (PTHREAD_BASIC_INFORMATION) malloc (sizeof_tbi);
   status = NtQueryInformationThread (thread->win32_obj_id,
 ThreadBasicInformation,
-tbi, sizeof_tbi, NULL);
+, sizeof (tbi), NULL);
   if (NT_SUCCESS (status))
 {
-  PTEB teb = (PTEB) tbi->TebBaseAddress;
+  PTEB teb = (PTEB) tbi.TebBaseAddress;
   /* stackaddr holds the uppermost stack address.  See the comments
 in pthread_attr_setstack and pthread_attr_setstackaddr for a
 description. */


[newlib-cygwin/cygwin-acl] Fix length returned from sys_cp_wcstombs in case nwc > # of wchars

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=56a9888b02c8781713b66ff720157dc38739bd82

commit 56a9888b02c8781713b66ff720157dc38739bd82
Author: Corinna Vinschen 
Date:   Thu Oct 22 14:22:07 2015 +0200

Fix length returned from sys_cp_wcstombs in case nwc > # of wchars

* strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes
without trailing NUL as the documentation implies.  Throughout Cygwin,
fix usage to align to this pattern.
* fhandler_process.cc (format_process_winexename): Drop trailing NUL
and LF from output.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog| 8 
 winsup/cygwin/dcrt0.cc | 2 +-
 winsup/cygwin/environ.cc   | 2 +-
 winsup/cygwin/fhandler_process.cc  | 6 +++---
 winsup/cygwin/fhandler_registry.cc | 7 ---
 winsup/cygwin/net.cc   | 2 +-
 winsup/cygwin/path.cc  | 6 +++---
 winsup/cygwin/strfuncs.cc  | 2 +-
 winsup/cygwin/uinfo.cc | 2 +-
 9 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 41a02ef..d3a47a4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2015-10-22  Corinna Vinschen  
+
+   * strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes
+   without trailing NUL as the documentation implies.  Throughout Cygwin,
+   fix usage to align to this pattern.
+   * fhandler_process.cc (format_process_winexename): Drop trailing NUL
+   and LF from output.
+
 2015-10-21  Corinna Vinschen  
 
* thread.cc (pthread_getattr_np): Fix memory leak, remove usage of
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 8ac7f4c..3d293f6 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -952,7 +952,7 @@ dll_crt0_1 (void *)
   if (!__argc)
 {
   PWCHAR wline = GetCommandLineW ();
-  size_t size = sys_wcstombs (NULL, 0, wline);
+  size_t size = sys_wcstombs (NULL, 0, wline) + 1;
   char *line = (char *) alloca (size);
   sys_wcstombs (line, size, wline);
 
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 8f25fb1..ab6511b 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -895,7 +895,7 @@ getwinenveq (const char *name, size_t namelen, int x)
   int totlen = GetEnvironmentVariableW (name0, valbuf, 32768);
   if (totlen > 0)
 {
-  totlen = sys_wcstombs (NULL, 0, valbuf);
+  totlen = sys_wcstombs (NULL, 0, valbuf) + 1;
   if (x == HEAP_1_STR)
totlen += namelen;
   else
diff --git a/winsup/cygwin/fhandler_process.cc 
b/winsup/cygwin/fhandler_process.cc
index d3ee874..516fbe3 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -568,9 +568,9 @@ format_process_winexename (void *data, char *)
   _pinfo *p = (_pinfo *) data;
   size_t len = sys_wcstombs (NULL, 0, p->progname);
   destbuf = (char *) crealloc_abort (destbuf, len + 1);
-  sys_wcstombs (destbuf, len, p->progname);
-  destbuf[len] = '\n';
-  return len + 1;
+  /* With trailing \0 for backward compat reasons. */
+  sys_wcstombs (destbuf, len + 1, p->progname);
+  return len;
 }
 
 struct heap_info
diff --git a/winsup/cygwin/fhandler_registry.cc 
b/winsup/cygwin/fhandler_registry.cc
index fbdb440..6663637 100644
--- a/winsup/cygwin/fhandler_registry.cc
+++ b/winsup/cygwin/fhandler_registry.cc
@@ -286,7 +286,7 @@ multi_wcstombs (char *dst, size_t len, const wchar_t *src, 
size_t nwc)
 
   while (nwc)
 {
-  siz = sys_wcstombs (dst, len, src, nwc);
+  siz = sys_wcstombs (dst, len, src, nwc) + 1;
   sum += siz;
   if (dst)
{
@@ -555,7 +555,8 @@ fhandler_registry::fstat (struct stat *buf)
  else
buf->st_size = sys_wcstombs (NULL, 0,
 (wchar_t *) tmpbuf,
-dwSize / sizeof (wchar_t));
+dwSize / sizeof (wchar_t))
+  + 1;
  if (tmpbuf)
free (tmpbuf);
}
@@ -972,7 +973,7 @@ fhandler_registry::fill_filebuf ()
}
   if (type == REG_SZ || type == REG_EXPAND_SZ || type == REG_LINK)
bufalloc = sys_wcstombs (NULL, 0, (wchar_t *) tmpbuf,
-size / sizeof (wchar_t));
+size / sizeof (wchar_t)) + 1;
   else if (type == REG_MULTI_SZ)
bufalloc = multi_wcstombs (NULL, 0, (wchar_t *) tmpbuf,
   size / sizeof (wchar_t));
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 20b4d3c..0f3946a 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ 

Re: [PATCH] Introduce the 'usertemp' filesystem type

2015-10-22 Thread Johannes Schindelin
Hi Corinna,

On Wed, 21 Oct 2015, Corinna Vinschen wrote:

> On Oct 20 13:47, Johannes Schindelin wrote:
> > On Tue, 20 Oct 2015, Corinna Vinschen wrote:
> > > On Sep 16 09:35, Johannes Schindelin wrote:
> > >
> > > > By specifying
> > > > 
> > > > none /tmp usertemp binary,posix=0 0 0
> > > > 
> > > > in /etc/fstab, the /tmp/ directory gets auto-mounted to the
> > > > directory specified by the %TEMP% variable.
> > > 
> > > In theory you could also utilize /etc/fstab.d/$USER, without the
> > > need to implement a usertemp mount type.
> > 
> > This is unfortunately not possible. The use case that triggered this
> > patch is Git for Windows (which does not use Cygwin directly, but the
> > MSys2 runtime which is derived from Cygwin).
> 
> Editorial note: 
> 
> It's a bit hard to understand why we need Git for Windows while there's
> a full fledged git available as part of the Cygwin distro.  It's also
> very frustrating that a Git for Windows standalone tool gets a lot of
> press coverage while nobody seems to care that Git for Windows under
> Cygwin exists for ages.  Sigh.

I actually used Cygwin Git myself. However, I had to work with a large
project and the POSIX emulation just put a serious dent into my
productivity.

Don't get me wrong: I love what Cygwin does. It is just that for using Git
efficiently, we needed to go directly to the Win32 API. So Git for Windows
is substantially faster, and takes less resources, than Cygwin Git.

Take for example the good old stat() call. If you need to run `git
status`, you require the modified time of every tracked file, so you call
stat() on it, right? There is an equivalent call in the Win32 API, but it
does not quite get as much information as the stat() call. So to emulate
the stat() call on Windows, we need to call additional Win32 API functions
to fill in those data. The really stupidly annoying thing about this is
that quite often, Git does not even care about those data and just throws
them away!

Another thing is that Git often calls external processes. The POSIX call
is `fork()`. But `fork()` does so much more than spawn a process: it
emulates the copy-on-write feature and also copies the file descriptors
and all that, but Git does not care and ignores all that and all the
effort was spent for naught.

That is why Git for Windows is so much faster than Cygwin Git.

It will get even faster in the future, when we convert more scripts into
builtins, because the shell we use is of course the venerable Bash, using
Cygwin's excellent fork() emulation.

So please understand that I am very, very thankful that Cygwin exists and
is maintained and developed further. At the same time, I think it is
important to develop Git for Windows further, to improve the user
experience.

> > Indeed. In Git for Windows' case, this is actually a feature. That way,
> > different users' files are encapsulated from each other.
> > [...]
> > As I said, in a multi-user setting, or even worse: in a portable
> > application, this is simply not possible other than via the strategy
> > implemented by this patch.
> 
> Here's a question.  If it's really only about git, why do you need
> to redirect /tmp, rather than having git use $TMP directly?

Ah, if it only was that easy! Then I would not bother you at all and do
exactly what you suggested.

The truth, however, is that Git expects quite a few utilities to be
available, utilities that are usually present in any Unix-like system. But
not on Windows. So we need to rely on tools that are shipped with MSys2 to
perform those tasks. One such tool is ssh-agent which *does* want to write
into `/tmp/` (see https://github.com/git-for-windows/git/issues/86).

At the same time, we really have to install our pseudo root file system
into `C:\Program Files` because this is the way things work on Windows. So
we *have* to mount `/tmp/`, and what better way than the Windows way: use
the dedicated per-user temporary directory? That is the way things work on
Windows.

> That would be much less intrusive than having to change the underlying
> POSIX layer, isn't it?

It would be less intrusive, I agree. But it would also not solve the
problem, so it is not a solution ;-)

> > [...]
> > > > +  char mb_tmp[len = sys_wcstombs (NULL, 0, tmp)];
> > > 
> > > - len = sys_wcstombs() + 1
> > 
> > Whoops. I always get that wrong.
> > 
> > But... actually... Did you know that `sys_wcstombs()` returns something
> > different than advertised? The documentation says:
> > 
> > - dst == NULL; len is ignored, the return value is the number
> >   of bytes required for the string without the trailing NUL, just
> >   like the return value of the wcstombs function.
> > 
> > But when I call
> > 
> > small_printf("len of 1: %d\n", sys_wcstombs(NULL, 0, L"1"));
> > 
> > it prints "len of 1: 2", i.e. the number of bytes requires for the string
> > *with* the trailing NUL, disagreeing with the comment in strfuncs.cc.
> 
> Drat.  You're right.  As usual I 

[newlib-cygwin/cygwin-acl] Export aligned_alloc, at_quick_exit, quick_exit.

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=b3e27da5a5fda36aade790a50f94a430b2971a05

commit b3e27da5a5fda36aade790a50f94a430b2971a05
Author: Corinna Vinschen 
Date:   Thu Oct 22 16:21:17 2015 +0200

Export aligned_alloc, at_quick_exit, quick_exit.

* common.din (aligned_alloc): Export.
(at_quick_exit): Export.
(quick_exit): Export.

* posix.xml (std-iso): New section.
(std-deprec): Rearrange title text.
* new-features.xml (ov-new2.3): Document aligned_alloc, at_quick_exit,

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog|  6 ++
 winsup/cygwin/common.din   |  3 +++
 winsup/cygwin/include/cygwin/version.h |  3 ++-
 winsup/cygwin/release/2.3.0|  2 ++
 winsup/doc/ChangeLog   |  7 +++
 winsup/doc/new-features.xml|  4 
 winsup/doc/posix.xml   | 12 +++-
 7 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0c7c5a9..a95938d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
 2015-10-22  Corinna Vinschen  
 
+   * common.din (aligned_alloc): Export.
+   (at_quick_exit): Export.
+   (quick_exit): Export.
+
+2015-10-22  Corinna Vinschen  
+
* sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing
subauthorities.
 
diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index 71a0c9b..5d22e97 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -130,6 +130,7 @@ acosf NOSIGFE
 acosh NOSIGFE
 acoshf NOSIGFE
 alarm SIGFE
+aligned_alloc SIGFE
 alphasort NOSIGFE
 arc4random NOSIGFE
 arc4random_addrandom NOSIGFE
@@ -168,6 +169,7 @@ atoff SIGFE
 atoi NOSIGFE
 atol NOSIGFE
 atoll NOSIGFE
+at_quick_exit SIGFE
 basename NOSIGFE
 bcmp NOSIGFE
 bcopy NOSIGFE
@@ -957,6 +959,7 @@ putwc_unlocked SIGFE
 putwchar SIGFE
 putwchar_unlocked SIGFE
 pwrite SIGFE
+quick_exit SIGFE
 qsort NOSIGFE
 qsort_r NOSIGFE
 quotactl SIGFE
diff --git a/winsup/cygwin/include/cygwin/version.h 
b/winsup/cygwin/include/cygwin/version.h
index 3b14ff4..fde82e9 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -472,13 +472,14 @@ details. */
   288: Export getcontext, makecontext, setcontext, swapcontext.
   289: Export sigsetjmp, siglongjmp.
   290: Add sysconf cache handling.
+  291: Export aligned_alloc, at_quick_exit, quick_exit.
  */
 
  /* Note that we forgot to bump the api for ualarm, strtoll, strtoull,
sigaltstack, sethostname. */
 
 #define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 290
+#define CYGWIN_VERSION_API_MINOR 291
 
  /* There is also a compatibity version number associated with the
shared memory regions.  It is incremented when incompatible
diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index e3abb20..48adb5f 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -14,6 +14,8 @@ What's new:
   _SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC, _SC_LEVEL3_CACHE_LINESIZE,
   _SC_LEVEL4_CACHE_SIZE, _SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE
 
+- New API: aligned_alloc, at_quick_exit, quick_exit.
+
 
 What changed:
 -
diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog
index 7e85a76..cd6563b 100644
--- a/winsup/doc/ChangeLog
+++ b/winsup/doc/ChangeLog
@@ -1,3 +1,10 @@
+2015-10-22  Corinna Vinschen  
+
+   * posix.xml (std-iso): New section.
+   (std-deprec): Rearrange title text.
+   * new-features.xml (ov-new2.3): Document aligned_alloc, at_quick_exit,
+   quick_exit.
+
 2015-10-06  Ken Brown  
 
* faq-using.xml (faq.using.same-with-permissions): New entry.
diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml
index d55d1fb..c95f339 100644
--- a/winsup/doc/new-features.xml
+++ b/winsup/doc/new-features.xml
@@ -32,6 +32,10 @@ setfacl(1) now allows to use the -b and -k option combined 
to allow reducing
 an ACL to only reflect standard POSIX permissions.
 
 
+
+New API: aligned_alloc, at_quick_exit, quick_exit.
+
+
 
 
 
diff --git a/winsup/doc/posix.xml b/winsup/doc/posix.xml
index 112ddc8..dc6c148 100644
--- a/winsup/doc/posix.xml
+++ b/winsup/doc/posix.xml
@@ -1306,9 +1306,19 @@ also IEEE Std 1003.1-2008 (POSIX.1-2008).
 xdrstdio_create(available in external "libtirpc" library)
 
 
+System interfaces not in POSIX but compatible with 
ISO C requirements:
+
+
+aligned_alloc  (ISO C11)
+at_quick_exit  (ISO C11)
+quick_exit (ISO C11)
+
+
+
+
 
 
-Other UNIX system interfaces, deprecated or not 
in POSIX.1-2008:
+Other UNIX system interfaces, not in 
POSIX.1-2008 or 

[newlib-cygwin/cygwin-acl] Avoid SEGV when handling SIDs with 0 subauthorities

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=57f2c5983f785c63c7a29af0cfcc29f6b46e1315

commit 57f2c5983f785c63c7a29af0cfcc29f6b46e1315
Author: Corinna Vinschen 
Date:   Thu Oct 22 15:38:42 2015 +0200

Avoid SEGV when handling SIDs with 0 subauthorities

* sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing
subauthorities.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog | 5 +
 winsup/cygwin/release/2.3.0 | 3 +++
 winsup/cygwin/sec_helper.cc | 5 -
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d3a47a4..0c7c5a9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
 2015-10-22  Corinna Vinschen  
 
+   * sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing
+   subauthorities.
+
+2015-10-22  Corinna Vinschen  
+
* strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes
without trailing NUL as the documentation implies.  Throughout Cygwin,
fix usage to align to this pattern.
diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index 99ef120..e3abb20 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -46,3 +46,6 @@ Bug Fixes
 - Fix memory leak in calls to pthread_getattr_np.
 
 - Fix output of /proc//winexename.
+
+- Avoid SEGV when handling SIDs with 0 subauthorities.
+  Addresses: https://cygwin.com/ml/cygwin/2015-10/msg00141.html
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index 551face..af3307e 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -220,7 +220,10 @@ cygsid::get_sid (DWORD s, DWORD cnt, DWORD *r, bool 
well_known)
   SID_IDENTIFIER_AUTHORITY sid_auth = { SECURITY_NULL_SID_AUTHORITY };
 # define SECURITY_NT_AUTH 5
 
-  if (s > 255 || cnt < 1 || cnt > SID_MAX_SUB_AUTHORITIES)
+  /* 2015-10-22: Note that we let slip SIDs with a subauthority count of 0.
+ There are systems, which generate the SID S-1-0 as group ownership SID,
+ see https://cygwin.com/ml/cygwin/2015-10/msg00141.html. */
+  if (s > 255 || cnt > SID_MAX_SUB_AUTHORITIES)
 {
   psid = NO_SID;
   return NULL;


[newlib-cygwin/cygwin-acl] Add release message for previous Cygwin patch

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4eb7f4d94cf0f364c93ec7ac12fb4522d1f819b4

commit 4eb7f4d94cf0f364c93ec7ac12fb4522d1f819b4
Author: Corinna Vinschen 
Date:   Thu Oct 22 15:35:46 2015 +0200

Add release message for previous Cygwin patch

Diff:
---
 winsup/cygwin/release/2.3.0 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index ad5cfd0..99ef120 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -44,3 +44,5 @@ Bug Fixes
   Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00229.html
 
 - Fix memory leak in calls to pthread_getattr_np.
+
+- Fix output of /proc//winexename.


[newlib-cygwin/cygwin-acl] * winsup/doc/faq-using.xml (faq.using.same-with-permissions): New entry.

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f15f539e7006ca8f84c07b19c354da136075a94c

commit f15f539e7006ca8f84c07b19c354da136075a94c
Author: Ken Brown 
Date:   Tue Oct 6 16:31:05 2015 -0400

* winsup/doc/faq-using.xml (faq.using.same-with-permissions): New entry.

Diff:
---
 winsup/doc/ChangeLog |  4 
 winsup/doc/faq-using.xml | 42 ++
 2 files changed, 46 insertions(+)

diff --git a/winsup/doc/ChangeLog b/winsup/doc/ChangeLog
index 35935be..7e85a76 100644
--- a/winsup/doc/ChangeLog
+++ b/winsup/doc/ChangeLog
@@ -1,3 +1,7 @@
+2015-10-06  Ken Brown  
+
+   * faq-using.xml (faq.using.same-with-permissions): New entry.
+
 2015-09-07  Brian Inglis  
 
* faq-using.xml (faq.using.man): Replace makewhatis with mandb.
diff --git a/winsup/doc/faq-using.xml b/winsup/doc/faq-using.xml
index 7656880..4cfc822 100644
--- a/winsup/doc/faq-using.xml
+++ b/winsup/doc/faq-using.xml
@@ -1183,6 +1183,48 @@ Users group instead.
 
 
 
+
+Why do my files have extra permissions after updating to 
Cygwin 1.7.34?
+
+
+The problem is exactly the same as with the key files of SSH.  See
+.
+
+The solution is the same:
+
+
+  $ ls -l *
+  -rw-rwxr--+ 1 user group 42 Nov 12  2010 file1
+  -rw-rwxr--+ 1 user group 42 Nov 12  2010 file2
+  $ setfacl -b *
+  $ ls -l *
+  -rw-r--r--  1 user group 42 Nov 12  2010 file1
+  -rw-r--r--  1 user group 42 Nov 12  2010 file2
+
+
+You may find that newly-created files also have unexpected
+permissions:
+
+
+  $ touch foo
+  $ ls -l foo
+  -rw-rwxr--+ 1 user group 42 Nov 12  2010 foo
+
+
+This probably means that the directory in which you're creating
+the files has unwanted default ACL entries that are inherited by
+newly-created files and subdirectories.  The solution is again the
+same:
+
+
+  $ setfacl -b .
+  $ touch bar
+  $ ls -l bar
+  -rw-r--r--  1 user group 42 Nov 12  2010 bar
+
+
+
+
 
 Why do my Tk programs not work anymore?
 


[newlib-cygwin/cygwin-acl] Fix EIO error accessing certain (OS X SMB?) drives

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=77df52e5fc07ceece2dfe590a25f8f80a0bf9fe2

commit 77df52e5fc07ceece2dfe590a25f8f80a0bf9fe2
Author: Corinna Vinschen 
Date:   Wed Oct 21 12:01:11 2015 +0200

Fix EIO error accessing certain (OS X SMB?) drives

* path.cc (symlink_info::check_reparse_point): Don't generate an EIO
error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog | 5 +
 winsup/cygwin/path.cc   | 8 +++-
 winsup/cygwin/release/2.3.0 | 3 +++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d5170d7..b883cb4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2015-10-21  Corinna Vinschen  
+
+   * path.cc (symlink_info::check_reparse_point): Don't generate an EIO
+   error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT.
+
 2015-09-23  Evgeny Grin  
 
* fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index a7feb31..c65c1ca 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2288,7 +2288,13 @@ symlink_info::check_reparse_point (HANDLE h, bool remote)
 {
   debug_printf ("NtFsControlFile(FSCTL_GET_REPARSE_POINT) failed, %y",
status);
-  set_error (EIO);
+  /* When accessing the root dir of some remote drives (observed with
+OS X shares), the FILE_ATTRIBUTE_REPARSE_POINT flag is set, but
+the followup call to NtFsControlFile(FSCTL_GET_REPARSE_POINT)
+returns with STATUS_NOT_A_REPARSE_POINT.  That's quite buggy, but
+we cope here with this scenario by not setting an error code. */
+  if (status != STATUS_NOT_A_REPARSE_POINT)
+   set_error (EIO);
   return 0;
 }
   if (rp->ReparseTag == IO_REPARSE_TAG_SYMLINK)
diff --git a/winsup/cygwin/release/2.3.0 b/winsup/cygwin/release/2.3.0
index 7b0cb61..ad34671 100644
--- a/winsup/cygwin/release/2.3.0
+++ b/winsup/cygwin/release/2.3.0
@@ -39,3 +39,6 @@ Bug Fixes
 - Fix a potential crash in advisory file locking due to usage of stack space
   out of scope.
   Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00079.html
+
+- Fix EIO error accessing certain (OS X SMB?) drives
+  Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00229.html


[newlib-cygwin/cygwin-acl] Fix compiler errors/warnings when compiling with -O3

2015-10-22 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f0b05fadb5bca889457862a74b4fc990ffd93d4f

commit f0b05fadb5bca889457862a74b4fc990ffd93d4f
Author: Corinna Vinschen 
Date:   Tue Oct 20 12:33:13 2015 +0200

Fix compiler errors/warnings when compiling with -O3

* fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler
warning in -O3 case.
(fhandler_socket::connect): Ditto.
* regex/regcomp.c (singleton): Ditto.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/ChangeLog  | 7 +++
 winsup/cygwin/fhandler_socket.cc | 4 ++--
 winsup/cygwin/regex/regcomp.c| 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d9ab975..d5170d7 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2015-09-23  Evgeny Grin  
+
+   * fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler
+   warning in -O3 case.
+   (fhandler_socket::connect): Ditto.
+   * regex/regcomp.c (singleton): Ditto.
+
 2015-08-29  Corinna Vinschen  
 
* fhandler_proc.cc (format_proc_cpuinfo): Fetch cache information
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 9ec8e46..bc3c610 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -746,7 +746,7 @@ fhandler_socket::wait_for_events (const long event_mask, 
const DWORD flags)
 return 0;
 
   int ret;
-  long events;
+  long events = 0;
 
   while (!(ret = evaluate_events (event_mask, events, !(flags & MSG_PEEK)))
 && !events)
@@ -1159,7 +1159,7 @@ int
 fhandler_socket::connect (const struct sockaddr *name, int namelen)
 {
   struct sockaddr_storage sst;
-  int type;
+  int type = 0;
 
   if (get_inet_addr (name, namelen, , , , connect_secret)
   == SOCKET_ERROR)
diff --git a/winsup/cygwin/regex/regcomp.c b/winsup/cygwin/regex/regcomp.c
index d68dcc3..554b43a 100644
--- a/winsup/cygwin/regex/regcomp.c
+++ b/winsup/cygwin/regex/regcomp.c
@@ -1246,7 +1246,7 @@ freeset(struct parse *p, cset *cs)
 static wint_t
 singleton(cset *cs)
 {
-   wint_t i, s, n;
+   wint_t i, s = OUT, n;
 
for (i = n = 0; i < NC; i++)
if (CHIN(cs, i)) {


TEST RELEASE: Cygwin 2.3.0-0.4

2015-10-22 Thread Corinna Vinschen
Hi Cygwin friends and users,


I released a new TEST version of Cygwin, 2.3.0-0.4.

This test release contains all Cygwin-related patches applied during
and after my vacation.  Other than that, the original intention,
testing the "new POSIX ACL handling reloaded" code, still applies.

This is the "new POSIX ACL handling reloaded" release.

In local testing I successfully integrated AuthZ into the current Cygwin
code to generate more correct user permissions by being able to generate
effective permissions for arbitrary users.

This success convinced me that it might be possible to pick up the POSIX
permission rewrite originally targeted for the 2.0.0 release and try to
update it using AuthZ and generally revamp it to reflect effective
permissions better.

My local testing looks good, but this is a major change, so this code
really needs a lot more testing in various scenarios.  Especially
some Windows ACLs created in corporate environments are often a hard
nut to crack, and the example from

https://cygwin.com/ml/cygwin/2015-04/msg00513.html

which was the ultimate downfall of the original implementation is
the stuff which needs some good testing.

There's, as usual, a downside: AuthZ leans a bit to the slow side.
Cygwin caches information already gathered once on a per-process basis,
but in locally crafted worst case scenarios (`ls' on lots of file owned
by lots of different users and groups) the slowdown may be up to 25%.
But that's really just a worst case, in the usual scenarios the slowdown
should be mostly unnoticable.

To alleviate the problem, the AuthZ code is fortunately only called for
non-Cygwin ACLs and Cygwin ACLs created before this release.  Within a
pure Cygwin environment (e.g., some build directory only used with
Cygwin tools) AuthZ should be practically unused.

Apart from the aforementioned code changes to "just do it right", there
are two additional changes I implemented for this new POSIX ACL revamp
release:

- I reverted the questionable change I added to 2.0.0-0.7 in terms of
  chmod group permission handling.  The original description of this
  change was:

If you have a non-trivial ACL with secondary accounts and thus a
mask value, chmod is supposed to change only the mask, not the
permissions of the primary group.  However, if the primary group has
few permissions to begin with, the result is really surprising.  ls
-l would, e.g., show read/write perms for the group, but the group
might still have only read perms.

Personally I find this chmod behaviour really, really bad, so I took
the liberty to change it in a way which gives a much less surprising
result:  If you call chmod on a non-trivial ACL, the group
permissions will be used for the primary group and the mask.

- setfacl(1) now accepts the combination of the -b and -k options, just as
  on Linux (here's looking at you Achim ;)).

As for the description what this implementation strives for, please see
http://linux.die.net/man/5/acl

All changes in this release so far:



What's new:
---

- posix_madvise(POSIX_MADV_WILLNEED) now utilizes OS functionality available
  starting with Windows 8/Server 2012.  Still a no-op on older systems.

- posix_madvise(POSIX_MADV_DONTNEED) now utilizes OS functionality available
  starting with Windows 8.1/Server 2012R2.  Still a no-op on older systems.

- sysconf() now supports returning CPU cache information:
  _SC_LEVEL1_ICACHE_SIZE, _SC_LEVEL1_ICACHE_ASSOC, _SC_LEVEL1_ICACHE_LINESIZE,
  _SC_LEVEL1_DCACHE_SIZE, _SC_LEVEL1_DCACHE_ASSOC, _SC_LEVEL1_DCACHE_LINESIZE,
  _SC_LEVEL2_CACHE_SIZE, _SC_LEVEL2_CACHE_ASSOC, _SC_LEVEL2_CACHE_LINESIZE,
  _SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC, _SC_LEVEL3_CACHE_LINESIZE,
  _SC_LEVEL4_CACHE_SIZE, _SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE

- New API: aligned_alloc, at_quick_exit, quick_exit.


What changed:
-

- setfacl(1) now allows to use the -b and -k option combined to allow reducing
  an ACL to only reflect standard POSIX permissions.


Bug Fixes
-

- Fix a hang when stracing a forking or spawning process without activating
  stracing of child processes.
  Addresses: https://cygwin.com/ml/cygwin/2015-08/msg00390.html

- Fix long-standing potential SEGV on 32 bit Cygwin when the dynamic loader
  for OS functions fails to load a function on Windows 7 or later.
  Addresses: No actual bug report known.

- sysconf _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN now handle more than
  64 CPUs on Windows 7 and later.

- Fix a potential crash in advisory file locking due to usage of stack space
  out of scope.
  Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00079.html

- Fix EIO error accessing certain (OS X SMB?) drives
  Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00229.html

- Fix memory leak in calls to pthread_getattr_np.

- Fix output of /proc//winexename.

- Avoid SEGV when handling 

[ANNOUNCEMENT] TEST RELEASE: Cygwin 2.3.0-0.4

2015-10-22 Thread Corinna Vinschen
Hi Cygwin friends and users,


I released a new TEST version of Cygwin, 2.3.0-0.4.

This test release contains all Cygwin-related patches applied during
and after my vacation.  Other than that, the original intention,
testing the "new POSIX ACL handling reloaded" code, still applies.

This is the "new POSIX ACL handling reloaded" release.

In local testing I successfully integrated AuthZ into the current Cygwin
code to generate more correct user permissions by being able to generate
effective permissions for arbitrary users.

This success convinced me that it might be possible to pick up the POSIX
permission rewrite originally targeted for the 2.0.0 release and try to
update it using AuthZ and generally revamp it to reflect effective
permissions better.

My local testing looks good, but this is a major change, so this code
really needs a lot more testing in various scenarios.  Especially
some Windows ACLs created in corporate environments are often a hard
nut to crack, and the example from

https://cygwin.com/ml/cygwin/2015-04/msg00513.html

which was the ultimate downfall of the original implementation is
the stuff which needs some good testing.

There's, as usual, a downside: AuthZ leans a bit to the slow side.
Cygwin caches information already gathered once on a per-process basis,
but in locally crafted worst case scenarios (`ls' on lots of file owned
by lots of different users and groups) the slowdown may be up to 25%.
But that's really just a worst case, in the usual scenarios the slowdown
should be mostly unnoticable.

To alleviate the problem, the AuthZ code is fortunately only called for
non-Cygwin ACLs and Cygwin ACLs created before this release.  Within a
pure Cygwin environment (e.g., some build directory only used with
Cygwin tools) AuthZ should be practically unused.

Apart from the aforementioned code changes to "just do it right", there
are two additional changes I implemented for this new POSIX ACL revamp
release:

- I reverted the questionable change I added to 2.0.0-0.7 in terms of
  chmod group permission handling.  The original description of this
  change was:

If you have a non-trivial ACL with secondary accounts and thus a
mask value, chmod is supposed to change only the mask, not the
permissions of the primary group.  However, if the primary group has
few permissions to begin with, the result is really surprising.  ls
-l would, e.g., show read/write perms for the group, but the group
might still have only read perms.

Personally I find this chmod behaviour really, really bad, so I took
the liberty to change it in a way which gives a much less surprising
result:  If you call chmod on a non-trivial ACL, the group
permissions will be used for the primary group and the mask.

- setfacl(1) now accepts the combination of the -b and -k options, just as
  on Linux (here's looking at you Achim ;)).

As for the description what this implementation strives for, please see
http://linux.die.net/man/5/acl

All changes in this release so far:



What's new:
---

- posix_madvise(POSIX_MADV_WILLNEED) now utilizes OS functionality available
  starting with Windows 8/Server 2012.  Still a no-op on older systems.

- posix_madvise(POSIX_MADV_DONTNEED) now utilizes OS functionality available
  starting with Windows 8.1/Server 2012R2.  Still a no-op on older systems.

- sysconf() now supports returning CPU cache information:
  _SC_LEVEL1_ICACHE_SIZE, _SC_LEVEL1_ICACHE_ASSOC, _SC_LEVEL1_ICACHE_LINESIZE,
  _SC_LEVEL1_DCACHE_SIZE, _SC_LEVEL1_DCACHE_ASSOC, _SC_LEVEL1_DCACHE_LINESIZE,
  _SC_LEVEL2_CACHE_SIZE, _SC_LEVEL2_CACHE_ASSOC, _SC_LEVEL2_CACHE_LINESIZE,
  _SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC, _SC_LEVEL3_CACHE_LINESIZE,
  _SC_LEVEL4_CACHE_SIZE, _SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE

- New API: aligned_alloc, at_quick_exit, quick_exit.


What changed:
-

- setfacl(1) now allows to use the -b and -k option combined to allow reducing
  an ACL to only reflect standard POSIX permissions.


Bug Fixes
-

- Fix a hang when stracing a forking or spawning process without activating
  stracing of child processes.
  Addresses: https://cygwin.com/ml/cygwin/2015-08/msg00390.html

- Fix long-standing potential SEGV on 32 bit Cygwin when the dynamic loader
  for OS functions fails to load a function on Windows 7 or later.
  Addresses: No actual bug report known.

- sysconf _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN now handle more than
  64 CPUs on Windows 7 and later.

- Fix a potential crash in advisory file locking due to usage of stack space
  out of scope.
  Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00079.html

- Fix EIO error accessing certain (OS X SMB?) drives
  Addresses: https://cygwin.com/ml/cygwin/2015-09/msg00229.html

- Fix memory leak in calls to pthread_getattr_np.

- Fix output of /proc//winexename.

- Avoid SEGV when handling 

Re: loading VT100 Font in stand alone program

2015-10-22 Thread reinhard . neder
Dear Ken,

thank you very much for your help and the bug fix.
I do have the links in /etc/X11/fontpath.d
xorg-x11-fonts-75dpi:unscaled:pri=20 -> /usr/share/X11/fonts/75dpi
and they work fine within cygwin.

I tried to create corresponding links within windows by
mklink "xorg-x11-fonts-75dpi:unscaled:pri=20" ..\..\..\usr\share\X11\fonts\75dpi
but I the a message the the file name syntax is illeagal.
A quick search told me that a colon is a really forbidden file name component in
WINDOWS and the mask with " " did not help.
Interstingly a single colon works fine !?!

So why are there colon in the name of the symbolic link, which program reads 
these links
and is there a way for me to change my system to use a different link name ?
Best
Reinhard

From: Ken Brown 
To: cygwin at cygwin dot com
Date: Tue, 13 Oct 2015 11:31:51 -0400
Subject: Re: loading VT100 Font in stand alone program
Authentication-results: sourceware.org; auth=none
References: 

On 10/13/2015 10:16 AM, reinhard.ne...@fau.de wrote:

Hi Everybody,

I have written a program "kuplot" that runs inside an X-window terminal 
through a
script:

#!/bin/sh
if( /bin/ps | /bin/grep XWin ); then
export DISPLAY=':0';
/bin/xterm -rightbar -sb -pob -title "kuplot secondary window"  -e 
/bin/kuplot;
else
/bin/rm -f /tmp/.X*-lock
/bin/xinit "/bin/xterm" -rightbar -sb -pob -title "kuplot primary 
window exit last"
-e /bin/kuplot -- "/usr/bin/XWin" :0 -multiwindow -logfile /dev/null;
fi

If I start this script from within CYGWIN (both 64 and 32 bit) the VT menu 
appears at
the top of my Xterm, and I can change the font size.

If I start the program from the desktop  icon, I do get the VT100 menu, but 
an error
message of:

/bin/xterm: cannot load font
'misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1'

and a similar message if I try to change the font size.

The program was installed into a separate folder at C:\Program files (x86)
and within this I have folders
bin! quite a few of the /bin/*dll and /bin/*exe
etc/X11! exact recursive copy of /etc/X11 in cygwin including fonts/* 
(only gzipped
filesthough?)

usr/share/terminfo ! exact recursive copy
/usr/share/X11 ! exact recursive copy

I seem to be missing the proper link to the VT100 fonts , where would I 
have to look
for
that?


You should have a directory /etc/X11/fontpath.d with some symlinks in it. Due 
to a bug
in setup, however, this directory may not have been created. The bug was just 
fixed
yesterday, so you should use the latest setup (2.872) and reinstall any 
xorg-x11-fonts-*
packages that you have installed.


Ken


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple

References: https://www.cygwin.com/ml/cygwin/2015-10/msg00148.html
loading VT100 Font in stand alone program
From: reinhard . neder




-- 
Prof. Dr. Reinhard Neder
Kristallographie und Strukturphysik
Universitaet Erlangen
Staudtststr. 3; 91058 Erlangen
tel. +49-9131-8525191
fax  +49-9131-8525182


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple