SIGALRM is not interrupting a blocking write to a pipe

2024-05-06 Thread ilya Basin via Cygwin
Hi List!

I need your help with troubleshooting an issue with "pv": 
https://codeberg.org/a-j-wood/pv/issues/87

This app uses SIGALRM to interrupt a blocking write to STDOUT and read more 
data into the buffer.
On Linuxes write() returns 0 after the signal, but on Cygwin even though the 
signal handler is called, the write call does not return, at least when writing 
to a pipe.

In the user guide it says "All sockets are non-blocking under the hood to allow 
to interrupt blocking calls by POSIX signals". It doesn't mention pipes, but I 
think the pipes should also be non-blocking under the hood.

In main.c the use of O_NONBLOCK is commented with "this can cause problems with 
(broken) applications such as dd". If I uncomment it the app is able to detect 
that the pipe is ready for writing. Have you ever heard about O_NONBLOCK 
breaking dd?


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


windows netsh/route output translated to English in mintty

2022-04-07 Thread Ilya Basin
Hi. One of my PCs still has Windows 7 and I noticed that when I run 
netsh interface ipv4 show route
or
route print

In Mintty, the output is translated to English and when I run these commands 
from Cygwin started in a Windows console the output is in the same language as 
the OS. Does Cygwin do that?

Secondly, it doesn't seem to be affected by TERM= LC_ALL= , redirections or 
even setsid.

And I also noticed that when the "Interface List" section of "route print" is 
translated to English the national interface names containing "Microsoft 
ISATAP" are omitted completely, including the newlines so the output looks like 
this:

...
  1...Software Loopback Interface 1
 12...00 00 00 00 00 00 00 e0  14...00 00 00 00 00 00 00 e0  16...00 00 00 
00 00 00 00 e0  18...00 00 00 00 00 00 00 e0  20...00 00 00 00 00 00 00 e0  
26...00 00 00 00 00 00 00 e0 
===

IPv4 Route Table
...

Does anybody know the reason?

-- 
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: Snapshot of Cygwin from Windows XP era

2021-10-23 Thread Ilya Basin via Cygwin
No guarantee, but try these

(from ftp://www.fruitbat.org/pub/cygwin/circa/2016/08/30/104223 )
https://drive.google.com/file/d/106n5y7W7pAPY44qT1V5dh1jTBpA6Th1w/view?usp=sharing

setup program:
https://drive.google.com/file/d/1BEY17yS9cfvWvnkJtuLuIQo85emi02Bl/view?usp=sharing

I have no Idea why I renamed setup.

On 23.10.2021 19:14, Hamish McIntyre-Bhatty via Cygwin wrote:
> Hi all,
> 
> I was wondering if there exists a snapshot of the Cygwin repos at a time when 
> Windows XP was still supported?
> 
> Thanks,
> 
> Hamish
> 
> 
> 

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


socat UDP-LISTEN,fork misbehaves

2021-10-23 Thread Ilya Basin via Cygwin
Hi List.
I have socat 1.7.4.1-1 and the same version on Linux.
When I try to create a forking UDP server, only the first client is served, 
unlike in Linux where subsequent clients are served properly.

Test case. Terminal 1:

socat -v UDP-LISTEN:12345,reuseaddr,fork SYSTEM:"stdbuf -i0 -o0 -e0 sed 
s/././g"

Terminal 2

( ( date; sleep 10 ) | socat UDP:127.0.0.1:12345 - & sleep 1; date | socat 
UDP:127.0.0.1:12345 - )

Expected output in Terminal 2:

...
...

Actual:

...

Reproducible: amd64, x86, Windows 10, Windows 7
Cygwin Configuration Diagnostics
Current System Time: Sat Oct 23 16:53:07 2021

Windows 10 Professional Ver 10.0 Build 19043 

Running in Terminal Service session

Path:   C:\cygwin64\usr\local\bin
C:\cygwin64\bin
V:\goodfs\bin
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Windows\System32\OpenSSH
C:\Users\basin\AppData\Local\Microsoft\WindowsApps

Output from C:\cygwin64\bin\id.exe
UID: 1087042(basin)
GID: 1049089(Domain Users)
1049089(Domain Users)
555(Пользователи удаленного рабочего стола)
545(Пользователи)
14(REMOTE INTERACTIVE LOGON)
4(ИНТЕРАКТИВНЫЕ)
11(Прошедшие проверку)
15(Данная организация)
4095(CurrentSession)
66048(ЛОКАЛЬНЫЕ)
1112589(edflux-team)
1109170(developers)
1114503(All Users)
1115358(prj-springer-team)
1094484(dep-java)
1109110(location_spb-corp1)
1109084(prj-springer)
1086997(Reksoft Users)
1115352(prj--team)
1094571(location_spb)
1057381(AccVPNUsers)
1093898(gr_company)
1049587(PrinterUsers)
1108982(funktel)
1093584(prod_emp)
1053424(RoleADCMember)
1050186(OfficeUsers)
70145(Подтвержденное центром проверки подлинности удостоверение)
1091802(AccBWPrinterUsers)
401408(Средний обязательный уровень)

SysDir: C:\Windows\system32
WinDir: C:\Windows

USER = 'basin'
PWD = '/cygdrive/c/2'
HOME = '/home/basin'

USERDOMAIN = 'REKSOFT'
OS = 'Windows_NT'
COMMONPROGRAMFILES = 'C:\Program Files\Common Files'
PROCESSOR_LEVEL = '6'
PSModulePath = 'C:\Program 
Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules'
CommonProgramW6432 = 'C:\Program Files\Common Files'
CommonProgramFiles(x86) = 'C:\Program Files (x86)\Common Files'
TZ = 'Europe/Moscow'
HOSTNAME = 'basin'
PUBLIC = 'C:\Users\Public'
OLDPWD = '/cygdrive/c'
USERNAME = 'basin'
LOGONSERVER = '\\DC2'
PROCESSOR_ARCHITECTURE = 'AMD64'
CLIENTNAME = 'MAR2'
LOCALAPPDATA = 'C:\Users\basin\AppData\Local'
COMPUTERNAME = 'BASIN'
!:: = '::\'
SYSTEMDRIVE = 'C:'
USERPROFILE = 'C:\Users\basin'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
SYSTEMROOT = 'C:\Windows'
USERDOMAIN_ROAMINGPROFILE = 'REKSOFT'
PROCESSOR_IDENTIFIER = 'Intel64 Family 6 Model 158 Stepping 10, GenuineIntel'
OneDriveConsumer = 'C:\Users\basin\OneDrive'
TMP = '/tmp'
LC_CTYPE = 'ru_RU.UTF-8'
TERM_PROGRAM = 'mintty'
TERM_PROGRAM_VERSION = '3.5.1'
OneDrive = 'C:\Users\basin\OneDrive'
!C: = 'C:\cygwin64\bin'
PROCESSOR_REVISION = '9e0a'
PROFILEREAD = 'true'
USERDNSDOMAIN = 'REKSOFT.RU'
PROMPT = '$P$G'
NUMBER_OF_PROCESSORS = '6'
ProgramW6432 = 'C:\Program Files'
qpref = '"C:\cygwin64\bin"'
COMSPEC = 'C:\Windows\system32\cmd.exe'
APPDATA = 'C:\Users\basin\AppData\Roaming'
SHELL = '/bin/bash'
TERM = 'xterm'
WINDIR = 'C:\Windows'
ProgramData = 'C:\ProgramData'
SHLVL = '1'
PRINTER = '\\apps64\SPB LPM 2nd floor Ricoh'
PROGRAMFILES = 'C:\Program Files'
ALLUSERSPROFILE = 'C:\ProgramData'
TEMP = '/tmp'
DriverData = 'C:\Windows\System32\Drivers\DriverData'
GIT_ASKPASS = '/home/basin/.ssh/fakeaskpass'
SESSIONNAME = 'RDP-Tcp#7'
ProgramFiles(x86) = 'C:\Program Files (x86)'
PS1 = '\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
HOMEDRIVE = 'C:'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info'
HOMEPATH = '\Users\basin'
ORIGINAL_PATH = 
'/cygdrive/v/goodfs/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Windows/System32/OpenSSH:/cygdrive/c/Users/basin/AppData/Local/Microsoft/WindowsApps'
EXECIGNORE = '*.dll'
VBOX_MSI_INSTALL_PATH = 'C:\Program Files\Oracle\VirtualBox\'
_ = '/usr/bin/cygcheck'

HKEY_CURRENT_USER\SOFTWARE\Cygwin
HKEY_CURRENT_USER\SOFTWARE\Cygwin\Installations
  (default) = '\??\C:\cygwin64'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Installations
  (default) = '\??\C:\cygwin64'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
  (default) = 'C:\cygwin64'

obcaseinsensitive set to 1

Cygwin installations found in the registry:
  System: Key: e022582115c10879 Path: C:\cygwin64
  User:   Key: e022582115c10879 Path: C:\cygwin64

c:  hd  NTFS237847Mb  73% CP CS UN PA FCQU  
d:  hd  NTFS236511Mb  66% CP CS UN PA FCQU  BASIN_OLD
f:  hd  NTFS 12432Mb   1% CP CS UN PA FCQU  New Volume
p:  net NTFS   7340013Mb  79% CP CS UN PA FCQU  New Volume
r:  net NTFS 

Re: xinetd: PID 2280: Service tftp missing attribute user - DISABLING

2021-10-01 Thread ilya Basin via Cygwin
Upd:

1)
There was a typo in the sed script. The correct one is:

