Re: [PATCH] kernel-shark: Add quotes around $XDG_SESSION_TYPE in kshark-su-record

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 22.07.19 г. 18:37 ч., Steven Rostedt wrote:

From: "Steven Rostedt (VMware)" <rostedt@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
  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


Thanks!

Reviewed-by: Yordan Karadzhov (VMware) <y.karadz@xxxxxxxxx>



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux