Linux-Trace-Devel Archive on lore.kernel.org
 help / color / 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	[flat|nested] 2+ messages in thread

* Re: [PATCH] kernel-shark: Add quotes around $XDG_SESSION_TYPE in kshark-su-record
  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)
  0 siblings, 0 replies; 2+ messages in thread
From: Yordan Karadzhov (VMware) @ 2019-07-23  8:02 UTC (permalink / raw)
  To: Steven Rostedt, Linux Trace Devel; +Cc: howaboutsynergy



On 22.07.19 г. 18:37 ч., Steven Rostedt wrote:
> 
> 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
> 

Thanks!

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

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

end of thread, back to index

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)

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org linux-trace-devel@archiver.kernel.org
	public-inbox-index linux-trace-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox