Cygwin-X shortcut no longer works after recent updates

2020-02-27 Thread Brian Inglis
Hi folks,

After the recent upgrades to cygwin 3.1.4, perl, etc. I have found that the
Cygwin-X Startup, Start Menu, and Task Bar shortcuts no longer work, although I
can start Cygwin-X by running startxwin from a mintty window.

>From the shortcut, the shell is invoked to run startxwin normally, two copies 
>of
xinit fork, and Xwin runs and displays the start tray Xserver icon, but my
mintty terminal and the xwin-xdg-menu clients don't start.

On exiting the X server, the processes are left running and have to be killed 
off.
There are sockets and lock files, which are left around after termination:
$ llgo /tmp/.X11-unix/X0*
srw-rw-rw- 1 0 Feb 27 23:11 /tmp/.X11-unix/X0=
-rw--- 1 0 Feb 27 23:11 /tmp/.X11-unix/X0.lock

The server log /var/log/xwin/XWin.0.log looks normal, and nothing shows in
~/.xsession-errors.

My .startxwinrc is a copy of /etc/X11/xinit/startxwinrc with addition of the
minnty terminal startup in bg before leaving xwin-xdg-menu running in fg.

The shortcut and processes when started normally look like:

C:\...\cygwin64\bin\run.exe --quote /bin/sh -l -c "cd; exec /usr/bin/startxwin"
/bin/sh /usr/bin/startxwin
\_ xinit /home/$USER/.startxwinrc -- /usr/bin/XWin ... [as below]
   \_ /usr/bin/XWin :0 -multiwindow -auth /home/$USER/.serverauth.$PGID

I have checked the man pages and the Cygwin-X docs for hints about things to
check and try with little success.

Hints and suggestions about possible problems and problem solving approaches
would be appreciated.

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

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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: OpenSSH: SSHD daemon (as SYSTEM) is partially broken

2020-02-27 Thread TestUser1
So is this expected to work fine in my environment, Windows Server 2016 (OS
Version 10.0.14393), without the workaround?

Thanks!



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
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: [ANN] Cygwin-OpenSSH 8.2.2.2

2020-02-27 Thread Brian Inglis
On 2020-02-27 12:36, Bill Stewart wrote:
> On Thu, Feb 27, 2020 at 11:52 AM Achim Gratz wrote:
> But more to the point: since you include GPL components, a binary-only
>> distribution is not OK.  The sources for at least the GPL licensed
>> utilities and libraries is missing.  It's not enough to say what these
>> are and roughly where to get them and leave the users with figuring it
>> out for themselves, you are supposed to provide sources in the same way
>> as your binaries, for the exact version you used to create the binaries,
>> including any modifications to the build system or the sources
>> themselves.

> I misunderstood, since the source is already freely available from cygwin
> and I am not changing any of the binaries.
> 
> I can certainly include the source as a component in the installer for the
> next version.

No, you must backport all sources to the current and all previous versions and
redistribute, or at least make them visible and available on your site,
otherwise you are in breach of the licence and must withdraw all distributions -
see:

https://www.fsf.org/licensing

and you may consult them for more accurate and complete information.

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

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
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] Properly encapsulate multi-statement macro.

2020-02-27 Thread Brian Inglis
On 2020-02-27 12:47, Hans-Bernhard Bröker wrote:
> 
>  winsup/cygwin/fhandler_console.cc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/winsup/cygwin/fhandler_console.cc 
> b/winsup/cygwin/fhandler_console.cc
> index 4ab9bcab8..353abd197 100644
> --- a/winsup/cygwin/fhandler_console.cc
> +++ b/winsup/cygwin/fhandler_console.cc
> @@ -63,10 +63,11 @@ static struct fhandler_base::rabuf_t con_ra;
>  static unsigned char wpbuf[WPBUF_LEN];
>  static int wpixput;
>  static unsigned char last_char;
> -#define wpbuf_put(x) \
> +#define wpbuf_put(x) do { \

Please split to avoid eye bleed:

  +#define wpbuf_put(x) \
  +do { \
>    wpbuf[wpixput++] = x; \
>    if (wpixput > WPBUF_LEN) \
> -    wpixput--;
> +    wpixput--; \
> +} while(0)
> 
>  static void
>  beep ()

