bug-hurd
[Top][All Lists]
Advanced

[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: Thu, 14 Sep 2017 14:10:05 +0200

On Mon, 2017-09-11 at 10:52 +0200, Svante Signell wrote:
> On Sat, 2017-09-09 at 22:04 +0200, Samuel Thibault wrote:
> > Svante Signell, on sam. 09 sept. 2017 10:51:36 +0200, wrote:
> > > 
> > Which programs do you run?
> > 
> > execv/spawn are called from the parent, so the program that needs
> > LD_LIBRARY_PATH is the parent of the program to be observed in
> > /proc/pid/exe

With the updated patch things works fine:

sh -c "./test_readlink /proc/self/exe"
bufsize = 40
'/proc/self/exe' points to '/home/srs/DEBs/test_cases/test_readlink'

sh -c "test_readlink /proc/self/exe"
sh: 1: test_readlink: not found

export PATH=$PATH:$PWD
sh -c "test_readlink /proc/self/exe"
bufsize = 40
'/proc/self/exe' points to '/home/srs/DEBs/test_cases/test_readlink'

Found a test case also for spawni.c, test_posix_spawn.c is attached.

./test_posix_spawn ./test_readlink /proc/self/exe
PID of child: 18389
bufsize = 40
'/proc/self/exe' points to '/home/srs/DEBs/test_cases/test_readlink'
Child status: exited, status=0

./test_posix_spawn test_readlink /proc/self/exe
posix_spawn: No such file or directory

export PATH=$PATH:$PWD
PID of child: 16152
bufsize = 40
'/proc/self/exe' points to '/home/srs/DEBs/test_cases/test_readlink'
Child status: exited, status=0

Attached is a new diff of submitted-exec_filename.diff: submitted-
exec_filename.diff.diff. Since that diff seems to be wrong here:

---- a/sysdeps/mach/hurd/fexecve.c
-+++ b/sysdeps/mach/hurd/fexecve.c
+ 
++  free (filename);
+   return __hurd_fail (err);
+ }
+ 
+Index: glibc-2.24-17.2/sysdeps/mach/hurd/fexecve.c
+===================================================================
+--- glibc-2.24-17.2.orig/sysdeps/mach/hurd/fexecve.c
++++ glibc-2.24-17.2/sysdeps/mach/hurd/fexecve.c

I attach the full diff file too.

Attachment: submitted-exec_filename.diff.diff
Description: Text Data

Attachment: submitted-exec_filename.diff
Description: Text Data

Attachment: test_posix_spawn.c
Description: Text Data


reply via email to

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