[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG: /proc/self/exe reports relative paths, should always return abs

From: Svante Signell
Subject: Re: BUG: /proc/self/exe reports relative paths, should always return absolute paths?
Date: Mon, 25 Sep 2017 17:51:52 +0200

On Sun, 2017-09-24 at 15:58 +0200, Svante Signell wrote:
> On Sun, 2017-09-24 at 15:22 +0200, Samuel Thibault wrote:
> > Hello,
> > 
> > Svante Signell, on dim. 24 sept. 2017 15:17:02 +0200, wrote:
> > > On Fri, 2017-09-22 at 20:27 +0200, Samuel Thibault wrote:
> > I however realize: we of course need the same for spawni() (using
> > getcwd
> > instead of realpath), since it'll have the same kinds of issues.
> I was afraid of that. Couldn't think of a suitable test case though. A
> new patch will be delivered soon.

New patch attached. I changed const char* filename to char *filename to avoid
the compiler warning with __file_exec_file_name(), where the fourth argument is
char *. However child_lookup() expects a const char *, but the compiler does not
complain here.

The following tests still reveal unwanted behaviour: (where to change ?) I have
not tested any new scripts.

export PATH=$PATH:.
test_readlink /proc/self/exe
'/proc/self/exe' points to '/home/srs/DEBs/test_cases/./test_readlink'

test_posix_spawn  ./test_readlink /proc/self/exe
'/proc/self/exe' points to '/home/srs/DEBs/test_cases/./test_readlink'

./test_posix_spawn  ./test_readlink /proc/self/exe
'/proc/self/exe' points to '/home/srs/DEBs/test_cases/./test_readlink'

./test_posix_spawn  test_readlink /proc/self/exe
'/proc/self/exe' points to './test_readlink'

test_posix_spawn  test_readlink /proc/self/exe
'/proc/self/exe' points to './test_readlink'

Attachment: submitted-exec_filename.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]