Re: setup 2.887 release candidate - please test

2018-02-07 Thread Marco Atzeri


On 06/02/2018 16:04, Jon Turney wrote:


A new setup release candidate is available at:

   https://cygwin.com/setup/setup-2.887.x86_64.exe (64 bit version)
   https://cygwin.com/setup/setup-2.887.x86.exe    (32 bit version)

Please test and report any problems here.

This is not the place for setup feature requests.



Not a feature ;-)

The current "-h" output is missing a header with a description
of program name an version.

 $ ./setup-2.887.x86.exe --help |head

Command Line Options:

--allow-unsupported-windowsAllow old, unsupported Windows versions
 -a --arch Architecture to install (x86_64 or x86)
 -C --categories   Specify entire categories to install
 -o --delete-orphans   Remove orphaned packages
 -A --disable-buggy-antivirus  Disable known or suspected buggy 
anti virus

   software packages during execution.
 -D --download Download packages from internet only


something like

$ bash --help
GNU bash, version 4.4.12(3)-release-(x86_64-unknown-cygwin)
...


--
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: setup 2.887 release candidate - please test

2018-02-07 Thread Steven Penny

On Tue, 6 Feb 2018 15:04:49, Jon Turney wrote:

Uses the libsolv dependency solver, rather than a home-made one.


a result of this is that packages on the "Review and confirm changes" page are
no longer alphabetized

please resolve this - thanks


--
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: Ghostscript cannot find CMaps in Poppler

2018-02-07 Thread Ken Brown

On 2/6/2018 8:40 PM, Vonobow Smith wrote:

  From Cygwin which is bundled with Ghostscript 9.21,
Ghostscript cannot find CMap's at all. As a result, CJK characters
cannot be rendered at all.


$ gsnd
GPL Ghostscript 9.22 (2017-10-04)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>/UniJIS-UTF8-H /CMap findresource
Error: /undefinedresource in findresource


This is caused by incorrect setting of search path for Ghostscript,
or the directory hierarchy of Poppler.

  GS search path is set as following:

$ gs --help

GPL Ghostscript 9.22 (2017-10-04)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
Usage: gs [switches] [file1.ps file2.ps ...]

... snip ...

Search path:
/usr/share/ghostscript/9.22/Resource/Init :
/usr/share/ghostscript/9.22/lib :
/usr/share/ghostscript/9.22/Resource/Font :
/usr/share/ghostscript/fonts : /usr/share/fonts/urw-base35 :
/usr/share/fonts : /usr/share/poppler/cMap/Adobe-CNS1 :
/usr/share/poppler/cMap/Adobe-GB1 :
/usr/share/poppler/cMap/Adobe-Japan1 :
/usr/share/poppler/cMap/Adobe-Japan2 :
/usr/share/poppler/cMap/Adobe-Korea1


However, CMap files are placed at:

$ cd /usr/share/poppler/cMap/Adobe-Japan1/; ls
78-EUC-HAdobe-Japan1-H-CID   UniHojo-UTF32-H
78-EUC-VAdobe-Japan1-H-Host  UniHojo-UTF32-V
78-HAdobe-Japan1-H-Mac   UniHojo-UTF8-H

... snip ...

The problem is directory hierachy lacks the element "CMap".
CMap files must be found in CMap directory under the search path, like:

/usr/share/poppler/cMap/Adobe-Japan1/CMap/UniJIS-UTF8-H
  
The old version of the Ghostscript held CMap's under:

/usr/share/ghostscript/ver.sion/Resources/CMap

and this is correct.

The easiest way to solve this problem is creating symbolic links
which name is "CMap" in each directories containing CMap files,
target of the links are the directories itself, like that:

cd /usr/share/poppler/cMap; for i in *; do (cd $i; ln -s . CMap); done


Thanks for the report.  I'll fix this in a slightly different way with a 
new ghostscript release.  It might take a week or so before I can get to 
this.


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



Re: [PATCH libtirpc] Disable libtirpc's own bindresvport{,_sa}() in favor of Cygwin's

2018-02-07 Thread Mark Geisert

Yaakov Selkowitz wrote:

On 2018-02-07 01:29, Mark Geisert wrote:

I don't have libtirpc in git so I'm submitting a text patch.  Sorry for
any inconvenience.  This is Cygwin-specific and against
src/bindresvport.c of libtirpc 1.0.1.  Unsure if it ought to go
upstream; appreciate input on that.


As Eric mentioned, ed-script diffs are useless.  Nonetheless, I have
been following the discussion, and the correct fix is:

https://github.com/cygwinports/libtirpc/blob/master/1.0.2-cygwin-bindresvport.patch

libtirpc 1.0.2-2 is on its way to the mirrors.



Thank you for following the discussion and reworking the patch, Yaakov.
Cheers,

..mark


Re: [PATCH libtirpc] Disable libtirpc's own bindresvport{,_sa}() in favor of Cygwin's

2018-02-07 Thread Mark Geisert

Brian Inglis wrote:

On 2018-02-07 08:38, Eric Blake wrote:

On 02/07/2018 01:29 AM, Mark Geisert wrote:

I don't have libtirpc in git so I'm submitting a text patch.  Sorry for any
inconvenience.  This is Cygwin-specific and against src/bindresvport.c of
libtirpc 1.0.1.  Unsure if it ought to go upstream; appreciate input on that.
Thanks much,

..mark

8<
35a36,38
 > /* On Cygwin prefer Cygwin's bindresvport{,_sa}() to portable version here */


An ed-script diff is practically useless; without context, it is too easy to
misapply the patch if the file has been edited differently in the meantime.
ALWAYS use 'diff -u' (what git does by default) or 'diff -c' when generating a
patch, so that it has proper context.


Also mandatory to add -p, --show-c-function for patches, and in general for
directory or recursive patch diffs -N, --new-file so new files are diffed as if
against an empty file; --strip-trailing-cr is useful if some files may have CRs.



Understood.  Thanks for the advice.  I knowingly took a risk here on the 
assumption nobody else would be working on this specific file.  But with your 
advice I don't need to take that kind of risk again.  And the patch will be more 
robust too.

Cheers,

..mark


RPC package changes

2018-02-07 Thread Yaakov Selkowitz
Pavel,

With glibc finally shedding its deprecated SUNRPC code, some packaging
changes are needed wrt RPC:

* rpcsvc-proto replaces onc-rpc-devel/rpcgen:

https://github.com/cygwinports/rpcsvc-proto

* libnsl needs to be added for  and :

https://github.com/cygwinports/libnsl

* rpcbind can then be updated to 0.2.4:

https://github.com/cygwinports/rpcbind/commit/d19c29b7ef5a80dc2f7c9343056af76a74bafaf1

Would you be able to look at these soon?

-- 
Yaakov



signature.asc
Description: OpenPGP digital signature


[ANNOUNCEMENT] clang/libcxx 5.0.1-2

2018-02-07 Thread Yaakov Selkowitz
The following packages have been uploaded to the Cygwin distribution:

* clang-5.0.1-2
* clang-analyzer-5.0.1-2
* clang-doc-5.0.1-2
* emacs-clang-format-5.0.1-2
* vim-clang-format-5.0.1-2
* git-clang-format-5.0.1-2
* libclang5.0-5.0.1-2
* libclang-devel-5.0.1-2
* libc++1-5.0.1-2
* libc++-devel-5.0.1-2
* mingw64-i686-clang-5.0.1-2
* mingw64-x86_64-clang-5.0.1-2

Clang is an LLVM native C/C++/ObjC compiler, which aims to deliver 
amazingly fast compiles, extremely useful error and warning messages and to 
provide a platform for building great source level tools. The Clang Static 
Analyzer is a tool that automatically finds bugs in your code, and is a 
great example of the sort of tool that can be built using the Clang 
frontend as a library to parse C/C++ code.

This update includes several changes:

* Use the catgets(3) functions from Cygwin 2.10 instead of the old 
standalone libcatgets;

* Use the SSP implementation from Cygwin 2.10 instead of that of GCC;

* Automatically add -lpthread when statically linking C++ for MinGW targets.

--
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



clang/libcxx 5.0.1-2

2018-02-07 Thread Yaakov Selkowitz
The following packages have been uploaded to the Cygwin distribution:

* clang-5.0.1-2
* clang-analyzer-5.0.1-2
* clang-doc-5.0.1-2
* emacs-clang-format-5.0.1-2
* vim-clang-format-5.0.1-2
* git-clang-format-5.0.1-2
* libclang5.0-5.0.1-2
* libclang-devel-5.0.1-2
* libc++1-5.0.1-2
* libc++-devel-5.0.1-2
* mingw64-i686-clang-5.0.1-2
* mingw64-x86_64-clang-5.0.1-2

Clang is an LLVM native C/C++/ObjC compiler, which aims to deliver 
amazingly fast compiles, extremely useful error and warning messages and to 
provide a platform for building great source level tools. The Clang Static 
Analyzer is a tool that automatically finds bugs in your code, and is a 
great example of the sort of tool that can be built using the Clang 
frontend as a library to parse C/C++ code.

This update includes several changes:

* Use the catgets(3) functions from Cygwin 2.10 instead of the old 
standalone libcatgets;

* Use the SSP implementation from Cygwin 2.10 instead of that of GCC;

* Automatically add -lpthread when statically linking C++ for MinGW targets.

--
Yaakov


libtirpc 1.0.2-2

2018-02-07 Thread Yaakov Selkowitz
The following packages have been uploaded to the Cygwin distribution:

* libtirpc3-1.0.2-2
* libtirpc-common-1.0.2-2
* libtirpc-devel-1.0.2-2
* libtirpc-doc-1.0.2-2

TI-RPC provides a library that implements Transport Independent Remote 
Procedure Calls. It supports RPCs over IPv4, IPv6, as well as local unix 
sockets.

This release includes a patch to use Cygwin's bindresvport(3) and 
bindresvport_sa(3) functions instead of its own.  The headers have been 
moved out from /usr/include/tirpc/rpc{,svc} to /usr/include/rpc{,svc}.

--
Yaakov


[ANNOUNCEMENT] libtirpc 1.0.2-2

2018-02-07 Thread Yaakov Selkowitz
The following packages have been uploaded to the Cygwin distribution:

* libtirpc3-1.0.2-2
* libtirpc-common-1.0.2-2
* libtirpc-devel-1.0.2-2
* libtirpc-doc-1.0.2-2

TI-RPC provides a library that implements Transport Independent Remote 
Procedure Calls. It supports RPCs over IPv4, IPv6, as well as local unix 
sockets.

This release includes a patch to use Cygwin's bindresvport(3) and 
bindresvport_sa(3) functions instead of its own.  The headers have been 
moved out from /usr/include/tirpc/rpc{,svc} to /usr/include/rpc{,svc}.

--
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: [PATCH libtirpc] Disable libtirpc's own bindresvport{,_sa}() in favor of Cygwin's

2018-02-07 Thread Yaakov Selkowitz
On 2018-02-07 01:29, Mark Geisert wrote:
> I don't have libtirpc in git so I'm submitting a text patch.  Sorry for
> any inconvenience.  This is Cygwin-specific and against
> src/bindresvport.c of libtirpc 1.0.1.  Unsure if it ought to go
> upstream; appreciate input on that.

As Eric mentioned, ed-script diffs are useless.  Nonetheless, I have
been following the discussion, and the correct fix is:

https://github.com/cygwinports/libtirpc/blob/master/1.0.2-cygwin-bindresvport.patch

libtirpc 1.0.2-2 is on its way to the mirrors.

-- 
Yaakov



signature.asc
Description: OpenPGP digital signature


Re: [PATCH libtirpc] Disable libtirpc's own bindresvport{,_sa}() in favor of Cygwin's

2018-02-07 Thread Brian Inglis
On 2018-02-07 08:38, Eric Blake wrote:
> On 02/07/2018 01:29 AM, Mark Geisert wrote:
>> I don't have libtirpc in git so I'm submitting a text patch.  Sorry for any
>> inconvenience.  This is Cygwin-specific and against src/bindresvport.c of
>> libtirpc 1.0.1.  Unsure if it ought to go upstream; appreciate input on that.
>> Thanks much,
>>
>> ..mark
>>
>> 8<
>> 35a36,38
>>  > /* On Cygwin prefer Cygwin's bindresvport{,_sa}() to portable version 
>> here */
> 
> An ed-script diff is practically useless; without context, it is too easy to
> misapply the patch if the file has been edited differently in the meantime. 
> ALWAYS use 'diff -u' (what git does by default) or 'diff -c' when generating a
> patch, so that it has proper context.

Also mandatory to add -p, --show-c-function for patches, and in general for
directory or recursive patch diffs -N, --new-file so new files are diffed as if
against an empty file; --strip-trailing-cr is useful if some files may have CRs.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada


RE: Problems with users home directory on cygwin64 on Windows 10

2018-02-07 Thread Ross Boulet
> -Original Message-
> From: cygwin-xfree-ow...@cygwin.com [mailto:cygwin-xfree-
> ow...@cygwin.com] On Behalf Of Steinar Bang
> Sent: Wednesday, February 07, 2018 9:07 AM
> To: cygwin-xfree@cygwin.com
> Subject: Problems with users home directory on cygwin64 on Windows 10
> 
> Platform: Intel i7, Windows 10 Pro
> Cygwin64
> 
> I installed cygwin X yesterday (basically the xorg-server, xlaunch, 
> lxterminal,
> openssh and mosh).  SSH doesn't work in the resulting installation because
> cygwin believes the home directory is /home/sb.
> 
> I have set HOME as an environment variable, that in cygwin looks like:
>  HOME=/cygdrive/d/Profiles/sb
> 
> getent reports the following:
>  sb@ITEM-S63383:~$ getent passwd sb
>  sb:*:1294839:1049089:U-AD-ONE\sb,S-1-5-21-2260904419-1400770398-
> 4175912926-246263:/home/sb:/bin/bash
>  sb@ITEM-S63383:~$
> 
> The user "sb" is an AD user and the computer belongs to an active domain.
> 
> I have tried the following:
>  1. Adding the following line to the /etc/nsswitch.conf file (also known
> as C:\cygwin64\etc\nsswitch.conf ):
>  db_home:  windows
>  2. Stopped all cygwin windows, but this didn't help  3. Changed the config to
>  db_home:  /%H
>  4. Stopped all cygwin windows, but the home directory was still
> /home/sb
>  5. Changed the /etc/nsswitch.conf file back to
>  db_home:  windows
>  5. Rebooted, but home directory was still /home/sb  6. Checked for
> /etc/password and/or /etc/group, but no such file were
> present
> 
> Any ideas?
> 
> Thanks!
> 
> 
> - Steinar
> 
> 
> --
[Ross Boulet] 

Have you tried running mkpasswd? The man page for mkpasswd looks like it might 
accomplish what you want.

