public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* cygpath 2.4.0 (32-bits) in error?
@ 2016-01-21 15:45 Houder
  2016-01-21 15:53 ` Achim Gratz
  0 siblings, 1 reply; 10+ messages in thread
From: Houder @ 2016-01-21 15:45 UTC (permalink / raw)
  To: cygwin

Hi Corinna,

The truth is out! :-)

@@ 'cygpath -S -u' (2.4.0, 32-bits) informs us that the system directory 
is:

     /drv/c/Windows/SysWOW64

However, it probably not what we want here.

(hint: do_sysfolders() in utils/cygpath.cc)

Regards,
Henri

-----
@@ uname -a
CYGWIN_NT-6.1-WOW Seven 2.3.1(0.291/5/3) 2015-11-14 12:42 i686 Cygwin

@@ /usr/bin/cygpath -S -u
/drv/c/Windows/System32
@@ /usr/bin/cygpath -S -w
C:\Windows\System32

-----
%% uname -a
CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin

%% /usr/bin/cygpath -S -u
/drv/c/Windows/SysWOW64 <==== Nice, the truth is out! ... but do we want 
it here?
%% /usr/bin/cygpath -S -w
C:\Windows\system32
%%
%% /usr/bin/cygpath -S -U
/proc/cygdrive/c/Windows/SysWOW64 <==== ditto

=====

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

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 15:45 cygpath 2.4.0 (32-bits) in error? Houder
@ 2016-01-21 15:53 ` Achim Gratz
  2016-01-21 16:01   ` Houder
  2016-01-21 17:40   ` Corinna Vinschen
  0 siblings, 2 replies; 10+ messages in thread
From: Achim Gratz @ 2016-01-21 15:53 UTC (permalink / raw)
  To: cygwin

Houder <houder <at> xs4all.nl> writes:
> %% uname -a
> CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin
> 
> %% /usr/bin/cygpath -S -u
> /drv/c/Windows/SysWOW64 <==== Nice, the truth is out! ... but do we want 
> it here?
> %% /usr/bin/cygpath -S -w
> C:\Windows\system32
> %%
> %% /usr/bin/cygpath -S -U
> /proc/cygdrive/c/Windows/SysWOW64 <==== ditto

Well

/usr/bin/cygpath -u $( /usr/bin/cygpath -Sw )

delivers the right result.  I guess an option to chose which result to get
might be nice, but I can cope either way.


Regards,
Achim.


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

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 15:53 ` Achim Gratz
@ 2016-01-21 16:01   ` Houder
  2016-01-21 17:40   ` Corinna Vinschen
  1 sibling, 0 replies; 10+ messages in thread
From: Houder @ 2016-01-21 16:01 UTC (permalink / raw)
  To: cygwin

On 2016-01-21 16:11, Achim Gratz wrote:
> Houder <houder <at> xs4all.nl> writes:
>> %% uname -a
>> CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin
>> 
>> %% /usr/bin/cygpath -S -u
>> /drv/c/Windows/SysWOW64 <==== Nice, the truth is out! ... but do we 
>> want
>> it here?
>> %% /usr/bin/cygpath -S -w
>> C:\Windows\system32
>> %%
>> %% /usr/bin/cygpath -S -U
>> /proc/cygdrive/c/Windows/SysWOW64 <==== ditto
> 
> Well
> 
> /usr/bin/cygpath -u $( /usr/bin/cygpath -Sw )
> 
> delivers the right result.  I guess an option to chose which result to 
> get
> might be nice, but I can cope either way.

... :-)

But I was only pointing out a difference between 2.3.1 and 2.4.0 ...

(and I even did not bring up SysNative this time ;-)

Regards,
Henri

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

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 15:53 ` Achim Gratz
  2016-01-21 16:01   ` Houder
@ 2016-01-21 17:40   ` Corinna Vinschen
  2016-01-21 19:52     ` Houder
  1 sibling, 1 reply; 10+ messages in thread
From: Corinna Vinschen @ 2016-01-21 17:40 UTC (permalink / raw)
  To: cygwin

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

On Jan 21 15:11, Achim Gratz wrote:
> Houder <houder <at> xs4all.nl> writes:
> > %% uname -a
> > CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin
> > 
> > %% /usr/bin/cygpath -S -u
> > /drv/c/Windows/SysWOW64 <==== Nice, the truth is out! ... but do we want 
> > it here?
> > %% /usr/bin/cygpath -S -w
> > C:\Windows\system32
> > %%
> > %% /usr/bin/cygpath -S -U
> > /proc/cygdrive/c/Windows/SysWOW64 <==== ditto
> 
> Well
> 
> /usr/bin/cygpath -u $( /usr/bin/cygpath -Sw )
> 
> delivers the right result.  I guess an option to chose which result to get
> might be nice, but I can cope either way.

I hate this path redirection stuff.  Patches welcome.  Maybe we should
simply replace SysWOW64 with System32, a simple string operation.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 17:40   ` Corinna Vinschen
@ 2016-01-21 19:52     ` Houder
  2016-01-21 19:53       ` Corinna Vinschen
  0 siblings, 1 reply; 10+ messages in thread
From: Houder @ 2016-01-21 19:52 UTC (permalink / raw)
  To: cygwin

On 2016-01-21 16:42, Corinna Vinschen wrote:
> On Jan 21 15:11, Achim Gratz wrote:
>> Houder <houder <at> xs4all.nl> writes:
>> > %% uname -a
>> > CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin
>> >
>> > %% /usr/bin/cygpath -S -u
>> > /drv/c/Windows/SysWOW64 <==== Nice, the truth is out! ... but do we want
>> > it here?
>> > %% /usr/bin/cygpath -S -w
>> > C:\Windows\system32
>> > %%
>> > %% /usr/bin/cygpath -S -U
>> > /proc/cygdrive/c/Windows/SysWOW64 <==== ditto
>> 
>> Well
>> 
>> /usr/bin/cygpath -u $( /usr/bin/cygpath -Sw )
>> 
>> delivers the right result.  I guess an option to chose which result to 
>> get
>> might be nice, but I can cope either way.
> 
> I hate this path redirection stuff.  Patches welcome.  Maybe we should
> simply replace SysWOW64 with System32, a simple string operation.

Hi Corinna,

Did not mean to get you angry ...

do_sysfolders() in cygpath.cc has changed between 2.3.1 and 2.4.0 where
it attempts to ascertain the 'system directory'.

The postprocessing after GetSystemDirectoryW() is different ...

The call to NtQueryInformationFile() in 2.4.0 spoils the result that has
been obtained by GetSystemDirectoryW() call.

Reverting your modification makes cygpath correct again (tested: 
32-bits).

It is clear from the commentary what you are attempting to achieve after
the call to GetSystemDirectoryW() ...

However, the code after the call to GetSystemDirectoryW() is a mystery 
to
me. Sorry.

Regards,
Henri

do_sysfolders() in cygpath.cc

-----
2.3.1
     case 'S':
       {
	HANDLE fh;
	WIN32_FIND_DATAW w32_fd;

	GetSystemDirectoryW (wbuf, MAX_PATH);
	/* The path returned by GetSystemDirectoryW is not case preserving.
	   The below code is a trick to get the correct case of the system
	   directory from Windows. */
	if ((fh = FindFirstFileW (wbuf, &w32_fd)) != INVALID_HANDLE_VALUE)
	  {
	    FindClose (fh);
	    wcscpy (wcsrchr (wbuf, L'\\') + 1, w32_fd.cFileName);
	  }
       }
       break;

-----
2.4.0:
     case 'S':
       {
	GetSystemDirectoryW (wbuf, MAX_PATH);
...
       if (iswalpha (wbuf[0]) && wbuf[1] == L':' && wbuf[2] == L'\\')
	{
	  OBJECT_ATTRIBUTES attr;
	  NTSTATUS status;
	  HANDLE h;
	  IO_STATUS_BLOCK io;
	  UNICODE_STRING upath;
	  const ULONG size = sizeof (FILE_NAME_INFORMATION)
			     + PATH_MAX * sizeof (WCHAR);
	  PFILE_NAME_INFORMATION pfni = (PFILE_NAME_INFORMATION) alloca (size);

	  /* Avoid another buffer, reuse pfni. */
	  wcpcpy (wcpcpy (pfni->FileName, L"\\??\\"), wbuf);
wprintf (L" 1: pfni->FileName: %S\n", pfni->FileName); // still correct
	  RtlInitUnicodeString (&upath, pfni->FileName);
wprintf (L" 2: pfni->FileName: %S\n", pfni->FileName); // still correct
	  InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE,
				      NULL, NULL);
	  status = NtOpenFile (&h, READ_CONTROL, &attr, &io,
			       FILE_SHARE_VALID_FLAGS, FILE_OPEN_REPARSE_POINT);
	  if (NT_SUCCESS (status))
	    {
	      status = NtQueryInformationFile (h, &io, pfni, size,
					       FileNameInformation); // returns the wrong path
wprintf (L" 3: pfni->FileName: %S\n", pfni->FileName); // WRONG
	      if (NT_SUCCESS (status))
		{
		  pfni->FileName[pfni->FileNameLength / sizeof (WCHAR)] = L'\0';
wprintf (L" 4: pfni->FileName: %S\n", pfni->FileName);
		  wcscpy (wbuf + 2, pfni->FileName);
wprintf (L"wcscpy(): %S\n", wbuf);
		}
	      NtClose (h);
	    }
	}

=====



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

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 19:52     ` Houder
@ 2016-01-21 19:53       ` Corinna Vinschen
  2016-01-21 19:56         ` Houder
  2016-01-21 20:10         ` Achim Gratz
  0 siblings, 2 replies; 10+ messages in thread
From: Corinna Vinschen @ 2016-01-21 19:53 UTC (permalink / raw)
  To: cygwin

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

On Jan 21 19:34, Houder wrote:
> On 2016-01-21 16:42, Corinna Vinschen wrote:
> >On Jan 21 15:11, Achim Gratz wrote:
> >>Houder <houder <at> xs4all.nl> writes:
> >>> %% uname -a
> >>> CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin
> >>>
> >>> %% /usr/bin/cygpath -S -u
> >>> /drv/c/Windows/SysWOW64 <==== Nice, the truth is out! ... but do we want
> >>> it here?
> >>> %% /usr/bin/cygpath -S -w
> >>> C:\Windows\system32
> >>> %%
> >>> %% /usr/bin/cygpath -S -U
> >>> /proc/cygdrive/c/Windows/SysWOW64 <==== ditto
> >>
> >>Well
> >>
> >>/usr/bin/cygpath -u $( /usr/bin/cygpath -Sw )
> >>
> >>delivers the right result.  I guess an option to chose which result to
> >>get
> >>might be nice, but I can cope either way.
> >
> >I hate this path redirection stuff.  Patches welcome.  Maybe we should
> >simply replace SysWOW64 with System32, a simple string operation.
> 
> Hi Corinna,
> 
> Did not mean to get you angry ...

It's not you getting me angry here ;)

> do_sysfolders() in cygpath.cc has changed between 2.3.1 and 2.4.0 where
> it attempts to ascertain the 'system directory'.
> 
> The postprocessing after GetSystemDirectoryW() is different ...

Yes, that was necessary to return case-correct paths.  I commited a
patch and hour and a half ago and uploaded a new snapshot to
https://cygwin.com/snapshots/  Please give it a try.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 19:53       ` Corinna Vinschen
@ 2016-01-21 19:56         ` Houder
  2016-01-22  5:03           ` Houder
  2016-01-22 21:19           ` Corinna Vinschen
  2016-01-21 20:10         ` Achim Gratz
  1 sibling, 2 replies; 10+ messages in thread
From: Houder @ 2016-01-21 19:56 UTC (permalink / raw)
  To: cygwin

On 2016-01-21 20:09, Corinna Vinschen wrote:
>> Hi Corinna,
>> 
>> Did not mean to get you angry ...
> 
> It's not you getting me angry here ;)

It is not? :-)))

>> do_sysfolders() in cygpath.cc has changed between 2.3.1 and 2.4.0 
>> where
>> it attempts to ascertain the 'system directory'.
>> 
>> The postprocessing after GetSystemDirectoryW() is different ...
> 
> Yes, that was necessary to return case-correct paths.  I commited a
> patch and hour and a half ago and uploaded a new snapshot to
> https://cygwin.com/snapshots/  Please give it a try.

-----
%% uname -a
CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin

%% cygpath -S
/drv/c/Windows/SysWOW64
%%
%% ./cygpath-2.4.0-snapshot -S
/drv/c/Windows/System32 <==== ok
%% ./cygpath-2.4.0-snapshot -S -U
/proc/cygdrive/c/Windows/System32 <==== ok

-----
64-%% uname -a
CYGWIN_NT-6.1 Seven 2.4.0(0.293/5/3) 2016-01-15 16:16 x86_64 Cygwin

64-%% cygpath -S
/drv/c/Windows/System32
64-%%
64-%% ./cygpath-64-2.4.0-snapshot -S
/drv/c/Windows/System32
64-%% ./cygpath-64-2.4.0-snapshot -S -U
/proc/cygdrive/c/Windows/System32

Btw, files in both cygwin-inst-20160121.tar.xz appear to be "included"
multiple times (3 or more) -- just saying.

Regards,
Henri

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

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 19:53       ` Corinna Vinschen
  2016-01-21 19:56         ` Houder
@ 2016-01-21 20:10         ` Achim Gratz
  1 sibling, 0 replies; 10+ messages in thread
From: Achim Gratz @ 2016-01-21 20:10 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen writes:
> Yes, that was necessary to return case-correct paths.  I commited a
> patch and hour and a half ago and uploaded a new snapshot to
> https://cygwin.com/snapshots/  Please give it a try.

For base-files I still plan to do

 cygpath -U $( cygpath -Sw )

dance so it will work with older Cygwin releases unless you think it's a
bad idea.


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

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

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

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 19:56         ` Houder
@ 2016-01-22  5:03           ` Houder
  2016-01-22 21:19           ` Corinna Vinschen
  1 sibling, 0 replies; 10+ messages in thread
From: Houder @ 2016-01-22  5:03 UTC (permalink / raw)
  To: cygwin

On 2016-01-21 20:44, Houder wrote:

> Btw, files in both cygwin-inst-20160121.tar.xz appear to be "included"
> multiple times (3 or more) -- just saying.

Please, ignore the above (my 7-zip exe must be in error).

Regards,
Henri

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

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

* Re: cygpath 2.4.0 (32-bits) in error?
  2016-01-21 19:56         ` Houder
  2016-01-22  5:03           ` Houder
@ 2016-01-22 21:19           ` Corinna Vinschen
  1 sibling, 0 replies; 10+ messages in thread
From: Corinna Vinschen @ 2016-01-22 21:19 UTC (permalink / raw)
  To: cygwin

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

On Jan 21 20:44, Houder wrote:
> On 2016-01-21 20:09, Corinna Vinschen wrote:
> >>Hi Corinna,
> >>
> >>Did not mean to get you angry ...
> >
> >It's not you getting me angry here ;)
> 
> It is not? :-)))
> 
> >>do_sysfolders() in cygpath.cc has changed between 2.3.1 and 2.4.0 where
> >>it attempts to ascertain the 'system directory'.
> >>
> >>The postprocessing after GetSystemDirectoryW() is different ...
> >
> >Yes, that was necessary to return case-correct paths.  I commited a
> >patch and hour and a half ago and uploaded a new snapshot to
> >https://cygwin.com/snapshots/  Please give it a try.
> 
> -----
> %% uname -a
> CYGWIN_NT-6.1-WOW Seven 2.4.0(0.293/5/3) 2016-01-15 16:14 i686 Cygwin
> 
> %% cygpath -S
> /drv/c/Windows/SysWOW64
> %%
> %% ./cygpath-2.4.0-snapshot -S
> /drv/c/Windows/System32 <==== ok
> %% ./cygpath-2.4.0-snapshot -S -U
> /proc/cygdrive/c/Windows/System32 <==== ok

Thanks for testing.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-01-22 20:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-21 15:45 cygpath 2.4.0 (32-bits) in error? Houder
2016-01-21 15:53 ` Achim Gratz
2016-01-21 16:01   ` Houder
2016-01-21 17:40   ` Corinna Vinschen
2016-01-21 19:52     ` Houder
2016-01-21 19:53       ` Corinna Vinschen
2016-01-21 19:56         ` Houder
2016-01-22  5:03           ` Houder
2016-01-22 21:19           ` Corinna Vinschen
2016-01-21 20:10         ` Achim Gratz

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