kernel-shark: Add quotes around $XDG_SESSION_TYPE in kshark-su-record
PATCH 1/1 kernel-shark: Add quotes around $XDG_SESSION_TYPE in kshark-su-record
From: "Steven Rostedt (VMware)" <[email protected]>
If XDG_SESSION_TYPE is not set, then $XDG_SESSION_TYPE will become nothing, which means the test:
if [ $XDG_SESSION_TYPE = "wayland" ];
turns into
if [ = "wayland" ];
And will cause a shell error. Adding quotes around "$XDG_SESSION_TYPE" changes an empty $XDG_SESSION_TYPE into:
if [ "" = "wayland" ];
which the shell can understand.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204261
--- kernel-shark/bin/kshark-su-record | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel-shark/bin/kshark-su-record +1 -1
@@ -1,6 +1,6 @@ #!/bin/bash -if [ $XDG_SESSION_TYPE = "wayland" ] +if [ "$XDG_SESSION_TYPE" = "wayland" ] then xhost +si:localuser:root &>/dev/null fi
Signature · 1 line
2.20.1
Quoted 31 lines · Steven Rostedt
From: "Steven Rostedt (VMware)" <[email protected]>
If
XDG_SESSION_TYPEis not set, then $XDG_SESSION_TYPE will become nothing, which means the test:if [ $XDG_SESSION_TYPE = "wayland" ];turns into
if [ = "wayland" ];And will cause a shell error. Adding quotes around "$XDG_SESSION_TYPE" changes an empty $XDG_SESSION_TYPE into:
if [ "" = "wayland" ];which the shell can understand.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204261
Signed-off-by Steven Rostedt (VMware) <[email protected]>--- kernel-shark/bin/kshark-su-record | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel-shark/bin/kshark-su-record +0
-0
kernel-shark/bin/kshark-su-record line 6
Quoted 7 lines
kernel-shark/bin/kshark-su-record +1
-1@@ -1,6 +1,6 @@ #!/bin/bash -if [ $XDG_SESSION_TYPE = "wayland" ] +if [ "$XDG_SESSION_TYPE" = "wayland" ] then xhost +si:localuser:root &>/dev/null fi
Thanks!