mkpasswd.exe | sed 's/^[^:]*\(cyg_server\):/\1:/;t;d'

I also had to do the same for the unprivileged user "tftpd" created by 
/usr/bin/tftpd-config

2) 
After being successfully started by xinetd the tftp server logs to Windows 
Event log:

tftpd: PID 2844: cannot drop privileges: No error 

and in the Audit log there is a deny message with:

FailureReason %%2310 Account currently disabled.

Workaround:

net user tftpd /active:YES

and it makes me wonder how it worked in older versions. The user is created by 
csih_create_unprivileged_user() with the command:

net user "${unpriv_user}" \
/homedir:"${dos_var_empty}" \
/comment:'' \
/add /active:no



On 01.10.2021 10:21, ilya Basin wrote:
> Hi. I installed xinetd and tftp-server recently, ran xinetd-config and 
> tftpd-config, and enabled /etc/xinetd.d/tftp. However, I was getting the 
> following error in Windows Event log:
> 
> xinetd: PID 2280: Service tftp missing attribute user - DISABLING
> 
> Workaround:
> 
># The xinetd user name must exist in /etc/passwd
># We have to strip "MYHOST+" from "MYHOST+cyg_server" to make xinetd match 
> the entry
>mkpasswd.exe | sed 's/^[^:]*\(cyg_server\):/\1/;t;d' >>/etc/passwd
> 
> Commenting "user=cyg_server" is not needed and won't help because then xinetd 
> looks for the current user in /etc/passwd
> 
> By the way, cygsshd runs fine as NT_AUTHORITY\SYSTEM on Windows 10 and can 
> serve both local and domain users. I just had to strip the machine prefix in 
> /etc/passwd for the local users. Perhaps /usr/share/doc/Cygwin/xinetd.README 
> is outdated?
> 

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


xinetd: PID 2280: Service tftp missing attribute user - DISABLING

2021-10-01 Thread ilya Basin via Cygwin
Hi. I installed xinetd and tftp-server recently, ran xinetd-config and 
tftpd-config, and enabled /etc/xinetd.d/tftp. However, I was getting the 
following error in Windows Event log:

xinetd: PID 2280: Service tftp missing attribute user - DISABLING

Workaround:

   # The xinetd user name must exist in /etc/passwd
   # We have to strip "MYHOST+" from "MYHOST+cyg_server" to make xinetd match 
the entry
   mkpasswd.exe | sed 's/^[^:]*\(cyg_server\):/\1/;t;d' >>/etc/passwd

Commenting "user=cyg_server" is not needed and won't help because then xinetd 
looks for the current user in /etc/passwd

By the way, cygsshd runs fine as NT_AUTHORITY\SYSTEM on Windows 10 and can 
serve both local and domain users. I just had to strip the machine prefix in 
/etc/passwd for the local users. Perhaps /usr/share/doc/Cygwin/xinetd.README is 
outdated?


-- 
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: requestedExecutionLevel "asInvoker" is ignored for setup-x86_64.exe

2021-08-31 Thread Ilya Basin via Cygwin
Never mind. Just found in the FAQ that the installer tries to spawn an elevated 
child instead of using the manifest. So in "setup-x86_64.exe -B" the "-B" 
switch does the trick. 

On 31.08.2021 18:38, ilya Basin wrote:
> Hi.
> I noticed that despite having:
> 
> 
> 
> in setup-x86_64.exe the UAC prompt is not bypassed and when I click Cancel 
> the program is not started.
> 
> Previously I used the same binary to install Cygwin for "Just me" on a host 
> where regular users are simply not allowed to trigger a UAC prompt.
> 
> I have downloaded some other software installers and they work as intended:
> 
> cf7_installer.exe
> Git-2.33.0-64-bit.exe
> pgadmin4-5.6-x64.exe
> 
> The following env var also failed:
> 
> set __COMPAT_LAYER=RunAsInvoker
> 
> Then I tried to un-UPX and remove the manifest with ResHacker and I also 
> renamed "setup-x86_64.exe" to "putes-x86_64.exe" because I heard that UAC 
> looks for keyword in .exe name without a manifest, but the resulting binary 
> still triggers the UAC.
> 
> 
> Reproducible on:
> Windows 10 20-H2 build 19042.746
> Windows 7 sp1 buld 7601
> 

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


requestedExecutionLevel "asInvoker" is ignored for setup-x86_64.exe