Also, this mailing list is deprecated. Please see 
https://cygwin.com/ml/cygwin-xfree-announce/2015-03/msg1.html


-Ross


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



Re: Spurious pastes

2018-02-07 Thread David Mathog

On 07-Feb-2018 06:26, Jon Turney wrote:

On 02/02/2018 22:26, David Mathog wrote:
In the last few days nedit on those remote machines has been doing 
spurious pastes. That is, whatever is currently in the X11 paste 
buffer (not the program's paste buffer) is ending up dropped into 
whatever file is being edited. Unclear why they are landing where they 
do, I have not actually seen it happen, just found it when diff 
indicated these odd insertions. My best guess is that these happen 
while I am scrolling over these regions. Needless to say, this is 
really not a good thing.


There have been only two changes recently.

1. I cleaned my mouse. 2. yum on 1/27/18 automatically installed on 
those servers: xorg-x11-server-common-1.17.4-16.el6.centos.1.x86_64


To eliminate (1) the mouse was swapped with another one. Too soon to
 know if that did anything.


I wonder if you aren't somehow accidentally clicking the middle mouse
button whilst scrolling?


That seems to be what caused it.  Those errant pastes have not happened 
again with the 2nd mouse.  My best guess is that somehow putting the 
mouse back together decreased the "click distance" on the scroll wheel, 
so that now and then in the middle of a scroll motion there was also a 
click.  I would never see it when it happened because the scroll actions 
on either side of the click would move it off the screen.





On 02-Feb-2018 13:13, David Mathog wrote:

I seem to recall that before this if I highlighted a region in an
xterm window, then moved to another X11 application window, and 
center
clicked, it would paste the highlighted text.  However, if nothing 
was
highlighted in the last window, nothing would paste.  My memory may 
be

faulty on this issue though, as I never paid a lot of attention to it
before it started misbehaving.


That wasn't right, but cut/paste is slightly different between "on the 
console" and "over putty ssh tunnel with X11 Server on Windows".


On an XFCE4 ubuntu system console this is what happens:


I'm guessing this means a non-X terminal?


That is a regular X11 server, xorg 1.15.1.  It just acts differently in 
that it was possible to "select nothing".



Is there a standard way to clear this buffer?


I was going to suggest 'xsel -c' or 'xclip -i /dev/null', but that
doesn't work (in this case) for obscure reasons to do with cut
buffers...


Too bad.  Sometimes I cut and paste hundreds of lines of text and those 
are always a mistaken center click in an xterm away from hundreds of 
bogus commands trying to run.


If you have any control of this issue a standard key stroke combination 
to clear would be wonderful.  Failing that, control-shift-center click 
(or something like that) to paste and then clear would be nearly as 
good.



For future issues, can I ask you to use the cygwin list, per [1]

[1] https://cygwin.com/ml/cygwin-xfree-announce/2015-03/msg1.html


I will try to remember that.

Thanks,

David Mathog
mat...@caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech

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



[newlib-cygwin] Cygwin: Fix x86 compiler warning

2018-02-07 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=283e0137c784ef2915c148633fa966ba7810fe70

commit 283e0137c784ef2915c148633fa966ba7810fe70
Author: Corinna Vinschen 
Date:   Wed Feb 7 17:34:59 2018 +0100

Cygwin: Fix x86 compiler warning

The previous patch introduced a compiler warning on x86.

Given time_t is only 4 bytes on x86 we get a long vs. unsigned long
comparison in timeval_to_ms.  Fix it by careful casting.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/times.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/times.cc b/winsup/cygwin/times.cc
index 198fc32..677376e 100644
--- a/winsup/cygwin/times.cc
+++ b/winsup/cygwin/times.cc
@@ -223,7 +223,7 @@ timeval_to_ms (const struct timeval *time_in, DWORD )
   || time_in->tv_usec >= USPERSEC)
 return false;
   if ((time_in->tv_sec == 0 && time_in->tv_usec == 0)
-  || time_in->tv_sec >= INFINITE / HZ)
+  || time_in->tv_sec >= (time_t) (INFINITE / HZ))
 ms = INFINITE;
   else
 ms = time_in->tv_sec * HZ + (time_in->tv_usec + (USPERSEC/HZ) - 1)


Re: [PATCH libtirpc] Disable libtirpc's own bindresvport{,_sa}() in favor of Cygwin's

2018-02-07 Thread Eric Blake

On 02/07/2018 01:29 AM, Mark Geisert wrote:
I don't have libtirpc in git so I'm submitting a text patch.  Sorry for 
any inconvenience.  This is Cygwin-specific and against 
src/bindresvport.c of libtirpc 1.0.1.  Unsure if it ought to go 
upstream; appreciate input on that.

Thanks much,

..mark

8<
35a36,38
 > /* On Cygwin prefer Cygwin's bindresvport{,_sa}() to portable version 
here */


An ed-script diff is practically useless; without context, it is too 
easy to misapply the patch if the file has been edited differently in 
the meantime.  ALWAYS use 'diff -u' (what git does by default) or 'diff 
-c' when generating a patch, so that it has proper context.


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[newlib-cygwin] Cygwin: setsockopt/getsockopt: Add missing optlen checks

