public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* unzip failure with files that contain colons
@ 2022-06-15 18:30 Adam Dinwoodie
  2022-06-16  4:22 ` Thomas Wolff
  0 siblings, 1 reply; 8+ messages in thread
From: Adam Dinwoodie @ 2022-06-15 18:30 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

Cygwin generally handles filenames with colons just fine, by mapping the
character to some higher Unicode character and remapping on the fly.
However Cygwin's `unzip` appears to have a bug: when unzipping an
archive that contains a filename with a colon, it replaces the colon
with an underscore.

cygcheck.out and simple test script attached; expected behaviour from
running `bash unzip-bug.sh` is that you get an empty file called `a:b`,
but on Cygwin you instead get an empty file called `a_b`.

[-- Attachment #2: unzip-bug.sh --]
[-- Type: application/x-sh, Size: 105 bytes --]

[-- Attachment #3: cygcheck.out --]
[-- Type: text/plain, Size: 14837 bytes --]


Cygwin Configuration Diagnostics
Current System Time: Wed Jun 15 19:22:23 2022

Windows 11 Enterprise Ver 10.0 Build 22000 

Running in Terminal Service session

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

Output from C:\cygwin64\bin\id.exe
UID: 197112(WDAGUtilityAccount)
GID: 197121(None)
197121(None)
114(Local account and member of Administrators group)
555(Remote Desktop Users)
545(Users)
544(Administrators)
14(REMOTE INTERACTIVE LOGON)
4(INTERACTIVE)
11(Authenticated Users)
15(This Organization)
113(Local account)
4095(CurrentSession)
66048(LOCAL)
262154(NTLM Authentication)
405504(High Mandatory Level)

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

USER = 'WDAGUtilityAccount'
PWD = '/home/WDAGUtilityAccount'
HOME = '/home/WDAGUtilityAccount'

USERDOMAIN = '9F304FFD-B233-4'
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/London'
HOSTNAME = '9f304ffd-b233-4d94-8617-0d861a04287a'
PUBLIC = 'C:\Users\Public'
OLDPWD = '/home/WDAGUtilityAccount'
USERNAME = 'WDAGUtilityAccount'
LOGONSERVER = '\\9F304FFD-B233-4'
PROCESSOR_ARCHITECTURE = 'AMD64'
CLIENTNAME = '5e5c3cdb-06ba-4'
LOCALAPPDATA = 'C:\Users\WDAGUtilityAccount\AppData\Local'
COMPUTERNAME = '9F304FFD-B233-4'
FPS_BROWSER_APP_PROFILE_STRING = 'Internet Explorer'
!:: = '::\'
SYSTEMDRIVE = 'C:'
USERPROFILE = 'C:\Users\WDAGUtilityAccount'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
SYSTEMROOT = 'C:\Windows'
USERDOMAIN_ROAMINGPROFILE = '9F304FFD-B233-4'
PROCESSOR_IDENTIFIER = 'Intel64 Family 6 Model 158 Stepping 13, GenuineIntel'
TMP = '/tmp'
LC_CTYPE = 'en_US.UTF-8'
TERM_PROGRAM = 'mintty'
TERM_PROGRAM_VERSION = '3.6.1'
PROCESSOR_REVISION = '9e0d'
FPS_BROWSER_USER_PROFILE_STRING = 'Default'
PROFILEREAD = 'true'
NUMBER_OF_PROCESSORS = '16'
ProgramW6432 = 'C:\Program Files'
COMSPEC = 'C:\Windows\system32\cmd.exe'
APPDATA = 'C:\Users\WDAGUtilityAccount\AppData\Roaming'
SHELL = '/bin/bash'
TERM = 'xterm'
WINDIR = 'C:\Windows'
ProgramData = 'C:\ProgramData'
SHLVL = '1'
MINTTY_SHORTCUT = '/cygdrive/c/Users/Public/Desktop/Cygwin64 Terminal.lnk'
PROGRAMFILES = 'C:\Program Files'
ALLUSERSPROFILE = 'C:\ProgramData'
TEMP = '/tmp'
DriverData = 'C:\Windows\System32\Drivers\DriverData'
SESSIONNAME = '31C5CE94259D4006A9E4#0'
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\WDAGUtilityAccount'
ORIGINAL_PATH = '/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Users/WDAGUtilityAccount/AppData/Local/Microsoft/WindowsApps'
EXECIGNORE = '*.dll'
_ = '/usr/bin/cygcheck'

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

c:  hd  NTFS     40830Mb   8% CP CS UN PA FC        

C:\cygwin64      /          system  binary,auto
C:\cygwin64\bin  /usr/bin   system  binary,auto
C:\cygwin64\lib  /usr/lib   system  binary,auto
cygdrive prefix  /cygdrive  user    binary,posix=0,auto

Found: C:\cygwin64\bin\awk
 -> C:\cygwin64\bin\gawk.exe
Found: C:\cygwin64\bin\bash.exe
Found: C:\cygwin64\bin\cat.exe
Found: C:\Windows\system32\certutil.exe
Not Found: clinfo
Found: C:\Windows\system32\comp.exe
Found: C:\Windows\system32\convert.exe
Found: C:\cygwin64\bin\cp.exe
Not Found: cpp (good!)
Not Found: crontab
Found: C:\Windows\system32\curl.exe
Found: C:\cygwin64\bin\expand.exe
Found: C:\Windows\system32\expand.exe
Warning: C:\cygwin64\bin\expand.exe hides C:\Windows\system32\expand.exe
Found: C:\cygwin64\bin\find.exe
Found: C:\Windows\system32\find.exe
Warning: C:\cygwin64\bin\find.exe hides C:\Windows\system32\find.exe
Found: C:\Windows\system32\ftp.exe
Not Found: gcc
Not Found: gdb
Found: C:\cygwin64\bin\grep.exe
Found: C:\cygwin64\bin\hostname.exe
Found: C:\Windows\system32\hostname.exe
Warning: C:\cygwin64\bin\hostname.exe hides C:\Windows\system32\hostname.exe
Found: C:\cygwin64\bin\kill.exe
Not Found: klist
Not Found: ld
Found: C:\cygwin64\bin\ls.exe
Not Found: make
Found: C:\cygwin64\bin\mv.exe
Found: C:\Windows\system32\nslookup.exe
Not Found: patch
Not Found: perl
Found: C:\Windows\system32\replace.exe
Found: C:\cygwin64\bin\rm.exe
Found: C:\cygwin64\bin\sed.exe
Found: C:\cygwin64\bin\sh.exe
Found: C:\Windows\system32\shutdown.exe
Found: C:\cygwin64\bin\sort.exe
Found: C:\Windows\system32\sort.exe
Warning: C:\cygwin64\bin\sort.exe hides C:\Windows\system32\sort.exe
Not Found: ssh
Found: C:\cygwin64\bin\tar.exe
Found: C:\Windows\system32\tar.exe
Warning: C:\cygwin64\bin\tar.exe hides C:\Windows\system32\tar.exe
Found: C:\cygwin64\bin\test.exe
Found: C:\cygwin64\bin\timeout.exe
Found: C:\Windows\system32\timeout.exe
Warning: C:\cygwin64\bin\timeout.exe hides C:\Windows\system32\timeout.exe
Found: C:\cygwin64\bin\vi.exe
Not Found: vim
Found: C:\cygwin64\bin\whoami.exe
Found: C:\Windows\system32\whoami.exe
Warning: C:\cygwin64\bin\whoami.exe hides C:\Windows\system32\whoami.exe

   39k 2016/09/19 C:\cygwin64\bin\cygargp-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygargp-0.dll" v0.0 ts=2016-09-19 02:13
   19k 2018/12/20 C:\cygwin64\bin\cygattr-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygattr-1.dll" v0.0 ts=2018-12-20 09:48
  254k 2020/03/31 C:\cygwin64\bin\cygblkid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygblkid-1.dll" v0.0 ts=2020-03-28 06:22
   66k 2019/07/21 C:\cygwin64\bin\cygbz2-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygbz2-1.dll" v0.0 ts=2019-07-22 00:05
 2491k 2022/05/07 C:\cygwin64\bin\cygcrypto-1.1.dll - os=4.0 img=0.0 sys=5.2
                  "cygcrypto-1.1.dll" v0.0 ts=2022-05-07 13:00
  353k 2020/03/31 C:\cygwin64\bin\cygfdisk-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygfdisk-1.dll" v0.0 ts=2020-03-28 06:23
   27k 2015/11/17 C:\cygwin64\bin\cygffi-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygffi-6.dll" v0.0 ts=2015-11-17 22:14
   56k 2019/07/28 C:\cygwin64\bin\cygformw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygformw-10.dll" v0.0 ts=2019-07-28 17:33
   74k 2022/05/02 C:\cygwin64\bin\cyggcc_s-seh-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyggcc_s-seh-1.dll" v0.0 ts=2022-05-02 11:29
   49k 2019/07/10 C:\cygwin64\bin\cyggdbm-6.dll - os=4.0 img=0.0 sys=5.2
                  "cyggdbm-6.dll" v0.0 ts=2019-07-10 14:53
  582k 2021/08/21 C:\cygwin64\bin\cyggmp-10.dll - os=4.0 img=0.0 sys=5.2
                  "cyggmp-10.dll" v0.0 ts=2021-08-21 19:11
   36k 2021/08/31 C:\cygwin64\bin\cyghistory7.dll - os=4.0 img=0.0 sys=5.2
                  "cyghistory7.dll" v0.0 ts=2021-08-31 07:54
 1007k 2020/07/13 C:\cygwin64\bin\cygiconv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygiconv-2.dll" v0.0 ts=2020-07-13 13:57
   42k 2021/07/29 C:\cygwin64\bin\cygintl-8.dll - os=4.0 img=0.0 sys=5.2
                  "cygintl-8.dll" v0.0 ts=2021-07-29 03:40
   73k 2017/06/19 C:\cygwin64\bin\cyglz4-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyglz4-1.dll" v0.0 ts=2017-06-19 15:40
  147k 2022/03/06 C:\cygwin64\bin\cyglzma-5.dll - os=4.0 img=0.0 sys=5.2
                  "cyglzma-5.dll" v0.0 ts=2022-03-06 18:26
  157k 2022/01/12 C:\cygwin64\bin\cygmagic-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygmagic-1.dll" v0.0 ts=2022-01-12 09:43
  212k 2022/03/19 C:\cygwin64\bin\cygman-2-10-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygman-2-10-2.dll" v0.0 ts=2022-03-19 15:41
   24k 2022/03/19 C:\cygwin64\bin\cygmandb-2-10-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygmandb-2-10-2.dll" v0.0 ts=2022-03-19 15:41
   28k 2019/07/28 C:\cygwin64\bin\cygmenuw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygmenuw-10.dll" v0.0 ts=2019-07-28 17:32
 2663k 2021/08/21 C:\cygwin64\bin\cygmpfr-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygmpfr-6.dll" v0.0 ts=2021-08-21 19:01
  301k 2019/07/28 C:\cygwin64\bin\cygncursesw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygncursesw-10.dll" v0.0 ts=2019-07-28 17:30
 1020k 2020/03/27 C:\cygwin64\bin\cygp11-kit-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygp11-kit-0.dll" v0.0 ts=2020-03-27 22:30
   14k 2019/07/28 C:\cygwin64\bin\cygpanelw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygpanelw-10.dll" v0.0 ts=2019-07-28 17:32
  497k 2021/06/20 C:\cygwin64\bin\cygpcre-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpcre-1.dll" v0.0 ts=2021-06-20 12:53
  627k 2022/04/30 C:\cygwin64\bin\cygpcre2-8-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygpcre2-8-0.dll" v0.0 ts=2022-04-30 13:08
   42k 2020/12/27 C:\cygwin64\bin\cygpipeline-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygpipeline-1.dll" v0.0 ts=2020-12-27 14:15
   42k 2020/12/31 C:\cygwin64\bin\cygpopt-0.dll - os=4.0 img=0.0 sys=5.2
                  "cygpopt-0.dll" v0.0 ts=2020-12-31 12:16
  254k 2021/08/31 C:\cygwin64\bin\cygreadline7.dll - os=4.0 img=0.0 sys=5.2
                  "cygreadline7.dll" v0.0 ts=2021-08-31 07:54
   11k 2015/07/17 C:\cygwin64\bin\cygsigsegv-2.dll - os=4.0 img=0.0 sys=5.2
                  "cygsigsegv-2.dll" v0.0 ts=2015-07-17 22:35
  156k 2020/03/31 C:\cygwin64\bin\cygsmartcols-1.dll - os=4.0 img=0.0 sys=5.2
                  "cygsmartcols-1.dll" v0.0 ts=2020-03-28 06:22
  511k 2022/05/07 C:\cygwin64\bin\cygssl-1.1.dll - os=4.0 img=0.0 sys=5.2
                  "cygssl-1.1.dll" v0.0 ts=2022-05-07 13:01
 1870k 2022/05/02 C:\cygwin64\bin\cygstdc++-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygstdc++-6.dll" v0.0 ts=2022-05-02 11:43
   68k 2019/07/29 C:\cygwin64\bin\cygtasn1-6.dll - os=4.0 img=0.0 sys=5.2
                  "cygtasn1-6.dll" v0.0 ts=2019-07-29 03:12
   57k 2019/07/28 C:\cygwin64\bin\cygticw-10.dll - os=4.0 img=0.0 sys=5.2
                  "cygticw-10.dll" v0.0 ts=2019-07-28 17:31
   27k 2020/03/31 C:\cygwin64\bin\cyguuid-1.dll - os=4.0 img=0.0 sys=5.2
                  "cyguuid-1.dll" v0.0 ts=2020-03-28 06:22
   88k 2022/04/10 C:\cygwin64\bin\cygz.dll - os=4.0 img=0.0 sys=5.2
                  "cygz.dll" v0.0 ts=2022-04-10 20:26
 3486k 2022/05/13 C:\cygwin64\bin\cygwin1.dll - os=4.0 img=0.0 sys=5.2
                  "cygwin1.dll" v0.0 ts=2022-05-13 13:27
    Cygwin DLL version info:
        DLL version: 3.3.5
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 341
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5


Can't find the cygrunsrv utility, skipping services check.


Cygwin Package Information
Last downloaded files to: C:\Users\WDAGUtilityAccount\Downloads
Last downloaded files from: https://www.mirrorservice.org/sites/sourceware.org/pub/cygwin/

Package              Version            Status
_autorebase          001091-1           OK
alternatives         1.3.30c-10         OK
base-cygwin          3.8-1              OK
base-files           4.3-3              OK
bash                 4.4.12-3           OK
bzip2                1.0.8-1            OK
ca-certificates      2021.2.52-1        OK
coreutils            8.32-1             OK
crypto-policies      20190218-1         OK
cygutils             1.4.17-1           OK
cygwin               3.3.5-1            OK
dash                 0.5.11.5-1         OK
diffutils            3.8-1              OK
editrights           1.03-1             OK
file                 5.41-2             OK
findutils            4.9.0-1            OK
gawk                 5.1.1-1            OK
getent               2.18.90-4          OK
grep                 3.7-2              OK
groff                1.22.4-1           OK
gzip                 1.12-1             OK
hostname             3.13-1             OK
info                 6.8-2              OK
ipc-utils            1.0-2              OK
less                 590-1              OK
libargp              20110921-3         OK
libattr1             2.4.48-2           OK
libblkid1            2.33.1-2           OK
libbz2_1             1.0.8-1            OK
libfdisk1            2.33.1-2           OK
libffi6              3.2.1-2            OK
libgcc1              11.3.0-1           OK
libgdbm6             1.18.1-1           OK
libgmp10             6.2.1-2            OK
libiconv2            1.16-2             OK
libintl8             0.21-1             OK
liblz4_1             1.7.5-1            OK
liblzma5             5.2.5-1            OK
libmpfr6             4.1.0-2            OK
libncursesw10        6.1-1.20190727     OK
libp11-kit0          0.23.20-1          OK
libpcre1             8.45-1             OK
libpcre2_8_0         10.40-1            OK
libpipeline1         1.5.3-1            OK
libpopt-common       1.18-1             OK
libpopt0             1.18-1             OK
libreadline7         8.1-2              OK
libsigsegv2          2.10-2             OK
libsmartcols1        2.33.1-2           OK
libssl1.1            1.1.1o-1           OK
libstdc++6           11.3.0-1           OK
libtasn1_6           4.14-1             OK
libuuid1             2.33.1-2           OK
login                1.13-1             OK
man-db               2.10.2-1           OK
mintty               3.6.1-1            OK
ncurses              6.1-1.20190727     OK
openssl              1.1.1o-1           OK
p11-kit              0.23.20-1          OK
p11-kit-trust        0.23.20-1          OK
rebase               4.5.0-1            OK
run                  1.3.4-2            OK
sed                  4.8-1              OK
tar                  1.34-1             OK
terminfo             6.1-1.20190727     OK
terminfo-extra       6.1-1.20190727     OK
tzcode               2022a-1            OK
tzdata               2022a-1            OK
unzip                6.0-17             OK
util-linux           2.33.1-2           OK
vim-minimal          8.2.4372-1         OK
which                2.20-2             OK
xz                   5.2.5-1            OK
zip                  3.0-12             OK
zlib0                1.2.12-1           OK
zstd                 1.5.2-1            OK
Use -h to see help about each section

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unzip failure with files that contain colons
  2022-06-15 18:30 unzip failure with files that contain colons Adam Dinwoodie
@ 2022-06-16  4:22 ` Thomas Wolff
  2022-06-16 15:29   ` Takashi Yano
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Wolff @ 2022-06-16  4:22 UTC (permalink / raw)
  To: cygwin


Am 15.06.2022 um 20:30 schrieb Adam Dinwoodie:
> Cygwin generally handles filenames with colons just fine, by mapping the
> character to some higher Unicode character and remapping on the fly.
> However Cygwin's `unzip` appears to have a bug: when unzipping an
> archive that contains a filename with a colon, it replaces the colon
> with an underscore.
>
> cygcheck.out and simple test script attached; expected behaviour from
> running `bash unzip-bug.sh` is that you get an empty file called `a:b`,
> but on Cygwin you instead get an empty file called `a_b`.
It's an explicit #ifdef __CYGWIN__ in upstream unzip, file unix/unix.c, 
which transforms a bunch of characters.
If I uncomment most of them (except \), all unpack fine:
x0:z  x1<z  x2>z  x3|z  x4"z  x5?z  x6*z

Someone should report upstream please.
Thomas

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unzip failure with files that contain colons
  2022-06-16  4:22 ` Thomas Wolff
@ 2022-06-16 15:29   ` Takashi Yano
  2022-06-16 15:50     ` Eliot Moss
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Takashi Yano @ 2022-06-16 15:29 UTC (permalink / raw)
  To: cygwin

On Thu, 16 Jun 2022 06:22:38 +0200
Thomas Wolff wrote:
> Am 15.06.2022 um 20:30 schrieb Adam Dinwoodie:
> > Cygwin generally handles filenames with colons just fine, by mapping the
> > character to some higher Unicode character and remapping on the fly.
> > However Cygwin's `unzip` appears to have a bug: when unzipping an
> > archive that contains a filename with a colon, it replaces the colon
> > with an underscore.
> >
> > cygcheck.out and simple test script attached; expected behaviour from
> > running `bash unzip-bug.sh` is that you get an empty file called `a:b`,
> > but on Cygwin you instead get an empty file called `a_b`.
> It's an explicit #ifdef __CYGWIN__ in upstream unzip, file unix/unix.c, 
> which transforms a bunch of characters.
> If I uncomment most of them (except \), all unpack fine:
> x0:z  x1<z  x2>z  x3|z  x4"z  x5?z  x6*z

I have taken over the maintenance of unzip package, and
fix the problem in the updated unzip-6.0-18.
https://cygwin.com/pipermail/cygwin/2022-June/251653.html

Please try.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unzip failure with files that contain colons
  2022-06-16 15:29   ` Takashi Yano
@ 2022-06-16 15:50     ` Eliot Moss
  2022-06-16 16:44       ` Takashi Yano
  2022-06-18 20:23       ` Andrey Repin
  2022-06-17  7:20     ` Adam Dinwoodie
       [not found]     ` <CAKwdsS-ZDR_ZFAkVwPci4mdcYcjONN_yoSb5sLxK678RRgfVmA@mail.gmail.com>
  2 siblings, 2 replies; 8+ messages in thread
From: Eliot Moss @ 2022-06-16 15:50 UTC (permalink / raw)
  To: Takashi Yano, cygwin

On 6/16/2022 11:29 AM, Takashi Yano wrote:
> On Thu, 16 Jun 2022 06:22:38 +0200
> Thomas Wolff wrote:
>> Am 15.06.2022 um 20:30 schrieb Adam Dinwoodie:
>>> Cygwin generally handles filenames with colons just fine, by mapping the
>>> character to some higher Unicode character and remapping on the fly.
>>> However Cygwin's `unzip` appears to have a bug: when unzipping an
>>> archive that contains a filename with a colon, it replaces the colon
>>> with an underscore.
>>>
>>> cygcheck.out and simple test script attached; expected behaviour from
>>> running `bash unzip-bug.sh` is that you get an empty file called `a:b`,
>>> but on Cygwin you instead get an empty file called `a_b`.
>> It's an explicit #ifdef __CYGWIN__ in upstream unzip, file unix/unix.c,
>> which transforms a bunch of characters.
>> If I uncomment most of them (except \), all unpack fine:
>> x0:z  x1<z  x2>z  x3|z  x4"z  x5?z  x6*z
> 
> I have taken over the maintenance of unzip package, and
> fix the problem in the updated unzip-6.0-18.
> https://cygwin.com/pipermail/cygwin/2022-June/251653.html

Is colon used for ADS under Windows?  Could that be why one should
be careful with it?

Regards - Eliot

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unzip failure with files that contain colons
  2022-06-16 15:50     ` Eliot Moss
@ 2022-06-16 16:44       ` Takashi Yano
  2022-06-18 20:23       ` Andrey Repin
  1 sibling, 0 replies; 8+ messages in thread
From: Takashi Yano @ 2022-06-16 16:44 UTC (permalink / raw)
  To: cygwin

On Thu, 16 Jun 2022 11:50:23 -0400
Eliot Moss wrote:
> On 6/16/2022 11:29 AM, Takashi Yano wrote:
> > On Thu, 16 Jun 2022 06:22:38 +0200
> > Thomas Wolff wrote:
> >> Am 15.06.2022 um 20:30 schrieb Adam Dinwoodie:
> >>> Cygwin generally handles filenames with colons just fine, by mapping the
> >>> character to some higher Unicode character and remapping on the fly.
> >>> However Cygwin's `unzip` appears to have a bug: when unzipping an
> >>> archive that contains a filename with a colon, it replaces the colon
> >>> with an underscore.
> >>>
> >>> cygcheck.out and simple test script attached; expected behaviour from
> >>> running `bash unzip-bug.sh` is that you get an empty file called `a:b`,
> >>> but on Cygwin you instead get an empty file called `a_b`.
> >> It's an explicit #ifdef __CYGWIN__ in upstream unzip, file unix/unix.c,
> >> which transforms a bunch of characters.
> >> If I uncomment most of them (except \), all unpack fine:
> >> x0:z  x1<z  x2>z  x3|z  x4"z  x5?z  x6*z
> > 
> > I have taken over the maintenance of unzip package, and
> > fix the problem in the updated unzip-6.0-18.
> > https://cygwin.com/pipermail/cygwin/2022-June/251653.html
> 
> Is colon used for ADS under Windows?  Could that be why one should
> be careful with it?

Cygwin replaces ':' (0x3A) in file name with U+F03A when creating
the file. See winsup/cygwin/path.cc and winsup/cygwin/strfuncs.cc.
Therefore, ':' can be safely used in file name without conflict.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unzip failure with files that contain colons
  2022-06-16 15:29   ` Takashi Yano
  2022-06-16 15:50     ` Eliot Moss
@ 2022-06-17  7:20     ` Adam Dinwoodie
       [not found]     ` <CAKwdsS-ZDR_ZFAkVwPci4mdcYcjONN_yoSb5sLxK678RRgfVmA@mail.gmail.com>
  2 siblings, 0 replies; 8+ messages in thread
From: Adam Dinwoodie @ 2022-06-17  7:20 UTC (permalink / raw)
  To: cygwin

On Fri, Jun 17, 2022 at 12:29:39AM +0900, Takashi Yano wrote:
> On Thu, 16 Jun 2022 06:22:38 +0200
> Thomas Wolff wrote:
> > Am 15.06.2022 um 20:30 schrieb Adam Dinwoodie:
> > > Cygwin generally handles filenames with colons just fine, by mapping the
> > > character to some higher Unicode character and remapping on the fly.
> > > However Cygwin's `unzip` appears to have a bug: when unzipping an
> > > archive that contains a filename with a colon, it replaces the colon
> > > with an underscore.
> > >
> > > cygcheck.out and simple test script attached; expected behaviour from
> > > running `bash unzip-bug.sh` is that you get an empty file called `a:b`,
> > > but on Cygwin you instead get an empty file called `a_b`.
> > It's an explicit #ifdef __CYGWIN__ in upstream unzip, file unix/unix.c, 
> > which transforms a bunch of characters.
> > If I uncomment most of them (except \), all unpack fine:
> > x0:z  x1<z  x2>z  x3|z  x4"z  x5?z  x6*z
> 
> I have taken over the maintenance of unzip package, and
> fix the problem in the updated unzip-6.0-18.
> https://cygwin.com/pipermail/cygwin/2022-June/251653.html
> 
> Please try.

Confirmed fixed.  Thank you for adopting this and the quick turnaround!

Adam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unzip failure with files that contain colons
  2022-06-16 15:50     ` Eliot Moss
  2022-06-16 16:44       ` Takashi Yano
@ 2022-06-18 20:23       ` Andrey Repin
  1 sibling, 0 replies; 8+ messages in thread
From: Andrey Repin @ 2022-06-18 20:23 UTC (permalink / raw)
  To: Eliot Moss, cygwin

Greetings, Eliot Moss!

> On 6/16/2022 11:29 AM, Takashi Yano wrote:
>> On Thu, 16 Jun 2022 06:22:38 +0200
>> Thomas Wolff wrote:
>>> Am 15.06.2022 um 20:30 schrieb Adam Dinwoodie:
>>>> Cygwin generally handles filenames with colons just fine, by mapping the
>>>> character to some higher Unicode character and remapping on the fly.
>>>> However Cygwin's `unzip` appears to have a bug: when unzipping an
>>>> archive that contains a filename with a colon, it replaces the colon
>>>> with an underscore.
>>>>
>>>> cygcheck.out and simple test script attached; expected behaviour from
>>>> running `bash unzip-bug.sh` is that you get an empty file called `a:b`,
>>>> but on Cygwin you instead get an empty file called `a_b`.
>>> It's an explicit #ifdef __CYGWIN__ in upstream unzip, file unix/unix.c,
>>> which transforms a bunch of characters.
>>> If I uncomment most of them (except \), all unpack fine:
>>> x0:z  x1<z  x2>z  x3|z  x4"z  x5?z  x6*z
>> > I have taken over the maintenance of unzip package, and
>> fix the problem in the updated unzip-6.0-18.
>> https://cygwin.com/pipermail/cygwin/2022-June/251653.html

> Is colon used for ADS under Windows?  Could that be why one should
> be careful with it?

Colon is used (aside from being disk-path separator) as file stream indicator.
Replacing it is not strictly correct, in global sense of things, but unpacking
archives is not the place where you'd want to see data stored in multiple
streams.


-- 
With best regards,
Andrey Repin
Saturday, June 18, 2022 23:21:27

Sorry for my terrible english...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: unzip failure to recognize '--'
       [not found]     ` <CAKwdsS-ZDR_ZFAkVwPci4mdcYcjONN_yoSb5sLxK678RRgfVmA@mail.gmail.com>
@ 2022-06-18 23:40       ` Takashi Yano
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Yano @ 2022-06-18 23:40 UTC (permalink / raw)
  To: cygwin

On Sat, 18 Jun 2022 15:08:35 -0700
Backwoods BC wrote:
> I'm tacking 'unzip' this issue on here since it seems appropriate:
> Unzip does not recognize the standard '--' flag to tell it to stop
> looking for flags.
> 
> I was processing some files that started with '--' and I ended up
> having to use 'cygpath' to expand them to absolute paths so that unzip
> wouldn't complain.

As you already recognized, Info-zip utility does not support '--'
flag. This is not a bug but by design. It can easily treats the
file name beginning with '-' as follows.

touch -- -d -x
zip ./--abc.zip ./-d ./-x
rm -- -d -x
unzip ./--abc.zip '\-d'


-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-06-18 23:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15 18:30 unzip failure with files that contain colons Adam Dinwoodie
2022-06-16  4:22 ` Thomas Wolff
2022-06-16 15:29   ` Takashi Yano
2022-06-16 15:50     ` Eliot Moss
2022-06-16 16:44       ` Takashi Yano
2022-06-18 20:23       ` Andrey Repin
2022-06-17  7:20     ` Adam Dinwoodie
     [not found]     ` <CAKwdsS-ZDR_ZFAkVwPci4mdcYcjONN_yoSb5sLxK678RRgfVmA@mail.gmail.com>
2022-06-18 23:40       ` unzip failure to recognize '--' Takashi Yano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).