linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel-shark: Add quotes around $XDG_SESSION_TYPE in kshark-su-record
@ 2019-07-22 15:37 Steven Rostedt
  2019-07-23  8:02 ` Yordan Karadzhov (VMware)
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2019-07-22 15:37 UTC (permalink / raw)
  To: Linux Trace Devel; +Cc: howaboutsynergy


From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

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
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel-shark/bin/kshark-su-record | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel-shark/bin/kshark-su-record b/kernel-shark/bin/kshark-su-record
index ee839a26..2477045f 100755
--- a/kernel-shark/bin/kshark-su-record
+++ b/kernel-shark/bin/kshark-su-record
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-if [ $XDG_SESSION_TYPE = "wayland" ]
+if [ "$XDG_SESSION_TYPE" = "wayland" ]
 then
     xhost +si:localuser:root &>/dev/null
 fi
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-23  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 15:37 [PATCH] kernel-shark: Add quotes around $XDG_SESSION_TYPE in kshark-su-record Steven Rostedt
2019-07-23  8:02 ` Yordan Karadzhov (VMware)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).