sscanf doesn't handle hexadecimal floating-point input

2021-04-18 Thread Keith Thompson via Cygwin
The *scanf() functions don't handle hexadecimal floating-point input
(for example "0x1p+0" representing 1.0).

A test program:

#include 
int main(void) {
int ok = 1;
float x = -1.0;
int result = sscanf("0x1p+0", "%f", );
const float expected_x = 1.0;
const int expected_result = 1;
printf("sscanf returned %d", result);
if (result != expected_result) {
ok = 0;
printf(" (expected %d)", expected_result);
}
printf(", x = %g", x);
if (x != expected_x) {
ok = 0;
printf(" (expected %g)", expected_x);
}
puts(ok ? ", PASSED" : ", FAILED");
}

On Cygwin, the output (compiled with gcc or clang) is:

sscanf returned 1, x = 0 (expected 1), FAILED

On Ubuntu, the output is:

sscanf returned 1, x = 1, PASSED

Looking through the newlib sources (git://sourceware.org/git/newlib-cygwin.git),
this might be related to the _WANT_IO_C99_FORMATS macro, but I haven't
looked into
the details.

The test case passes on Cygwin when compiled with i686-w64-mingw32-gcc
or x86_64-w64-mingw32-gcc.
--
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: Possibly becoming a mirror

2021-04-18 Thread Brian Inglis

On 2021-04-18 12:47, Hamish McIntyre-Bhatty via Cygwin wrote:
I'm considering hosting a mirror for Cygwin on a server I have, but it doesn't 
currently have a domain. Is this acceptable or do I need to sort that first? I'm 
planning to do that in the near future either way.


You need a public IP address with a public DNS entry pointing to that host in a 
domain.
Some ISPs offer static IP addresses reasonably and some require a higher priced 
business account:


https://www.broadbandgenie.co.uk/broadband/help/what-static-ip

Andrews & Arnold: Free static IP as standard.

	Plusnet: Available on most home and business packages. £5 setup fee for home 
packages.


Zen: Available for free on request.

You may also be able to configure your router to establish a link from your ISP 
DHCP address to a public dynamic DNS service providing a DNS host name.
Whether the name may be from a domain you control or only from theirs depends on 
their service offerings.
Some domain registrars also offer various services including forwarding with 
registration.


Remember you will have to initially download all 163GB of mirror files 
currently, rsync download any updates at least twice daily, and upload that to 
all comers, which could have low speeds and limits (10% of download, and 
remember ratings are theoretical max in Mb/s, divide by 10 for MB/s, then do an 
ISP speedtest and another external like speedtest.net), or require a business 
account, depending on your equipment and ISP:


https://www.speedtest.net/global-index/united-kingdom#fixed

and these numbers obviously reflect business internet services, as upload is a 
large fraction of download rather than typical 10%, so expect numbers that are a 
fraction of those listed


If may be cheaper and better to consider renting a virtual cloud server.
If you think you can do this from a server within an organization to which you 
belong, you should first talk to management, admins, and network staff.


--
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.
[Data in binary units and prefixes, physical quantities in SI.]
--
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


Possibly becoming a mirror

2021-04-18 Thread Hamish McIntyre-Bhatty via Cygwin
I'm considering hosting a mirror for Cygwin on a server I have, but it 
doesn't currently have a domain. Is this acceptable or do I need to sort 
that first? I'm planning to do that in the near future either way.


Hamish


OpenPGP_0x18F1759B3457223F.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature
--
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: Tee and file redirections are very slow to write anything.

2021-04-18 Thread Hamish McIntyre-Bhatty via Cygwin

Excellent, I shall give that a try. Thanks.

Hamish

On 25/02/2021 10:27, Takashi Yano via Cygwin wrote:

On Thu, 25 Feb 2021 09:51:48 +
"Henry S. Thompson wrote:

Hamish McIntyre-Bhatty via Cygwin writes:


I'm now thinking it may have been a Python script that was behaving this
way - I might go and double check in case this isn't what I think it is.

I have noticed recently (on a Linux box) that Python3.8 logging exhibits
the problem you report, that is, no output until end of job.

stdbuf does not take effect for python, however, you can use
-u option or setting environment PYTHONUNBUFFERED=1.



OpenPGP_0x18F1759B3457223F.asc
Description: application/pgp-keys


OpenPGP_signature
Description: OpenPGP digital signature
--
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: sshd 100% Load after disconnect

2021-04-18 Thread Andrey Repin
Greetings, iw875...@gmx.eu!

> sshd seems to run at 100% Load for one thread after ssh disconnect

125% or more, actually.

> (Close Terminal Window) on my Windows 10 computer.

> If I use exit it isn't so.

> I have to kill sshd or reboot the machine to kill the load.

Kill the shell (or another process that's holding it).
It's safer a little.


-- 
With best regards,
Andrey Repin
Sunday, April 18, 2021 17:06:24

Sorry for my terrible english...

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


[PATCH setup] Handle '--packages package=version'

2021-04-18 Thread Jon Turney
Handle '--packages package=version' to allow specifing the version of a
package to install on the command line.

isManuallyWanted() now returns the target packageversion (if specified),
or an empty packageversion (which is translated into an instruction to
the solver to choose the version).

In the 'upgrade' case, this changes from using the complex logic of
packagemeta::trustp() to determine the target version, when unspecified
on the command line, to allowing the solver to make that decision (which
should be broadly the same i.e. not downgrading test versions, etc.).

This also subtly changes the behaviour when the package version is not
specified.  Instead of forcing the current version, we allow the solver
to choose the version, so it may not pick that version, if other
constraints exist, which prevent a solution containing that version.

There's probably some future work which can be done to simplify the
remaining uses packagemeta::trustp(), which are only related to the UI.
---
 choose.cc   |  9 ---
 package_meta.cc | 71 +
 package_meta.h  |  3 ++-
 3 files changed, 73 insertions(+), 10 deletions(-)

diff --git a/choose.cc b/choose.cc
index 4fa0c74..7632bba 100644
--- a/choose.cc
+++ b/choose.cc
@@ -289,7 +289,8 @@ ChooserPage::applyCommandLinePackageSelection()
i != db.packages.end (); ++i)
 {
   packagemeta  = *(i->second);
-  bool wanted= pkg.isManuallyWanted();
+  packageversion wanted_version;
+  bool wanted= pkg.isManuallyWanted(wanted_version);
   bool deleted   = pkg.isManuallyDeleted();
   bool base  = pkg.categories.find ("Base") != pkg.categories.end ();
   bool orphaned  = pkg.categories.find ("Orphaned") != pkg.categories.end 
();
@@ -299,15 +300,15 @@ ChooserPage::applyCommandLinePackageSelection()
   bool uninstall = (!(wanted  || base) && (deleted || PruneInstallOption))
 || (orphaned && CleanOrphansOption);
   if (install)
-pkg.set_action (packagemeta::Install_action, UpgradeAlsoOption ? 
packageversion () : pkg.curr, true);
+pkg.set_action (packagemeta::Install_action, UpgradeAlsoOption ? 
packageversion () : wanted_version, true);
   else if (reinstall)
-   pkg.set_action (packagemeta::Reinstall_action, pkg.curr);
+   pkg.set_action (packagemeta::Reinstall_action, !wanted ? pkg.curr : 
wanted_version);
   else if (uninstall)
pkg.set_action (packagemeta::Uninstall_action, packageversion ());
   else if (PruneInstallOption)
pkg.set_action (packagemeta::NoChange_action, pkg.curr);
   else if (upgrade)
-   pkg.set_action (packagemeta::Install_action, pkg.trustp(true, 
TRUST_UNKNOWN));
+   pkg.set_action (packagemeta::Install_action, !wanted ? packageversion 
() : wanted_version);
   else
pkg.set_action (packagemeta::NoChange_action, pkg.installed);
 }
diff --git a/package_meta.cc b/package_meta.cc
index 73239f1..1c6183c 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -214,6 +214,20 @@ packagemeta::add_version (const SolverPool::addPackageData 
)
   return thepkg;
 }
 
