I have a custom application which comes with its own libstdc++.so.6 and it requires cap_net_admin and cap_net_raw to work properly.
Before I set file capabilities it starts without problems but when I set:
/sbin/setcap cap_net_admin,cap_net_raw+pie /path/to/customapp
it gives the following error:
./customapp: /usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by ./customapp)
When I do
readelf -d it shows that it is looking for libraries at the correct location:
0x0000000f (RPATH) Library rpath: [$ORIGIN/lib]
ldd ./customapp shows the same:
libstdc++.so.6 => /path/to/./lib/libstdc++.so.6 (0xb75ed000)
I followed the advice given here and added new shared library path to
echo "/path/to/lib" > /etc/ld.so.conf.d/customapp.conf && ldconfig
I tried this on Ubuntu 14.04 and it works well there so why doesn't it work on Debian?
OS: Debian GNU/Linux 7.6 (wheezy)
uname -a: Linux debsrv 3.2.0-4-686-pae #1 SMP Debian 3.2.60-1+deb7u3 i686 GNU/Linux