2018-02-07 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=51af517cabcf2677f9ad1b8540dcd98f8e141928

commit 51af517cabcf2677f9ad1b8540dcd98f8e141928
Author: Corinna Vinschen 
Date:   Wed Feb 7 15:37:48 2018 +0100

Cygwin: setsockopt/getsockopt: Add missing optlen checks

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/net.cc | 23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 9ff64b8..6f96acb 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -842,6 +842,11 @@ cygwin_setsockopt (int fd, int level, int optname, const 
void *optval,
 SO_REUSEADDR has been set but don't call setsockopt.
 Instead fhandler_socket::bind sets SO_EXCLUSIVEADDRUSE if
 the application did not set SO_REUSEADDR. */
+ if (optlen < (socklen_t) sizeof (int))
+   {
+ set_errno (EINVAL);
+ __leave;
+   }
  if (fh->get_socket_type () == SOCK_STREAM)
ignore = true;
  break;
@@ -901,7 +906,7 @@ cygwin_setsockopt (int fd, int level, int optname, const 
void *optval,
}
}
 
-  if (optlen == sizeof (int))
+  if (optlen == (socklen_t) sizeof (int))
debug_printf ("setsockopt optval=%x", *(int *) optval);
 
   /* Postprocessing setsockopt, setting fhandler_socket members, etc. */
