|
From: Robert W. <rj...@du...> - 2004-11-18 21:32:49
|
Hi all,
I was speaking to Jeremy about the issue we see with programs that do a
readlink on /proc/self/exe. Instead of trying to come up with a
complete solution that solves this for every possible scenario, I'd like
to check in an intermediate fix that simply handles the single scenario
where your code does this:
readlink("/proc/self/exe", &buf, size);
This will catch 99% of the cases and work now... If we can come up with
a better solution later, we can change it then.
Is everyone OK with this? Personally, I need this at work for some code
that does this in multiple places, so I'm biased... ;-)
Regards,
Robert.
|
|
From: Tom H. <th...@cy...> - 2004-11-18 22:12:10
|
In message <110...@he...>
Robert Walsh <rj...@du...> wrote:
> I was speaking to Jeremy about the issue we see with programs that do a
> readlink on /proc/self/exe. Instead of trying to come up with a
> complete solution that solves this for every possible scenario, I'd like
> to check in an intermediate fix that simply handles the single scenario
> where your code does this:
>
> readlink("/proc/self/exe", &buf, size);
>
> This will catch 99% of the cases and work now... If we can come up with
> a better solution later, we can change it then.
I already wrote a patch to do that - it's on the bug tracker
somewhere. It turned out that it didn't help with the bug though
as I recall as the program was using open or something.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Robert W. <rj...@du...> - 2004-11-18 22:28:05
|
> > I was speaking to Jeremy about the issue we see with programs that do a
> > readlink on /proc/self/exe. Instead of trying to come up with a
> > complete solution that solves this for every possible scenario, I'd like
> > to check in an intermediate fix that simply handles the single scenario
> > where your code does this:
> >
> > readlink("/proc/self/exe", &buf, size);
> >
> > This will catch 99% of the cases and work now... If we can come up with
> > a better solution later, we can change it then.
>
> I already wrote a patch to do that - it's on the bug tracker
> somewhere. It turned out that it didn't help with the bug though
> as I recall as the program was using open or something.
Oh good - less work to do ;-) I've twiddled your patch so that it works
correctly with the new syscall work Nick has been doing. It works, in
that readlink now does the correct thing for this case. Should I go
ahead and check it in? Even though it isn't complete, as you pointed
out, it's still very useful.
Regards,
Robert.
|