This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: [BUG ?] Failed to rebuild Cygwin
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 31 Jul 2013 12:27:37 +0200
- Subject: Re: [BUG ?] Failed to rebuild Cygwin
- References: <003401ce8dcb$a630b310$f2921930$%fedin at samsung dot com>
- Reply-to: cygwin at cygwin dot com
On Jul 31 12:55, Pavel Fedin wrote:
> Hello!
>
> I have occasionally found a little problem in path check code. Attempt to
> reference thing like '/..' fails, however at least under Linux this resolves
> to root, and you can actually attempt to go past-root as many times as you
> want, e. g. '/../../../..'. The bug was occasionally revealed by 'make' test
> suite.
> [...]
> P.S. I suggest that the way to fix the described path check bug is to undo
> your small optimization and move back setting check_parent flag to:
> --- cut ---
> /* Strip runs of /'s. */
> if (!isslash (*src))
> {
> *tail++ = *src++;
> check_parent = true;
> }
> --- cut ---
This works, but what bugs me a bit is setting a variable to true for
each non-slash character. That happens a lot of time.
> The idea behind this is that the check will take place only if we have
> actually got something to check (at least one non-slash character). In case
> of '/..' the first 'isslash(*src)' returns TRUE, consequently the loop will
> not run at all.
> An alternative is to add a check against 'dst' being empty around the
> actual check:
> --- cut ---
> path_conv head (dst);
> if (!head.isdir())
> return ENOENT;
> --- cut ---
I applied a patch which skips testing / or // when a /.. or //.. has
been encountered. Can you please give it a try?
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
--
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