Re: [ANN] Cygwin-OpenSSH 8.2.2.2

2020-02-26 Thread ASSI
Bill Stewart writes:
> Installer is available on the 'Releases' tab.

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


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

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

--
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] Cygwin: console: Adjust the detailed behaviour of ESC sequences.

2020-02-26 Thread Takashi Yano
- This patch makes some detailed behaviour of ESC sequences such as
  "CSI Ps L" (IL), "CSI Ps M" (DL) and "ESC M" (RI) in xterm mode
  match with real xterm.
---
 winsup/cygwin/fhandler.h  |  1 +
 winsup/cygwin/fhandler_console.cc | 51 ++-
 2 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 55f18aebd..c897380ae 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -1861,6 +1861,7 @@ class dev_console
   bool saw_question_mark;
   bool saw_greater_than_sign;
   bool saw_space;
+  bool saw_exclamation_mark;
   bool vt100_graphics_mode_G0;
   bool vt100_graphics_mode_G1;
   bool iso_2022_G1;
diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index 4ab9bcab8..64e12b832 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2053,6 +2053,19 @@ fhandler_console::char_command (char c)
{
  /* Use "CSI Ps T" instead */
  cursor_get (, );
+ if (y < srTop || y > srBottom)
+   break;
+ if (y == con.b.srWindow.Top
+ && srBottom == con.b.srWindow.Bottom)
+   {
+ /* Erase scroll down area */
+ n = con.args[0] ? : 1;
+ __small_sprintf (buf, "\033[%d;1H\033[J\033[%d;%dH",
+  srBottom - (n-1) - con.b.srWindow.Top + 1,
+  y + 1 - con.b.srWindow.Top, x + 1);
+ WriteConsoleA (get_output_handle (),
+buf, strlen (buf), , 0);
+   }
  __small_sprintf (buf, "\033[%d;%dr",
   y + 1 - con.b.srWindow.Top,
   srBottom + 1 - con.b.srWindow.Top);
@@ -2079,6 +2092,8 @@ fhandler_console::char_command (char c)
{
  /* Use "CSI Ps S" instead */
  cursor_get (, );
+ if (y < srTop || y > srBottom)
+   break;
  __small_sprintf (buf, "\033[%d;%dr",
   y + 1 - con.b.srWindow.Top,
   srBottom + 1 - con.b.srWindow.Top);
@@ -2137,6 +2152,16 @@ fhandler_console::char_command (char c)
fix_tab_position ();
}
  break;
+   case 'p':
+ if (con.saw_exclamation_mark) /* DECSTR Soft reset */
+   {
+ con.scroll_region.Top = 0;
+ con.scroll_region.Bottom = -1;
+   }
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ break;
default:
  /* Other escape sequences */
  wpbuf_put (c);
@@ -2970,6 +2995,7 @@ fhandler_console::write (const void *vsrc, size_t len)
  con.saw_question_mark = false;
  con.saw_greater_than_sign = false;
  con.saw_space = false;
+ con.saw_exclamation_mark = false;
}
  else if (wincap.has_con_24bit_colors () && !con_is_legacy
   && wincap.has_con_broken_il_dl () && *src == 'M')
@@ -2979,13 +3005,17 @@ fhandler_console::write (const void *vsrc, size_t len)
  cursor_get (, );
  if (y == srTop)
{
- /* Erase scroll down area */
- char buf[] = "\033[32768;1H\033[J\033[32768;32768";
- __small_sprintf (buf, "\033[%d;1H\033[J\033[%d;%dH",
-srBottom - con.b.srWindow.Top + 1,
-y + 1 - con.b.srWindow.Top, x + 1);
- WriteConsoleA (get_output_handle (),
-buf, strlen (buf), , 0);
+ if (y == con.b.srWindow.Top
+ && srBottom == con.b.srWindow.Bottom)
+   {
+ /* Erase scroll down area */
+ char buf[] = "\033[32768;1H\033[J\033[32768;32768";
+ __small_sprintf (buf, "\033[%d;1H\033[J\033[%d;%dH",
+  srBottom - con.b.srWindow.Top + 1,
+  y + 1 - con.b.srWindow.Top, x + 1);
+ WriteConsoleA (get_output_handle (),
+buf, strlen (buf), , 0);
+   }
  /* Substitute "CSI Ps T" */
  wpbuf_put ('[');
  wpbuf_put ('T');
@@ -2998,6 +3028,11 @@ fhandler_console::write (const void *vsrc, size_t len)
}
  else if (wincap.has_con_24bit_colors () && !con_is_legacy)
{ /* Only CSI is handled in xterm compatible mode. */
+ if (*src == 'c') /* RIS Full reset */
+   {
+ con.scroll_region.Top = 0;
+ con.scroll_region.Bottom = -1;
+   }
  wpbuf_put (*src);
   

Re: cygwin licensing question

2020-02-26 Thread William Deegan
I'd also take a look at this:
https://cygwin.com/licensing.html

On Wed, Feb 26, 2020 at 4:04 PM Brian Inglis <
brian.ing...@systematicsw.ab.ca> 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:   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: cygwin licensing question

2020-02-26 Thread Brian Inglis
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:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



[ANN] Cygwin-OpenSSH 8.2.2.2

2020-02-26 Thread Bill Stewart
I have updated the package:

https://github.com/Bill-Stewart/Cygwin-OpenSSH

Installer is available on the 'Releases' tab.

Description:

Cygwin-OpenSSH is a convenient packaging of the Cygwin version of OpenSSH
for Windows systems.

Notable changes:

- Updated OpenSSH to version 8.2

- Updated cygwin1.dll to 3.1.4

- posh.exe (default shell, launches PowerShell) can now launch PowerShell
Core (if installed)*

- ps1exec.exe replaced with runposh.exe (supports PowerShell Core)

- Minor script updates

*To use PowerShell Core instead of Windows PowerShell, modify /etc/profile
to run '/bin/posh -c' instead of just '/bin/posh'.

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



[newlib-cygwin] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7dfe04e93343418eace45ea84bf9f6d1258cb632

commit 7dfe04e93343418eace45ea84bf9f6d1258cb632
Author: Takashi Yano 
Date:   Thu Feb 27 00:32:59 2020 +0900

Cygwin: console: Add workaround for broken IL/DL in xterm mode.

- Cygwin console with xterm compatible mode causes problem reported
  in https://www.cygwin.com/ml/cygwin-patches/2020-q1/msg00212.html
  if background/foreground colors are set to gray/black respectively
  in Win10 1903/1909. This is caused by "CSI Ps L" (IL), "CSI Ps M"
  (DL) and "ESC M" (RI) control sequences which are broken. This
  patch adds a workaround for the issue.

Diff:
---
 winsup/cygwin/fhandler_console.cc | 156 +-
 winsup/cygwin/wincap.cc   |  10 +++
 winsup/cygwin/wincap.h|   2 +
 3 files changed, 166 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index 328424a..3f756c5 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -57,6 +57,16 @@ bool NO_COPY fhandler_console::invisible_console;
Only one console can exist in a process, therefore, static is suitable. */
 static struct fhandler_base::rabuf_t con_ra;
 
+/* Write pending buffer for ESC sequence handling
+   in xterm compatible mode */
+#define WPBUF_LEN 256
+static unsigned char wpbuf[WPBUF_LEN];
+static int wpixput;
+#define wpbuf_put(x) \
+  wpbuf[wpixput++] = x; \
+  if (wpixput > WPBUF_LEN) \
+wpixput--;
+
 static void
 beep ()
 {
@@ -2014,6 +2024,82 @@ fhandler_console::char_command (char c)
   char buf[40];
   int r, g, b;
 
+  if (wincap.has_con_24bit_colors () && !con_is_legacy)
+{
+  /* For xterm compatible mode */
+  DWORD wn;
+  switch (c)
+   {
+   case 'r': /* DECSTBM */
+ con.scroll_region.Top = con.args[0] ? con.args[0] - 1 : 0;
+ con.scroll_region.Bottom = con.args[1] ? con.args[1] - 1 : -1;
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ break;
+   case 'L': /* IL */
+ if (wincap.has_con_broken_il_dl ())
+   {
+ /* Use "CSI Ps T" instead */
+ cursor_get (, );
+ __small_sprintf (buf, "\033[%d;%dr",
+  y + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ wpbuf_put ('T');
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ __small_sprintf (buf, "\033[%d;%dr",
+  srTop + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ __small_sprintf (buf, "\033[%d;%dH",
+  y + 1 - con.b.srWindow.Top, x + 1);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+   }
+ else
+   {
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+   }
+ break;
+   case 'M': /* DL */
+ if (wincap.has_con_broken_il_dl ())
+   {
+ /* Use "CSI Ps S" instead */
+ cursor_get (, );
+ __small_sprintf (buf, "\033[%d;%dr",
+  y + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ wpbuf_put ('S');
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ __small_sprintf (buf, "\033[%d;%dr",
+  srTop + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ __small_sprintf (buf, "\033[%d;%dH",
+  y + 1 - con.b.srWindow.Top, x + 1);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+   }
+ else
+   {
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+   }
+ break;
+   default:
+ /* Other escape sequences */
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ break;
+   }
+  return;
+}
+
+  /* For legacy cygwin treminal */
   switch (c)
 {
 case 'm':   /* Set Graphics Rendition */
@@ -2641,6 +2727,7 @@ fhandler_console::write_normal (const unsigned char *src,
   while (found < end
   

Re: [PATCH v2 0/4] Modify handling of several ESC sequences in xterm mode.

2020-02-26 Thread Corinna Vinschen
On Feb 27 00:32, Takashi Yano wrote:
> Takashi Yano (4):
>   Cygwin: console: Add workaround for broken IL/DL in xterm mode.
>   Cygwin: console: Unify workaround code for CSI3J and CSI?1049h/l.
>   Cygwin: console: Add support for REP escape sequence to xterm mode.
>   Cygwin: console: Add emulation of CSI3J on Win10 1809.
> 
>  winsup/cygwin/fhandler_console.cc | 247 +++---
>  winsup/cygwin/wincap.cc   |  20 +++
>  winsup/cygwin/wincap.h|   4 +
>  3 files changed, 248 insertions(+), 23 deletions(-)
> 
> -- 
> 2.21.0

Looks good to me.  Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


[newlib-cygwin] Cygwin: console: Add emulation of CSI3J on Win10 1809.

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c13cdfd00ed09d23e5cf1864033a1bfd54bc3aab

commit c13cdfd00ed09d23e5cf1864033a1bfd54bc3aab
Author: Takashi Yano 
Date:   Thu Feb 27 00:33:02 2020 +0900

Cygwin: console: Add emulation of CSI3J on Win10 1809.

- This patch add emulation of CSI3J, which is broken in Win10 1809,
  rather than ignoring it as before.

Diff:
---
 winsup/cygwin/fhandler_console.cc | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index f87d932..4ab9bca 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2102,8 +2102,23 @@ fhandler_console::char_command (char c)
  break;
case 'J': /* ED */
  wpbuf_put (c);
- /* Ignore CSI3J in Win10 1809 because it is broken. */
- if (con.args[0] != 3 || !wincap.has_con_broken_csi3j ())
+ if (con.args[0] == 3 && wincap.has_con_broken_csi3j ())
+   { /* Workaround for broken CSI3J in Win10 1809 */
+ CONSOLE_SCREEN_BUFFER_INFO sbi;
+ GetConsoleScreenBufferInfo (get_output_handle (), );
+ SMALL_RECT r = {0, sbi.srWindow.Top,
+   (SHORT) (sbi.dwSize.X - 1), (SHORT) (sbi.dwSize.Y - 1)};
+ CHAR_INFO f = {' ', sbi.wAttributes};
+ COORD d = {0, 0};
+ ScrollConsoleScreenBufferA (get_output_handle (),
+ , NULL, d, );
+ SetConsoleCursorPosition (get_output_handle (), d);
+ d = sbi.dwCursorPosition;
+ d.Y -= sbi.srWindow.Top;
+ SetConsoleCursorPosition (get_output_handle (), d);
+   }
+ else
+   /* Just send the sequence */
WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
  break;
case 'h': /* DECSET */


[newlib-cygwin] Cygwin: console: Add support for REP escape sequence to xterm mode.

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0d7bbc0bc3da7d7c9e0a76243cbeaf458724d32d

commit 0d7bbc0bc3da7d7c9e0a76243cbeaf458724d32d
Author: Takashi Yano 
Date:   Thu Feb 27 00:33:01 2020 +0900

Cygwin: console: Add support for REP escape sequence to xterm mode.

- In Win10 upto 1809, xterm compatible mode does not have REP
  escape sequence which terminfo declares. This patch adds support
  for "CSI Ps b" (REP). With this patch, bvi (binary editor) works
  normally in Win10 1809. Also, xterm compatible mode does not have
  "CSI Pm `" (HPA), "CSI Pm a" (HPR) and "CSI Ps e" (VPR). However,
  they do not appear to be declared by terminfo. Therefore, these
  have been pending.

Diff:
---
 winsup/cygwin/fhandler_console.cc | 33 +
 winsup/cygwin/wincap.cc   | 10 ++
 winsup/cygwin/wincap.h|  2 ++
 3 files changed, 45 insertions(+)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index fbeccff..f87d932 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -62,6 +62,7 @@ static struct fhandler_base::rabuf_t con_ra;
 #define WPBUF_LEN 256
 static unsigned char wpbuf[WPBUF_LEN];
 static int wpixput;
+static unsigned char last_char;
 #define wpbuf_put(x) \
   wpbuf[wpixput++] = x; \
   if (wpixput > WPBUF_LEN) \
@@ -2009,6 +2010,37 @@ fhandler_console::char_command (char c)
   DWORD wn;
   switch (c)
{
+#if 0 /* These sequences, which are supported by real xterm, are
+not supported by xterm compatible mode. Therefore they
+were implemented once. However, these are not declared
+in terminfo of xterm-256color, therefore, do not appear
+to be necessary. */
+   case '`': /* HPA */
+ if (con.args[0] == 0)
+   con.args[0] = 1;
+ cursor_get (, );
+ cursor_set (false, con.args[0]-1, y);
+ break;
+   case 'a': /* HPR */
+ if (con.args[0] == 0)
+   con.args[0] = 1;
+ cursor_rel (con.args[0], 0);
+ break;
+   case 'e': /* VPR */
+ if (con.args[0] == 0)
+   con.args[0] = 1;
+ cursor_rel (0, con.args[0]);
+ break;
+#endif
+   case 'b': /* REP */
+ wpbuf_put (c);
+ if (wincap.has_con_esc_rep ())
+   /* Just send the sequence */
+   WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ else if (last_char && last_char != '\n')
+   for (int i = 0; i < con.args[0]; i++)
+ WriteConsoleA (get_output_handle (), _char, 1, , 0);
+ break;
case 'r': /* DECSTBM */
  con.scroll_region.Top = con.args[0] ? con.args[0] - 1 : 0;
  con.scroll_region.Bottom = con.args[1] ? con.args[1] - 1 : -1;
@@ -2746,6 +2778,7 @@ fhandler_console::write_normal (const unsigned char *src,
  break;
default:
  found += ret;
+ last_char = *(found - 1);
  break;
}
 }
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 714a6d4..922705e 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -44,6 +44,7 @@ wincaps wincap_vista __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -73,6 +74,7 @@ wincaps wincap_7 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -102,6 +104,7 @@ wincaps wincap_8 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -131,6 +134,7 @@ wincaps wincap_8_1 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -160,6 +164,7 @@ wincaps  wincap_10_1507 __attribute__((section 
(".cygwin_dll_common"), shared))
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -189,6 +194,7 @@ wincaps wincap_10_1703 __attribute__((section 
(".cygwin_dll_common"), shared)) =
 has_con_24bit_colors:true,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -218,6 +224,7 @@ wincaps wincap_10_1709 __attribute__((section 
(".cygwin_dll_common"), shared)) =
 has_con_24bit_colors:true,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -247,6 +254,7 @@ wincaps wincap_10_1803 __attribute__((section 
(".cygwin_dll_common"), shared)) =
 

[newlib-cygwin] Cygwin: console: Unify workaround code for CSI3J and CSI?1049h/l.

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3b42762e0b02ad53cc01dd752b94a044b7a42ebf

commit 3b42762e0b02ad53cc01dd752b94a044b7a42ebf
Author: Takashi Yano 
Date:   Thu Feb 27 00:33:00 2020 +0900

Cygwin: console: Unify workaround code for CSI3J and CSI?1049h/l.

- This patch unifies workaround code for CSI3J and CSI?1049h/l into
  the code handling other escape sequences in xterm mode.

Diff:
---
 winsup/cygwin/fhandler_console.cc | 43 ---
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index 3f756c5..fbeccff 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1786,24 +1786,6 @@ static const wchar_t __vt100_conv[31] = {
 inline bool
 fhandler_console::write_console (PWCHAR buf, DWORD len, DWORD& done)
 {
-  bool need_fix_tab_position = false;
-  /* Check if screen will be alternated. */
-  if (wincap.has_con_24bit_colors () && !con_is_legacy
-  && memmem (buf, len*sizeof (WCHAR), L"\033[?1049", 7*sizeof (WCHAR)))
-need_fix_tab_position = true;
-  /* Workaround for broken CSI3J (ESC[3J) support in xterm compatible mode. */
-  if (wincap.has_con_24bit_colors () && !con_is_legacy &&
-  wincap.has_con_broken_csi3j ())
-{
-  WCHAR *p = buf;
-  while ((p = (WCHAR *) memmem (p, (len - (p - buf))*sizeof (WCHAR),
-   L"\033[3J", 4*sizeof (WCHAR
-   {
- memmove (p, p+4, (len - (p+4 - buf))*sizeof (WCHAR));
- len -= 4;
-   }
-}
-
   if (con.iso_2022_G1
? con.vt100_graphics_mode_G1
: con.vt100_graphics_mode_G0)
@@ -1822,9 +1804,6 @@ fhandler_console::write_console (PWCHAR buf, DWORD len, 
DWORD& done)
   len -= done;
   buf += done;
 }
-  /* Call fix_tab_position() if screen has been alternated. */
-  if (need_fix_tab_position)
-fix_tab_position ();
   return true;
 }
 
@@ -2089,6 +2068,28 @@ fhandler_console::char_command (char c)
  WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
}
  break;
+   case 'J': /* ED */
+ wpbuf_put (c);
+ /* Ignore CSI3J in Win10 1809 because it is broken. */
+ if (con.args[0] != 3 || !wincap.has_con_broken_csi3j ())
+   WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ break;
+   case 'h': /* DECSET */
+   case 'l': /* DECRST */
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ if (con.saw_question_mark)
+   {
+ bool need_fix_tab_position = false;
+ for (int i = 0; i < con.nargs; i++)
+   if (con.args[i] == 1049)
+ need_fix_tab_position = true;
+ /* Call fix_tab_position() if screen has been alternated. */
+ if (need_fix_tab_position)
+   fix_tab_position ();
+   }
+ break;
default:
  /* Other escape sequences */
  wpbuf_put (c);


Re: [PATCH] Cygwin: Fix size of a buffer in the ps utility

2020-02-26 Thread Corinna Vinschen
On Feb 26 20:08, Jon Turney wrote:
> Fix the size of a temporary buffer used in the ps utility, reported as a
> new warning by gcc-9.2.0
> 
> ../../../../src/winsup/utils/ps.cc: In function 'const char* ttynam(int)':
> ../../../../src/winsup/utils/ps.cc:101:23: warning: 'sprintf' may write a 
> terminating nul past the end of the destination [-Wformat-overflow=]
> ../../../../src/winsup/utils/ps.cc:101:11: note: 'sprintf' output between 9 
> and 10 bytes into a destination of size 9
> ---
>  winsup/utils/ps.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This is already fixed in git.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


Re: [PATCH] Cygwin: Update dumper for bfd API changes

2020-02-26 Thread Corinna Vinschen
On Feb 26 20:07, Jon Turney wrote:
> Update dumper for bfd API changes in binutils 2.34
> 
> libbfd doesn't guarantee API stability, so we've just been lucky this
> hasn't broken more often.
> 
> See binutils commit fd361982.
> ---
>  winsup/utils/dumper.cc   | 30 ++
>  winsup/utils/parse_pe.cc |  4 
>  2 files changed, 26 insertions(+), 8 deletions(-)

Great, please push.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


[newlib-cygwin] Cygwin: cygserver: drop useless packed attribute

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0a37e9f0bc24c6d326816e6686c4eaa25b4fd83e

commit 0a37e9f0bc24c6d326816e6686c4eaa25b4fd83e
Author: Corinna Vinschen 
Date:   Wed Feb 26 20:52:55 2020 +0100

Cygwin: cygserver: drop useless packed attribute

...from structs used for data exchange between clients and cygserver.
All of the structs have the same size and member offsets, packed or
unpacked.  Keeping the packed attribute results in ominous warnings
from gcc-9.2.0:

  cygserver.cc:259:10: warning: taking address of packed member of
  'client_request_attach_tty::request_attach_tty' may result in an
  unaligned pointer value [-Waddress-of-packed-member]

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/cygserver.h | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/winsup/cygwin/cygserver.h b/winsup/cygwin/cygserver.h
index 9de8c44..2788fa3 100644
--- a/winsup/cygwin/cygserver.h
+++ b/winsup/cygwin/cygserver.h
@@ -11,12 +11,6 @@ details. */
 #ifndef _CYGSERVER_H_
 #define _CYGSERVER_H_
 
-#ifdef __GNUC__
-#define CYGSERVER_PACKED __attribute__ ((packed))
-#else
-#define CYGSERVER_PACKED
-#endif
-
 #define CYGWIN_SERVER_VERSION_MAJOR1
 #define CYGWIN_SERVER_VERSION_API  4
 #define CYGWIN_SERVER_VERSION_MINOR0
@@ -65,7 +59,7 @@ protected:
 
 header_t () {};
 header_t (request_code_t, size_t);
-  } CYGSERVER_PACKED;
+  };
 
 public:
 #ifndef __INSIDE_CYGWIN__
@@ -111,7 +105,7 @@ private:
   struct request_get_version
   {
 DWORD major, api, minor, patch;
-  } CYGSERVER_PACKED;
+  };
 
 public:
   client_request_get_version ();
@@ -156,7 +150,7 @@ private:
   {
 DWORD pid, master_pid;
 HANDLE from_master, to_master;
-  } CYGSERVER_PACKED;
+  };
 
 public:
 #ifdef __INSIDE_CYGWIN__


[newlib-cygwin] Cygwin: ps: fix compiler warning in ttynam

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=09981903e6d3a42a23b13cfaed3c9b8b0f0e2f02

commit 09981903e6d3a42a23b13cfaed3c9b8b0f0e2f02
Author: Corinna Vinschen 
Date:   Wed Feb 26 21:08:51 2020 +0100

Cygwin: ps: fix compiler warning in ttynam

The helper function ttynam creates a tty name by using sprintf wrongly
on a pretty short buffer.  The foramt string only specifies a minimum
field length, not a maximum field length, so gcc-9.2.0 complains:

  ps.cc:101:23: warning: 'sprintf' may write a terminating nul past the
  end of the destination [-Wformat-overflow=]

Fix this thoroughly by specifying a maximum field width as well as by
using snprintf with a fixed buffer length.  Also, drop using a static
buffer in favor of using a buffer in the caller.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/utils/ps.cc | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc
index 2307f79..731f72c 100644
--- a/winsup/utils/ps.cc
+++ b/winsup/utils/ps.cc
@@ -88,17 +88,17 @@ to_time_t (FILETIME *ptr)
 }
 
 static const char *
-ttynam (int ntty)
+ttynam (int ntty, char buf[9])
 {
-  static char buf[9];
   char buf0[9];
+
   if (ntty < 0)
 strcpy (buf0, "?");
   else if (ntty & 0x)
-sprintf (buf0, "cons%d", ntty & 0xff);
+snprintf (buf0, 9, "cons%d", ntty & 0xff);
   else
-sprintf (buf0, "pty%d", ntty);
-  sprintf (buf, " %-7s", buf0);
+snprintf (buf0, 9, "pty%d", ntty);
+  snprintf (buf, 9, " %-7.7s", buf0);
   return buf;
 }
 
@@ -358,6 +358,7 @@ main (int argc, char *argv[])
}
 
   char uname[128];
+  char ttyname[9];
 
   if (fflag)
{
@@ -373,13 +374,13 @@ main (int argc, char *argv[])
}
 
   if (sflag)
-   printf (dfmt, p->pid, ttynam (p->ctty), start_time (p), pname);
+   printf (dfmt, p->pid, ttynam (p->ctty, ttyname), start_time (p), pname);
   else if (fflag)
-   printf (ffmt, uname, p->pid, p->ppid, ttynam (p->ctty), start_time (p),
-   pname);
+   printf (ffmt, uname, p->pid, p->ppid, ttynam (p->ctty, ttyname),
+   start_time (p), pname);
   else if (lflag)
printf (lfmt, status, p->pid, p->ppid, p->pgid,
-   p->dwProcessId, ttynam (p->ctty),
+   p->dwProcessId, ttynam (p->ctty, ttyname),
p->version >= EXTERNAL_PINFO_VERSION_32_BIT ? p->uid32 : p->uid,
start_time (p), pname);


[PATCH] Cygwin: Fix size of a buffer in the ps utility

2020-02-26 Thread Jon Turney
Fix the size of a temporary buffer used in the ps utility, reported as a
new warning by gcc-9.2.0

../../../../src/winsup/utils/ps.cc: In function 'const char* ttynam(int)':
../../../../src/winsup/utils/ps.cc:101:23: warning: 'sprintf' may write a 
terminating nul past the end of the destination [-Wformat-overflow=]
../../../../src/winsup/utils/ps.cc:101:11: note: 'sprintf' output between 9 and 
10 bytes into a destination of size 9
---
 winsup/utils/ps.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc
index 2307f7955..63b92319e 100644
--- a/winsup/utils/ps.cc
+++ b/winsup/utils/ps.cc
@@ -90,7 +90,7 @@ to_time_t (FILETIME *ptr)
 static const char *
 ttynam (int ntty)
 {
-  static char buf[9];
+  static char buf[10];
   char buf0[9];
   if (ntty < 0)
 strcpy (buf0, "?");
-- 
2.21.0



[PATCH] Cygwin: Update dumper for bfd API changes

2020-02-26 Thread Jon Turney
Update dumper for bfd API changes in binutils 2.34

libbfd doesn't guarantee API stability, so we've just been lucky this
hasn't broken more often.

See binutils commit fd361982.
---
 winsup/utils/dumper.cc   | 30 ++
 winsup/utils/parse_pe.cc |  4 
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc
index f71bdda8b..226c2283d 100644
--- a/winsup/utils/dumper.cc
+++ b/winsup/utils/dumper.cc
@@ -39,6 +39,20 @@
 
 #define NOTE_NAME_SIZE 16
 
+#ifdef bfd_get_section_size
+/* for bfd < 2.34 */
+#define get_section_name(abfd, sect) bfd_get_section_name (abfd, sect)
+#define get_section_size(sect) bfd_get_section_size(sect)
+#define set_section_size(abfd, sect, size) bfd_set_section_size(abfd, sect, 
size)
+#define set_section_flags(abfd, sect, flags) bfd_set_section_flags(abfd, sect, 
flags)
+#else
+/* otherwise bfd >= 2.34 */
+#define get_section_name(afbd, sect) bfd_section_name (sect)
+#define get_section_size(sect) bfd_section_size(sect)
+#define set_section_size(abfd, sect, size) bfd_set_section_size(sect, size)
+#define set_section_flags(abfd, sect, flags) bfd_set_section_flags(sect, flags)
+#endif
+
 typedef struct _note_header
   {
 Elf_External_Note elf_note_header;
@@ -131,7 +145,7 @@ dumper::sane ()
 void
 print_section_name (bfd* abfd, asection* sect, PTR obj)
 {
-  deb_printf (" %s", bfd_get_section_name (abfd, sect));
+  deb_printf (" %s", get_section_name (abfd, sect));
 }
 
 void
@@ -712,10 +726,10 @@ dumper::prepare_core_dump ()
 
   if (p->type == pr_ent_module && status_section != NULL)
{
- if (!bfd_set_section_size (core_bfd,
-status_section,
-(bfd_get_section_size (status_section)
- + sect_size)))
+ if (!set_section_size (core_bfd,
+status_section,
+(get_section_size (status_section)
+ + sect_size)))
{
  bfd_perror ("resizing status section");
  goto failed;
@@ -738,8 +752,8 @@ dumper::prepare_core_dump ()
  goto failed;
}
 
-  if (!bfd_set_section_flags (core_bfd, new_section, sect_flags) ||
- !bfd_set_section_size (core_bfd, new_section, sect_size))
+  if (!set_section_flags (core_bfd, new_section, sect_flags) ||
+ !set_section_size (core_bfd, new_section, sect_size))
{
  bfd_perror ("setting section attributes");
  goto failed;
@@ -823,7 +837,7 @@ dumper::write_core_dump ()
   deb_printf ("writing section type=%u base=%p size=%p flags=%08x\n",
  p->type,
  p->section->vma,
- bfd_get_section_size (p->section),
+ get_section_size (p->section),
  p->section->flags);
 
   switch (p->type)
diff --git a/winsup/utils/parse_pe.cc b/winsup/utils/parse_pe.cc
index 2a388638c..90b5c0b0d 100644
--- a/winsup/utils/parse_pe.cc
+++ b/winsup/utils/parse_pe.cc
@@ -25,6 +25,10 @@
 
 #include "dumper.h"
 
+#ifndef bfd_get_section_size
+#define bfd_get_section_size(sect) bfd_section_size(sect)
+#endif
+
 int
 exclusion::add (LPBYTE mem_base, SIZE_T mem_size)
 {
-- 
2.21.0



cygwin licensing question

2020-02-26 Thread MrPmghost .
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: directory without search permission is searchable?

2020-02-26 Thread Jun-ichi Takimoto


> 2020/02/26 19:54, Corinna Vinschen  wrote:
> 
> The default is to bypass traverse checking for *all* users.

Thanks.

The reason I asked about this is:
zsh recently added a test to confirm that a glob pattern "*/" does NOT
include "dir/" if the directory "dir" has no search permission.
This test fails on Cygwin.

A patch to skip this test on Cygwin:
http://www.zsh.org/mla/workers/2020/msg00317.html
I will soon push this to zsh git master.

Jun

--
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: directory without search permission is searchable?

2020-02-26 Thread Corinna Vinschen
On Feb 27 01:10, Jun-ichi Takimoto wrote:
> 
> > 2020/02/26 19:54, Corinna Vinschen  wrote:
> > 
> > The default is to bypass traverse checking for *all* users.
> 
> Thanks.
> 
> The reason I asked about this is:
> zsh recently added a test to confirm that a glob pattern "*/" does NOT
> include "dir/" if the directory "dir" has no search permission.
> This test fails on Cygwin.

Yeah, that's expected.  Even with Cygwin it's still Windows under
the hood :)

> A patch to skip this test on Cygwin:
> http://www.zsh.org/mla/workers/2020/msg00317.html
> I will soon push this to zsh git master.

Great, thanks!


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


Re: [ANNOUNCEMENT] Updated: gcc-9.2.0-2 (x86/x86_64)

2020-02-26 Thread Corinna Vinschen
On Feb 26 13:53, Denis Excoffier wrote:
> 
> > On 2020-02-25 01:18, Jon Turney wrote :
> > 
> > On 24/02/2020 23:35, JonY wrote:
> >> On 2/24/20 8:21 PM, Achim Gratz wrote:
> >>> JonY writes:
>  gcc-9.2.0-2 has been uploaded for Cygwin. This version is the same as
>  -1, just repackaged and marked as stable.
> >>> 
> >>> This version of gcc requires a newer binutils than defined as current in
> >>> the Cygwin repo, so until this gets corrected one needs to manually
> >>> switch to the test version binutils-2.31.1-1.
> > 
> > binutils-2.31.1-1 has been promoted from test to current.
> > 
> 
> In order to compile cleanly the last snapshot with gcc 9.2.0, i had to apply 
> the following patch (see below).
> Otherwise one get an uninitialized variable together with a missing 
> __attribute__.

Thanks, I fixed this a bit differently.  Would you mind to send unified
diffs in future (diff -up is the nicest)?  They are easier to read than
the standard diffs :}


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


[newlib-cygwin] Cygwin: Makefile.in: add -fno-builtin-execve CFLAG when building exec.o

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5f66c2c756c2b3b43e565e471c82ee4ed05a4adb

commit 5f66c2c756c2b3b43e565e471c82ee4ed05a4adb
Author: Corinna Vinschen 
Date:   Wed Feb 26 17:02:01 2020 +0100

Cygwin: Makefile.in: add -fno-builtin-execve CFLAG when building exec.o

gcc-9.2.0 has an execve builtin which uses the nothrow attribute.
This results in an error when aliasing execve to _execve for newlib:

exec.cc:88:23: error: 'int _execve(const char*, char* const*, char*
const*)' specifies less restrictive attribute than its target
'int execve(const char*, char* const*, char* const*)': 'nothrow'
[-Werror=missing-attributes]
   88 | EXPORT_ALIAS (execve, _execve) /* For newlib */

Add the -fno-builtin-execve CFLAGS when building exec.o to override
the gcc builtin.

Signed-off-by: Corinna Vinschen 

Diff:
---
 winsup/cygwin/Makefile.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index ca0633e..f273ba7 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -567,6 +567,8 @@ ifeq ($(target_cpu),i686)
 exceptions_CFLAGS:=-fno-omit-frame-pointer
 endif
 endif
+# required since gcc 9.x
+exec_CFLAGS:=-fno-builtin-execve
 
 fhandler_proc_CFLAGS+=-DUSERNAME="\"$(USER)\"" -DHOSTNAME="\"$(HOSTNAME)\""
 fhandler_proc_CFLAGS+=-DGCC_VERSION="\"`$(CC) -v 2>&1 | tail -n 1`\""


[newlib-cygwin] Cygwin: posix timers: fix uninitialized variable

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=28382c97a5d5fd7366adbf7ce9445b1b4beb02a9

commit 28382c97a5d5fd7366adbf7ce9445b1b4beb02a9
Author: Corinna Vinschen 
Date:   Wed Feb 26 16:50:34 2020 +0100

Cygwin: posix timers: fix uninitialized variable

The variable returning the overrun count from the tracker object after
disarming the overrun counter was not correctly initialized.  For some
reason this has only been noticed by gcc-9.2.0, not by the formerly used
gcc-7.4.0.

This problem should not have had any runtime impact.  The method
timer_tracker::disarm_overrun_event is supposed to be called in
lock-step with timer_tracker::arm_overrun_event, which in turn
results in the variable getting a valid value.

Signed-off-by: Corinna Vinschen 

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

diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc
index c0d548f..75cd4fa 100644
--- a/winsup/cygwin/posix_timer.cc
+++ b/winsup/cygwin/posix_timer.cc
@@ -81,7 +81,7 @@ timer_tracker::arm_overrun_event (LONG64 exp_cnt)
 LONG
 timer_tracker::disarm_overrun_event ()
 {
-  LONG ret;
+  LONG ret = 0;
 
   AcquireSRWLockExclusive ();
   if (overrun_count != OVR_DISARMED)


[PATCH v2 4/4] Cygwin: console: Add emulation of CSI3J on Win10 1809.

2020-02-26 Thread Takashi Yano
- This patch add emulation of CSI3J, which is broken in Win10 1809,
  rather than ignoring it as before.
---
 winsup/cygwin/fhandler_console.cc | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index b0951497a..7f2e8af5c 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2102,8 +2102,23 @@ fhandler_console::char_command (char c)
  break;
case 'J': /* ED */
  wpbuf_put (c);
- /* Ignore CSI3J in Win10 1809 because it is broken. */
- if (con.args[0] != 3 || !wincap.has_con_broken_csi3j ())
+ if (con.args[0] == 3 && wincap.has_con_broken_csi3j ())
+   { /* Workaround for broken CSI3J in Win10 1809 */
+ CONSOLE_SCREEN_BUFFER_INFO sbi;
+ GetConsoleScreenBufferInfo (get_output_handle (), );
+ SMALL_RECT r = {0, sbi.srWindow.Top,
+   (SHORT) (sbi.dwSize.X - 1), (SHORT) (sbi.dwSize.Y - 1)};
+ CHAR_INFO f = {' ', sbi.wAttributes};
+ COORD d = {0, 0};
+ ScrollConsoleScreenBufferA (get_output_handle (),
+ , NULL, d, );
+ SetConsoleCursorPosition (get_output_handle (), d);
+ d = sbi.dwCursorPosition;
+ d.Y -= sbi.srWindow.Top;
+ SetConsoleCursorPosition (get_output_handle (), d);
+   }
+ else
+   /* Just send the sequence */
WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
  break;
case 'h': /* DECSET */
-- 
2.21.0



[PATCH v2 3/4] Cygwin: console: Add support for REP escape sequence to xterm mode.

2020-02-26 Thread Takashi Yano
- In Win10 upto 1809, xterm compatible mode does not have REP
  escape sequence which terminfo declares. This patch adds support
  for "CSI Ps b" (REP). With this patch, bvi (binary editor) works
  normally in Win10 1809. Also, xterm compatible mode does not have
  "CSI Pm `" (HPA), "CSI Pm a" (HPR) and "CSI Ps e" (VPR). However,
  they do not appear to be declared by terminfo. Therefore, these
  have been pending.
---
 winsup/cygwin/fhandler_console.cc | 33 +++
 winsup/cygwin/wincap.cc   | 10 ++
 winsup/cygwin/wincap.h|  2 ++
 3 files changed, 45 insertions(+)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index 3bd1d27d1..b0951497a 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -62,6 +62,7 @@ static struct fhandler_base::rabuf_t con_ra;
 #define WPBUF_LEN 256
 static unsigned char wpbuf[WPBUF_LEN];
 static int wpixput;
+static unsigned char last_char;
 #define wpbuf_put(x) \
   wpbuf[wpixput++] = x; \
   if (wpixput > WPBUF_LEN) \
@@ -2009,6 +2010,37 @@ fhandler_console::char_command (char c)
   DWORD wn;
   switch (c)
{
+#if 0 /* These sequences, which are supported by real xterm, are
+not supported by xterm compatible mode. Therefore they
+were implemented once. However, these are not declared
+in terminfo of xterm-256color, therefore, do not appear
+to be necessary. */
+   case '`': /* HPA */
+ if (con.args[0] == 0)
+   con.args[0] = 1;
+ cursor_get (, );
+ cursor_set (false, con.args[0]-1, y);
+ break;
+   case 'a': /* HPR */
+ if (con.args[0] == 0)
+   con.args[0] = 1;
+ cursor_rel (con.args[0], 0);
+ break;
+   case 'e': /* VPR */
+ if (con.args[0] == 0)
+   con.args[0] = 1;
+ cursor_rel (0, con.args[0]);
+ break;
+#endif
+   case 'b': /* REP */
+ wpbuf_put (c);
+ if (wincap.has_con_esc_rep ())
+   /* Just send the sequence */
+   WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ else if (last_char && last_char != '\n')
+   for (int i = 0; i < con.args[0]; i++)
+ WriteConsoleA (get_output_handle (), _char, 1, , 0);
+ break;
case 'r': /* DECSTBM */
  con.scroll_region.Top = con.args[0] ? con.args[0] - 1 : 0;
  con.scroll_region.Bottom = con.args[1] ? con.args[1] - 1 : -1;
@@ -2746,6 +2778,7 @@ fhandler_console::write_normal (const unsigned char *src,
  break;
default:
  found += ret;
+ last_char = *(found - 1);
  break;
}
 }
diff --git a/winsup/cygwin/wincap.cc b/winsup/cygwin/wincap.cc
index 714a6d49f..922705e65 100644
--- a/winsup/cygwin/wincap.cc
+++ b/winsup/cygwin/wincap.cc
@@ -44,6 +44,7 @@ wincaps wincap_vista __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -73,6 +74,7 @@ wincaps wincap_7 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -102,6 +104,7 @@ wincaps wincap_8 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -131,6 +134,7 @@ wincaps wincap_8_1 __attribute__((section 
(".cygwin_dll_common"), shared)) = {
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -160,6 +164,7 @@ wincaps  wincap_10_1507 __attribute__((section 
(".cygwin_dll_common"), shared))
 has_con_24bit_colors:false,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -189,6 +194,7 @@ wincaps wincap_10_1703 __attribute__((section 
(".cygwin_dll_common"), shared)) =
 has_con_24bit_colors:true,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -218,6 +224,7 @@ wincaps wincap_10_1709 __attribute__((section 
(".cygwin_dll_common"), shared)) =
 has_con_24bit_colors:true,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -247,6 +254,7 @@ wincaps wincap_10_1803 __attribute__((section 
(".cygwin_dll_common"), shared)) =
 has_con_24bit_colors:true,
 has_con_broken_csi3j:false,
 has_con_broken_il_dl:false,
+has_con_esc_rep:false,
   },
 };
 
@@ -276,6 +284,7 @@ wincaps wincap_10_1809 __attribute__((section 
(".cygwin_dll_common"), shared)) =
 has_con_24bit_colors:true,
 has_con_broken_csi3j:true,
 has_con_broken_il_dl:false,

[PATCH v2 0/4] Modify handling of several ESC sequences in xterm mode.

2020-02-26 Thread Takashi Yano
Takashi Yano (4):
  Cygwin: console: Add workaround for broken IL/DL in xterm mode.
  Cygwin: console: Unify workaround code for CSI3J and CSI?1049h/l.
  Cygwin: console: Add support for REP escape sequence to xterm mode.
  Cygwin: console: Add emulation of CSI3J on Win10 1809.

 winsup/cygwin/fhandler_console.cc | 247 +++---
 winsup/cygwin/wincap.cc   |  20 +++
 winsup/cygwin/wincap.h|   4 +
 3 files changed, 248 insertions(+), 23 deletions(-)

-- 
2.21.0



[PATCH v2 2/4] Cygwin: console: Unify workaround code for CSI3J and CSI?1049h/l.

2020-02-26 Thread Takashi Yano
- This patch unifies workaround code for CSI3J and CSI?1049h/l into
  the code handling other escape sequences in xterm mode.
---
 winsup/cygwin/fhandler_console.cc | 43 ---
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index c2198ea1e..3bd1d27d1 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -1786,24 +1786,6 @@ static const wchar_t __vt100_conv[31] = {
 inline bool
 fhandler_console::write_console (PWCHAR buf, DWORD len, DWORD& done)
 {
-  bool need_fix_tab_position = false;
-  /* Check if screen will be alternated. */
-  if (wincap.has_con_24bit_colors () && !con_is_legacy
-  && memmem (buf, len*sizeof (WCHAR), L"\033[?1049", 7*sizeof (WCHAR)))
-need_fix_tab_position = true;
-  /* Workaround for broken CSI3J (ESC[3J) support in xterm compatible mode. */
-  if (wincap.has_con_24bit_colors () && !con_is_legacy &&
-  wincap.has_con_broken_csi3j ())
-{
-  WCHAR *p = buf;
-  while ((p = (WCHAR *) memmem (p, (len - (p - buf))*sizeof (WCHAR),
-   L"\033[3J", 4*sizeof (WCHAR
-   {
- memmove (p, p+4, (len - (p+4 - buf))*sizeof (WCHAR));
- len -= 4;
-   }
-}
-
   if (con.iso_2022_G1
? con.vt100_graphics_mode_G1
: con.vt100_graphics_mode_G0)
@@ -1822,9 +1804,6 @@ fhandler_console::write_console (PWCHAR buf, DWORD len, 
DWORD& done)
   len -= done;
   buf += done;
 }
-  /* Call fix_tab_position() if screen has been alternated. */
-  if (need_fix_tab_position)
-fix_tab_position ();
   return true;
 }
 
@@ -2089,6 +2068,28 @@ fhandler_console::char_command (char c)
  WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
}
  break;
+   case 'J': /* ED */
+ wpbuf_put (c);
+ /* Ignore CSI3J in Win10 1809 because it is broken. */
+ if (con.args[0] != 3 || !wincap.has_con_broken_csi3j ())
+   WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ break;
+   case 'h': /* DECSET */
+   case 'l': /* DECRST */
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ if (con.saw_question_mark)
+   {
+ bool need_fix_tab_position = false;
+ for (int i = 0; i < con.nargs; i++)
+   if (con.args[i] == 1049)
+ need_fix_tab_position = true;
+ /* Call fix_tab_position() if screen has been alternated. */
+ if (need_fix_tab_position)
+   fix_tab_position ();
+   }
+ break;
default:
  /* Other escape sequences */
  wpbuf_put (c);
-- 
2.21.0



[PATCH v2 1/4] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-26 Thread Takashi Yano
- Cygwin console with xterm compatible mode causes problem reported
  in https://www.cygwin.com/ml/cygwin-patches/2020-q1/msg00212.html
  if background/foreground colors are set to gray/black respectively
  in Win10 1903/1909. This is caused by "CSI Ps L" (IL), "CSI Ps M"
  (DL) and "ESC M" (RI) control sequences which are broken. This
  patch adds a workaround for the issue.
---
 winsup/cygwin/fhandler_console.cc | 156 +-
 winsup/cygwin/wincap.cc   |  10 ++
 winsup/cygwin/wincap.h|   2 +
 3 files changed, 166 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc 
b/winsup/cygwin/fhandler_console.cc
index 328424a7d..c2198ea1e 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -57,6 +57,16 @@ bool NO_COPY fhandler_console::invisible_console;
Only one console can exist in a process, therefore, static is suitable. */
 static struct fhandler_base::rabuf_t con_ra;
 
+/* Write pending buffer for ESC sequence handling
+   in xterm compatible mode */
+#define WPBUF_LEN 256
+static unsigned char wpbuf[WPBUF_LEN];
+static int wpixput;
+#define wpbuf_put(x) \
+  wpbuf[wpixput++] = x; \
+  if (wpixput > WPBUF_LEN) \
+wpixput--;
+
 static void
 beep ()
 {
@@ -2014,6 +2024,82 @@ fhandler_console::char_command (char c)
   char buf[40];
   int r, g, b;
 
+  if (wincap.has_con_24bit_colors () && !con_is_legacy)
+{
+  /* For xterm compatible mode */
+  DWORD wn;
+  switch (c)
+   {
+   case 'r': /* DECSTBM */
+ con.scroll_region.Top = con.args[0] ? con.args[0] - 1 : 0;
+ con.scroll_region.Bottom = con.args[1] ? con.args[1] - 1 : -1;
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ break;
+   case 'L': /* IL */
+ if (wincap.has_con_broken_il_dl ())
+   {
+ /* Use "CSI Ps T" instead */
+ cursor_get (, );
+ __small_sprintf (buf, "\033[%d;%dr",
+  y + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ wpbuf_put ('T');
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ __small_sprintf (buf, "\033[%d;%dr",
+  srTop + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ __small_sprintf (buf, "\033[%d;%dH",
+  y + 1 - con.b.srWindow.Top, x + 1);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+   }
+ else
+   {
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+   }
+ break;
+   case 'M': /* DL */
+ if (wincap.has_con_broken_il_dl ())
+   {
+ /* Use "CSI Ps S" instead */
+ cursor_get (, );
+ __small_sprintf (buf, "\033[%d;%dr",
+  y + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ wpbuf_put ('S');
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ __small_sprintf (buf, "\033[%d;%dr",
+  srTop + 1 - con.b.srWindow.Top,
+  srBottom + 1 - con.b.srWindow.Top);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+ __small_sprintf (buf, "\033[%d;%dH",
+  y + 1 - con.b.srWindow.Top, x + 1);
+ WriteConsoleA (get_output_handle (), buf, strlen (buf), , 0);
+   }
+ else
+   {
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+   }
+ break;
+   default:
+ /* Other escape sequences */
+ wpbuf_put (c);
+ /* Just send the sequence */
+ WriteConsoleA (get_output_handle (), wpbuf, wpixput, , 0);
+ break;
+   }
+  return;
+}
+
+  /* For legacy cygwin treminal */
   switch (c)
 {
 case 'm':   /* Set Graphics Rendition */
@@ -2641,6 +2727,7 @@ fhandler_console::write_normal (const unsigned char *src,
   while (found < end
 && found - src < CONVERT_LIMIT
 && base_chars[*found] != IGN
+&& base_chars[*found] != ESC
 && ((wincap.has_con_24bit_colors () && !con_is_legacy)
 || base_chars[*found] == NOR))
 {
@@ -2712,6 +2799,7 @@ do_print:
  break;
case ESC:
  con.state = gotesc;

Vous cherchez un bon comptable

2020-02-26 Thread FINANCEJOB.ma
Pour vous désinscrire, cliquez sur ce lien :
Désinscrire


--
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: [ANNOUNCEMENT] Updated: gcc-9.2.0-2 (x86/x86_64)

2020-02-26 Thread Denis Excoffier


> On 2020-02-25 01:18, Jon Turney wrote :
> 
> On 24/02/2020 23:35, JonY wrote:
>> On 2/24/20 8:21 PM, Achim Gratz wrote:
>>> JonY writes:
 gcc-9.2.0-2 has been uploaded for Cygwin. This version is the same as
 -1, just repackaged and marked as stable.
>>> 
>>> This version of gcc requires a newer binutils than defined as current in
>>> the Cygwin repo, so until this gets corrected one needs to manually
>>> switch to the test version binutils-2.31.1-1.
> 
> binutils-2.31.1-1 has been promoted from test to current.
> 

In order to compile cleanly the last snapshot with gcc 9.2.0, i had to apply 
the following patch (see below).
Otherwise one get an uninitialized variable together with a missing 
__attribute__.

Regards,

Denis Excoffier.

diff -cNr cygwin-snapshot-20200221-1o/winsup/cygwin/exec.cc 
cygwin-snapshot-20200221-1p/winsup/cygwin/exec.cc
*** cygwin-snapshot-20200221-1o/winsup/cygwin/exec.cc   Mon Jun 27 13:27:22 2016
--- cygwin-snapshot-20200221-1p/winsup/cygwin/exec.cc   Wed Feb 26 08:42:33 2020
***
*** 85,91 
  {
return spawnve (_P_OVERLAY, path, argv, envp);
  }
! EXPORT_ALIAS (execve, _execve)/* For newlib */
  
  extern "C" int
  execvp (const char *file, char * const *argv)
--- 85,92 
  {
return spawnve (_P_OVERLAY, path, argv, envp);
  }
! //EXPORT_ALIAS (execve, _execve)  /* For newlib */
! extern "C" __typeof (execve) _execve __attribute__ ((alias("execve"), 
nothrow));
  
  extern "C" int
  execvp (const char *file, char * const *argv)
diff -cNr cygwin-snapshot-20200221-1o/winsup/cygwin/posix_timer.cc 
cygwin-snapshot-20200221-1p/winsup/cygwin/posix_timer.cc
*** cygwin-snapshot-20200221-1o/winsup/cygwin/posix_timer.ccFri Mar  8 
12:58:25 2019
--- cygwin-snapshot-20200221-1p/winsup/cygwin/posix_timer.ccWed Feb 26 
08:41:33 2020
***
*** 81,87 
  LONG
  timer_tracker::disarm_overrun_event ()
  {
!   LONG ret;
  
AcquireSRWLockExclusive ();
if (overrun_count != OVR_DISARMED)
--- 81,87 
  LONG
  timer_tracker::disarm_overrun_event ()
  {
!   LONG ret = 0;
  
AcquireSRWLockExclusive ();
if (overrun_count != OVR_DISARMED)




--
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 1/2] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-26 Thread Corinna Vinschen
On Feb 26 20:12, Takashi Yano wrote:
> Hi Corinna,
> 
> On Wed, 26 Feb 2020 02:14:37 +0900
> Takashi Yano wrote:
> > - Cygwin console with xterm compatible mode causes problem reported
> >   in https://www.cygwin.com/ml/cygwin-patches/2020-q1/msg00212.html
> >   if background/foreground colors are set to gray/black respectively
> >   in Win10 1903/1909. This is caused by "CSI Ps L" (IL), "CSI Ps M"
> >   (DL) and "ESC M" (RI) control sequences which are broken. This
> >   patch adds a workaround for the issue. Also, workaround code for
> >   "CSI3J" and "CSI?1049h/l" are unified into the codes handling
> >   escape sequences above.
> 
> Hmm, this fix seems to be not enough...
> Could you please wait?

Sure, no hurry!


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


Re: [PATCH] cpuinfo:power management: add proc_feedback, acc_power

2020-02-26 Thread Corinna Vinschen
On Feb 25 16:44, Brian Inglis wrote:
> linux 4.6 x86/cpu: Add advanced power management bits
> Bit 11 of CPUID 8000_0007 edx is processor feedback interface.
> Bit 12 of CPUID 8000_0007 edx is accumulated power.
> 
> Print proper names in /proc/cpuinfo
> 
> [missed enabling this 2016 change during previous major cpuinfo update
> as no power related changes were made to the Linux files since then]
> ---
>  winsup/cygwin/fhandler_proc.cc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
> index 030ade68a..605a8443f 100644
> --- a/winsup/cygwin/fhandler_proc.cc
> +++ b/winsup/cygwin/fhandler_proc.cc
> @@ -1397,8 +1397,8 @@ format_proc_cpuinfo (void *, char *)
>  /* ftcprint (features1,  8, "invariant_tsc"); */ /* TSC invariant */
> ftcprint (features1,  9, "cpb");  /* core performance boost */
> ftcprint (features1, 10, "eff_freq_ro");  /* ro eff freq interface */
> -/* ftcprint (features1, 11, "proc_feedback"); */ /* proc feedback if */
> -/* ftcprint (features1, 12, "acc_power"); */ /* core power reporting */
> +   ftcprint (features1, 11, "proc_feedback");/* proc feedback if */
> +   ftcprint (features1, 12, "acc_power");/* core power reporting */
>  /* ftcprint (features1, 13, "connstby"); */  /* connected standby */
>  /* ftcprint (features1, 14, "rapl"); */  /* running average power 
> limit */
>   }
> -- 
> 2.21.0

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


[newlib-cygwin] cpuinfo:power management: add proc_feedback, acc_power

2020-02-26 Thread Corinna Vinschen
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4653cc92ed509b8f9b340b16920e8cb683c85f40

commit 4653cc92ed509b8f9b340b16920e8cb683c85f40
Author: Brian Inglis 
Date:   Tue Feb 25 16:44:16 2020 -0700

cpuinfo:power management: add proc_feedback, acc_power

linux 4.6 x86/cpu: Add advanced power management bits
Bit 11 of CPUID 8000_0007 edx is processor feedback interface.
Bit 12 of CPUID 8000_0007 edx is accumulated power.

Print proper names in /proc/cpuinfo

[missed enabling this 2016 change during previous major cpuinfo update
as no power related changes were made to the Linux files since then]

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

diff --git a/winsup/cygwin/fhandler_proc.cc b/winsup/cygwin/fhandler_proc.cc
index 030ade6..605a844 100644
--- a/winsup/cygwin/fhandler_proc.cc
+++ b/winsup/cygwin/fhandler_proc.cc
@@ -1397,8 +1397,8 @@ format_proc_cpuinfo (void *, char *)
 /*   ftcprint (features1,  8, "invariant_tsc"); */ /* TSC invariant */
  ftcprint (features1,  9, "cpb");  /* core performance boost */
  ftcprint (features1, 10, "eff_freq_ro");  /* ro eff freq interface */
-/*   ftcprint (features1, 11, "proc_feedback"); */ /* proc feedback if */
-/*   ftcprint (features1, 12, "acc_power"); */ /* core power reporting */
+ ftcprint (features1, 11, "proc_feedback");/* proc feedback if */
+ ftcprint (features1, 12, "acc_power");/* core power reporting */
 /*   ftcprint (features1, 13, "connstby"); */  /* connected standby */
 /*   ftcprint (features1, 14, "rapl"); */  /* running average power 
limit */
}


Re: [PATCH 1/2] Cygwin: console: Add workaround for broken IL/DL in xterm mode.

2020-02-26 Thread Takashi Yano
Hi Corinna,

On Wed, 26 Feb 2020 02:14:37 +0900
Takashi Yano wrote:
> - Cygwin console with xterm compatible mode causes problem reported
>   in https://www.cygwin.com/ml/cygwin-patches/2020-q1/msg00212.html
>   if background/foreground colors are set to gray/black respectively
>   in Win10 1903/1909. This is caused by "CSI Ps L" (IL), "CSI Ps M"
>   (DL) and "ESC M" (RI) control sequences which are broken. This
>   patch adds a workaround for the issue. Also, workaround code for
>   "CSI3J" and "CSI?1049h/l" are unified into the codes handling
>   escape sequences above.

Hmm, this fix seems to be not enough...
Could you please wait?

-- 
Takashi Yano 


Re: directory without search permission is searchable?

2020-02-26 Thread Corinna Vinschen
On Feb 26 08:42, Thomas Wolff wrote:
> Am 26.02.2020 um 06:29 schrieb Jun T:
> > It seems 'ls -l dir/file' or 'stat dir/file' succeeds even if
> > I don't have read/search permission for the 'dir'.
> > 
> > Create a directory and a file in it:
> > 
> > $ mkdir tmpdir
> > $ ls -ld tmpdir
> > drwxr-xr-x+ 1 takimoto none 0 Feb 26 12:46 tmpdir
> > $ touch tmpdir/afile
> > $ ls -l tmpdir/afile
> > -rw-r--r-- 1 takimoto 0 none Feb 26 12:46 tmpdir/afile
> > 
> > Remove all permissions from tmpdir:
> > 
> > $ chmod  tmpdir
> > $ ls -ld tmpdir
> > d-+ 1 takimoto none 0 Feb 26 12:46 tmpdir
> > $ getfacl tmpdir
> > # file: tmpdir
> > # owner: takimoto
> > # group: none
> > user::---
> > group::---
> > other::---
> > default:user::rwx
> > default:group::r-x
> > default:other::r-x
> > 
> > This fails as expected:
> > 
> > $ ls -l tmpdir
> > ls: cannot open directory 'tmpdir': Permission denied
> > 
> > But the followings succeed (should fail, I believe):
> > 
> > $ ls -l tmpdir/afile
> > -rw-r--r-- 1 takimoto none 0 Feb 26 12:46 tmpdir/afile
> > $ stat tmpdir/afile
> >File: tmpdir/afile
> >Size: 0   Blocks: 0  IO Block: 65536  regular empty 
> > file
> > Device: d05d00abh/3495755947d   Inode: 14636698789089092  Links: 1
> > Access: (0644/-rw-r--r--)  Uid: (197609/takimoto)   Gid: (197121/  none)
> > Access: 2020-02-26 12:46:12.478966400 +0900
> > Modify: 2020-02-26 12:46:12.478966400 +0900
> > Change: 2020-02-26 12:46:12.464849300 +0900
> >   Birth: 2020-02-26 12:46:12.464849300 +0900
> > 
> > Does this happen only for me?
> To confirm, I noticed this before.

This is Windows for you:

https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/bypass-traverse-checking

The default is to bypass traverse checking for *all* users.  If you
change this in the "Local Security Policy" for a user, bad things happen,
as described in the "Potential impact" section in thew above document.

Way back when we had code in Cygwin which enabled traverse checking for
a while.  It always resulted in problems, so we reverted it.  I always
planned to reenable that in a lean way, that is, only at "open file on
NTFS" rather than the original "always on as soon as the process
starts", but I never got around to it.  In fact, it doesn't make much
sense to disallow Cygwin processes access to files, a native Windows
process can easily access, so I scratched the idea.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer


signature.asc
Description: PGP signature


[ANNOUNCEMENT] Updated: binutils-2.34-1 (x86/x86_64)

2020-02-26 Thread JonY
The following packages have been uploaded to the Cygwin distribution:

* binutils-2.34

This version was tested by building gcc-9.2.0.


  *** 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  cygwin.com

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

http://sourceware.org/lists.html#unsubscribe-simple

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




signature.asc
Description: OpenPGP digital signature


Updated: binutils-2.34-1 (x86/x86_64)

2020-02-26 Thread JonY
The following packages have been uploaded to the Cygwin distribution:

* binutils-2.34

This version was tested by building gcc-9.2.0.


  *** 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  cygwin.com

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

http://sourceware.org/lists.html#unsubscribe-simple

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




signature.asc
Description: OpenPGP digital signature


Updated: octave-5.2.0-1

2020-02-26 Thread Marco Atzeri

New versions 5.2.0-1 of

   octave
   octave-devel
   octave-doc

are available in the Cygwin distribution:

CHANGES
Latest upstream  release.
https://www.gnu.org/software/octave/news/release/2020/01/31/octave-5.2.0-released.html

Full changes for 5.x series:
https://www.gnu.org/software/octave/NEWS-5.1.html

GENERAL NOTE
there are 2 octave main binaries with multiple graphic properties

octave  command line with full plotting capabilities

octave --guigraphical interface

octave-cli  command line inteface with plotting
restricted to fltk and gnuplot toolkits

Of the 3 graphics toolkit fltk, gnuplot and qt
fltk is the worst performing on cygwin
gnuplot the lightest
qt the most graphic rich

OCTAVE-FORGE NOTE
You need to install with setup the specific forge package
you are looking for.

The update of the global pkg database is managed
by cygwin setup during the postinstall phase.
A semaphore system is in place to update the database only when needed
and just one time, also when multiple forge packages are added or removed.

DESCRIPTION
The GNU Octave language for numerical computations is a (mostly
Matlab (R) compatible) high-level language, primarily intended
for numerical computations.  It provides a convenient command-line
interface for solving linear and nonlinear problems numerically.

HOMEPAGE
http://www.gnu.org/software/octave/

Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .



[ANNOUNCEMENT] Updated: octave-5.2.0-1

2020-02-26 Thread Marco Atzeri

New versions 5.2.0-1 of

   octave
   octave-devel
   octave-doc

are available in the Cygwin distribution:

CHANGES
Latest upstream  release.
https://www.gnu.org/software/octave/news/release/2020/01/31/octave-5.2.0-released.html

Full changes for 5.x series:
https://www.gnu.org/software/octave/NEWS-5.1.html

GENERAL NOTE
there are 2 octave main binaries with multiple graphic properties

octave  command line with full plotting capabilities

octave --guigraphical interface

octave-cli  command line inteface with plotting
restricted to fltk and gnuplot toolkits

Of the 3 graphics toolkit fltk, gnuplot and qt
fltk is the worst performing on cygwin
gnuplot the lightest
qt the most graphic rich

OCTAVE-FORGE NOTE
You need to install with setup the specific forge package
you are looking for.

The update of the global pkg database is managed
by cygwin setup during the postinstall phase.
A semaphore system is in place to update the database only when needed
and just one time, also when multiple forge packages are added or removed.

DESCRIPTION
The GNU Octave language for numerical computations is a (mostly
Matlab (R) compatible) high-level language, primarily intended
for numerical computations.  It provides a convenient command-line
interface for solving linear and nonlinear problems numerically.

HOMEPAGE
http://www.gnu.org/software/octave/

Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

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