Hi When testing running kwin_wayland after running setcap cap_sys_nice=eip /opt/bin/kwin_wayland on my self-built kwin, it seems that $LD_LIBRARY_PATH is lost. This seems to be similar to what happens running a setuid binary It seems that the rpath might have to be set on the binaries themselves, so they can find the libraries ...unfortunately I also think that $PATH is lost Thanks
This is expected. All LD_* variables are ignored when an executable with capabilities is launched.
Could the RPATH attribute be set on the kwin_* binaries so they can run without the LD_LIBRARY_PATH having to be set?
I have KWin compiled into a non standard path. Everything works fine. So it is possible.
I'll have to look at my configuration maybe... My Kwin cmake line is cmake -Wno-dev .. -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -DCMAKE_PREFIX_PATH=$INSTALLDIR -DCMAKE_BUILD_TYPE=Release ...and the libraries are installed in /opt/lib/(i386-linux-gnu|x86_64-linux-gnu) I do specify some things to be installed there, mostly Frameworks, but I'm not sure how that was automatically inherited... I also don't have anything /opt in /etc/environment or my ld.conf
I guess it's some RPATH setting. I know that I haven't used LD_LIBRARY_PATH for years and rpath was just being used by default.
Maybe I need a cmake argument, objdump and readelf seen to imply there's not RPATH set
OK... I made some tweaks, and set kwin's RPATH... ...it looks like RPATHs are not handled recursively though, so for every kf5 library, I might need to add -DCMAKE_INSTALL_RPATH=/opt/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
I have tried again, to no avail... I wonder if I am doing something wrong. I have no Qt5 under /usr, only the one and Frameworks I built in /opt This is what I tried to change for Kwin's cmake options (where $INSTALLDIR=/opt) cmake -Wno-dev .. -DCMAKE_INSTALL_PREFIX=$INSTALLDIR -DCMAKE_PREFIX_PATH=$INSTALLDIR -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_RPATH=$INSTALLDIR/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) -DCMAKE_SKIP_BUILD_RPATH=FALSE -DLIB_INSTALL_DIR=$INSTALLDIR/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)