[ANNOUNCEMENT] multitail 6.4.2-1

2017-10-10 Thread Andrew Schulman
multitail 6.4.2-1 is now available in Cygwin. This is a new upstream
release. The author of multitail doesn't provide an up-to-date changelog,
but there's a little bit of explanation on the project home page[1], and an
older changelog[2].

MultiTail lets you view one or multiple files like the original tail
program. The difference is that it creates multiple windows on your console
(with ncurses). It can also:

* Monitor wildcards: if another file matching the wildcard has a more
recent modification date, it will automatically switch to that file. That
way you can, for example, monitor a complete directory of files. 
* Merge 2 or more logfiles.
* Use colors while displaying the logfiles (through regular expressions),
for faster recognition of what is important and what not. 
* Filter lines (again with regular expressions) and has interactive menus
for editing given regular expressions and deleting and adding windows. 
* Have windows with the output of shell scripts and other software. When
viewing the output of external software, MultiTail can mimic the
functionality of tools like 'watch' and such.

Andrew E. Schulman

[1] https://www.vanheusden.com/multitail/index.php
[2] https://www.vanheusden.com/multitail/changelog.php


***


To update your installation, click on the "Install Cygwin now" link on
the http://cygwin.com/ web page.  This downloads setup.exe to your
system.  Then, run setup and answer all of the questions.

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there.  It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain.com_at_cygwin.com

If you need more information on unsubscribing, start reading here: 

http://cygwin.com/lists.html#subscribe-unsubscribe

Please read *all* of the information on unsubscribing that is available
starting at this URL.

--
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: fix gethostbyaddr argument types

2017-10-10 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=747f31854a572b3dd64912997dde2dc984b1f2d8

commit 747f31854a572b3dd64912997dde2dc984b1f2d8
Author: Yaakov Selkowitz 
Date:   Tue Sep 26 20:36:35 2017 -0500

cygwin: fix gethostbyaddr argument types

The first argument of gethostbyaddr needs to accept a generic pointer
to be compatible with e.g. struct in_addr *.  This caused an issue
compiling krb5-1.15.

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 winsup/cygwin/include/netdb.h | 2 +-
 winsup/cygwin/net.cc  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/include/netdb.h b/winsup/cygwin/include/netdb.h
index e46e341..91e9172 100644
--- a/winsup/cygwin/include/netdb.h
+++ b/winsup/cygwin/include/netdb.h
@@ -228,7 +228,7 @@ voidendnetent (void);
 void   endprotoent (void);
 void   endservent (void);
 void   endrpcent  (void);
-struct hostent *gethostbyaddr (const char *, int, int);
+struct hostent *gethostbyaddr (const void *, socklen_t, int);
 struct hostent *gethostbyname (const char *);
 #if __MISC_VISIBLE
 struct hostent *gethostbyname2 (const char *, int);
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index fd903b1..8969e7c 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -1152,13 +1152,13 @@ cygwin_gethostbyname (const char *name)
 
 /* exported as gethostbyaddr: standards? */
 extern "C" struct hostent *
