linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH 1/2] kernel-shark: Execute kshark-record from same dir as kshark-su-record
Date: Thu, 25 Jul 2019 16:59:14 +0300	[thread overview]
Message-ID: <1b5e7a79-fdaf-94f9-1727-5688c189d738@gmail.com> (raw)
In-Reply-To: <20190725084514.410f1cb1@gandalf.local.home>



On 25.07.19 г. 15:45 ч., Steven Rostedt wrote:
> On Thu, 25 Jul 2019 12:01:34 +0300
> "Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:
> 
> 
>> I just realized that there is one problem with the patch. With this
>> modification, you can use only the installed version of the script (so
>> you more or less depend on PATH).
>>
>> This will work:
>>    kshark-su-record
>>
>> This will work as well:
>>    /usr/local/bin/kshark-su-record
>>
>> However this will not work:
>>    kernel-shark/bin/kshark-su-record
>>
>> because you are trying to start with pkexec an executable from your $HOME
> 
> What about this patch?
> 
> -- Steve
> 
> diff --git a/kernel-shark/bin/kshark-su-record b/kernel-shark/bin/kshark-su-record
> index 8c9fbd02a351..152d0cdff3e7 100755
> --- a/kernel-shark/bin/kshark-su-record
> +++ b/kernel-shark/bin/kshark-su-record
> @@ -6,4 +6,8 @@ then
>   fi
>   
>   THIS_DIR=`dirname $0`
> +if [ "${THIS_DIR#/}" == "${THIS_DIR}" ]
> +then
> +    THIS_DIR=`pwd`"/$THIS_DIR"
> +fi
>   pkexec env DISPLAY=${DISPLAY} ${THIS_DIR}/kshark-record -o ${PWD}/trace.dat
> 

I see that this works, however now I am really confused why it works.

I thought that pkexec will start an executable only from the path 
provided in

kernel-shark/org.freedesktop.kshark-record.policy

Thanks!
Yordan


  reply	other threads:[~2019-07-25 13:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 22:50 [PATCH 0/2] kernel-shark: Be more careful with kshark-su-record Steven Rostedt
2019-07-23 22:50 ` [PATCH 1/2] kernel-shark: Execute kshark-record from same dir as kshark-su-record Steven Rostedt
2019-07-25  9:01   ` Yordan Karadzhov (VMware)
2019-07-25 12:45     ` Steven Rostedt
2019-07-25 13:59       ` Yordan Karadzhov (VMware) [this message]
2019-07-25 14:00       ` Yordan Karadzhov (VMware)
2019-07-23 22:50 ` [PATCH 2/2] kernel-shark: Set the DISPLAY environment for pkexec kshark-record Steven Rostedt
2019-07-24 10:42   ` Yordan Karadzhov (VMware)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b5e7a79-fdaf-94f9-1727-5688c189d738@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).