That's interesting.  For self updating applications, well first of all
applications should not have access to modify there own source.  Leaving
that aside as it's obviously working for you and your users are
presumably aware of the security risks.

Then I have to point out that the code you linked to is correct, though
I may add a replacement for 3 and that's to try and use /proc/self/exe.
It should be rare for the other two attempts not to function.

I'm sad to hear that this bug that got into the kernel is effecting your
project also.  As a work around, you can try adding the path to the
mount point.  I'll just write some pseudo code in shell.

lnk=$(readlink /proc/$(pgrep firefox)/exe); for ech in $(cut -f2 -d\  
/proc/mounts); do [ -f "$ech$lnk" ] && echo "$ech$lnk"; done
/.usr-ro/lib/firefox/firefox
/.usr-rw/lib/firefox/firefox
/usr/lib/firefox/firefox

I guess it's not the most sane solution, you could spice it up a bit.
lnk=$(readlink /proc/$(pgrep firefox)/exe); for ech in $(cut -f2 -d\  
/proc/mounts | grep -e ^/var -e ^/usr -e ^/lib -e ^/home); do [ -f "$ech$lnk" ] 
&& echo "$ech$lnk"; done
/usr/lib/firefox/firefox

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1007089

Title:
  overlayfs alters /proc/self/exe link(s), making result a dead link.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1007089/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to