Re: Cygwin 3.4.9 - how to install ssh-keygen

2023-11-21 Thread Matthias--- via Cygwin
Am Dienstag, dem 21.11.2023 um 19:23 -0700 schrieb Brian Inglis:
> On 2023-11-20 09:54, Matthias--- via Cygwin wrote:
> > Dear all,
> >
> > I've installed cygwin 3.4.9-1 in my virtualbox running on Windows 10.
> > After installing defaults plus openssh 9.5p 1-1, I open the 
> > Cygwin64-Terminal as Administrator
> > and
> > run ssh-host-config.
> >   * Answered "yes" to create the /etc/ssh_config and /etc/sshd_config
> >   * Answered "no" to use StrictMode
> >   * and "yes" to install sshd as a service
> >   * I just press  for the question for "Value of CYGWIN for the 
> > daemon".
> > cygrunsrv -S cygsshd will not start the sshd. The logfile say "no hostkeys 
> > available".
> >
> > Unfortunately  I can't find ssh-keygen in the installable packages.
> > Howto install ssh-keygen or how to create hostkeys?
>
> Delete any manually created directories as permissions are likely wrong then 
> run
>
> $ /usr/bin/ssh-user-config
>
Thank you,
$HOME/.ssh has been created with id_dsa and id_dsa.pub
rsa and ecdsa hasn't been created also if it said "*** Info: Generating 
/home/meyer/.ssh/id_..."

Br
Matthias


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


Re: inkscape installed but does nothing

2023-11-21 Thread Brian Inglis via Cygwin

On 2023-11-21 21:33, René Berber via Cygwin wrote:

On 11/21/2023 10:23 PM, J.F. Huesman via Cygwin wrote:


I installed inkscape 0.92.3-1 using the cygwin update program.Calling
inkscape does nothing. 

[snip]

All graphical apps use Cygwin/X (or any X Windows).


To check that Cygwin/X server is installed:

$ which xinit xwin
/usr/bin/xinit
/usr/bin/xwin

if not then install xinit and that pulls in all the other machinery.

Or you can display on a remote host X server using e.g.

$ DISPLAY=:0 inkscape ... &

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

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry


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


Re: inkscape installed but does nothing

2023-11-21 Thread René Berber via Cygwin

On 11/21/2023 10:23 PM, J.F. Huesman via Cygwin wrote:


I installed inkscape 0.92.3-1 using the cygwin update program.Calling
inkscape does nothing. 

[snip]

All graphical apps use CygwinX (or any X Windows).
--
RB




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


inkscape installed but does nothing

2023-11-21 Thread J.F. Huesman via Cygwin
I installed inkscape 0.92.3-1 using the cygwin update program.Calling inkscape 
does nothing. No file processed or output.
which inkscape/usr/bin/inkscape
/usr/bin/ is in the PATH
inkscape -V[nothing...blank line then back to prompt]
Running inkscape with the -? or --help returns nothing but a blank line and 
back to the prompt.
I tried uninstalling and reinstalling. Same behavior.I restarted the computer. 
Same behavior.I ran cygwin terminal with Administrator privileges. Same 
behavior.
System info:
CYGWIN_NT-10.0-19045 Quintessential 3.4.9-1.x86_64 2023-09-06 11:19 UTC x86_64 
Cygwin
Device name QuintessentialProcessor AMD Athlon(tm) II X4 630 Processor   2.80 
GHzInstalled RAM 16.0 GBDevice ID EC60A66C-74D5-476F-BB7D-A2B3418AE297Product 
ID 00326-1-0-AA260System type 64-bit operating system, x64-based 
processorPen and touch No pen or touch input is available for this display

Any suggestions would be appreciated.John
  
"God used beautiful mathematics in creating the world." -Paul Dirac
  
"God is dead." -Nietzsche (1882) 
"Nietzsche is dead." -God (1900)  
To date, Nietzsche has not responded.  
  
"If you study science deep enough and long enough, it will force you to believe 
in God." -Lord William Kelvin

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


Re: Cygwin 3.4.9 - how to install ssh-keygen

2023-11-21 Thread Brian Inglis via Cygwin