+const packageversion *
+packagemeta::findVersion(std::string ) const
+{
+  for (std::set ::iterator i = versions.begin();
+   i != versions.end();
+   i++)
+{
+  if (i->Canonical_version() == version)
+return &(*i);
+}
+
+  return NULL;
+}
+
 bool
 packagemeta::isBlacklisted(const packageversion ) const
 {
@@ -310,10 +324,10 @@ validatePackageNames (std::set )
 }
 }
 
-bool packagemeta::isManuallyWanted() const
+bool packagemeta::isManuallyWanted(packageversion ) const
 {
   static bool parsed_yet = false;
-  static std::set parsed_names;
+  static std::map parsed_names;
   hasManualSelections |= parsed_names.size ();
   static std::set parsed_categories;
   hasManualSelections |= parsed_categories.size ();
@@ -325,12 +339,40 @@ bool packagemeta::isManuallyWanted() const
   {
 std::vector packages_options = PackageOption;
 std::vector categories_options = CategoryOption;
+
+std::set items;
 for (std::vector::iterator n = packages_options.begin ();
n != packages_options.end (); ++n)
   {
-   parseNames (parsed_names, *n);
+   parseNames (items, *n);
   }
-validatePackageNames (parsed_names);
+
+std::set packages;
+/* Separate any 'package=version' into package and version parts */
+for (std::set::iterator n = items.begin();
+ n != items.end();
+ ++n)
+  {
+std::string package;
+std::string version;
+std::string::size_type loc = n->find ("=", 0);
+if (loc != std::string::npos)
+  {
+package = n->substr(0, loc);
+version = n->substr(loc+1);
+  }
+else
+  {
+package = *n;
+version = "";
+  }
+Log (LOG_BABBLE) << "package: " << package << " version: " << version 
<< 

[ANNOUNCEMENT] Updated: curl, libcurl{4, -devel, -doc}, mingw64-{x86_64, i686}-curl 7.76.1

2021-04-18 Thread Cygwin curl Maintainer
The following packages have been upgraded in the Cygwin distribution:

* curl  7.76.1
* libcurl4  7.76.1
* libcurl-devel 7.76.1
* libcurl-doc   7.76.1
* mingw64-x86_64-curl   7.76.1
* mingw64-i686-curl 7.76.1

Command line tool and Library supporting transferring files with
URL syntax, using FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, and
FILE, SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form
based upload, proxies, cookies, user+password authentication (Basic,
Digest, NTLM, Negotiate...), file transfer resume, proxy tunneling and a
busload of other useful tricks.

For more information see the project home page:

https://curl.se/

As there are multiple components and many changes each release please
see below or read /usr/share/doc/curl/RELEASE-NOTES after installation
for complete details:

https://curl.se/changes.html

curl and libcurl 7.76.1

* Public curl releases: 199
* Command line options: 240
* curl_easy_setopt() options:   288
* Public functions in libcurl:  85
* Contributors: 2356

This release includes the following known bugs:

* see /usr/share/doc/curl/KNOWN_BUGS (https://curl.se/docs/knownbugs.html)

This release includes the following bugfixes:

* configure: disable min version set for Darwin
* configure: include  unconditionally
* configure: remove use of RETSIGTYPE
* docs/HTTP3.md: update the build instruction using gnutls
* examples/hiperfifo.c: check event_initialized before delete
* file: support GETing directories again
* github/workflow: add "security-extended" to codeql-analysis.yml
* h2: allow 100 streams by default
* hostip: fix builds that disable all asynchronous DNS
* http_proxy: only loop on 407 + close if we have credentials
* install: add instructions for Apple Darwin platforms
* lib: remove unused HAVE_INET_NTOA_R* defines
* libssh: get rid of PATH_MAX
* ngtcp2+gnutls: clear credentials when freed
* ngtcp2: Use ALPN h3-29 for now
* ntlm: fix negotiated flags usage
* ntlm: support version 2 on 32-bit platforms
* openssl: fix CURLOPT_SSLCERT_BLOB without CURLOPT_SSLCERT_KEY
* TLS: fix HTTP/2 selection
* tool_progress: fix progress meter final update in parallel mode
* typecheck-gcc: make the ssl-ctx-cb check use SSL_CTX pointers

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


Updated: curl, libcurl{4, -devel, -doc}, mingw64-{x86_64, i686}-curl 7.76.1

2021-04-18 Thread Cygwin curl Maintainer
The following packages have been upgraded in the Cygwin distribution:

* curl  7.76.1
* libcurl4  7.76.1
* libcurl-devel 7.76.1
* libcurl-doc   7.76.1
* mingw64-x86_64-curl   7.76.1
* mingw64-i686-curl 7.76.1

Command line tool and Library supporting transferring files with
URL syntax, using FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, and
FILE, SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form
based upload, proxies, cookies, user+password authentication (Basic,
Digest, NTLM, Negotiate...), file transfer resume, proxy tunneling and a
busload of other useful tricks.

For more information see the project home page:

https://curl.se/

As there are multiple components and many changes each release please
see below or read /usr/share/doc/curl/RELEASE-NOTES after installation
for complete details:

https://curl.se/changes.html

curl and libcurl 7.76.1

* Public curl releases: 199
* Command line options: 240
* curl_easy_setopt() options:   288
* Public functions in libcurl:  85
* Contributors: 2356

This release includes the following known bugs:

* see /usr/share/doc/curl/KNOWN_BUGS (https://curl.se/docs/knownbugs.html)

This release includes the following bugfixes:

* configure: disable min version set for Darwin
* configure: include  unconditionally
* configure: remove use of RETSIGTYPE
* docs/HTTP3.md: update the build instruction using gnutls
* examples/hiperfifo.c: check event_initialized before delete
* file: support GETing directories again
* github/workflow: add "security-extended" to codeql-analysis.yml
* h2: allow 100 streams by default
* hostip: fix builds that disable all asynchronous DNS
* http_proxy: only loop on 407 + close if we have credentials
* install: add instructions for Apple Darwin platforms
* lib: remove unused HAVE_INET_NTOA_R* defines
* libssh: get rid of PATH_MAX
* ngtcp2+gnutls: clear credentials when freed
* ngtcp2: Use ALPN h3-29 for now
* ntlm: fix negotiated flags usage
* ntlm: support version 2 on 32-bit platforms
* openssl: fix CURLOPT_SSLCERT_BLOB without CURLOPT_SSLCERT_KEY
* TLS: fix HTTP/2 selection
* tool_progress: fix progress meter final update in parallel mode
* typecheck-gcc: make the ssl-ctx-cb check use SSL_CTX pointers



sshd 100% Load after disconnect

2021-04-18 Thread iw875421

Hi group,

sshd seems to run at 100% Load for one thread after ssh disconnect
(Close Terminal Window) on my Windows 10 computer.

If I use exit it isn't so.

I have to kill sshd or reboot the machine to kill the load.

--
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: Regression in Cygwin 3.2.0

2021-04-18 Thread David Allsopp via Cygwin
Takashi Yano wrote:
> On Fri, 16 Apr 2021 11:17:50 +0100
> David Allsopp wrote:
> > I'm unable to build OCaml using the mingw-w64 compilers with Cygwin
> 3.2.0.
> > Windows 10.0.19042.928 (and tried on three different machines so far)
> >
> > Repro:
> >
> >  - Fresh Cygwin64 installation with make, libiconv,
> > mingw64-x86_64-gcc-core and git added; fire up mintty
> >  - git clone --depth 1 --recursive https://github.com/ocaml/ocaml
> >  - cd ocaml && ./configure --host=x86_64-w64-mingw32 && make -j8
> > flexdll && make -j8 world.opt
> >
> > This is consistently hanging with Cygwin 3.2.0 and seems possibly to
> > have something to do with linking (the creation of
> > runtime/ocamlrun.exe and stdlib/camlheader, which is also an
> > executable, seem to be part of the problem).
> >
> > It can be immediately fixed by downgrading to Cygwin 3.1.7, cleaning
> > the tree and repeating the build.
> >
> > I'm of course very happy to try to reduce this to a smaller repro
> > case, but is there an obvious culprit in Cygwin 3.2.0 to check before I
> do?
> 
> Thanks for the report. I looked into this problem and found that the
> caused is the combination of some race issues for non-cygwin processes in
> pty and console code.
> 
> I will submit the patches fixing this issue.

Fantastic, thanks - I'll keep an eye on cygwin-patches and test.


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


realpath issue with native[strict] symlinks

2021-04-18 Thread Orgad Shaneh via Cygwin
Hi,

When winsymlinks:native/nativestrict is used, realpath doesn't resolve
the full path correctly, when a symlink to the same directory is used.

Example follows. The output is:
/home/user/recurse/test/d1
/home/user/recurse/test2/d1

While it should be /home/user/recurse/d1 for both.

A few observations:
1. When CYGWIN is not set at all, the link is created as a junction.
It works ok in cygwin, but cannot be accessed from cmd (probably
because it is a file junction, and not a directory one). On this case,
realpath works as expected.
2. If I create a junction using mklink /j test3 ., the issue reproduces,
regardless of winsymlinks configuration.

#!/bin/sh

export CYGWIN=winsymlinks:nativestrict
rm -rf recurse
mkdir recurse
cd recurse
mkdir d1
ln -s . test
ln -s $PWD test2
cmd ///c 'mklink /j test3 .'
(cd test/d1 && realpath .)
(cd test2/d1 && realpath .)
(cd test3/d1 && realpath .)

- Orgad
--
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: A problem with noacl+umask+chmod result

2021-04-18 Thread Orgad Shaneh via Cygwin
On Sat, Apr 17, 2021 at 8:11 PM Kaz Kylheku (Cygwin)
<743-406-3...@kylheku.com> wrote:
>
> On 2021-04-08 21:34, Orgad Shaneh via Cygwin wrote:
> > On Fri, Apr 9, 2021 at 4:50 AM Andrey Repin 
> > wrote:
> >>
> >> Greetings, Orgad Shaneh!
> >>
> >> > On Wed, Apr 7, 2021 at 11:47 PM Orgad Shaneh  wrote:
> >> > Marco Atzeri replied to the mailing list but did not CC me, so I
> >> > didn't receive it:
> >>
> >> The expectation is that you subscribe to the list of interest.
> >
> > Why? If I report a bug, I'm interested in this bug, and I don't want
> > to receive dozens of emails every day about other issues.
>
> Hi Orgad,
>
> The odd thing is that you're able to post at all.
>
> The Cygwin has an inconsistent configuration: it seems to allow
> posts from non-subscribers, yet it removes them from the Cc: line
> when remailing their posting.

Not sure about this. Some of the replies did include me in CC. If a user appears
in "From", any Reply to All should include the sender.

> > Every time you report a bug to a project on github/jira/whatever, you
> > subscribe to everything in this project?
>
> Without creating a github account, how do you do anything of that
> sort on github?

I don't mind registering to gain post access. My concern was about subscribing
to the mailing list, and getting many emails that are not related to my issues.

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