2021-08-31 Thread ilya Basin via Cygwin
Hi.
I noticed that despite having:



in setup-x86_64.exe the UAC prompt is not bypassed and when I click Cancel the 
program is not started.

Previously I used the same binary to install Cygwin for "Just me" on a host 
where regular users are simply not allowed to trigger a UAC prompt.

I have downloaded some other software installers and they work as intended:

cf7_installer.exe
Git-2.33.0-64-bit.exe
pgadmin4-5.6-x64.exe

The following env var also failed:

set __COMPAT_LAYER=RunAsInvoker

Then I tried to un-UPX and remove the manifest with ResHacker and I also 
renamed "setup-x86_64.exe" to "putes-x86_64.exe" because I heard that UAC looks 
for keyword in .exe name without a manifest, but the resulting binary still 
triggers the UAC.


Reproducible on:
Windows 10 20-H2 build 19042.746
Windows 7 sp1 buld 7601

-- 
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: no regular expressions in less

2021-07-21 Thread Ilya Basin via Cygwin
Yes, 32bit.

On 21.07.2021 21:18, Takashi Yano wrote:
> On Wed, 21 Jul 2021 20:43:54 +0300
> Basin Ilya via Cygwin  wrote:
>> Hi list.
>> I've just noticed that regexp search works identically to exact match search 
>> in less and it prints this:
>>
>> $ /usr/bin/less --version
>> less 581.2 (no regular expressions)
> 
> Are you using 32bit version of cygwin?
> In my environment, this only happens in 32bit cygwin.
> 
> In 64 bit cygwin, it says:
> 
> less 581.2 (PCRE2 regular expressions)
> Copyright (C) 1984-2021  Mark Nudelman
> 
> 

-- 
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.exe waits repeatedly with SYN_SENT for inaccessible ldap

2021-01-26 Thread Ilya Basin via Cygwin
The problem is solved.
Our DHCP server was sending me a bad WINS server ip. After fixing the issue I 
had to reboot the PC (just refreshing the ip and restarting cygsshd was not 
enough).

On 22.01.2021 22:07, basini...@gmail.com wrote:
> Hi. The problem first appeared ten days ago. It now takes minutes to login as 
> a domain user. Tcpview shows that sshd.exe is trying to connect an 
> inaccessible server on the port 389 (ldap). If I close the socket using 
> Tcpview, successful login happens sooner. Both password and public key logins 
> are affected, but with a public key sshd.exe tries to connect that server 
> multiple times. Also, if I don't close the sockets repeatedly, ssh 
> disconnects from the SSH server after 2 minutes of silence before the "last 
> login" line appears:
> 
> $ time ssh -vvv localhost
> ...
> debug1: Offering public key:
> debug3: send packet: type 50
> debug2: we sent a publickey packet, wait for reply
> 
> 
> debug3: receive packet: type 60
> debug1: Server accepts key: 
> debug3: sign_and_send_pubkey: RSA
> debug3: sign_and_send_pubkey: signing using rsa-sha2-512
> debug3: send packet: type 50
> 
> 
> Connection closed by ::1 port 22
> 
> real2m0.292s
> user0m0.045s
> sys 0m0.122s
> 
> 
> 
> Besedes, sshd.exe has a live connection on port 389 to another server all the 
> time.
> 
> 
> I can't see anything interesting in sshd log. At least the ldap ip address 
> does not appear in the log.
> 
> ...
>  
> sshd: PID 1786: debug1: temporarily_use_uid: 1087042/1049089 
> (e=18/18) 
>   
>  
> sshd: PID 1786: debug1: trying public key file 
> /home/basin/.ssh/authorized_keys 
> ...
> 
>  
> sshd: PID 1786: debug1: temporarily_use_uid: 1087042/1049089 
> (e=18/18) 
> ...
> 
> 
>  
> sshd: PID 1786: debug1: trying public key file 
> /home/basin/.ssh/authorized_keys 
> ...
> 
> 
>  
> sshd: PID 1786: debug1: monitor_child_preauth: basin has been 
> authenticated by privileged process 
> ...
> 
> 
>  
> sshd: PID 1652: debug1: main_sigchld_handler: Child exited 
> 
> BTW, is it possible to make sshd write to a log file instead of Windows Event 
> Log?
> 
> 
--
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


sshd.exe waits repeatedly with SYN_SENT for inaccessible ldap

2021-01-22 Thread Ilya Basin via Cygwin
Hi. The problem first appeared ten days ago. It now takes minutes to login as a 
domain user. Tcpview shows that sshd.exe is trying to connect an inaccessible 
server on the port 389 (ldap). If I close the socket using Tcpview, successful 
login happens sooner. Both password and public key logins are affected, but 
with a public key sshd.exe tries to connect that server multiple times. Also, 
if I don't close the sockets repeatedly, ssh disconnects from the SSH server 
after 2 minutes of silence before the "last login" line appears:

$ time ssh -vvv localhost
...
debug1: Offering public key:
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply


debug3: receive packet: type 60
debug1: Server accepts key: 
debug3: sign_and_send_pubkey: RSA
debug3: sign_and_send_pubkey: signing using rsa-sha2-512
debug3: send packet: type 50


Connection closed by ::1 port 22

real2m0.292s
user0m0.045s
sys 0m0.122s



Besedes, sshd.exe has a live connection on port 389 to another server all the 
time.


I can't see anything interesting in sshd log. At least the ldap ip address does 
not appear in the log.

...
 
sshd: PID 1786: debug1: temporarily_use_uid: 1087042/1049089 
(e=18/18) 
  
 
sshd: PID 1786: debug1: trying public key file 
/home/basin/.ssh/authorized_keys 
...

 
sshd: PID 1786: debug1: temporarily_use_uid: 1087042/1049089 
(e=18/18) 
...


 
sshd: PID 1786: debug1: trying public key file 
/home/basin/.ssh/authorized_keys 
...


 
sshd: PID 1786: debug1: monitor_child_preauth: basin has been 
authenticated by privileged process 
...


 
sshd: PID 1652: debug1: main_sigchld_handler: Child exited 

BTW, is it possible to make sshd write to a log file instead of Windows Event 
Log?


--
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: blockdev.exe is missing in util-linux. How to determine block device size in bash?

2020-12-05 Thread Ilya Basin via Cygwin
Strange. On Win7 this doesn't work:

il@mar2 /cygdrive/c/Windows/System32
$ cat /proc/partitions
major minor  #blocks  name   win-mounts

8 0 0 sda
816 0 sdb

il@mar2 /cygdrive/c/Windows/System32
$ dd of=/dev/null if=/dev/sda bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.215181 s, 487 MB/s


On 28.11.2020 20:04, Brian Inglis wrote:
> $ cat /proc/partitions
> major minor  #blocks  name   win-mounts
> 
> 8 0 976762584 sda
> 8 1 16384 sda1
> 8 2 97678 sda2   C:\
> 816 976762584 sdb
> 817131072 sdb1
> 818102400 sdb2
> 819 975482161 sdb3   D:\
> 820577536 sdb4
> 821465920 sdb5
> 832 0 sdc
--
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


surrounding double quotes not removed from native command line arguments when they contain unicode and locale is default

2020-11-12 Thread Ilya Basin via Cygwin
Hi.
When I launch a Cygwin program from a native Windows program and an argument in 
the command line string is quoted and contains national characters then the 
Cygwin program behaves as if double quotes were part of the program argument.
This happens if I don't explicitly set LC_ALL or if I set LC_ALL=C or set 
LC_ALL=C.UTF-8

This is a problem because arguments with spaces must be quoted.

If I set the locale to some language and country the quotes are removed as 
expected no matter what code page I use, UTF-8 or a single-byte code page. The 
locale doesn't have to match the alphabet used.

If the argument is not quoted or if it doesn't contain national characters then 
it works even with the C locale.

C:\>set LC_ALL=

C:\>C:/cygwin/bin/ls -l C:/test-z-я/some.txt
-rw-r--r-- 1 il None 0 Nov 12 09:52 'C:/test-z-'$'/321/217''/some.txt'

C:\>C:/cygwin/bin/ls -l "C:/test-z-я/some.txt"
/usr/bin/ls: cannot access '"C:/test-z-'$'\321\217''/some.txt"': No such 
file or directory

C:\>C:/cygwin/bin/ls -l "C:/test-z-Z/some.txt"
-rw-r--r-- 1 il None 0 Nov 12 09:52 C:/test-z-Z/some.txt

C:\>C:\cygwin\bin\locale
LANG=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=

C:\>set LC_ALL=C.UTF-8

C:\>C:/cygwin/bin/ls -l "C:/test-z-я/some.txt"
/usr/bin/ls: cannot access '"C:/test-z-я/some.txt"': No such file or 
directory

C:\>set LC_ALL=en_US.CP1252

C:\>C:/cygwin/bin/ls -l "C:/test-z-я/some.txt"
-rw-r--r-- 1 il None 0 Nov 12 09:52 'C:/test-z-'$'/030''N'$'/217''/some.txt'

C:\>set LC_ALL=en_US.UTF-8

C:\>C:/cygwin/bin/ls -l "C:/test-z-я/some.txt"
-rw-r--r-- 1 il None 0 Nov 12 09:52 'C:/test-z-я/some.txt'

--
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: Something makes curl hang for 5 minutes after connection refused