On 2023-11-20 09:54, Matthias--- via Cygwin wrote:

Dear all,

I've installed cygwin 3.4.9-1 in my virtualbox running on Windows 10.
After installing defaults plus openssh 9.5p 1-1, I open the Cygwin64-Terminal 
as Administrator and
run ssh-host-config.
  * Answered "yes" to create the /etc/ssh_config and /etc/sshd_config
  * Answered "no" to use StrictMode
  * and "yes" to install sshd as a service
  * I just press  for the question for "Value of CYGWIN for the daemon".
cygrunsrv -S cygsshd will not start the sshd. The logfile say "no hostkeys 
available".

Unfortunately  I can't find ssh-keygen in the installable packages.
Howto install ssh-keygen or how to create hostkeys?


Delete any manually created directories as permissions are likely wrong then run

$ /usr/bin/ssh-user-config

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

La perfection est atteinte   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry

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


Re: Cygwin 3.4.9 - how to install ssh-keygen

2023-11-21 Thread Lee via Cygwin
On Tue, Nov 21, 2023 at 2:07 PM Hans-Bernhard Bröker wrote:
>
> I  can't see a command like
>
> cygcheck -p ssh-keygen
>
> as noticeably more cumbersome than comparable commands of other
> distributions

But you _can_ see/realize the implications of that command :)
I did a 'man cygcheck' before posting my reply, but somehow didn't notice

 -p, --package-query  search for REGEXP in the entire
cygwin.com package
  repository (requires internet connectivity)

which, in hindsight, seems really obvious but somehow I did miss it so
thanks for pointing it out!

Regards,
Lee


>
> Lee via Cygwin  schrieb am Mo., 20. Nov. 2023, 23:42:
>
> > On Mon, Nov 20, 2023 at 11:54 AM Matthias wrote:
> > >
> > > Dear all,
> > >
> > > I've installed cygwin 3.4.9-1 in my virtualbox running on Windows 10.
> > > After installing defaults plus openssh 9.5p 1-1, I open the
> > Cygwin64-Terminal as Administrator and
> > > run ssh-host-config.
> > >  * Answered "yes" to create the /etc/ssh_config and /etc/sshd_config
> > >  * Answered "no" to use StrictMode
> > >  * and "yes" to install sshd as a service
> > >  * I just press  for the question for "Value of CYGWIN for the
> > daemon".
> > > cygrunsrv -S cygsshd will not start the sshd. The logfile say "no
> > hostkeys available".
> > >
> > > Unfortunately  I can't find ssh-keygen in the installable packages.
> > > Howto install ssh-keygen or how to create hostkeys?
> >
> > The easy way to see if it's already installed
> >   $ which ssh-keygen
> >   /usr/bin/ssh-keygen
> >
> > If no, Cygwin is a bit of a pain when looking for a program that's
> > included in another package.
> >
> > There's probably a better way, but I use the cygwin package search - eg:
> >   https://cygwin.com/cgi-bin2/package-grep.cgi?grep=ssh-keygen
> > and then take a guess as the most likely candidate in the results list
> > and click on that link to see if it's included in that package - eg
> >
> > https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fopenssh%2Fopenssh-9.5p1-1=ssh-keygen
> >
> >
> > Regards
> > Lee

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


Fwd: Cygwin 3.4.9 - how to install ssh-keygen

2023-11-21 Thread Hans-Bernhard Bröker via Cygwin
I  can't see a command like

cygcheck -p ssh-keygen

as noticeably more cumbersome than comparable commands of other
distributions

Lee via Cygwin  schrieb am Mo., 20. Nov. 2023, 23:42:

> On Mon, Nov 20, 2023 at 11:54 AM Matthias wrote:
> >
> > Dear all,
> >
> > I've installed cygwin 3.4.9-1 in my virtualbox running on Windows 10.
> > After installing defaults plus openssh 9.5p 1-1, I open the
> Cygwin64-Terminal as Administrator and
> > run ssh-host-config.
> >  * Answered "yes" to create the /etc/ssh_config and /etc/sshd_config
> >  * Answered "no" to use StrictMode
> >  * and "yes" to install sshd as a service
> >  * I just press  for the question for "Value of CYGWIN for the
> daemon".
> > cygrunsrv -S cygsshd will not start the sshd. The logfile say "no
> hostkeys available".
> >
> > Unfortunately  I can't find ssh-keygen in the installable packages.
> > Howto install ssh-keygen or how to create hostkeys?
>
> The easy way to see if it's already installed
>   $ which ssh-keygen
>   /usr/bin/ssh-keygen
>
> If no, Cygwin is a bit of a pain when looking for a program that's
> included in another package.
>
> There's probably a better way, but I use the cygwin package search - eg:
>   https://cygwin.com/cgi-bin2/package-grep.cgi?grep=ssh-keygen
> and then take a guess as the most likely candidate in the results list
> and click on that link to see if it's included in that package - eg
>
> https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fopenssh%2Fopenssh-9.5p1-1=ssh-keygen
>
>
> Regards
> Lee
>
> --
> Problem reports:  https://cygwin.com/problems.html
> FAQ:  https://cygwin.com/faq/
> Documentation:https://cygwin.com/docs.html
> Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple
>

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


Re: [PATCH] Cygwin: Add /dev/disk/by-label and /dev/disk/by-uuid symlinks

2023-11-21 Thread Corinna Vinschen
On Nov 21 19:31, Christian Franke wrote:
> Corinna Vinschen wrote:
> > Hi Christian,
> > 
> > Looks good, but I just realized that I was already wondering about the
> > sanitization and forgot to talk about it:
> > 
> > On Nov 21 12:24, Christian Franke wrote:
> > > diff --git a/winsup/cygwin/fhandler/dev_disk.cc 
> > > b/winsup/cygwin/fhandler/dev_disk.cc
> > > index c5d72816f..d12ac52fa 100644
> > > --- a/winsup/cygwin/fhandler/dev_disk.cc
> > > +++ b/winsup/cygwin/fhandler/dev_disk.cc
> > > @@ -64,10 +64,12 @@ sanitize_label_string (WCHAR *s)
> > > /* Linux does not skip leading spaces. */
> > > return sanitize_string (s, L'\0', L' ', L'_', [] (WCHAR c) -> bool
> > >   {
> > > -  /* Labels may contain characters not allowed in filenames.
> > > -  Linux replaces spaces with \x20 which is not an option here. */
> > > +  /* Labels may contain characters not allowed in filenames.  Also
> > Apart from slash and backslash, we don't have this problem in Cygwin,
> > usually.  Even control characters are no problem.  All chars not allowed
> > in filenames are just transposed into the Unicode private use area, as
> > per strfuncs.cc, line 20ff on the way to storage, and back when reading
> > the names from storage.  This, and especially in a virtual filesystem
> > like /proc, there's no reason to avoid these characters.
> 
> Thanks for clarification.
> 
> 
> > 
> > > + replace '#' to avoid that duplicate markers introduce new
> > > +  duplicates.  Linux replaces spaces with \x20 which is not an
> > > +  option here. */
> > > return !((0 <= c && c <= L' ') || c == L':' || c == L'/' || c == 
> > > L'\\'
> > > -   || c == L'"');
> > > +   || c == L'#' || c == L'"');
> > If you really want to avoid chars not allowed in DOS filenames, the
> > list seems incomplete, missing '<', '>', '?', '*', '|'.
> > 
> > But as I said, there's really no reason for that.  I simply reduced the
> > above expression to
> > 
> >return !(c == L'/' || c == L'\\' || c == L'#');
> > 
> > and created a disk label
> > 
> >test"foo*bar?baz:"
> > 
> > It works nicely, including stuff like
> > 
> >$ ls *\"*
> >$ ls *\**
> > 
> > So, I can push it as is, or we just allow everything and the kitchen sink
> > as per the reduced filter expression.  What do you prefer?
> 
> The latter - patch attached.

Pushed.

Thanks a lot,
Corinna


Re: [PATCH] Cygwin: Add /dev/disk/by-label and /dev/disk/by-uuid symlinks

2023-11-21 Thread Christian Franke

Corinna Vinschen wrote:

Hi Christian,

Looks good, but I just realized that I was already wondering about the
sanitization and forgot to talk about it:

On Nov 21 12:24, Christian Franke wrote:

diff --git a/winsup/cygwin/fhandler/dev_disk.cc 
b/winsup/cygwin/fhandler/dev_disk.cc
index c5d72816f..d12ac52fa 100644
--- a/winsup/cygwin/fhandler/dev_disk.cc
+++ b/winsup/cygwin/fhandler/dev_disk.cc
@@ -64,10 +64,12 @@ sanitize_label_string (WCHAR *s)
/* Linux does not skip leading spaces. */
return sanitize_string (s, L'\0', L' ', L'_', [] (WCHAR c) -> bool
  {
-  /* Labels may contain characters not allowed in filenames.
-Linux replaces spaces with \x20 which is not an option here. */
+  /* Labels may contain characters not allowed in filenames.  Also

Apart from slash and backslash, we don't have this problem in Cygwin,
usually.  Even control characters are no problem.  All chars not allowed
in filenames are just transposed into the Unicode private use area, as
per strfuncs.cc, line 20ff on the way to storage, and back when reading
the names from storage.  This, and especially in a virtual filesystem
like /proc, there's no reason to avoid these characters.


Thanks for clarification.





+ replace '#' to avoid that duplicate markers introduce new
+duplicates.  Linux replaces spaces with \x20 which is not an
+option here. */
return !((0 <= c && c <= L' ') || c == L':' || c == L'/' || c == L'\\'
- || c == L'"');
+ || c == L'#' || c == L'"');

If you really want to avoid chars not allowed in DOS filenames, the
list seems incomplete, missing '<', '>', '?', '*', '|'.

But as I said, there's really no reason for that.  I simply reduced the
above expression to

   return !(c == L'/' || c == L'\\' || c == L'#');

and created a disk label

   test"foo*bar?baz:"

It works nicely, including stuff like

   $ ls *\"*
   $ ls *\**

So, I can push it as is, or we just allow everything and the kitchen sink
as per the reduced filter expression.  What do you prefer?


The latter - patch attached.

Christian

From ecc54356adbe7768bd5fd5561c78c67cd5725183 Mon Sep 17 00:00:00 2001
From: Christian Franke 
Date: Tue, 21 Nov 2023 19:28:02 +0100
Subject: [PATCH] Cygwin: /dev/disk: Append '#N' if the same name appears more
 than once

No longer drop ranges of identical link names.  Append '#0, #1, ...'
to each name instead.  Enhance charset allowed in label names.
No longer ignore null volume serial numbers.

Signed-off-by: Christian Franke 
---
 winsup/cygwin/fhandler/dev_disk.cc | 54 ++
 1 file changed, 33 insertions(+), 21 deletions(-)

diff --git a/winsup/cygwin/fhandler/dev_disk.cc 
b/winsup/cygwin/fhandler/dev_disk.cc
index c5d72816f..29af9de95 100644
--- a/winsup/cygwin/fhandler/dev_disk.cc
+++ b/winsup/cygwin/fhandler/dev_disk.cc
@@ -64,10 +64,11 @@ sanitize_label_string (WCHAR *s)
   /* Linux does not skip leading spaces. */
   return sanitize_string (s, L'\0', L' ', L'_', [] (WCHAR c) -> bool
 {
-  /* Labels may contain characters not allowed in filenames.
-Linux replaces spaces with \x20 which is not an option here. */
-  return !((0 <= c && c <= L' ') || c == L':' || c == L'/' || c == L'\\'
- || c == L'"');
+  /* Labels may contain characters not allowed in filenames.  Also
+ replace '#' to avoid that duplicate markers introduce new
+duplicates.  Linux replaces spaces with \x20 which is not an
+option here. */
+  return !(c == L'/' || c == L'\\' || c == L'#');
 }
   );
 }
@@ -304,8 +305,7 @@ partition_to_label_or_uuid(bool uuid, const UNICODE_STRING 
*drive_uname,
   const NTFS_VOLUME_DATA_BUFFER *nvdb =
 reinterpret_cast(ioctl_buf);
   if (uuid && DeviceIoControl (volhdl, FSCTL_GET_NTFS_VOLUME_DATA, nullptr, 0,
-  ioctl_buf, NT_MAX_PATH, _read, nullptr)
-  && nvdb->VolumeSerialNumber.QuadPart)
+  ioctl_buf, NT_MAX_PATH, _read, nullptr))
 {
   /* Print without any separator as on Linux. */
   __small_sprintf (name, "%016X", nvdb->VolumeSerialNumber.QuadPart);
@@ -327,13 +327,9 @@ partition_to_label_or_uuid(bool uuid, const UNICODE_STRING 
*drive_uname,
   FILE_FS_VOLUME_INFORMATION *ffvi =
 reinterpret_cast(ioctl_buf);
   if (uuid)
-{
-  if (!ffvi->VolumeSerialNumber)
-   return false;
-  /* Print with separator as on Linux. */
-  __small_sprintf (name, "%04x-%04x", ffvi->VolumeSerialNumber >> 16,
-  ffvi->VolumeSerialNumber & 0x);
-}
+/* Print with separator as on Linux. */
+__small_sprintf (name, "%04x-%04x", ffvi->VolumeSerialNumber >> 16,
+ffvi->VolumeSerialNumber & 0x);
   else
 {
   /* Label is not null terminated. */
@@ -361,6 +357,20 @@ by_id_compare_name (const void *a, const void *b)
   return strcmp (ap->name, bp->name);
 }
 
+static int

RE: [EXTERNAL] Re: Please support download setup-x86_64.exe on IPv6-only network

2023-11-21 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C] via Cygwin
> :::0:0:0/96 == :::0:a.b.c.d

https://www.ibm.com/docs/en/zos/2.1.0?topic=addresses-ipv4-mapped-ipv6

Mapped IPv4 addresses have the :::a.b.c.d short form, without any 
intervening 0 word.  The CIDR form above just denotes that 96 bits
are the prefix (the "network" part) and, thus, the remaining 32 bits is the 
host part within the network.  IPv6 addresses are 128 bit long.

But the :::0:a.b.c.d notation is not a mapped IPv4 address, it's just some 
IPv6 address which is written with last
four octets in the IPv4 notation (any IPv6 address can be accepted this way), 
but when you convert it back from its binary
form, that won't re-emerge the same way because only IPv4 compatible (all 96 
leading bits zero) or IPv4 mapped (80 zero bits
followed by 16 one bits) followed by 4 bytes of IPv4 address) can be 
conventionally written in the IPv4 form (depending
on the system settings).

E.g. 1.2.3.4 (input) -> (binary rep) :::1.2.3.4 -> (output) 1.2.3.4

but

:::0:1.2.3.4 -> (binary rep, same) -> (output) :::0:102:304

HTH,

Anton Lavrentiev
Contractor NIH/NLM/NCBI


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


Re: [PATCH] Cygwin: Add /dev/disk/by-label and /dev/disk/by-uuid symlinks

2023-11-21 Thread Corinna Vinschen
Hi Christian,

Looks good, but I just realized that I was already wondering about the
sanitization and forgot to talk about it:

On Nov 21 12:24, Christian Franke wrote:
> diff --git a/winsup/cygwin/fhandler/dev_disk.cc 
> b/winsup/cygwin/fhandler/dev_disk.cc
> index c5d72816f..d12ac52fa 100644
> --- a/winsup/cygwin/fhandler/dev_disk.cc
> +++ b/winsup/cygwin/fhandler/dev_disk.cc
> @@ -64,10 +64,12 @@ sanitize_label_string (WCHAR *s)
>/* Linux does not skip leading spaces. */
>return sanitize_string (s, L'\0', L' ', L'_', [] (WCHAR c) -> bool
>  {
> -  /* Labels may contain characters not allowed in filenames.
> -  Linux replaces spaces with \x20 which is not an option here. */
> +  /* Labels may contain characters not allowed in filenames.  Also

Apart from slash and backslash, we don't have this problem in Cygwin,
usually.  Even control characters are no problem.  All chars not allowed
in filenames are just transposed into the Unicode private use area, as
per strfuncs.cc, line 20ff on the way to storage, and back when reading
the names from storage.  This, and especially in a virtual filesystem
like /proc, there's no reason to avoid these characters.

> + replace '#' to avoid that duplicate markers introduce new
> +  duplicates.  Linux replaces spaces with \x20 which is not an
> +  option here. */
>return !((0 <= c && c <= L' ') || c == L':' || c == L'/' || c == L'\\'
> -   || c == L'"');
> +   || c == L'#' || c == L'"');

If you really want to avoid chars not allowed in DOS filenames, the
list seems incomplete, missing '<', '>', '?', '*', '|'.

But as I said, there's really no reason for that.  I simply reduced the
above expression to

  return !(c == L'/' || c == L'\\' || c == L'#');

and created a disk label

  test"foo*bar?baz:"

It works nicely, including stuff like

  $ ls *\"*
  $ ls *\**

So, I can push it as is, or we just allow everything and the kitchen sink
as per the reduced filter expression.  What do you prefer?


Thanks,
Corinna


Re: [PATCH] Cygwin: Add /dev/disk/by-label and /dev/disk/by-uuid symlinks

2023-11-21 Thread Christian Franke

Christian Franke wrote:

Corinna Vinschen wrote:

On Nov 20 10:40, Corinna Vinschen wrote:

Hi Christian,

This puzzles me:

On Nov 17 21:25, Christian Franke wrote:
@@ -610,7 +607,7 @@ get_by_id_table (by_id_entry * , 
fhandler_dev_disk::dev_disk_location loc)

    if (!table)
  return (errno_set ? -1 : 0);
  -  /* Sort by name and remove duplicates. */
+  /* Sort by name and mark duplicates. */
    qsort (table, table_size, sizeof (*table), by_id_compare_name);
    for (unsigned i = 0; i < table_size; i++)

by_id_compare_name only compars the actual names...


  {
@@ -619,12 +616,13 @@ get_by_id_table (by_id_entry * , 
fhandler_dev_disk::dev_disk_location loc)

  j++;
    if (j == i + 1)
  continue;
-  /* Duplicate(s) found, remove all entries with this name. */
-  debug_printf ("removing duplicates %d-%d: '%s'", i, j - 1, 
table[i].name);

-  if (j < table_size)
-    memmove (table + i, table + j, (table_size - j) * sizeof 
(*table));

-  table_size -= j - i;
-  i--;
+  /* Duplicate(s) found, append "#N" to all entries. This never

...but the names are identical.  So the *order* within the identically
named entries depends on qsort's reshuffling of table
entries.  Which in turn depends on outside factors like number of table
entries and the ultimate position of the identical entries within the
ordered table.

Having said that, I don't see how adding ordinals to the names can be
unambiguous.  AFAICS, the numbers may change by just adding another
disk (USB Stick) to the system...

Oops, that's not exactly what I was trying to say, sorry.

The problem is not adding ordinals to the name, AFAICS, the problem is
that the sorting function by_id_compare_name is not up to the task to
make sure the order is unambiguous within the entries of identical name.


That's correct, thanks for catching. qsort is not a stable sort. 
Changing drives outside the duplicate range may also change the order 
within the range. Could be fixed by a lexicographic compare of {name, 
drive, part}.




Attached.

From 7dafb85210ef77ea8798f22160f7782c394ef5c3 Mon Sep 17 00:00:00 2001
From: Christian Franke 
Date: Tue, 21 Nov 2023 12:17:14 +0100
Subject: [PATCH] Cygwin: /dev/disk: Append '#N' if the same name appears more
 than once

No longer drop ranges of identical link names.  Append '#0, #1, ...'
to each name instead.  No longer ignore null volume serial numbers.

Signed-off-by: Christian Franke 
---
 winsup/cygwin/fhandler/dev_disk.cc | 53 +++---
 1 file changed, 33 insertions(+), 20 deletions(-)

diff --git a/winsup/cygwin/fhandler/dev_disk.cc 
b/winsup/cygwin/fhandler/dev_disk.cc
index c5d72816f..d12ac52fa 100644
--- a/winsup/cygwin/fhandler/dev_disk.cc
+++ b/winsup/cygwin/fhandler/dev_disk.cc
@@ -64,10 +64,12 @@ sanitize_label_string (WCHAR *s)
   /* Linux does not skip leading spaces. */
   return sanitize_string (s, L'\0', L' ', L'_', [] (WCHAR c) -> bool
 {
-  /* Labels may contain characters not allowed in filenames.
-Linux replaces spaces with \x20 which is not an option here. */
+  /* Labels may contain characters not allowed in filenames.  Also
+ replace '#' to avoid that duplicate markers introduce new
+duplicates.  Linux replaces spaces with \x20 which is not an
+option here. */
   return !((0 <= c && c <= L' ') || c == L':' || c == L'/' || c == L'\\'
- || c == L'"');
+ || c == L'#' || c == L'"');
 }
   );
 }
@@ -304,8 +306,7 @@ partition_to_label_or_uuid(bool uuid, const UNICODE_STRING 
*drive_uname,
   const NTFS_VOLUME_DATA_BUFFER *nvdb =
 reinterpret_cast(ioctl_buf);
   if (uuid && DeviceIoControl (volhdl, FSCTL_GET_NTFS_VOLUME_DATA, nullptr, 0,
-  ioctl_buf, NT_MAX_PATH, _read, nullptr)
-  && nvdb->VolumeSerialNumber.QuadPart)
+  ioctl_buf, NT_MAX_PATH, _read, nullptr))
 {
   /* Print without any separator as on Linux. */
   __small_sprintf (name, "%016X", nvdb->VolumeSerialNumber.QuadPart);
@@ -327,13 +328,9 @@ partition_to_label_or_uuid(bool uuid, const UNICODE_STRING 
*drive_uname,
   FILE_FS_VOLUME_INFORMATION *ffvi =
 reinterpret_cast(ioctl_buf);
   if (uuid)
-{
-  if (!ffvi->VolumeSerialNumber)
-   return false;
-  /* Print with separator as on Linux. */
-  __small_sprintf (name, "%04x-%04x", ffvi->VolumeSerialNumber >> 16,
-  ffvi->VolumeSerialNumber & 0x);
-}
+/* Print with separator as on Linux. */
+__small_sprintf (name, "%04x-%04x", ffvi->VolumeSerialNumber >> 16,
+ffvi->VolumeSerialNumber & 0x);
   else
 {
   /* Label is not null terminated. */
@@ -361,6 +358,20 @@ by_id_compare_name (const void *a, const void *b)
   return strcmp (ap->name, bp->name);
 }
 
+static int
+by_id_compare_name_drive_part (const void *a, const void *b)
+{
+  const by_id_entry *ap = reinterpret_cast(a);
+  const 

Re: Cygwin 3.4.9 - how to install ssh-keygen

2023-11-21 Thread Matthias--- via Cygwin
Thanks, I found it.

It is still not working. I'll ask for it in another thread with a better 
subject :)

Thanks a lot
Matthias


Am Montag, dem 20.11.2023 um 17:41 -0500 schrieb Lee:
> On Mon, Nov 20, 2023 at 11:54 AM Matthias wrote:
> >
> > Dear all,
> >
> > I've installed cygwin 3.4.9-1 in my virtualbox running on Windows 10.
> > After installing defaults plus openssh 9.5p 1-1, I open the 
> > Cygwin64-Terminal as Administrator
> > and
> > run ssh-host-config.
> >  * Answered "yes" to create the /etc/ssh_config and /etc/sshd_config
> >  * Answered "no" to use StrictMode
> >  * and "yes" to install sshd as a service
> >  * I just press  for the question for "Value of CYGWIN for the 
> > daemon".
> > cygrunsrv -S cygsshd will not start the sshd. The logfile say "no hostkeys 
> > available".
> >
> > Unfortunately  I can't find ssh-keygen in the installable packages.
> > Howto install ssh-keygen or how to create hostkeys?
>
> The easy way to see if it's already installed
>   $ which ssh-keygen
>   /usr/bin/ssh-keygen
>
> If no, Cygwin is a bit of a pain when looking for a program that's
> included in another package.
>
> There's probably a better way, but I use the cygwin package search - eg:
>   https://cygwin.com/cgi-bin2/package-grep.cgi?grep=ssh-keygen
> and then take a guess as the most likely candidate in the results list
> and click on that link to see if it's included in that package - eg
>  
> https://cygwin.com/cgi-bin2/package-cat.cgi?file=x86_64%2Fopenssh%2Fopenssh-9.5p1-1=ssh-keygen
>
>
> Regards
> Lee



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


Cygwin 3.4.9 - Error starting cygsshd service

2023-11-21 Thread Matthias--- via Cygwin
Hello,

I've installed cygwin 3.4.9-1 in my virtualbox running on Windows 10.
After installing defaults plus openssh 9.5p 1-1, I open the Cygwin64-Terminal 
as Administrator and
run ssh-host-config.
Answered "yes" to create the /etc/ssh_config and /etc/sshd_config
Answered "no" to use StrictMode
and "yes" to install sshd as a service
I just press  for the question for "Value of CYGWIN for the daemon".

cygrunsrv -S cygsshd will not start the sshd. "QueryServiceStatus:  Win32 error 
1062:"

I tried "ssh-keygen -A" - but no keys created.
I have no $HOME/.ssh or /etc/ssh and create them. Both owned by me with 
u=rwx,go=rw. I tried ssh-
keygen again but without success.
I also tried ssh-host-config again. It says "*** Info: Generating missing SSH 
host keys" but I still
have no keys in /etc/ssh or $HOME/.ssh

Thanks
Matthias


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


Re: Please support download setup-x86_64.exe on IPv6-only network

2023-11-21 Thread Lee via Cygwin
On Tue, Nov 21, 2023 at 12:35 AM Brian Inglis wrote:
>
> On 2023-11-20 17:45, Lee via Cygwin wrote:
> > On Mon, Nov 20, 2023 at 7:13 PM Backwoods BC via Cygwin wrote:
> >>
> >> On Thu, Nov 16, 2023 at 12:41 PM Brian Inglis via Cygwin wrote:
> >>> The whole IP v4 internet is available as a compatibility subnet 
> >>> :::0:a.b.c.d
> >>> on IP v6, so there is no excuse for not supporting interconnection, as it 
> >>> will
> >>> be required until the last backbone routers drop IP v4 support.
> >>
> >> Just a small correction for the mail archives as this appears solved.
> >> The correct IPV6 address for the IPV4 address range is
> >> :::a.b.c.d  (no '0')
> >
> > If you're going for correcting the record, let's make it correct.
> > :::a.b.c.d is not a solution for IPv6 => IPv4 interconnection over
> > the Internet.
> >
> > from:  https://www.rfc-editor.org/rfc/rfc5156
> >
> > 2.2.  IPv4-Mapped Addresses
> >
> > :::0:0/96 are the IPv4-mapped addresses [RFC4291].  Addresses
> > within this block should not appear on the public Internet.
>
> These internal addresses are used by dual stack hosts to allow clients or
> servers to handle connections to IPv4 hosts the same as IPv6 hosts.

I think that at best you're terribly confused, but let's play this out.

> Whereas :::0:0:0/96 == :::0:a.b.c.d allows IPv6 only hosts without
> assigned IPv4 addresses to connect to IPv4 only hosts via SIIT see:
>
> https://www.rfc-editor.org/rfc/rfc7915 Stateless IP/ICMP Translation.

I did see RFC 7915.  I searched for '' and there were no matches.

You need something else to back up your claim that
  :::0:0:0/96 == :::0:a.b.c.d allows IPv6 only hosts without
  assigned IPv4 addresses to connect to IPv4 only hosts.

And please explain how an ipv6 host is going to get a packet with a
0::/8 address delivered across the internet.

see:  
https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml

An ipv6 prefix of 2000::/3 is defined as Global Unicast.  In other
words, an ipv6 unicast address MUST start off with 2000::/3 to be
routed across the Internet.

And look at footnotes 3 and 4
:::0:0/96 reserved for IPv4-mapped Address [RFC4291].
0::/96 deprecated by [RFC4291]. Formerly defined as the
"IPv4-compatible IPv6 address" prefix.

Nothing about :::0:0:0/96

Regards,
Lee

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