@@ -966,7 +971,15 @@ cygwin_getsockopt (int fd, int level, int optname, void 
*optval,
case SO_PEERCRED:
  {
struct ucred *cred = (struct ucred *) optval;
+
+   if (*optlen < (socklen_t) sizeof *cred)
+ {
+   set_errno (EINVAL);
+   __leave;
+ }
res = fh->getpeereid (>pid, >uid, >gid);
+   if (!res)
+ *optlen = (socklen_t) sizeof *cred;
__leave;
  }
  break;
@@ -974,8 +987,14 @@ cygwin_getsockopt (int fd, int level, int optname, void 
*optval,
case SO_REUSEADDR:
  {
unsigned int *reuseaddr = (unsigned int *) optval;
+
+   if (*optlen < (socklen_t) sizeof *reuseaddr)
+ {
+   set_errno (EINVAL);
+   __leave;
+ }
*reuseaddr = fh->saw_reuseaddr();
-   *optlen = sizeof *reuseaddr;
+   *optlen = (socklen_t) sizeof *reuseaddr;
ignore = true;
  }
  break;


[newlib-cygwin] Cygwin: sockets: Handle SO_RCVTIMEO and SO_SNDTIMEO

2018-02-07 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c51a0b74dcec39222d5a61189bfe4a6aa73dcf46

commit c51a0b74dcec39222d5a61189bfe4a6aa73dcf46
Author: Corinna Vinschen 
Date:   Wed Feb 7 16:16:51 2018 +0100

Cygwin: sockets: Handle SO_RCVTIMEO and SO_SNDTIMEO

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/fhandler.h |  7 +++
 winsup/cygwin/fhandler_socket.cc | 21 ++--
 winsup/cygwin/net.cc | 42 
 winsup/cygwin/release/2.10.1 | 13 +
 winsup/cygwin/times.cc   | 16 +++
 winsup/cygwin/winsup.h   |  1 +
 6 files changed, 98 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 153e384..a446e75 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -524,6 +524,13 @@ class fhandler_socket: public fhandler_base
   void wmem (int nwmem) { _wmem = nwmem; }
 
  private:
+  DWORD _rcvtimeo; /* msecs */
+  DWORD _sndtimeo; /* msecs */
+ public:
+  DWORD  () { return _rcvtimeo; }
+  DWORD  () { return _sndtimeo; }
+
+ private:
   struct _WSAPROTOCOL_INFOW *prot_info_ptr;
  public:
   void init_fixup_before ();
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 6eac689..92b4db9 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -227,6 +227,8 @@ fhandler_socket::fhandler_socket () :
   wsock_events (NULL),
   wsock_mtx (NULL),
   wsock_evt (NULL),
+  _rcvtimeo (INFINITE),
+  _sndtimeo (INFINITE),
   prot_info_ptr (NULL),
   sun_path (NULL),
   peer_sun_path (NULL),
@@ -752,6 +754,8 @@ fhandler_socket::wait_for_events (const long event_mask, 
const DWORD flags)
 
   int ret;
   long events = 0;
+  DWORD wfmo_timeout = 50;
+  DWORD timeout;
 
   WSAEVENT ev[3] = { wsock_evt, NULL, NULL };
   wait_signal_arrived here (ev[1]);
@@ -759,19 +763,32 @@ fhandler_socket::wait_for_events (const long event_mask, 
const DWORD flags)
   if ((ev[2] = pthread::get_cancel_event ()) != NULL)
 ++ev_cnt;
 
+  if (is_nonblocking () || (flags & MSG_DONTWAIT))
+timeout = 0;
+  else if (event_mask & FD_READ)
+timeout = rcvtimeo ();
+  else if (event_mask & FD_WRITE)
+timeout = sndtimeo ();
+  else
+timeout = INFINITE;
+
   while (!(ret = evaluate_events (event_mask, events, !(flags & MSG_PEEK)))
 && !events)
 {
-  if (is_nonblocking () || (flags & MSG_DONTWAIT))
+  if (timeout == 0)
{
  WSASetLastError (WSAEWOULDBLOCK);
  return SOCKET_ERROR;
}
 
-  switch (WSAWaitForMultipleEvents (ev_cnt, ev, FALSE, 50, FALSE))
+  if (timeout < wfmo_timeout)
+   wfmo_timeout = timeout;
+  switch (WSAWaitForMultipleEvents (ev_cnt, ev, FALSE, wfmo_timeout, 
FALSE))
{
  case WSA_WAIT_TIMEOUT:
  case WSA_WAIT_EVENT_0:
+   if (timeout != INFINITE)
+ timeout -= wfmo_timeout;
break;
 
  case WSA_WAIT_EVENT_0 + 1:
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 6f96acb..43da5dc 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -851,6 +851,21 @@ cygwin_setsockopt (int fd, int level, int optname, const 
void *optval,
ignore = true;
  break;
 
+   case SO_RCVTIMEO:
+   case SO_SNDTIMEO:
+ if (optlen < (socklen_t) sizeof (struct timeval))
+   {
+ set_errno (EINVAL);
+ __leave;
+   }
+ if (timeval_to_ms ((struct timeval *) optval,
+(optname == SO_RCVTIMEO)
+? fh->rcvtimeo () : fh->sndtimeo ()))
+   res = 0;
+ else
+   set_errno (EDOM);
+ __leave;
+
default:
  break;
}
@@ -999,6 +1014,33 @@ cygwin_getsockopt (int fd, int level, int optname, void 
*optval,
  }
  break;
 
+   case SO_RCVTIMEO:
+   case SO_SNDTIMEO:
+ {
+   struct timeval *time_out = (struct timeval *) optval;
+
+   if (*optlen < (socklen_t) sizeof *time_out)
+ {
+   set_errno (EINVAL);
+   __leave;
+ }
+   DWORD ms = (optname == SO_RCVTIMEO) ? fh->rcvtimeo ()
+   : fh->sndtimeo ();
+   if (ms == 0 || ms == INFINITE)
+ {
+   time_out->tv_sec = 0;
+   time_out->tv_usec = 0;
+ }
+   else
+ {
+   time_out->tv_sec = ms / HZ;
+   time_out->tv_usec = ((ms % HZ) * USPERSEC) / HZ;
+ }
+   *optlen = (socklen_t) sizeof *time_out;
+   res = 0;
+   __leave;
+ 

Problems with users home directory on cygwin64 on Windows 10

2018-02-07 Thread Steinar Bang
Platform: Intel i7, Windows 10 Pro
  Cygwin64

I installed cygwin X yesterday (basically the xorg-server, xlaunch,
lxterminal, openssh and mosh).  SSH doesn't work in the resulting
installation because cygwin believes the home directory is /home/sb.

I have set HOME as an environment variable, that in cygwin looks like:
 HOME=/cygdrive/d/Profiles/sb

getent reports the following:
 sb@ITEM-S63383:~$ getent passwd sb
 
sb:*:1294839:1049089:U-AD-ONE\sb,S-1-5-21-2260904419-1400770398-4175912926-246263:/home/sb:/bin/bash
 sb@ITEM-S63383:~$

The user "sb" is an AD user and the computer belongs to an active domain.

I have tried the following:
 1. Adding the following line to the /etc/nsswitch.conf file (also known
as C:\cygwin64\etc\nsswitch.conf ):
 db_home:  windows
 2. Stopped all cygwin windows, but this didn't help
 3. Changed the config to
 db_home:  /%H
 4. Stopped all cygwin windows, but the home directory was still
/home/sb
 5. Changed the /etc/nsswitch.conf file back to
 db_home:  windows
 5. Rebooted, but home directory was still /home/sb
 6. Checked for /etc/password and/or /etc/group, but no such file were
present

Any ideas?

Thanks!


- Steinar


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



Re: Spurious pastes

2018-02-07 Thread Jon Turney

On 02/02/2018 22:26, David Mathog wrote:
In the last few days nedit on those remote machines has been doing 
spurious pastes. That is, whatever is currently in the X11 paste 
buffer (not the program's paste buffer) is ending up dropped into 
whatever file is being edited. Unclear why they are landing where 
they do, I have not actually seen it happen, just found it when diff 
indicated these odd insertions. My best guess is that these happen 
while I am scrolling over these regions. Needless to say, this is 
really not a good thing.


There have been only two changes recently.

1. I cleaned my mouse. 2. yum on 1/27/18 automatically installed on 
those servers: xorg-x11-server-common-1.17.4-16.el6.centos.1.x86_64


To eliminate (1) the mouse was swapped with another one. Too soon to
 know if that did anything.


I wonder if you aren't somehow accidentally clicking the middle mouse 
button whilst scrolling?



On 02-Feb-2018 13:13, David Mathog wrote:

I seem to recall that before this if I highlighted a region in an
xterm window, then moved to another X11 application window, and center
clicked, it would paste the highlighted text.  However, if nothing was
highlighted in the last window, nothing would paste.  My memory may be
faulty on this issue though, as I never paid a lot of attention to it
before it started misbehaving.


That wasn't right, but cut/paste is slightly different between "on the 
console" and "over putty ssh tunnel with X11 Server on Windows".


On an XFCE4 ubuntu system console this is what happens:


I'm guessing this means a non-X terminal?


1.  type "pwd" into an uxterm window
2.  highlight "pwd" on the line at the preceding prompt, center
     click once at the current prompt.  "pwd" is pasted.
     Press "enter".
3.  left click once on the still highlighted "pwd", now 2 lines up.
     The highlight goes away.  Center click once at the prompt.
     "pwd" is still pasted. Press "enter".
4.  With the left mouse button drag across any letter and back
     to the original position.  So nothing is highlighted.  This can
     be on any text anywhere in the window.  Center click
     at the prompt.  Nothing is pasted - the paste buffer is now
     empty.

So on the console it is possible to select "nothing".

On the X11 server ssh to the Ubuntu system and it is the same for the 
first 3 steps, but the 4th still pastes "pwd".  The rule seems to be 
"paste buffer can be replaced by anything selected, but not by a select 
operation which ends with nothing highlighted."


On the X11 server ssh to the Centos system, it behaves just like a 
similar connection to the Centos system.


The operations do the same thing when going between two uxterm windows 
on any of these tests.


Which is right?  Is "nothing" a valid thing to load into the paste 
buffer or no?


From the testing I did on a couple of linux systems, making an empty 
selection in urxvt doesn't change the clipboard contents, so I don't 
think this is specifically a Cygwin X server problem.


I think it's up to the client (i.e. urxvt) how it interprets making an 
empty selection, which seems to be to not update the selection.



Is there a standard way to clear this buffer?


I was going to suggest 'xsel -c' or 'xclip -i /dev/null', but that 
doesn't work (in this case) for obscure reasons to do with cut buffers...



For future issues, can I ask you to use the cygwin list, per [1]

[1] https://cygwin.com/ml/cygwin-xfree-announce/2015-03/msg1.html


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



[newlib-cygwin] Cygwin: Cleanup time handling

2018-02-07 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2af67d21b2e4e1d657fe88fc42924cbebab64585

commit 2af67d21b2e4e1d657fe88fc42924cbebab64585
Author: Corinna Vinschen 
Date:   Wed Feb 7 13:07:44 2018 +0100

Cygwin: Cleanup time handling

* Redefine NSPERSEC to NS100PERSEC
* Define NSPERSEC as nanosecs per second
* Define USPERSEC as microsecs per second
* Use above constants throughout where appropriate
* Rename to_us to timespec_to_us and inline
* Rename it_bad to timespec_bad and inline

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/fhandler_disk_file.cc |  4 +-
 winsup/cygwin/fhandler_proc.cc  | 12 +++---
 winsup/cygwin/fhandler_process.cc   |  8 ++--
 winsup/cygwin/hires.h   |  6 ++-
 winsup/cygwin/posix_ipc.cc  |  2 +-
 winsup/cygwin/resource.cc   |  4 +-
 winsup/cygwin/sched.cc  |  8 ++--
 winsup/cygwin/select.cc |  5 ++-
 winsup/cygwin/signal.cc | 26 +++-
 winsup/cygwin/sysconf.cc|  3 +-
 winsup/cygwin/thread.cc | 10 +++--
 winsup/cygwin/timer.cc  | 39 +
 winsup/cygwin/times.cc  | 85 ++---
 13 files changed, 115 insertions(+), 97 deletions(-)

diff --git a/winsup/cygwin/fhandler_disk_file.cc 
b/winsup/cygwin/fhandler_disk_file.cc
index 5dfcae4..f079965 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1314,8 +1314,8 @@ fhandler_base::utimens_fs (const struct timespec *tvp)
 tmp[1] = tmp[0] = timeofday;
   else
 {
-  if ((tvp[0].tv_nsec < UTIME_NOW || tvp[0].tv_nsec > 9L)
- || (tvp[1].tv_nsec < UTIME_NOW || tvp[1].tv_nsec > 9L))
+  if ((tvp[0].tv_nsec < UTIME_NOW || tvp[0].tv_nsec >= NSPERSEC)
+ || (tvp[1].tv_nsec < UTIME_NOW || tvp[1].tv_nsec >= NSPERSEC))
{
  if (closeit)
close_fs ();
diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index ad367e4..771235f 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -535,9 +535,9 @@ format_proc_stat (void *, char *)
   for (unsigned long i = 0; i < wincap.cpu_count (); i++)
{
  kernel_time += (spt[i].KernelTime.QuadPart - spt[i].IdleTime.QuadPart)
-* HZ / 1000ULL;
- user_time += spt[i].UserTime.QuadPart * HZ / 1000ULL;
- idle_time += spt[i].IdleTime.QuadPart * HZ / 1000ULL;
+* HZ / NS100PERSEC;
+ user_time += spt[i].UserTime.QuadPart * HZ / NS100PERSEC;
+ idle_time += spt[i].IdleTime.QuadPart * HZ / NS100PERSEC;
}
 
   eobuf += __small_sprintf (eobuf, "cpu %U %U %U %U\n",
@@ -546,9 +546,9 @@ format_proc_stat (void *, char *)
   for (unsigned long i = 0; i < wincap.cpu_count (); i++)
{
  interrupt_count += spt[i].InterruptCount;
- kernel_time = (spt[i].KernelTime.QuadPart - spt[i].IdleTime.QuadPart) 
* HZ / 1000ULL;
- user_time = spt[i].UserTime.QuadPart * HZ / 1000ULL;
- idle_time = spt[i].IdleTime.QuadPart * HZ / 1000ULL;
+ kernel_time = (spt[i].KernelTime.QuadPart - spt[i].IdleTime.QuadPart) 
* HZ / NS100PERSEC;
+ user_time = spt[i].UserTime.QuadPart * HZ / NS100PERSEC;
+ idle_time = spt[i].IdleTime.QuadPart * HZ / NS100PERSEC;
  eobuf += __small_sprintf (eobuf, "cpu%d %U %U %U %U\n", i,
user_time, 0ULL, kernel_time, idle_time);
}
diff --git a/winsup/cygwin/fhandler_process.cc 
b/winsup/cygwin/fhandler_process.cc
index eb5a523..c748447 100644
--- a/winsup/cygwin/fhandler_process.cc
+++ b/winsup/cygwin/fhandler_process.cc
@@ -1139,19 +1139,19 @@ format_process_stat (void *data, char *)
   return 0;
 }
   fault_count = vmc.PageFaultCount;
-  utime = put.UserTime.QuadPart * HZ / 1000ULL;
-  stime = put.KernelTime.QuadPart * HZ / 1000ULL;
+  utime = put.UserTime.QuadPart * HZ / NS100PERSEC;
+  stime = put.KernelTime.QuadPart * HZ / NS100PERSEC;
 #if 0
if (stodi.CurrentTime.QuadPart > put.CreateTime.QuadPart)
  start_time = (spt.KernelTime.QuadPart + spt.UserTime.QuadPart -
-  stodi.CurrentTime.QuadPart + put.CreateTime.QuadPart) * HZ / 
1000ULL;
+  stodi.CurrentTime.QuadPart + put.CreateTime.QuadPart) * HZ / 
NS100PERSEC;
else
  /*
   * sometimes stodi.CurrentTime is a bit behind
   * Note: some older versions of procps are broken and can't cope
   * with process start times > time(NULL).
   */
- start_time = (spt.KernelTme.QuadPart + spt.UserTime.QuadPart) * HZ / 
1000ULL;
+ start_time = (spt.KernelTme.QuadPart + spt.UserTime.QuadPart) * HZ / 
NS100PERSEC;
 #endif
   /* The BasePriority returned to a 32 bit process under WOW64 is
  apparently broken, for 32 and 

Re: setup 2.887 release candidate - please test

2018-02-07 Thread Jon Turney

On 07/02/2018 11:38, David Balažic wrote:

On 7 February 2018 at 01:49, Steven Penny wrote:

On Tue, 6 Feb 2018 15:04:49, Jon Turney wrote:
- 'Current' is replaced by 'Best' (which is slightly different in ways

it's difficult to summarize briefly) and 'Sync' (which exposes the
--force-current (distupgrade) option through the UI).


i get the desire for one word labels - but im not sure how good
"sync" is. its not clear in the GUI what it does, and frankly, even
reading your description doesnt clear up for me what it does. i
guess i would need to run "--help" and see what "--force-current"
does to figure it out. that just seems like more work than it
should be.

This could be improved by having a tooltip on the GUI item, 
explaining in a sentence or two, what it does.


There already is a tooltip:

"Sets all packages to the version available from the package 
respository, downgrading if necessary."


--
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: setup 2.887 release candidate - please test

2018-02-07 Thread David Balažic
On 7 February 2018 at 01:49, Steven Penny  wrote:

> On Tue, 6 Feb 2018 15:04:49, Jon Turney wrote:
>
>> - Query the user for action to take if a corrupt local file is found
>>
>
> works great - thanks
>
> - 'Current' is replaced by 'Best' (which is slightly different in ways
>> it's difficult to summarize briefly) and 'Sync' (which exposes the
>> --force-current (distupgrade) option through the UI).
>>
>
> i get the desire for one word labels - but im not sure how good "sync" is.
> its
> not clear in the GUI what it does, and frankly, even reading your
> description
> doesnt clear up for me what it does. i guess i would need to run "--help"
> and
> see what "--force-current" does to figure it out. that just seems like
> more work
> than it should be.
>
>  This could be improved by having a tooltip on the GUI item, explaining in
a sentence or two, what it does.

Regards,
David

--
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