-cygwin_gethostbyaddr (const char *addr, int len, int type)
+cygwin_gethostbyaddr (const void *addr, socklen_t len, int type)
 {
   hostent *res = NULL;
 
   __try
 {
-  res = dup_ent (gethostbyaddr (addr, len, type));
+  res = dup_ent (gethostbyaddr ((const char *) addr, len, type));
   if (res)
debug_printf ("h_name %s", res->h_name);
   else


[newlib-cygwin] Feature test macros overhaul: Cygwin netdb.h

2017-10-10 Thread Yaakov Selkowitz
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0b45b053e833d2e87dd71a4a5198fd8158d53a1d

commit 0b45b053e833d2e87dd71a4a5198fd8158d53a1d
Author: Yaakov Selkowitz 
Date:   Tue Sep 26 20:36:34 2017 -0500

Feature test macros overhaul: Cygwin netdb.h

herror etc. are MISC, rcmd etc. are BSD, addrinfo functions are
POSIX.1-2001, except for IDN functionality which is GNU.

Signed-off-by: Yaakov Selkowitz 

Diff:
---
 winsup/cygwin/include/netdb.h | 26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/include/netdb.h b/winsup/cygwin/include/netdb.h
index 968847b..e46e341 100644
--- a/winsup/cygwin/include/netdb.h
+++ b/winsup/cygwin/include/netdb.h
@@ -117,7 +117,7 @@ struct rpcent {
int r_number;   /* rpc program number */
 };
 
-#ifndef __INSIDE_CYGWIN_NET__
+#if __POSIX_VISIBLE >= 200112 && !defined(__INSIDE_CYGWIN_NET__)
 struct addrinfo {
   int ai_flags;/* input flags */
   int ai_family;   /* address family of socket */
@@ -135,6 +135,8 @@ struct addrinfo {
  * (left in extern int h_errno).
  */
 
+#if __MISC_VISIBLE || __POSIX_VISIBLE < 200809
+
 #ifdef  __INSIDE_CYGWIN_NET__
 extern int h_errno;
 #else
@@ -152,6 +154,10 @@ extern __declspec(dllimport) int h_errno;
 #defineNO_DATA 4 /* Valid name, no data record of requested 
type */
 #defineNO_ADDRESS  NO_DATA /* no address, look for MX 
record */
 
+#endif /* __MISC_VISIBLE || __POSIX_VISIBLE < 200809 */
+
+#if __POSIX_VISIBLE >= 200112
+
 /* Flag values for getaddrinfo function. */
 #define AI_PASSIVE  0x1/* Intend socket address for bind. */
 #define AI_CANONNAME0x2/* Return canonical node name. */
@@ -161,6 +167,7 @@ extern __declspec(dllimport) int h_errno;
 #define AI_ADDRCONFIG   0x400  /* Only return address types available on
   this host. */
 #define AI_V4MAPPED 0x800  /* IPv4 mapped addresses are acceptable. */
+#ifdef __GNU_VISIBLE
 /* Glibc extensions. We use numerical values taken by winsock-specific
extensions. */
 #define AI_IDN  0x4000 /* Encode IDN input from current local to
@@ -171,6 +178,7 @@ extern __declspec(dllimport) int h_errno;
   input string.  */
 #define AI_IDN_USE_STD3_ASCII_RULES 0x2 /* Filter ASCII chars according to
   STD3 rules.  */
+#endif /* __GNU_VISIBLE */
 
 /* Flag values for getnameinfo function. */
 #define NI_NOFQDN   0x1/* Don't lookup hostname. */
@@ -178,6 +186,7 @@ extern __declspec(dllimport) int h_errno;
 #define NI_NAMEREQD 0x4/* Not being able to resolve is an error. */
 #define NI_NUMERICSERV  0x8/* Return port number, rather than name. */
 #define NI_DGRAM0x10   /* Lookup datagram (UDP) service. */
+#ifdef __GNU_VISIBLE
 /* Glibc extensions. We use numerical values taken by winsock-specific
extensions. */
 #define NI_IDN  0x4000 /* Decode name from punycode to IDN in
@@ -186,6 +195,7 @@ extern __declspec(dllimport) int h_errno;
   output string.  */
 #define NI_IDN_USE_STD3_ASCII_RULES 0x2 /* Filter ASCII chars according to
   STD3 rules.  */
+#endif /* __GNU_VISIBLE */
 
 #define NI_MAXHOST  1025   /* Best effort maximum hostname length. */
 #define NI_MAXSERV  32 /* Best effort maximum service name length. */
@@ -205,8 +215,12 @@ extern __declspec(dllimport) int h_errno;
 #define EAI_BADHINTS12 /* Invalid value for hints */
 #define EAI_PROTOCOL13 /* Resolved protocol is unknown */
 #define EAI_OVERFLOW14 /* An argument buffer overflowed */
+#ifdef __GNU_VISIBLE
 /* Glibc extensions. */
 #define EAI_IDN_ENCODE 15  /* Parameter string not correctly encoded */
+#endif
+
+#endif /* __POSIX_VISIBLE >= 200112 */
 
 #ifndef __INSIDE_CYGWIN_NET__
 void   endhostent (void);
@@ -216,7 +230,9 @@ voidendservent (void);
 void   endrpcent  (void);
 struct hostent *gethostbyaddr (const char *, int, int);
 struct hostent *gethostbyname (const char *);
+#if __MISC_VISIBLE
 struct hostent *gethostbyname2 (const char *, int);
+#endif
 struct hostent *gethostent (void);
 struct netent  *getnetbyaddr (uint32_t, int);
 struct netent  *getnetbyname (const char *);
@@ -230,20 +246,25 @@ struct servent*getservent (void);
 struct rpcent  *getrpcent (void);
 struct rpcent  *getrpcbyname (const char *);
 struct rpcent  *getrpcbynumber (int);
+#if __MISC_VISIBLE
 const char  *hstrerror (int);
 void   herror (const char *);
+#endif
 void   sethostent (int);
 void   setnetent (int);
 void   setprotoent (int);
 void   setservent (int);
 void   setrpcent (int);
+#if __POSIX_VISIBLE >= 200112
 void   

RE: ERROR: A specified logon session does not exist. It may already have been terminated

2017-10-10 Thread Fournier, Danny G
Glenn,

I was able to run the command and find the file, albeit empty. Here are the 
commands I ran:

my_user@MY_SERVER ~
$ runas /noprofile /user:MY_SERVER\my_user echo hello > a.txt

my_user@MY_SERVER ~
$ runas /noprofile /user:MY_SERVER\administrator echo hello > b.txt

Even in the Command Prompt on the server, runas in this fashion yields an empty 
file. 

If I simply run echo hello > file.txt, "hello" can be seen in the file (both in 
the Command Prompt in Windows and via Cygwin/SSH).

Dan

-Original Message-
From: Gluszczak, Glenn [mailto:glenn.gluszc...@dell.com] 
Sent: October-10-17 12:14 PM
To: Fournier, Danny G; cygwin@cygwin.com
Subject: RE: ERROR: A specified logon session does not exist. It may already 
have been terminated

It may still work but you don't see the other terminal window unless you're on 
the desktop.
To prove, try this command instead.

runas /noprofile /user:orawin\administrator echo hello > a

Then look for the file "a".

I was just wondering if perhaps the issue was due to spawning a separate 
window.  Might be unrelated.
I've never used schtasks.

-
Glenn,

I suspect that runas doesn't work through SSH. I ran it without any parameters 
which resulted in no output in the terminal.

However, if I run runas through the Windows Command Prompt, I clearly see 
output indicating that I missed required parameters.

Thanks,

Dan


Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

---


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on 
Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged 
keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been 
terminated.

We will also get the same error by simply invoking schtasks.exe without any 
parameters, which is supposed to list the jobs currently configured on the 
server.

What we have done:

-Most articles found state to change the following Local Policy to disabled 
(which was set already):
Network access: Do not allow storage of passwords and credentials for network 
authentication

-We have also added the user into the following Local Policy: Log on as a batch 
job and Log on as a service -The user has permission to read and execute 
schtasks.exe -We regenerated passwd and group files -Command prompts in 
Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, 
sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the 
same issue.

Dan


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


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


--
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 setup 00/14] Use libsolv, solve all our problems... (WIP)

2017-10-10 Thread Jon Turney

On 10/10/2017 12:18, Ken Brown wrote:
I've just started testing (based on the current HEAD of topic/libsolv), 
and so far everything looks good.  My only suggestion is a cosmetic one. 
  Now that you've made "Test" a checkbox, independent of the radio 
buttons "Keep/Current/Sync", users might be confused by the fact that 
"Current" remains selected when "Test" is checked.


Initially, I didn't want to make any UI change here, but it made it a 
lot easier to think about how map the command line options to solver flags.


But yeah, I wasn't sure if I should change this or not.  I kept it the 
same just to keep the default the same, but that doesn't seem a very 
good reason.


"Test" should probably be something a little less terse, as well.

> In fact, the
"Current" button has a different meaning now than it used to have. Maybe 
the "Current" label should be changed to "Best", in keeping with its new 
meaning (and tooltip).


People seem to sometimes think "Current" means (something like) "Sync", 
when it fact it is (something like) "Best", so perhaps that's another 
reason why a change of name is a good idea.


Re: setup stuck on cygwin.ldif

2017-10-10 Thread Jon Turney

On 10/10/2017 08:21, Shaddy Baddah wrote:

On 10/10/17 17:59, Shaddy Baddah wrote:

On 09/10/17 04:16, Brian Inglis wrote:

On 2017-10-08 07:46, Shaddy Baddah wrote:

I have a weird problem happening... so I have tried to update a 64-bit
Cygwin installation on Windows 10 Pro. I closed all Cygwin processes,
and a ps -ef is showing only the ps process itself.
In anycase, during the install I was prompted that the file
/usr/share/cygwin/cygwin.ldif was busy.
I ran Process Explorer and searched for what might have the file open.
I couldn't find anything. I clicked retry a number of times, but it
wouldn't yield. Finally, I clicked continue. And now I'm stuck in this
endless loop on the file:
https://imgur.com/Nj35Y3T
It's a animated gif, so you may have to select play in your browser. 
Not

much to see, except the constant attempt to install the cygwin.ldif
file.
Any ideas here? I guess I'll have to kill setup... but I fear that it
will play havoc with my install :-(


Have you tried Windows cmd OPENFILES /Query ?



So I tried to "Reinstall" all, and now the problem has shifted. Every
attempt to reinstall stops with "Unable to extract
/etc/defaults/etc/pki/ca-trust/ca-legacy.conf". "The file is in use or
some other error occurred.".

Retry doesn't help. openfiles doesn't reveal anything:

https://imgur.com/a/XV1YQ

Having enhanced setup.exe at one point, and accordingly debugged it,
I'll try and see if I can turn up the logging, see what is going on
exactly. I actually don't know where setup.log/setup.log.full is going
to at the moment.


OK, I understand the logging only gets written when setup exits. So here
is what I am seeing:


This is to allow for the fact that we don't know where /var/log/ is 
going to be when setup starts.  But yeah, waiting until it exits to 
write the log is a bit of a misfeature.



Installing file cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf
2017/10/10 18:09:58 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf) failed 13 
Permission denied
2017/10/10 18:09:58 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf for writing.


There is nothing in the target folder. icacls of ca-trust shows:

portapps@AVANT-W10 F:\portapps-sw\cygwin\etc\defaults\etc\pki
 > icacls ca-trust
ca-trust AVANT-W10\portapps:(F)
  AVANT-W10\None:(RX)
  Everyone:(RX)
  CREATOR OWNER:(OI)(CI)(IO)(F)
  CREATOR GROUP:(OI)(CI)(IO)(RX)
  Everyone:(OI)(CI)(IO)(RX)

Successfully processed 1 files; Failed processing 0 files

A retry, just repeats of course:

2017/10/10 18:13:08 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf) failed 13 
Permission denied
2017/10/10 18:13:08 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf for writing.


Then if you click continue, you get an endless loop that takes up
all your CPU:


Fascinating.

I did a bit of staring at [1], and this log looks like we not advancing 
to the next archive member before next_file_name(), because not only 
does extract_file() fail, but also extract_replace_on_reboot() (creating 
the .new file to be renamed on reboot) is failing.


It looks like we've never handled extract_replace_on_reboot() failing 
correctly, since we don't advance to the next archive member in that case.


I'm assuming there's something unusual about permissions which is why 
the .new file can't be created, or perhaps this problem would be more 
common?


You might be able to work around this using the --no-replaceonreboot 
option, but it looks like that will always suffer from the same problem.


[1] 
https://sourceware.org/git/gitweb.cgi?p=cygwin-setup.git;a=blob;f=install.cc;h=f8f0b59d2d2163798c1e222b913b2a8ee0c009d9;hb=HEAD#l474


2017/10/10 18:13:11 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new) failed 13 
Permission denied
2017/10/10 18:13:11 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new for writing.
2017/10/10 18:13:11 Unable to install file 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new

Installing file cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf
2017/10/10 18:13:11 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf) failed 13 
Permission denied
2017/10/10 18:13:11 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf for writing.
2017/10/10 18:13:11 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new) failed 13 
Permission denied
2017/10/10 18:13:11 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new for writing.
2017/10/10 18:13:11 Unable to install file 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new

Installing file cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf


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

RE: ERROR: A specified logon session does not exist. It may already have been terminated

2017-10-10 Thread Gluszczak, Glenn
It may still work but you don't see the other terminal window unless you're on 
the desktop.
To prove, try this command instead.

runas /noprofile /user:orawin\administrator echo hello > a

Then look for the file "a".

I was just wondering if perhaps the issue was due to spawning a separate 
window.  Might be unrelated.
I've never used schtasks.

-
Glenn,

I suspect that runas doesn't work through SSH. I ran it without any parameters 
which resulted in no output in the terminal.

However, if I run runas through the Windows Command Prompt, I clearly see 
output indicating that I missed required parameters.

Thanks,

Dan


Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

---


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on 
Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged 
keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been 
terminated.

We will also get the same error by simply invoking schtasks.exe without any 
parameters, which is supposed to list the jobs currently configured on the 
server.

What we have done:

-Most articles found state to change the following Local Policy to disabled 
(which was set already):
Network access: Do not allow storage of passwords and credentials for network 
authentication

-We have also added the user into the following Local Policy: Log on as a batch 
job and Log on as a service -The user has permission to read and execute 
schtasks.exe -We regenerated passwd and group files -Command prompts in 
Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, 
sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the 
same issue.

Dan


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


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


--
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: ERROR: A specified logon session does not exist. It may already have been terminated

2017-10-10 Thread Fournier, Danny G
Glenn,

I suspect that runas doesn't work through SSH. I ran it without any parameters 
which resulted in no output in the terminal.

However, if I run runas through the Windows Command Prompt, I clearly see 
output indicating that I missed required parameters.

Thanks,

Dan

-Original Message-
From: Gluszczak, Glenn [mailto:glenn.gluszc...@dell.com] 
Sent: October-10-17 11:48 AM
To: Fournier, Danny G; cygwin@cygwin.com
Subject: RE: ERROR: A specified logon session does not exist. It may already 
have been terminated

Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

---


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on 
Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged 
keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been 
terminated.

We will also get the same error by simply invoking schtasks.exe without any 
parameters, which is supposed to list the jobs currently configured on the 
server.

What we have done:

-Most articles found state to change the following Local Policy to disabled 
(which was set already):
Network access: Do not allow storage of passwords and credentials for network 
authentication

-We have also added the user into the following Local Policy: Log on as a batch 
job and Log on as a service -The user has permission to read and execute 
schtasks.exe -We regenerated passwd and group files -Command prompts in 
Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, 
sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the 
same issue.

Dan


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


--
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: ERROR: A specified logon session does not exist. It may already have been terminated

2017-10-10 Thread Gluszczak, Glenn
Does schtasks.exe open a separate/new terminal session?
You could check if a command like "runas" works through ssh.

runas /noprofile /user:mymachine\administrator dir

Glenn

---


We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on 
Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged 
keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been 
terminated.

We will also get the same error by simply invoking schtasks.exe without any 
parameters, which is supposed to list the jobs currently configured on the 
server.

What we have done:

-Most articles found state to change the following Local Policy to disabled 
(which was set already):
Network access: Do not allow storage of passwords and credentials for network 
authentication

-We have also added the user into the following Local Policy: Log on as a batch 
job and Log on as a service -The user has permission to read and execute 
schtasks.exe -We regenerated passwd and group files -Command prompts in 
Windows, running as the specific user, can run schtasks.exe without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, 
sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the 
same issue.

Dan


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


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



ERROR: A specified logon session does not exist. It may already have been terminated

2017-10-10 Thread Fournier, Danny G
We recently upgraded Cygwin to 2.9.0(0.318/5/3) from 2.0.4(0.287/5/3) on 
Windows Server 2008 R2.

Once we connect to the server using SSH, using a user where we have exchanged 
keys for, we call the following command:
schtasks.exe /Run /TN "SomeJobName"

This will give the following error:
ERROR: A specified logon session does not exist. It may already have been 
terminated.

We will also get the same error by simply invoking schtasks.exe without any 
parameters, which is supposed to list the jobs currently configured on the 
server.

What we have done:

-Most articles found state to change the following Local Policy to disabled 
(which was set already):
Network access: Do not allow storage of passwords and credentials for network 
authentication

-We have also added the user into the following Local Policy: Log on as a batch 
job and Log on as a service
-The user has permission to read and execute schtasks.exe
-We regenerated passwd and group files
-Command prompts in Windows, running as the specific user, can run schtasks.exe 
without any problem

We are able to successfully call other executables: icacls.exe, robocopy.exe, 
sc.exe and even powershell.exe.

We also tested against another server with Cygwin 2.7.0(0.306/5/3) and got the 
same issue.

Dan


--
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] cygwin: fix potential buffer overflow in fork

2017-10-10 Thread Michael Haubenwallner
On 10/10/2017 02:44 PM, Corinna Vinschen wrote:
> On Oct 10 14:26, Michael Haubenwallner wrote:
>> On 10/10/2017 01:48 PM, Corinna Vinschen wrote:
>>> Hi Michael,
>>>
>>> On Oct  9 18:58, Michael Haubenwallner wrote:
 When fork fails, we can use "%s" now with system_sprintf for the errmsg
 rather than a (potentially too small) buffer for the format string.
>>>
>>> How could buf be too small?
>>
>> See below.
>>
>> Actually I've found this by searching for suspect char array definitions
>> while hunting the "uninitialized variable for RtlLookupFunctionEntry" bug.
>>
 * fork.cc (fork): Use "%s" with system_printf now.
 ---
  winsup/cygwin/fork.cc | 9 ++---
  1 file changed, 2 insertions(+), 7 deletions(-)

 diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
 index 73a72f530..bcbef12d8 100644
 --- a/winsup/cygwin/fork.cc
 +++ b/winsup/cygwin/fork.cc
 @@ -618,13 +618,8 @@ fork ()
if (!grouped.errmsg)
syscall_printf ("fork failed - child pid %d, errno %d", 
 grouped.child_pid, grouped.this_errno);
else
 -  {
 -char buf[strlen (grouped.errmsg) + sizeof ("child %d - , errno 
 4294967295  ")];
>>
>> Usually child_pid is longer than the 2 characters counted by "%d", but
>> errno usually is shorther than the 10 characters counted by "4294967295",
>> and there is another 2 reserved characters counted by trailing "  ".
>>
>> In practice the buffer unlikely will be too small, so this is merely 
>> cosmetics.
> 
> But buf is just the format string.  It won't get manipulated by
> system_printf.  Which means the 4294967295 is nonsense, too, a %d
> would have been sufficient.

Indeed! (out of coffee exception)

Thanks!
/haubi/


Re: [PATCH] cygwin: fix potential buffer overflow in fork

2017-10-10 Thread Corinna Vinschen
On Oct 10 14:44, Corinna Vinschen wrote:
> On Oct 10 14:26, Michael Haubenwallner wrote:
> > But wait, what's the difference between syscall_printf and system_printf?
> 
> Prefixing with timestamps and stuff.

No, wait.  I mixed that up with small_printf.  syscall_printf is printed
in an strace only, while system_printf is printed on the console, too.

I'm not sure what the intention here is, except to distinguish the cases
where frok::error() isn't called when failing, two cases with error()
only called in an `#ifdef DEBUGGING'.

[...time passes...]

Ah, I understand the first case in frok::parent, just not the second one.
But, anyway, let's stick to it.

Patch pushed as is.


Thanks,
Corinna

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


signature.asc
Description: PGP signature


[newlib-cygwin] cygwin: fix potential buffer overflow in fork

2017-10-10 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=1adbd77cab6f60b105c5d8b1a4350161c3ac213d

commit 1adbd77cab6f60b105c5d8b1a4350161c3ac213d
Author: Michael Haubenwallner 
Date:   Mon Oct 9 18:58:24 2017 +0200

cygwin: fix potential buffer overflow in fork

When fork fails, we can use "%s" now with system_sprintf for the errmsg
rather than a (potentially too small) buffer for the format string.

* fork.cc (fork): Use "%s" with system_printf now.

Diff:
---
 winsup/cygwin/fork.cc | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 73a72f5..bcbef12 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -618,13 +618,8 @@ fork ()
   if (!grouped.errmsg)
syscall_printf ("fork failed - child pid %d, errno %d", 
grouped.child_pid, grouped.this_errno);
   else
-   {
- char buf[strlen (grouped.errmsg) + sizeof ("child %d - , errno 
4294967295  ")];
- strcpy (buf, "child %d - ");
- strcat (buf, grouped.errmsg);
- strcat (buf, ", errno %d");
- system_printf (buf, grouped.child_pid, grouped.this_errno);
-   }
+   system_printf ("child %d - %s, errno %d", grouped.child_pid,
+  grouped.errmsg, grouped.this_errno);
 
   set_errno (grouped.this_errno);
 }


Re: [PATCH] cygwin: fix potential buffer overflow in fork

2017-10-10 Thread Corinna Vinschen
On Oct 10 14:26, Michael Haubenwallner wrote:
> On 10/10/2017 01:48 PM, Corinna Vinschen wrote:
> > Hi Michael,
> > 
> > On Oct  9 18:58, Michael Haubenwallner wrote:
> >> When fork fails, we can use "%s" now with system_sprintf for the errmsg
> >> rather than a (potentially too small) buffer for the format string.
> > 
> > How could buf be too small?
> 
> See below.
> 
> Actually I've found this by searching for suspect char array definitions
> while hunting the "uninitialized variable for RtlLookupFunctionEntry" bug.
> 
> >> * fork.cc (fork): Use "%s" with system_printf now.
> >> ---
> >>  winsup/cygwin/fork.cc | 9 ++---
> >>  1 file changed, 2 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
> >> index 73a72f530..bcbef12d8 100644
> >> --- a/winsup/cygwin/fork.cc
> >> +++ b/winsup/cygwin/fork.cc
> >> @@ -618,13 +618,8 @@ fork ()
> >>if (!grouped.errmsg)
> >>syscall_printf ("fork failed - child pid %d, errno %d", 
> >> grouped.child_pid, grouped.this_errno);
> >>else
> >> -  {
> >> -char buf[strlen (grouped.errmsg) + sizeof ("child %d - , errno 
> >> 4294967295  ")];
> 
> Usually child_pid is longer than the 2 characters counted by "%d", but
> errno usually is shorther than the 10 characters counted by "4294967295",
> and there is another 2 reserved characters counted by trailing "  ".
> 
> In practice the buffer unlikely will be too small, so this is merely 
> cosmetics.

But buf is just the format string.  It won't get manipulated by
system_printf.  Which means the 4294967295 is nonsense, too, a %d
would have been sufficient.

> >> -strcpy (buf, "child %d - ");
> >> -strcat (buf, grouped.errmsg);
> >> -strcat (buf, ", errno %d");
> >> -system_printf (buf, grouped.child_pid, grouped.this_errno);
> >> -  }
> >> +  system_printf ("child %d - %s, errno %d", grouped.child_pid,
> >> + grouped.errmsg, grouped.this_errno);
> >>  
> >>set_errno (grouped.this_errno);
> >>  }
> >> -- 
> >> 2.14.2
> > 
> > I guess this also means we can drop the if/else, kind of like
> > 
> >   system_printf ("child %d %s%s, errno %d",
> >  grouped.child_pid,
> >  grouped.errmsg ? "- " : "",
> >  grouped.errmsg ?: "",
> >  grouped.this_errno);
> > 
> > What do you think?
> 
> Nothing I really take care of - yet suggesting:
> 
>   system_printf ("fork failed - child %d%s%s, errno %d",
>grouped.child_pid,
>grouped.errmsg ? " - " : "",
>grouped.errmsg ?: "",
>grouped.this_errno);

Yep.

> But wait, what's the difference between syscall_printf and system_printf?

Prefixing with timestamps and stuff.


Corinna

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


signature.asc
Description: PGP signature


Re: [PATCH] cygwin: fix potential buffer overflow in fork

2017-10-10 Thread Michael Haubenwallner
On 10/10/2017 01:48 PM, Corinna Vinschen wrote:
> Hi Michael,
> 
> On Oct  9 18:58, Michael Haubenwallner wrote:
>> When fork fails, we can use "%s" now with system_sprintf for the errmsg
>> rather than a (potentially too small) buffer for the format string.
> 
> How could buf be too small?

See below.

Actually I've found this by searching for suspect char array definitions
while hunting the "uninitialized variable for RtlLookupFunctionEntry" bug.

>> * fork.cc (fork): Use "%s" with system_printf now.
>> ---
>>  winsup/cygwin/fork.cc | 9 ++---
>>  1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
>> index 73a72f530..bcbef12d8 100644
>> --- a/winsup/cygwin/fork.cc
>> +++ b/winsup/cygwin/fork.cc
>> @@ -618,13 +618,8 @@ fork ()
>>if (!grouped.errmsg)
>>  syscall_printf ("fork failed - child pid %d, errno %d", 
>> grouped.child_pid, grouped.this_errno);
>>else
>> -{
>> -  char buf[strlen (grouped.errmsg) + sizeof ("child %d - , errno 
>> 4294967295  ")];

Usually child_pid is longer than the 2 characters counted by "%d", but
errno usually is shorther than the 10 characters counted by "4294967295",
and there is another 2 reserved characters counted by trailing "  ".

In practice the buffer unlikely will be too small, so this is merely cosmetics.

>> -  strcpy (buf, "child %d - ");
>> -  strcat (buf, grouped.errmsg);
>> -  strcat (buf, ", errno %d");
>> -  system_printf (buf, grouped.child_pid, grouped.this_errno);
>> -}
>> +system_printf ("child %d - %s, errno %d", grouped.child_pid,
>> +   grouped.errmsg, grouped.this_errno);
>>  
>>set_errno (grouped.this_errno);
>>  }
>> -- 
>> 2.14.2
> 
> I guess this also means we can drop the if/else, kind of like
> 
>   system_printf ("child %d %s%s, errno %d",
>grouped.child_pid,
>grouped.errmsg ? "- " : "",
>grouped.errmsg ?: "",
>grouped.this_errno);
> 
> What do you think?

Nothing I really take care of - yet suggesting:

  system_printf ("fork failed - child %d%s%s, errno %d",
 grouped.child_pid,
 grouped.errmsg ? " - " : "",
 grouped.errmsg ?: "",
 grouped.this_errno);

But wait, what's the difference between syscall_printf and system_printf?

/haubi/


Re: Unable to build clickhouse using cygwin on Windows Server 2012

2017-10-10 Thread Marco Atzeri

On 10/10/2017 12:47, Tomas Repik | Instarea wrote:

Hello list,

recently I came across cygwin as a way to run linux software on windows and
I have some issues with getting compilation using gcc. I posted my question
on StackOverflow
,
idealy post your answers there, but mailing it to the list is fine as well.

Thank you

Tomas


TL;DR


I'm trying to build the latest clickhouse release (v1.1.54292-stable) in

cygwin (mintty-2.7.9) on Windows server 2012 (build 9600). I've picked and
installed these additional packages in cygwin:
automake 10-1
automake 1.15.1-1
cmake 3.6.2.-1
gcc 6.3.0-2
g++ 6.3.0-2
gccmakedep 1.0.3.-1
git 2.14.1-2
libboost_system 1.63.0-1
libmcpp-devel 2.7.2-2
libmysqlclient-devel 10.1.26-1
libpcreposix0 8.40-3
libpoco-devel 1.7.9-1
libpoco-49 1.7.9-1
libtool 2.4.6-5
make 4.2.1-2
mcpp 2.7.2-2
poco 1.7.9-1
python3 3.6.1-1
I'm following the official instructions so I ran:
export THREADS=$(grep -c ^processor /proc/cpuinfo)
export CC=gcc
export CXX=g++
export CMAKE_LEGACY_CYGWIN_WIN32=1


that is bad. You can not compile a package
with that set and using the cygwin headers.




--
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] cygwin: fix potential buffer overflow in small_sprintf

2017-10-10 Thread Corinna Vinschen
On Oct  9 18:57, Michael Haubenwallner wrote:
> With "%C" format string, argument may convert in up to MB_LEN_MAX bytes.
> Relying on sys_wcstombs to add a trailing zero here requires us to
> provide a large enough buffer.
> 
> * smallprint.c (__small_vsprintf): Use MB_LEN_MAX+1 bufsize for "%C".
> ---
>  winsup/cygwin/smallprint.cc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc
> index 3cec31cce..8553f7002 100644
> --- a/winsup/cygwin/smallprint.cc
> +++ b/winsup/cygwin/smallprint.cc
> @@ -193,8 +193,8 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
>   case 'C':
> {
>   WCHAR wc = (WCHAR) va_arg (ap, int);
> - char buf[4], *c;
> - sys_wcstombs (buf, 4, , 1);
> + char buf[MB_LEN_MAX+1] = "", *c;
> + sys_wcstombs (buf, MB_LEN_MAX+1, , 1);
>   for (c = buf; *c; ++c)
> *dst++ = *c;
> }
> -- 
> 2.14.2

Pushed.


Thanks,
Corinna

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


signature.asc
Description: PGP signature


Re: [PATCH] cygwin: fix potential buffer overflow in fork

2017-10-10 Thread Corinna Vinschen
Hi Michael,

On Oct  9 18:58, Michael Haubenwallner wrote:
> When fork fails, we can use "%s" now with system_sprintf for the errmsg
> rather than a (potentially too small) buffer for the format string.

How could buf be too small?

> 
> * fork.cc (fork): Use "%s" with system_printf now.
> ---
>  winsup/cygwin/fork.cc | 9 ++---
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
> index 73a72f530..bcbef12d8 100644
> --- a/winsup/cygwin/fork.cc
> +++ b/winsup/cygwin/fork.cc
> @@ -618,13 +618,8 @@ fork ()
>if (!grouped.errmsg)
>   syscall_printf ("fork failed - child pid %d, errno %d", 
> grouped.child_pid, grouped.this_errno);
>else
> - {
> -   char buf[strlen (grouped.errmsg) + sizeof ("child %d - , errno 
> 4294967295  ")];
> -   strcpy (buf, "child %d - ");
> -   strcat (buf, grouped.errmsg);
> -   strcat (buf, ", errno %d");
> -   system_printf (buf, grouped.child_pid, grouped.this_errno);
> - }
> + system_printf ("child %d - %s, errno %d", grouped.child_pid,
> +grouped.errmsg, grouped.this_errno);
>  
>set_errno (grouped.this_errno);
>  }
> -- 
> 2.14.2

I guess this also means we can drop the if/else, kind of like

  system_printf ("child %d %s%s, errno %d",
 grouped.child_pid,
 grouped.errmsg ? "- " : "",
 grouped.errmsg ?: "",
 grouped.this_errno);

What do you think?


Thanks,
Corinna

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


signature.asc
Description: PGP signature


[newlib-cygwin] cygwin: fix potential buffer overflow in small_sprintf

2017-10-10 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=44499712954d7450262da9db4ee4219e40b1aaac

commit 44499712954d7450262da9db4ee4219e40b1aaac
Author: Michael Haubenwallner 
Date:   Mon Oct 9 18:57:58 2017 +0200

cygwin: fix potential buffer overflow in small_sprintf

With "%C" format string, argument may convert in up to MB_LEN_MAX bytes.
Relying on sys_wcstombs to add a trailing zero here requires us to
provide a large enough buffer.

* smallprint.c (__small_vsprintf): Use MB_LEN_MAX+1 bufsize for "%C".

Diff:
---
 winsup/cygwin/smallprint.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc
index 3cec31c..8553f70 100644
--- a/winsup/cygwin/smallprint.cc
+++ b/winsup/cygwin/smallprint.cc
@@ -193,8 +193,8 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
case 'C':
  {
WCHAR wc = (WCHAR) va_arg (ap, int);
-   char buf[4], *c;
-   sys_wcstombs (buf, 4, , 1);
+   char buf[MB_LEN_MAX+1] = "", *c;
+   sys_wcstombs (buf, MB_LEN_MAX+1, , 1);
for (c = buf; *c; ++c)
  *dst++ = *c;
  }


Unable to build clickhouse using cygwin on Windows Server 2012

2017-10-10 Thread Tomas Repik | Instarea
Hello list,

recently I came across cygwin as a way to run linux software on windows and
I have some issues with getting compilation using gcc. I posted my question
on StackOverflow
,
idealy post your answers there, but mailing it to the list is fine as well.

Thank you

Tomas

> TL;DR

I'm trying to build the latest clickhouse release (v1.1.54292-stable) in
> cygwin (mintty-2.7.9) on Windows server 2012 (build 9600). I've picked and
> installed these additional packages in cygwin:
> automake 10-1
> automake 1.15.1-1
> cmake 3.6.2.-1
> gcc 6.3.0-2
> g++ 6.3.0-2
> gccmakedep 1.0.3.-1
> git 2.14.1-2
> libboost_system 1.63.0-1
> libmcpp-devel 2.7.2-2
> libmysqlclient-devel 10.1.26-1
> libpcreposix0 8.40-3
> libpoco-devel 1.7.9-1
> libpoco-49 1.7.9-1
> libtool 2.4.6-5
> make 4.2.1-2
> mcpp 2.7.2-2
> poco 1.7.9-1
> python3 3.6.1-1
> I'm following the official instructions so I ran:
> export THREADS=$(grep -c ^processor /proc/cpuinfo)
> export CC=gcc
> export CXX=g++
> export CMAKE_LEGACY_CYGWIN_WIN32=1
> mkdir build
> cd build
> cmake ..
> make -j $THREADS
> The compilation error I'm getting is this:
> In function ‘CityHash_v1_0_2::uint128 CityHash_v1_0_2::CityMurmur(const
> char*, size_t, CityHash_v1_0_2::uint128)’:
> /home/user/ClickHouse/contrib/libcityhash/src/city.cc:261:3:
> error: ‘ssize_t’ was not declared in this scope
> ssize_t l = len - 16;
> If I grep the /usr/include/sys/types.h for ssize_t it's properly defined
> there, but for some reason the compiler can't find it.
>

--
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: OpenSSH-7.6p1-1

2017-10-10 Thread Corinna Vinschen
I've just updated the Cygwin version of OpenSSH to 7.6p1-1.

This is primarily an upstream bugfix release.

This release for Cygwin already contains the post-release fix mentioned in
https://lists.mindrot.org/pipermail/openssh-unix-dev/2017-October/036307.html

The original upstream release message:

=

OpenSSH 7.6 has just been released. It will be available from the
mirrors listed at http://www.openssh.com/ shortly.

OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.

Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested snapshots or donated to the
project. More information on donations may be found at:
http://www.openssh.com/donations.html

Potentially-incompatible changes


This release includes a number of changes that may affect existing
configurations:

 * ssh(1): delete SSH protocol version 1 support, associated
   configuration options and documentation.

 * ssh(1)/sshd(8): remove support for the hmac-ripemd160 MAC.

 * ssh(1)/sshd(8): remove support for the arcfour, blowfish and CAST
   ciphers.

 * Refuse RSA keys <1024 bits in length and improve reporting for keys
   that do not meet this requirement.

 * ssh(1): do not offer CBC ciphers by default.

Changes since OpenSSH 7.5
=

This is primarily a bugfix release. It also contains substantial
internal refactoring.

Security


 * sftp-server(8): in read-only mode, sftp-server was incorrectly
   permitting creation of zero-length files. Reported by Michal
   Zalewski.

New Features


 * ssh(1): add RemoteCommand option to specify a command in the ssh
   config file instead of giving it on the client's command line. This
   allows the configuration file to specify the command that will be
   executed on the remote host.

 * sshd(8): add ExposeAuthInfo option that enables writing details of
   the authentication methods used (including public keys where
   applicable) to a file that is exposed via a $SSH_USER_AUTH
   environment variable in the subsequent session.

 * ssh(1): add support for reverse dynamic forwarding. In this mode,
   ssh will act as a SOCKS4/5 proxy and forward connections
   to destinations requested by the remote SOCKS client. This mode
   is requested using extended syntax for the -R and RemoteForward
   options and, because it is implemented solely at the client,
   does not require the server be updated to be supported.

 * sshd(8): allow LogLevel directive in sshd_config Match blocks;
   bz#2717

 * ssh-keygen(1): allow inclusion of arbitrary string or flag
   certificate extensions and critical options.

 * ssh-keygen(1): allow ssh-keygen to use a key held in ssh-agent as
   a CA when signing certificates. bz#2377

 * ssh(1)/sshd(8): allow IPQoS=none in ssh/sshd to not set an explicit
   ToS/DSCP value and just use the operating system default.

 * ssh-add(1): added -q option to make ssh-add quiet on success.

 * ssh(1): expand the StrictHostKeyChecking option with two new
   settings. The first "accept-new" will automatically accept
   hitherto-unseen keys but will refuse connections for changed or
   invalid hostkeys. This is a safer subset of the current behaviour
   of StrictHostKeyChecking=no. The second setting "off", is a synonym
   for the current behaviour of StrictHostKeyChecking=no: accept new
   host keys, and continue connection for hosts with incorrect
   hostkeys. A future release will change the meaning of
   StrictHostKeyChecking=no to the behaviour of "accept-new". bz#2400

 * ssh(1): add SyslogFacility option to ssh(1) matching the equivalent
   option in sshd(8). bz#2705

Bugfixes


 * ssh(1): use HostKeyAlias if specified instead of hostname for
   matching host certificate principal names; bz#2728

 * sftp(1): implement sorting for globbed ls; bz#2649

 * ssh(1): add a user@host prefix to client's "Permission denied"
   messages, useful in particular when using "stacked" connections
   (e.g. ssh -J) where it's not clear which host is denying. bz#2720

 * ssh(1): accept unknown EXT_INFO extension values that contain \0
   characters. These are legal, but would previously cause fatal
   connection errors if received.

 * ssh(1)/sshd(8): repair compression statistics printed at
   connection exit

 * sftp(1): print '?' instead of incorrect link count (that the
   protocol doesn't provide) for remote listings. bz#2710

 * ssh(1): return failure rather than fatal() for more cases during
   session multiplexing negotiations. Causes the session to fall back
   to a non-mux connection if they occur. bz#2707

 * ssh(1): mention that the server may send debug messages to explain
   public key authentication problems under some circumstances; bz#2709

 * Translate OpenSSL error codes to 

Updated: OpenSSH-7.6p1-1

2017-10-10 Thread Corinna Vinschen
I've just updated the Cygwin version of OpenSSH to 7.6p1-1.

This is primarily an upstream bugfix release.

This release for Cygwin already contains the post-release fix mentioned in
https://lists.mindrot.org/pipermail/openssh-unix-dev/2017-October/036307.html

The original upstream release message:

=

OpenSSH 7.6 has just been released. It will be available from the
mirrors listed at http://www.openssh.com/ shortly.

OpenSSH is a 100% complete SSH protocol 2.0 implementation and
includes sftp client and server support.

Once again, we would like to thank the OpenSSH community for their
continued support of the project, especially those who contributed
code or patches, reported bugs, tested snapshots or donated to the
project. More information on donations may be found at:
http://www.openssh.com/donations.html

Potentially-incompatible changes


This release includes a number of changes that may affect existing
configurations:

 * ssh(1): delete SSH protocol version 1 support, associated
   configuration options and documentation.

 * ssh(1)/sshd(8): remove support for the hmac-ripemd160 MAC.

 * ssh(1)/sshd(8): remove support for the arcfour, blowfish and CAST
   ciphers.

 * Refuse RSA keys <1024 bits in length and improve reporting for keys
   that do not meet this requirement.

 * ssh(1): do not offer CBC ciphers by default.

Changes since OpenSSH 7.5
=

This is primarily a bugfix release. It also contains substantial
internal refactoring.

Security


 * sftp-server(8): in read-only mode, sftp-server was incorrectly
   permitting creation of zero-length files. Reported by Michal
   Zalewski.

New Features


 * ssh(1): add RemoteCommand option to specify a command in the ssh
   config file instead of giving it on the client's command line. This
   allows the configuration file to specify the command that will be
   executed on the remote host.

 * sshd(8): add ExposeAuthInfo option that enables writing details of
   the authentication methods used (including public keys where
   applicable) to a file that is exposed via a $SSH_USER_AUTH
   environment variable in the subsequent session.

 * ssh(1): add support for reverse dynamic forwarding. In this mode,
   ssh will act as a SOCKS4/5 proxy and forward connections
   to destinations requested by the remote SOCKS client. This mode
   is requested using extended syntax for the -R and RemoteForward
   options and, because it is implemented solely at the client,
   does not require the server be updated to be supported.

 * sshd(8): allow LogLevel directive in sshd_config Match blocks;
   bz#2717

 * ssh-keygen(1): allow inclusion of arbitrary string or flag
   certificate extensions and critical options.

 * ssh-keygen(1): allow ssh-keygen to use a key held in ssh-agent as
   a CA when signing certificates. bz#2377

 * ssh(1)/sshd(8): allow IPQoS=none in ssh/sshd to not set an explicit
   ToS/DSCP value and just use the operating system default.

 * ssh-add(1): added -q option to make ssh-add quiet on success.

 * ssh(1): expand the StrictHostKeyChecking option with two new
   settings. The first "accept-new" will automatically accept
   hitherto-unseen keys but will refuse connections for changed or
   invalid hostkeys. This is a safer subset of the current behaviour
   of StrictHostKeyChecking=no. The second setting "off", is a synonym
   for the current behaviour of StrictHostKeyChecking=no: accept new
   host keys, and continue connection for hosts with incorrect
   hostkeys. A future release will change the meaning of
   StrictHostKeyChecking=no to the behaviour of "accept-new". bz#2400

 * ssh(1): add SyslogFacility option to ssh(1) matching the equivalent
   option in sshd(8). bz#2705

Bugfixes


 * ssh(1): use HostKeyAlias if specified instead of hostname for
   matching host certificate principal names; bz#2728

 * sftp(1): implement sorting for globbed ls; bz#2649

 * ssh(1): add a user@host prefix to client's "Permission denied"
   messages, useful in particular when using "stacked" connections
   (e.g. ssh -J) where it's not clear which host is denying. bz#2720

 * ssh(1): accept unknown EXT_INFO extension values that contain \0
   characters. These are legal, but would previously cause fatal
   connection errors if received.

 * ssh(1)/sshd(8): repair compression statistics printed at
   connection exit

 * sftp(1): print '?' instead of incorrect link count (that the
   protocol doesn't provide) for remote listings. bz#2710

 * ssh(1): return failure rather than fatal() for more cases during
   session multiplexing negotiations. Causes the session to fall back
   to a non-mux connection if they occur. bz#2707

 * ssh(1): mention that the server may send debug messages to explain
   public key authentication problems under some circumstances; bz#2709

 * Translate OpenSSL error codes to 

Re: SIGIO using UDP sockets just hangs (permantely blocks) socket I/O.

2017-10-10 Thread Corinna Vinschen
On Sep 30 11:50, tvonderhaar wrote:
> Dear cygwin_list,
> 
> I have tried to get signals working with UDP bound sockets. I have
> tried every combination and order of the included code, but once I
> ioctl() the socket with "FIOASYNC" I get one signal from the socket and
> the previously "FNDELAY" set socket blocks forever on a call to
> recvfrom(). I can detect the block with a select, but it never becomes
> ready. This code works flawlessly on Linux and in the past worked on
> SUN,HP- UX(I remove the HP specific code) and Alpha OSes. If I don't
> perform the ioctl() with "FIOASYNC" or perform a second call to ioctl()
> with the "set_state=0" the socket does not block as expected, but I of
> course I don't get my SIGIO signal. Note: I make the call to the
> function as follows:
> 
>set_io_async(udp_socket_fd,call_back,SIGIO,FALSE);
>   /*FASLE defined as '0' and SIGIO as defined by CYGWIN.*/
> 
>  I only found one google search of an individual attempting non-blocking
> asynchronous() I/O and they indicated it worked using this code sequence
> under CYGWIN. "FASYNC" has no affect on CYGWIN using fcntl() as after

FASYNC/O_ASYNC is not supported at all by Cygwin and never was.
Signal-driven IO was never very high on the wishlist, so it wasn't fully
implemented.  What about using select from another thread instead?


Corinna

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


signature.asc
Description: PGP signature


Re: setup stuck on cygwin.ldif

2017-10-10 Thread Shaddy Baddah

Hi,

On 10/10/17 17:59, Shaddy Baddah wrote:

Hi,

On 09/10/17 04:16, Brian Inglis wrote:

On 2017-10-08 07:46, Shaddy Baddah wrote:

I have a weird problem happening... so I have tried to update a 64-bit
Cygwin installation on Windows 10 Pro. I closed all Cygwin processes,
and a ps -ef is showing only the ps process itself.
In anycase, during the install I was prompted that the file
/usr/share/cygwin/cygwin.ldif was busy.
I ran Process Explorer and searched for what might have the file open.
I couldn't find anything. I clicked retry a number of times, but it
wouldn't yield. Finally, I clicked continue. And now I'm stuck in this
endless loop on the file:
https://imgur.com/Nj35Y3T
It's a animated gif, so you may have to select play in your browser. Not
much to see, except the constant attempt to install the cygwin.ldif
file.
Any ideas here? I guess I'll have to kill setup... but I fear that it
will play havoc with my install :-(


Have you tried Windows cmd OPENFILES /Query ?



So I tried to "Reinstall" all, and now the problem has shifted. Every
attempt to reinstall stops with "Unable to extract
/etc/defaults/etc/pki/ca-trust/ca-legacy.conf". "The file is in use or
some other error occurred.".

Retry doesn't help. openfiles doesn't reveal anything:

https://imgur.com/a/XV1YQ

Having enhanced setup.exe at one point, and accordingly debugged it,
I'll try and see if I can turn up the logging, see what is going on
exactly. I actually don't know where setup.log/setup.log.full is going
to at the moment.


OK, I understand the logging only gets written when setup exits. So here
is what I am seeing:

Installing file cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf
2017/10/10 18:09:58 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf) failed 13 
Permission denied
2017/10/10 18:09:58 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf for writing.


There is nothing in the target folder. icacls of ca-trust shows:

portapps@AVANT-W10 F:\portapps-sw\cygwin\etc\defaults\etc\pki
> icacls ca-trust
ca-trust AVANT-W10\portapps:(F)
 AVANT-W10\None:(RX)
 Everyone:(RX)
 CREATOR OWNER:(OI)(CI)(IO)(F)
 CREATOR GROUP:(OI)(CI)(IO)(RX)
 Everyone:(OI)(CI)(IO)(RX)

Successfully processed 1 files; Failed processing 0 files

A retry, just repeats of course:

2017/10/10 18:13:08 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf) failed 13 
Permission denied
2017/10/10 18:13:08 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf for writing.


Then if you click continue, you get an endless loop that takes up
all your CPU:

2017/10/10 18:13:11 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new) failed 13 
Permission denied
2017/10/10 18:13:11 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new for writing.
2017/10/10 18:13:11 Unable to install file 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new

Installing file cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf
2017/10/10 18:13:11 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf) failed 13 
Permission denied
2017/10/10 18:13:11 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf for writing.
2017/10/10 18:13:11 io_stream_cygfile: 
fopen(/etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new) failed 13 
Permission denied
2017/10/10 18:13:11 Failed to open 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new for writing.
2017/10/10 18:13:11 Unable to install file 
cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf.new

Installing file cygfile:///etc/defaults/etc/pki/ca-trust/ca-legacy.conf


With regards to the permission problem... I am almost certain this is
going to be an issue related to recent Cygwin acl changes... but I am
in no position to verify this at the moment.

--
Regards,
Shaddy







--
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 stuck on cygwin.ldif

2017-10-10 Thread Shaddy Baddah

Hi,

On 09/10/17 04:16, Brian Inglis wrote:

On 2017-10-08 07:46, Shaddy Baddah wrote:

I have a weird problem happening... so I have tried to update a 64-bit
Cygwin installation on Windows 10 Pro. I closed all Cygwin processes,
and a ps -ef is showing only the ps process itself.
In anycase, during the install I was prompted that the file
/usr/share/cygwin/cygwin.ldif was busy.
I ran Process Explorer and searched for what might have the file open.
I couldn't find anything. I clicked retry a number of times, but it
wouldn't yield. Finally, I clicked continue. And now I'm stuck in this
endless loop on the file:
https://imgur.com/Nj35Y3T
It's a animated gif, so you may have to select play in your browser. Not
much to see, except the constant attempt to install the cygwin.ldif
file.
Any ideas here? I guess I'll have to kill setup... but I fear that it
will play havoc with my install :-(


Have you tried Windows cmd OPENFILES /Query ?



So I tried to "Reinstall" all, and now the problem has shifted. Every
attempt to reinstall stops with "Unable to extract
/etc/defaults/etc/pki/ca-trust/ca-legacy.conf". "The file is in use or
some other error occurred.".

Retry doesn't help. openfiles doesn't reveal anything:

https://imgur.com/a/XV1YQ

Having enhanced setup.exe at one point, and accordingly debugged it,
I'll try and see if I can turn up the logging, see what is going on
exactly. I actually don't know where setup.log/setup.log.full is going
to at the moment.

--
Regards,
Shaddy

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