Subject: bug#35662: Really relocatable binaries crash with Permission denied

From: "pelzflorian (Florian Pelz)" <[email-masked]>
Date: Fri, 10 May 2019 07:54:41 +0200

On Fri, May 10, 2019 at 12:01:36AM +0200, pelzflorian (Florian Pelz) wrote:
> sed -i 's|@STORE_DIRECTORY@|/gnu/store|g' run-in-namespace.c
> sed -i 's|@WRAPPED_PROGRAM@|/mybin/sh|g' run-in-namespace.c
> gcc -std=gnu99 -static -O0 -g -Wall run-in-namespace.c

I think it should have been

sed -i 's|@STORE_DIRECTORY@|/gnu/store|g' run-in-namespace.c
sed -i 's|@WRAPPED_PROGRAM@|/gnu/store/qn1ax1fkj16x280m1rv7mcimfmn9l2pf-bash-4.4.23/bin/sh|g' run-in-namespace.c
echo '#define PROOT_PROGRAM "iyd2ikxadcp89j5919pwja6swnx00493-proot-static-5.1.0/bin/proot"' > new
cat run-in-namespace.c >> new
mv new run-in-namespace.c
gcc -std=gnu99 -static -O0 -g -Wall run-in-namespace.c

but it does not make a difference to the gdb output except the line

> 278	      && lstat ("/mybin/sh", &statbuf) != 0)

Regards,
Florian