and post to cygwin-patches?

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

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

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



Incorrect behavior in TIOCINQ ioctl

2020-02-27 Thread Åke Rehnman

Hi,

I recently ran in to some troubles with the TIOCINQ ioctl. I am 
wondering if the cygwin implementation is correct... It seems if there 
were any existing framing overrun errors etc etc  before calling the 
TIOCINQ ioctl it is returning an error (EINVAL). Reading through linux 
implmentation of TIOCINQ does simply return number of pending chars 
without any clearing or checking for errors.


I suggest the whole if (ev & CE_FRAME  .. ) is removed.

Excerpt from fhandler_serial.cc:

/* ioctl: */
int
fhandler_serial::ioctl (unsigned int cmd, void *buf)
{
.
.
  if (!ClearCommError (get_handle (), &ev, &st))
    {
  __seterrno ();
  res = -1;
    }
.
.
.
 case TIOCINQ:
   if (ev & CE_FRAME || ev & CE_IOE || ev & CE_OVERRUN || ev & 
CE_RXOVER

       || ev & CE_RXPARITY)
     {
       set_errno (EINVAL);    /* FIXME: Use correct errno */
       res = -1;
     }
 else
        ipbuf = st.cbInQue;
 break;



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



[PATCH] Properly encapsulate multi-statement macro.

2020-02-27 Thread Hans-Bernhard Bröker



 winsup/cygwin/fhandler_console.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc

index 4ab9bcab8..353abd197 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -63,10 +63,11 @@ static struct fhandler_base::rabuf_t con_ra;
 static unsigned char wpbuf[WPBUF_LEN];
 static int wpixput;
 static unsigned char last_char;
-#define wpbuf_put(x) \
+#define wpbuf_put(x) do { \
   wpbuf[wpixput++] = x; \
   if (wpixput > WPBUF_LEN) \
-wpixput--;
+wpixput--; \
+} while(0)

 static void
 beep ()
--
2.21.0



--
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: [ANN] Cygwin-OpenSSH 8.2.2.2

2020-02-27 Thread Bill Stewart
On Thu, Feb 27, 2020 at 11:52 AM Achim Gratz wrote:

But more to the point: since you include GPL components, a binary-only
> distribution is not OK.  The sources for at least the GPL licensed
> utilities and libraries is missing.  It's not enough to say what these
> are and roughly where to get them and leave the users with figuring it
> out for themselves, you are supposed to provide sources in the same way
> as your binaries, for the exact version you used to create the binaries,
> including any modifications to the build system or the sources
> themselves.
>

I misunderstood, since the source is already freely available from cygwin
and I am not changing any of the binaries.

I can certainly include the source as a component in the installer for the
next version.

Bill

--
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: OpenSSH: SSHD daemon (as SYSTEM) is partially broken

2020-02-27 Thread Bill Stewart
On Thu, Feb 27, 2020 at 11:09 AM n0nc3  wrote:

It appears Cygwin SSHD's functionality is partially broke in the later
> versions, where SSHD runs as SYSTEM (no longer cyg_server).
>
> On reboot, any attempt to SSH into the server *before* any previous logon
> attempt (RDP/locally/etc) is quickly denied:
>
>debug1: Offering public key: /home//.ssh/id_rsa
>debug3: send_pubkey_test
>debug2: we sent a publickey packet, wait for reply
>Connection closed by 
>
> Once an RDP/local login is attempted, regardless of success/failure,
> subsequent ssh attempts will progress to the password prompt which
> eventually gets us in.
>

This is a known issue on OS versions older than 8.1.

See thread starting with this message:

https://cygwin.com/ml/cygwin/2019-03/msg00087.html

My proposed workaround is this:

https://cygwin.com/ml/cygwin/2019-03/msg00113.html

Bill

--
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: [ANN] Cygwin-OpenSSH 8.2.2.2

2020-02-27 Thread Achim Gratz
Bill Stewart writes:
> The relevant licenses are provided as links in the installer and referenced
> in the User's Guide.

They are incomplete as they do not include the libraries you depend on.

But more to the point: since you include GPL components, a binary-only
distribution is not OK.  The sources for at least the GPL licensed
utilities and libraries is missing.  It's not enough to say what these
are and roughly where to get them and leave the users with figuring it
out for themselves, you are supposed to provide sources in the same way
as your binaries, for the exact version you used to create the binaries,
including any modifications to the build system or the sources
themselves.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

--
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: [ANN] Cygwin-OpenSSH 8.2.2.2

2020-02-27 Thread Henry S. Thompson
Bill Stewart writes:

> On Wed, Feb 26, 2020 at 11:47 PM ASSI wrote:
>
> You will perhaps want to read the Cygwin licensing terms
>> plus the licensing terms of each of the packages you distribute.
>>
>
> The relevant licenses are provided as links in the installer and referenced
> in the User's Guide.

What I believe everyone is being too polite to say explicitly is that
you have not conformed to Cygwin's license terms [1] yourself:

   What are the licensing terms?

   Most of the tools are covered by the GNU GPL, some are public domain,
   and others have a X11 style license. To cover the GNU GPL
   requirements, the basic rule is if you give out any binaries, you
   must also make the source available. For the full details, be sure to
   read the text of the GNU General Public License (GPL).

   The Cygwin™ API library found in the winsup subdirectory of the
   source code is covered by the GNU Lesser General Public License
   (LGPL) version 3 or later. For details of the requirements of LGPLv3,
   please read the GNU Lesser General Public License (LGPL).

I have tried pretty hard to find the Cygwin and OpenSSH sources in your
distro and cannot find them...

It seems likely that you're trying to do a good thing here, although in
general pointing people to the Cygwin site with instructions allows a
much better user experience than giving them a package which depends on
a 3rd party (you) for updates.  But you should play by the rules,
please.

ht

[1] https://cygwin.com/licensing.html
-- 
   Henry S. Thompson, School of Informatics, University of Edinburgh
  10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: h...@inf.ed.ac.uk
   URL: http://www.ltg.ed.ac.uk/~ht/
 [mail from me _always_ has a .sig like this -- mail without it is forged spam]

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


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



OpenSSH: SSHD daemon (as SYSTEM) is partially broken

2020-02-27 Thread n0nc3


It appears Cygwin SSHD's functionality is partially broke in the later
versions, where SSHD runs as SYSTEM (no longer cyg_server).

On reboot, any attempt to SSH into the server *before* any previous logon
attempt (RDP/locally/etc) is quickly denied:

   debug1: Offering public key: /home//.ssh/id_rsa
   debug3: send_pubkey_test
   debug2: we sent a publickey packet, wait for reply
   Connection closed by 
   
Once an RDP/local login is attempted, regardless of success/failure,
subsequent ssh attempts will progress to the password prompt which
eventually gets us in.

The Event Viewer shows the attached error message, relating to a NULL SID
and 0xC0BB status.
ssh_as_first_login.txt
  

It was a rather vanilla 'ssh-host-config' run to get it installed: strict
modes = no, no special ssh_/sshd_config settings at this point.

Running latest cygwin packages on Windows Server 2016 Standard:
CYGWIN_NT-10.0  3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin
...
openssh  8.2p1-1OK



--
Sent from: http://cygwin.1069669.n5.nabble.com/Cygwin-list-f3.html

--
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: Mingw pkg-config not working

2020-02-27 Thread Carlo B.
Hello,
I wanted to say that I modified the script in this way and it seems
that it has resolved all issues:

#!/bin/sh
if [ "$#" -eq 1 ] && [ "$1" == "--version" ]; then
exec pkgconf --version
else
exec pkgconf --personality=i686-w64-mingw32 $@
fi

Fixing x64_64 is easy, I have just replaced i686-w64-mingw32 with
x86_64-w64-mingw32 in the personality.
I hope you will find this fix useful and, if you think it is good, the
maintainer of the package could rewrite those scripts in the same way.

Sincerely.

Il giorno sab 22 feb 2020 alle ore 18:47 Jon Turney
 ha scritto:
>
> On 20/02/2020 11:06, Carlo B. wrote:
> [...]
> > x86_64-w64-mingw32-pkg-config are emulated with a shell script, for
> > example the one for i686 is:
> >
> > #!/bin/sh
> > exec pkgconf --personality=i686-w64-mingw32 $@
> >
> > But while this solution mostly works when you exec it from the command
> > line, it makes impossible to detect the presence of the tool from
> > meson and cmake build systems.
> > If you try to do this on the bash prompt, you get:
> >
> > $ i686-w64-mingw32-pkg-config --version
> > pkgconf: --version specified with other options or module names,
> > assuming --modversion.
> > Please specify at least one package name on the command line.
> >
> > and this is exactly what happens with those build systems (and perhaps
> > others, I don't know): it tries to call pkg-config with "--version"
> > and it executes the above script that calls pkgconf. But sadly, the
> > presence of the "--personality" option makes the process to fail,
> > because the "--version" is currently allowed only when no other
> > options are added.
> > And, for this reason, meson and cmake fail the detection of the tool.
> >
> > I have also filed an issue here for pkgconf:
> > https://todo.sr.ht/~kaniini/pkgconf/10
> > because the solution is actually to ignore the presence of the
> > "--personality" option when the "--version" is written, but
> > unfortunately I have not received any feedback.
> >
> > So, I'm also writing here, with the hope that you could find a solution.
> [...]
>
> Thanks for reporting this issue.
>
> I guess the alternative to fixing pkgconf would be to modify those
> wrapper scripts to detect when the parameters are just '--version' (or
> equivalent) and not use --personality in that case?
>
> These wrapper scripts are specific to cygwin (generated by the cygport,
> see [1])
>
> It's possible other distros have more sophisticated wrapper scripts,
> which avoid this problem?
>
> If you do write or discover some improved wrapper scripts, a patch to
> [1] to update them would be appreciated.
>
> [1]
> https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/pkgconf.git;a=blob;f=pkgconf.cygport#l84

--
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: [ANN] Cygwin-OpenSSH 8.2.2.2

2020-02-27 Thread Bill Stewart
On Wed, Feb 26, 2020 at 11:47 PM ASSI wrote:

You will perhaps want to read the Cygwin licensing terms
> plus the licensing terms of each of the packages you distribute.
>

The relevant licenses are provided as links in the installer and referenced
in the User's Guide.

Bill

--
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: cygwin licensing question

2020-02-27 Thread MrPmghost .
Hi,

Thanks for all your feedback regarding this license subject. We will follow
your advice and ask a lawyer specialist in the matter.

Pierre

Le mer. 26 févr. 2020 à 17:37, MrPmghost .  a écrit :

> Hi,
>
>
>
> I am Pierre Meignen, software developer working for a belgium company.
>
> I have a question regarding cygwin and its use.
>
> Is it allowed/legal to integrate cygwin installer (2.11.1(0.329/5/3)) into
> the installer of an application that we plan to distribute commercially?
>
> I have checked the past cygwin posts but I did not see any clear answer to
> my question.
>
> I know how to handle source code in LGPL but I have difficulty to
> understand what I can do with cygwin (LGPL) but which also contains tools
> covered by the GNU GPL and so on.
>
>
>
> We have customized cygwin installer in order to install locally the
> necessary packages.
>
> Once in its execution, our application launches cygwin.bat and launch
> commands to upload embedded systems.
>
> We do not link towards cygwin.dll.
>
> We currently use the application internally but we plan to distribute it
> commerically in the future.
>
>
>
> Thanks in advance for your support/feedback,
>
> BR,
>
> Pierre Meignen
>

--
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: cygwin licensing question

2020-02-27 Thread Corinna Vinschen
On Feb 26 16:37, William Deegan wrote:
> I'd also take a look at this:
> https://cygwin.com/licensing.html

https://cygwin.com/acronyms/#IANAL

I can't speak for any package in the distro apart from the setup tool
and the Cygwin package and its accompanying Cygwin-specific tools (the
"cygwin" package), but in terms of setup and the cygwin package, just
provide the sources of these packages together with your binaries.

If your way of distribution is a tweaked version of setup, you MUST
provide the tweaked sources to your customers per the GPL anyway.

If you provide all sources of all binaries you're delivering to your
customers, you're basically off the hook anyway.  Given that space and
bandwidth is not much of a burden these days, it's the easiest way to
comply with the idea of open source and their licenses.  The setup
tool is designed for source distribution anyway, so that's no problem
at all.

Apart from that, Brian is right.  You should really ask a lawyer who's
specialized in licensing.  Nobody here is qualified to give an answer
standing up in court.


Corinna


> 
> On Wed, Feb 26, 2020 at 4:04 PM Brian Inglis wrote:
> > On 2020-02-26 09:37, MrPmghost . wrote:
> > > I am Pierre Meignen, software developer working for a belgium company.
> > > I have a question regarding cygwin and its use.
> > > Is it allowed/legal to integrate cygwin installer (2.11.1(0.329/5/3))
> > into
> > > the installer of an application that we plan to distribute commercially?
> > > I have checked the past cygwin posts but I did not see any clear answer
> > to
> > > my question.
> > > I know how to handle source code in LGPL but I have difficulty to
> > > understand what I can do with cygwin (LGPL) but which also contains tools
> > > covered by the GNU GPL and so on.
> > > We have customized cygwin installer in order to install locally the
> > > necessary packages.
> > > Once in its execution, our application launches cygwin.bat and launch
> > > commands to upload embedded systems.
> > > We do not link towards cygwin.dll.
> >  cygwin1.dll
> >
> > > We currently use the application internally but we plan to distribute it
> > > commerically in the future.
> > > Thanks in advance for your support/feedback,
> >
> > [Disclaimer: I am not any kind of lawyer or project lead just another
> > volunteer]
> >
> > Cygwin is not a formal organization and has no officers or lawyers, at best
> > volunteer project co-leads and maintainers with commit privileges to
> > primary
> > source repositories.
> >
> > Cygwin is an online project which has volunteers around the world
> > collaboratively maintaining a collection of packages archived and
> > distributed on
> > third party donated and supported domain names and infrastructure.
> >
> > Copyright and licence compliance is your responsibility if you download any
> > binaries or sources. As you are based in Belgium in the EU you also have to
> > comply with Belgian and EU law which may have stricter copyright and
> > licensing
> > compliance requirements.
> >
> > Each package comes with its own licensing terms, including cygwin
> > (cygwin1.dll)
> > and setup (setup_x86{_64}.exe), usually under (case insensitively):
> >
> > /usr/share/{,doc/}PACKAGE{,-doc}/*{COPY,LICEN}*
> > or
> > /usr/share/doc/common-licenses
> >
> > You will have to provide your corporate lawyers with the licences for each
> > package you wish to include in your product.
> >
> > Your corporate lawyers will have to determine what responsibilities you
> > have
> > related to package licensing requirements, what you must do (e.g. publish
> > and
> > attribute all copyrights and licences in your product distribution and
> > documentation, distribute and provide online source archives, and submit
> > patches
> > upstream, etc.), and how you are limited by the licences in what you may
> > do with
> > each package.
> >
> > As so many packages are licensed under the [L]GPL2/3 or by the FSF if GNU
> > sourced, see https://www.fsf.org/licensing/ your corporate lawyers may
> > want to
> > work with the FSF Licensing and Compliance Team mailto:licens...@fsf.org
> > or
> > their lawyers mailto:le...@fsf.org as Cygwin has no lawyers.
> >
> > In general, you probably need to document, track, submit, and log
> > submission of
> > any modifications you make to any Cygwin package source code as patches to
> > cygwin-a...@cygwin.com, or upstream to the upstream package maintainer or
> > source
> > given in the package source archive, often shown in a .cygport file.
> >
> > Question for project leads - who maintains the maintainer copyright
> > assignments,
> > attributions, disclaimers, releases, etc. and where, or is that all also
> > only in
> > some mail archives?
> >
> > --
> > Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
> >
> > This email may be disturbing to some readers as it contains
> > too much technical detail. Reader discretion is advised.
> >
> > --
> > Problem reports: