public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Oddity with cygport, debuginfo generation, and rxvt-unicode
@ 2012-08-21 18:02 Charles Wilson
  2012-08-22  0:13 ` Yaakov (Cygwin/X)
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Wilson @ 2012-08-21 18:02 UTC (permalink / raw)
  To: cygwin

While rebuilding rxvt-unicode, I saw the following error during 'cygport
install':

Preparing debuginfo source files:
realpath: unknown option -- p
Try `realpath --help' for more information.
	80 files
Preparing executables for UAC:


A little debugging showed that realpath is being invoked during
src_postinstall here:

line 978:do
                 # make sure that paths with '../' don't leave srcdir
                 case $(realpath -m ${dbgsrc}) in
                         ${dbgsrcdir}/*) ;;
                         *)  continue ;;
                 esac

                 srcf=${dbgsrc#${dbgsrcdir}/}

I see that this line is hit many times, but here is the relevant sequence:

...
realpath -m <iom_perl.xs
realpath -m -pe
realpath: unknown option -- p
Try `realpath --help' for more information.
realpath -m s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g
realpath -m |
realpath -m /usr/src/debug/rxvt-unicode-X-9.07-2/src/../libev/ev++.h
...

Although only the second of these lines triggers the error message, each
of the first four is problematic.

This looks like a bug in gcc/binutils to me; debug src paths shouldn't
include pipe line shell commands, should they?

In the meantime, I think a fix like this for cygport would be appropriate:

line 978:do
+          # avoid invoking realpath with redirection metacharacters
+          case "${dbgsrc}" in
+          *[\<\|\>]* ) continue;
+          esac

           # make sure that paths with '../' don't leave $dbgsrcdir
-          case $(realpath -m ${dbgsrc}) in
+          case $(realpath -m -- ${dbgsrc}) in
                   ${dbgsrcdir}/*) ;;
                   *)  continue ;;
           esac

           srcf=${dbgsrc#${dbgsrcdir}/}

...although I'm not sure if this might cause a problem if a filename
actually contains a shell redirection metacharacter (and the originating
project is always careful to appropriate quote that filename).

--
Chuck

--
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] 4+ messages in thread

* Re: Oddity with cygport, debuginfo generation, and rxvt-unicode
  2012-08-21 18:02 Oddity with cygport, debuginfo generation, and rxvt-unicode Charles Wilson
@ 2012-08-22  0:13 ` Yaakov (Cygwin/X)
  2012-08-22 11:15   ` Charles Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Yaakov (Cygwin/X) @ 2012-08-22  0:13 UTC (permalink / raw)
  To: cygwin

On 2012-08-21 12:20, Charles Wilson wrote:
> While rebuilding rxvt-unicode, I saw the following error during 'cygport
> install':
>
> Preparing debuginfo source files:
> realpath: unknown option -- p
> Try `realpath --help' for more information.
> 	80 files
> Preparing executables for UAC:
>
>
> A little debugging showed that realpath is being invoked during
> src_postinstall here:
>
> line 978:do
>                   # make sure that paths with '../' don't leave srcdir
>                   case $(realpath -m ${dbgsrc}) in
>                           ${dbgsrcdir}/*) ;;
>                           *)  continue ;;
>                   esac
>
>                   srcf=${dbgsrc#${dbgsrcdir}/}

FWIW, readlink is now used in git instead of realpath, as the latter is 
not available in Fedora 16 or EL6, but the result should be the same.

> I see that this line is hit many times, but here is the relevant sequence:
>
> ...
> realpath -m <iom_perl.xs
> realpath -m -pe
> realpath: unknown option -- p
> Try `realpath --help' for more information.
> realpath -m s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g
> realpath -m |
> realpath -m /usr/src/debug/rxvt-unicode-X-9.07-2/src/../libev/ev++.h
> ...
>
> Although only the second of these lines triggers the error message, each
> of the first four is problematic.
>
> This looks like a bug in gcc/binutils to me; debug src paths shouldn't
> include pipe line shell commands, should they?

Not AFAIK.  That is very odd, but I am able to duplicate it with your 
current package.

> In the meantime, I think a fix like this for cygport would be appropriate:

Could you confirm that just this change fixes this:

-          case $(realpath -m ${dbgsrc}) in
+          case $(readlink -m -- "${dbgsrc}") in

> ...although I'm not sure if this might cause a problem if a filename
> actually contains a shell redirection metacharacter (and the originating
> project is always careful to appropriate quote that filename).

And when was the last time you saw that?


Yaakov


--
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] 4+ messages in thread

* Re: Oddity with cygport, debuginfo generation, and rxvt-unicode
  2012-08-22  0:13 ` Yaakov (Cygwin/X)
@ 2012-08-22 11:15   ` Charles Wilson
  2012-08-22 19:10     ` Earnie Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Wilson @ 2012-08-22 11:15 UTC (permalink / raw)
  To: cygwin

On 8/21/2012 4:48 PM, Yaakov (Cygwin/X) wrote:
> On 2012-08-21 12:20, Charles Wilson wrote:
>> In the meantime, I think a fix like this for cygport would be
>> appropriate:
>
> Could you confirm that just this change fixes this:
>
> - case $(realpath -m ${dbgsrc}) in
> + case $(readlink -m -- "${dbgsrc}") in

Yes, that change, by itself, fixes the problem.

>> ...although I'm not sure if this might cause a problem if a filename
>> actually contains a shell redirection metacharacter (and the originating
>> project is always careful to appropriate quote that filename).
>
> And when was the last time you saw that?

Oh, let me think...never. I'm still (re)training people that spaces are 
evil.  Don't even get me started on hashes and shell metas in filenames...

--
Chuck

--
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] 4+ messages in thread

* Re: Oddity with cygport, debuginfo generation, and rxvt-unicode
  2012-08-22 11:15   ` Charles Wilson
@ 2012-08-22 19:10     ` Earnie Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Earnie Boyd @ 2012-08-22 19:10 UTC (permalink / raw)
  To: cygwin

On Tue, Aug 21, 2012 at 11:40 PM, Charles Wilson wrote:
> Oh, let me think...never. I'm still (re)training people that spaces are
> evil.  Don't even get me started on hashes and shell metas in filenames...

Oh, just rename them to be asc(0x010); that's always good for a laugh. ;)

-- 
Earnie
-- https://sites.google.com/site/earnieboyd

--
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] 4+ messages in thread

end of thread, other threads:[~2012-08-22 11:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21 18:02 Oddity with cygport, debuginfo generation, and rxvt-unicode Charles Wilson
2012-08-22  0:13 ` Yaakov (Cygwin/X)
2012-08-22 11:15   ` Charles Wilson
2012-08-22 19:10     ` Earnie Boyd

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