[Vm-dev] Unix VM alias resolving bug

Henrik Johansen henrik.s.johansen at veloxit.no
Thu Jun 24 18:04:11 UTC 2010


On Jun 24, 2010, at 7:49 46PM, Eliot Miranda wrote:

> 
> 
> On Thu, Jun 24, 2010 at 10:33 AM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> 
> 
> On 24.06.2010, at 19:30, Henrik Johansen wrote:
> 
> >
> > There's a bug in the alias resolution sqGetFilenameFromString in sqUnixMain.c
> >
> > In the line
> > filenameLength = readLink(aCharBuffer, aCharBuffer, MAXPATHLEN)
> > It replaces the old link path with the resolved link path, however links may be relative, eg. /bin/sh linking to bash rather than /bin/bash.
> >
> > Thus, file opening, and other operations using this function will fail if encountering a relative link.
> >
> > F.ex. print (on Ubuntu, where sh -> dash):
> >
> > |openedRelative|
> > openedRelative := nil.
> > [FileStream readOnlyFileNamed: '/bin/sh' do: [:fs | openedRelative := true]] on: FileDoesNotExistException do: [openedRelative := false].
> > openedRelative
> >
> > and you get false.
> >
> > Cheers,
> > Henry
> 
> Yeah I've been bitten by that too. Do you have a patch? Actually, Ian prefers to be sent a fully patched file ...
> 
> You'll find its fixed in the Cog sources.  Alas there are other changes there-in, but at least that function is not affected by other changes.
>  
> 
> - Bert -
> 
> 
> 
Thanks!

Attached is the sqUnixMain.c from 2202 release, with the function modified as has been done in Cog.
I built using it, and verified the expression in previous mail now returns true.

Cheers,
Henry

-------------- next part --------------
Skipped content of type multipart/mixed


More information about the Vm-dev mailing list