kernel-shark: Let polkit decide the environment and path of kshark-record
cover kernel-shark: Let polkit decide the environment and path of kshark-record
As the policy defined in the polkit actions for KernelShark Record define both the environment ($DISPLAY and $XAUTHORITY) as well as the path to the executible, no need to add hacks to the kshark-su-record that is used. Just revert the code that did so.
Steven Rostedt (VMware) (2):
kernel-shark: Revert adding environment variables to kshark-su-record
kernel-shark: Revert adding relative path to policy installation
----
kernel-shark/bin/kshark-su-record | 3 +-- kernel-shark/src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
PATCH 1/2 kernel-shark: Revert adding environment variables to kshark-su-record
From: "Steven Rostedt (VMware)" <[email protected]>
This reverts:
8eb0d753e ("kernel-shark: Execute kshark-record from same dir as kshark-su-record") b084eb5aa ("kernel-shark: Set the DISPLAY environment for pkexec kshark-record")
As the policykit (when installed correctly), should handle both the path to the executable, as well as the DISPLAY and XAUTHORITY environment variables.
--- kernel-shark/bin/kshark-su-record | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel-shark/bin/kshark-su-record +1 -2
@@ -2,5 +2,4 @@ xhost +si:localuser:root &>/dev/null -THIS_DIR=`dirname $0` -pkexec env DISPLAY=${DISPLAY} ${THIS_DIR}/kshark-record -o ${PWD}/trace.dat +pkexec kshark-record -o ${PWD}/trace.dat
Signature · 1 line
2.20.1
Re: [PATCH 1/2] kernel-shark: Revert adding environment variables to kshark-su-record
Quoted 11 lines · Steven Rostedt
From: "Steven Rostedt (VMware)" <[email protected]>
This reverts:
8eb0d753e("kernel-shark: Execute kshark-record from same dir as kshark-su-record")b084eb5aa("kernel-shark: Set the DISPLAY environment for pkexec kshark-record")As the policykit (when installed correctly), should handle both the path to the executable, as well as the DISPLAY and XAUTHORITY environment variables.
Signed-off-by Steven Rostedt (VMware) <[email protected]>
Quoted 16 lines
--- kernel-shark/bin/kshark-su-record | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)kernel-shark/bin/kshark-su-record +1
-2@@ -2,5 +2,4 @@ xhost +si:localuser:root &>/dev/null -THIS_DIR=`dirname $0` -pkexec env DISPLAY=${DISPLAY} ${THIS_DIR}/kshark-record -o ${PWD}/trace.dat +pkexec kshark-record -o ${PWD}/trace.dat
PATCH 2/2 kernel-shark: Revert adding relative path to policy installation
In reply to Steven RostedtFrom: "Steven Rostedt (VMware)" <[email protected]>
This reverts the change in a45ab5a44 ("kernel-shark: Remove hard-coded install paths") that removed the full path of installing org.freedesktop.kshark-record.policy to a relative path. This means if we installed in /usr/local/bin the policy still needs to go into /usr/share/polkit-1/actions/
This does not affect DESTDIR, as installing still goes in the relative path from DESTDIR for package maintainers.
--- kernel-shark/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel-shark/src/CMakeLists.txt +1 -1
@@ -93,7 +93,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND) DESTINATION ${_INSTALL_PREFIX}/share/icons/${KS_APP_NAME}) install(FILES "${KS_DIR}/org.freedesktop.kshark-record.policy" - DESTINATION ${_INSTALL_PREFIX}/share/polkit-1/actions/) + DESTINATION /usr/share/polkit-1/actions/) install(PROGRAMS "${KS_DIR}/bin/kshark-su-record" DESTINATION ${_INSTALL_PREFIX}/bin/)
Signature · 1 line
2.20.1
Re: [PATCH 2/2] kernel-shark: Revert adding relative path to policy installation
Quoted 8 lines · Steven Rostedt
From: "Steven Rostedt (VMware)" <[email protected]>
This reverts the change in
a45ab5a44("kernel-shark: Remove hard-coded install paths") that removed the full path of installing org.freedesktop.kshark-record.policy to a relative path. This means if we installed in/usr/local/binthe policy still needs to go into/usr/share/polkit-1/actions/
Quoted 5 lines
This does not affect DESTDIR, as installing still goes in the relative path from DESTDIR for package maintainers.
Suggested-by Yordan Karadzhov (VMware) <[email protected]>Signed-off-by Steven Rostedt (VMware) <[email protected]>
Thanks!
Quoted 18 lines
--- kernel-shark/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel-shark/src/CMakeLists.txt +1
-1@@ -93,7 +93,7 @@ if (Qt5Widgets_FOUND AND Qt5Network_FOUND) DESTINATION ${_INSTALL_PREFIX}/share/icons/${KS_APP_NAME}) install(FILES "${KS_DIR}/org.freedesktop.kshark-record.policy" - DESTINATION ${_INSTALL_PREFIX}/share/polkit-1/actions/) + DESTINATION /usr/share/polkit-1/actions/) install(PROGRAMS "${KS_DIR}/bin/kshark-su-record" DESTINATION ${_INSTALL_PREFIX}/bin/)