2020-11-12 Thread Ilya Basin via Cygwin
This looks fixed now. Thanks.

On 15.09.2019 10:07, Basin Ilya wrote:
> Hi.
> Any update on this?
>
> 01.12.2018 12:51, Corinna Vinschen пишет:
>> On Nov 30 20:42, Brian Inglis wrote:
>>> On 2018-11-30 12:49, Lee wrote:
 On 11/30/18, Basin Ilya  wrote:
> Hi.
>
> Recently I noticed that `curl` does not fail immediately after connection
> refused, but waits for 5 minutes.
>
> This only happens on my machine and only with the `Cygwin` version of
> `curl`. The mingw version is unaffected.
> I tried downgrading curl, but it didn't help. I thought there's a rogue
> setting in `/etc` or in home or maybe some environment variable, but I
> couldn't find it.
>
> basin@BASIN /cygdrive/c/Users/basin
> $ >/dev/null /usr/bin/curl -v http://127.0.0.1:2/
> * STATE: INIT => CONNECT handle 0x80048658; line 1404 (connection
> #-5000)
> * Added connection 0. The cache now contains 1 members
> *   Trying 127.0.0.1...
> * TCP_NODELAY set
> * STATE: CONNECT => WAITCONNECT handle 0x80048658; line 1456 
> (connection
> #0)
 <.. snip ..>
> curl: (28) Connection timed out after 300145 milliseconds
>
> basin@BASIN /cygdrive/c/Users/basin
> $ /usr/bin/curl --version
> curl 7.59.0 (i686-pc-cygwin) libcurl/7.59.0 OpenSSL/1.0.2p zlib/1.2.11
> libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.2) libssh2/1.7.0 nghttp2/1.31.0
> Can someone try to reproduce it?
 I get the same behavior:
 $ /usr/bin/curl -v http://127.0.0.1:2/
 * STATE: INIT => CONNECT handle 0x600057ad0; line 1404 (connection #-5000)
 * Added connection 0. The cache now contains 1 members
 *   Trying 127.0.0.1...
 * TCP_NODELAY set
 * STATE: CONNECT => WAITCONNECT handle 0x600057ad0; line 1456 (connection 
 #0)
 * Connection timed out after 300324 milliseconds
 * multi_done
 * stopped the pause stream!
 * Closing connection 0
 * The cache now contains 0 members
 curl: (28) Connection timed out after 300324 milliseconds

 $ /usr/bin/curl --version
 curl 7.59.0 (x86_64-unknown-cygwin) libcurl/7.59.0 OpenSSL/1.0.2p
 zlib/1.2.11 libidn2/2.0.4 libpsl/0.18.0 (+libidn2/2.0.2) libssh2/1.7.0
 nghttp2/1.31.0


 I also get an almost immediate 'failed to connect' notice on windows:
 C:\>C:\UTIL\curl\curl.exe -v http://127.0.0.1:2/
 *   Trying 127.0.0.1...
 * TCP_NODELAY set
 * connect to 127.0.0.1 port 2 failed: Connection refused
 * Failed to connect to 127.0.0.1 port 2: Connection refused
 * Closing connection 0
 curl: (7) Failed to connect to 127.0.0.1 port 2: Connection refused

 with either version of curl:
 C:\>where curl
 C:\UTIL\curl\curl.exe
 C:\Windows\System32\curl.exe
>>> Ditto all the way!
>>>
>>> Could this be caused by network speed improvements made to Cygwin a while 
>>> back?
>>> Or were those patches never sent/received/applied from Daniel Havey (MS 
>>> Windows
>>> Program Manager for Transports and IP)?
>> Somebody may want to bisect this...
>>
>>
>> Corinna
>>
--
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


Prevent Ctrl-C kill native process

2015-03-20 Thread Ilya Basin
How to tell Cygwin not to kill a native process when I press Ctrl-C ?
I tried to run it in background, but it doesn't help, when its output
is piped.

Compare these:
( while true; do echo aaa; sleep 1; done  ) | ( trap '' INT; cat )
( while true; do echo aaa; sleep 1; done ) | ( trap '' INT; cat )

( /cygdrive/c/Windows/system32/ping -t localhost ) | ( trap '' INT; cat )
( /cygdrive/c/Windows/system32/ping -t localhost  ) | ( trap '' INT; cat )

The last command should not die, when I press Ctrl-C, but it dies
anyway.






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



local admin `chmod 400` still can write

2014-07-31 Thread Ilya Basin
Hi.

From cygwin shell I'm able to read and write files even though my
Windows user has no permission for it. I tried `chmod` and to deny
everything for Everyone in the Windows dialog, but it didn't help. How
is it possible?

$ id
uid=48466(basin) gid=545(Users) 
groups=545(Users),0(root),544(Administrators)
$ touch aaa.txt
$ chmod 400 aaa.txt
$ ls -l aaa.txt
-r+ 1 Administrators  0 Jul 30 19:23 aaa.txt
$ echo aaa aaa.txt
$ cat aaa.txt
aaa

My id is not 0, but maybe cygwin still behaves as if I was root.


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



'ssh -1 -L named_pipe' freezes

2013-04-09 Thread Ilya Basin
Here's my script that works on linux:

cmd=ssh -T -N -g -1 -L 10001:anotherhost:22
fifo=`mktemp -u`
mkfifo $fifo
$cmd $fifo 
exec 3$fifo
# message: Pseudo-terminal will not be allocated because stdin is not a 
terminal.
# netstat shows that port 10001 is LISTENING
# from another terminal: ssh -p 10001 localhost
#printf '\0' 3 # unfreeze on Cygwin
wait

-N is ignored for protocol version 1, so as a workaround I redirect
input from an eternal pipe.
I want to save processes, so I'm using a named pipe instead of
something like:
sleep | ssh

On Cygwin when I try to use the forwarded port, the new client freezes
until I write something to the pipe.

This happens only with named pipes. Normal pipes work well.


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



setup.exe wrong percentage

2013-04-05 Thread Ilya Basin
Hello.
In download only mode setup.exe 2.774 shows wrong percentage. see:
http://i51.fastpic.ru/big/2013/0405/4b/605ee14742b48fb58e153a5952bf084b.png


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



du crashes if .lnk symlink and a folder it points to are named the same, differing only in letter case

2012-03-25 Thread Ilya Basin
I needed that because one git repository has branches named
Epam/a and epam/b, and git was always creating the missing epam
directory at fetch.

$ ls -l
total 0
drwxr-xr-x+ 1 adminpwd None 0 Mar 25 11:42 Epam
drwxr-xr-x+ 1 adminpwd None 0 Mar 25 11:42 epam

why no  - Epam part? 'ls' behaves funny too, but at least it
doesn't crash.


$ ls -l epam.lnk
lrwxrwxrwx 1 Users None 4 Mar 13 16:43 epam.lnk - Epam

$ du .
0   ./Epam
Aborted (core dumped)

crash caused by abort() called from here:

coreutils-8.15/lib/fts-cycle.c:
static void
leave_dir (FTS *fts, FTSENT *ent)
{
  struct stat const *st = ent-fts_statp;
  if (fts-fts_options  (FTS_TIGHT_CYCLE_CHECK | FTS_LOGICAL))
{
  struct Active_dir obj;
  void *found;
  obj.dev = st-st_dev;
  obj.ino = st-st_ino;
  found = hash_delete (fts-fts_cycle.ht, obj);
  if (!found)
abort (); -- here


cygcheck.out
Description: Binary data
--
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: env var or mount option for multibyte-unicode filenames conversion

2011-08-22 Thread Ilya Basin
Corinna Vinschen corinna-cygwin at cygwin.com writes:

 
 On Aug 18 14:19, Ilya Basin wrote:
  Hi. Currently, the code page for internal convertion of file names to
  unicode depends on programs's locale.
  I want to keep UTF-8 as current locale, but use CP1251 for this
  conversion. Is it possible?
 
 Maybe if you describe your problem slightly more detailed?  Why would
 you want CP1251 in a Cygwin application if all other apps are using UTF-8?
 
 Corinna
 
Hi! I've just found your reply in web archives; didn't receive a copy
for some reason.

It's for git. Let me repost the question to git list:

Most of our developers use msysgit which stores filenames in CP1251
encoding. Two of us use cygwin and linux.

When checkout on both linux and cygwin, Russian filenames are garbled.

On Cygwin it even worse, because the conversion of invalid UTF-8 chars
to Unicode, made by Cygwin is irreversible, causing git to miss
the files it've just checked out. Workaround for Cygwin is to change
LANG from C.UTF-8 to ru_RU.CP1251. It fixes filenames, but brakes
everything else: log (fixed by i18n.logOutputEncoding), status, show,
diff.

-- 


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



env var or mount option for multibyte-unicode filenames conversion

2011-08-18 Thread Ilya Basin
Hi. Currently, the code page for internal convertion of file names to
unicode depends on programs's locale.
I want to keep UTF-8 as current locale, but use CP1251 for this
conversion. Is it possible?



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



Fwd: /usr/bin not automounted sometimes

2011-02-16 Thread Ilya Basin
It's happening again ((
===8==Original message text===
Hi list! Sometimes, when I start cygwin.bat, it prints me:
-bash: /usr/bin/tr: No such file or directory
-bash: /usr/bin/sed: No such file or directory
$
and mount shows that /usr/bin and /usr/lib not mounted.
But if I run cygwin.bat as another windows user (e.g. by runas), it
logins normally. Of course, I can mount them manually as a workaround
and re-login.

I think it happens when one windows user is running a cygwin program
and another user tries to login. I had this problem on 2 Windows XP
machines, but it's not 100% reproduceable.
For once it was just bash running as local admin: when I closed that
program, I was able to login as non-admin.
Later I installed nfsd and it also causes this problem sometimes: I
have to restart the nfsd service.
===8===End of original message text===



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



/usr/bin not automounted sometimes

2011-01-28 Thread Ilya Basin
Hi list! Sometimes, when I start cygwin.bat, it prints me:
-bash: /usr/bin/tr: No such file or directory
-bash: /usr/bin/sed: No such file or directory
$
and mount shows that /usr/bin and /usr/lib not mounted.
But if I run cygwin.bat as another windows user (e.g. by runas), it
logins normally. Of cource, I can mount them manually as a workaround
and re-login.

I think it happens when one windows user is running a cygwin program
and another user tries to login. I had this problem on 2 Windows XP
machines, but it's not 100% reproduceable.
For once it was just bash running as local admin: when I closed that
program, I was able to login as non-admin.
Later I installed nfsd and it also causes this problem sometimes: I
have to restart the nfsd service.



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



can't make setup.exe --untrusted-keys to work

2010-09-13 Thread Ilya Basin
I have a custom public key for my repo.
This works:
  setup.exe --keep-untrusted-keys -K basinilya.pub
Then I can see that something was added to the end of /etc/setup.rc
  extrakeys
  (public-key (dsa (p #00E03CE0...41FD#) ) )

Next time I invoke setup.exe like this:
  setup.exe --untrusted-keys --keep-untrusted-keys
and expect it to verify my signature, but it displays the failed to
verify error and after setup.exe exits, the tail of setup.rc looks
like this:
  extrakeys
  (public-key (dsa (p


--
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[4]: Question marks in localized man pages

2010-09-12 Thread Ilya Basin
AK On 11 September 2010 18:48, Ilya Basin wrote:
 AK On Saturday, September 11, 2010, Ilya Basin wrote:
 Hi. My default LANG is C.UTF-8. If I change it to ru.UTF-8, all
 non-ascii characters in man pages are displayed as question marks.

 AK ru.UTF-8 isn't a valid locale setting; you need a territory in there
 AK as well, e.g. ru_RU.UTF-8, otherwise you end up in the ASCII-only C
 AK locale.

 AK Andy

 For some reason with the standard ru_RU.UTF-8 man pages are in English

AK Hmm, something is quite wrong with that then.

AK We don't seem to have many man pages in Russian (or any other language
AK that isn't English) in the first place. Was it the vim pages you were
AK looking at?
yes
AK Does inserting preconv as you mentioned previously help with ru_RU.UTF-8 
too?
No, as I told before, with LANG=ru_RU.UTF-8 man can't find man pages
in Russian and displays them in English.
AK Andy

I think there're at least 2 problems:
 - man incorrectly parses the LANG variable
 - man doesn't use preconv


-- 


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



Question marks in localized man pages

2010-09-11 Thread Ilya Basin
Hi. My default LANG is C.UTF-8. If I change it to ru.UTF-8, all
non-ascii characters in man pages are displayed as question marks.
I found that on Linux before going to nroff, the unzipped man page is
first piped through /usr/bin/preconv that escapes non-ascii chars:
  vim \- Vi IMproved 
(\[u0423]\[u043B]\[u0443]\[u0447]\[u0448]\[u0435]\[u043D]\[u043D]\[u044B]\[u0439]
 Vi)
On Cygwin the unzipped man page goes directly to nroff, which replaces
unknown characters with question marks.
I added preconv to /etc/man.conf as follows:
  NROFF   /usr/bin/preconv -e UTF-8 | /usr/bin/nroff -c -mandoc 
2/dev/null
That solved my problem. I wonder why preconv isn't there by default.







--
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[2]: Question marks in localized man pages

2010-09-11 Thread Ilya Basin
AK On Saturday, September 11, 2010, Ilya Basin wrote:
 Hi. My default LANG is C.UTF-8. If I change it to ru.UTF-8, all
 non-ascii characters in man pages are displayed as question marks.

AK ru.UTF-8 isn't a valid locale setting; you need a territory in there
AK as well, e.g. ru_RU.UTF-8, otherwise you end up in the ASCII-only C
AK locale.

AK Andy

For some reason with the standard ru_RU.UTF-8 man pages are in English

-- 


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