public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] buildrun: no sanitize $PATH for kbuild invocation
@ 2018-12-21  8:10 faicker.mo
  2018-12-26  9:53 ` wyang
  0 siblings, 1 reply; 3+ messages in thread
From: faicker.mo @ 2018-12-21  8:10 UTC (permalink / raw)
  To: systemtap; +Cc: faicker.mo

From: "faicker.mo" <faicker.mo@ucloud.cn>

For newer kernel, SCL with newer gcc and systemtap prepends
it's directory to the $PATH to take effect.  It doesn't work
if $PATH is sanitized (prefixed with /usr/bin:/bin:)

Fixes e8474d2a

Signed-off-by: faicker.mo <faicker.mo@ucloud.cn>
---
 buildrun.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buildrun.cxx b/buildrun.cxx
index cef14ad..dcdb6e8 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -99,7 +99,7 @@ make_any_make_cmd(systemtap_session& s, const string& dir, const string& target)
   const char *oldpath = getenv("PATH");
   if (oldpath != NULL)
     {
-      newpath += ':';
+      newpath = "PATH=";
       newpath += oldpath;
     }
 
-- 
1.8.3.1

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

* Re: [PATCH] buildrun: no sanitize $PATH for kbuild invocation
  2018-12-21  8:10 [PATCH] buildrun: no sanitize $PATH for kbuild invocation faicker.mo
@ 2018-12-26  9:53 ` wyang
  2018-12-28  7:10   ` Faicker Mo
  0 siblings, 1 reply; 3+ messages in thread
From: wyang @ 2018-12-26  9:53 UTC (permalink / raw)
  To: faicker.mo, systemtap

Please try to use -B, you can pass option to kbuild.

Wei


On 2018/12/21 下午4:08, faicker.mo wrote:
> From: "faicker.mo" <faicker.mo@ucloud.cn>
>
> For newer kernel, SCL with newer gcc and systemtap prepends
> it's directory to the $PATH to take effect.  It doesn't work
> if $PATH is sanitized (prefixed with /usr/bin:/bin:)
>
> Fixes e8474d2a
>
> Signed-off-by: faicker.mo <faicker.mo@ucloud.cn>
> ---
>   buildrun.cxx | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/buildrun.cxx b/buildrun.cxx
> index cef14ad..dcdb6e8 100644
> --- a/buildrun.cxx
> +++ b/buildrun.cxx
> @@ -99,7 +99,7 @@ make_any_make_cmd(systemtap_session& s, const string& dir, const string& target)
>     const char *oldpath = getenv("PATH");
>     if (oldpath != NULL)
>       {
> -      newpath += ':';
> +      newpath = "PATH=";
>         newpath += oldpath;
>       }
>   

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

* Re:Re: [PATCH] buildrun: no sanitize $PATH for kbuild invocation
  2018-12-26  9:53 ` wyang
@ 2018-12-28  7:10   ` Faicker Mo
  0 siblings, 0 replies; 3+ messages in thread
From: Faicker Mo @ 2018-12-28  7:10 UTC (permalink / raw)
  To: wyang; +Cc: systemtap

Wei, Thank you.The problem is solved.
If we want systemtap to run on the newer kernel with centos 6, following these steps,
yum install centos-release-scl scl-utils
yum install devtoolset-7-gcc devtoolset-7-make  devtoolset-7-systemtap
scl enable devtoolset-7 bash
stap -g -vv -B CC=/opt/rh/devtoolset-7/root/usr/bin/gcc a.stp


> -----原始邮件-----
> 发件人: wyang <w90p710@gmail.com>
> 发送时间: 2018年12月26日 星期三
> 收件人: "faicker.mo" <faicker.mo@ucloud.cn>, systemtap@sourceware.org
> 抄送: 
> 主题: Re: [PATCH] buildrun: no sanitize $PATH for kbuild invocation
> 
> Please try to use -B, you can pass option to kbuild.
> 
> Wei
> 
> 
> On 2018/12/21 下午4:08, faicker.mo wrote:
> > From: "faicker.mo" <faicker.mo@ucloud.cn>
> >
> > For newer kernel, SCL with newer gcc and systemtap prepends
> > it's directory to the $PATH to take effect.  It doesn't work
> > if $PATH is sanitized (prefixed with /usr/bin:/bin:)
> >
> > Fixes e8474d2a
> >
> > Signed-off-by: faicker.mo <faicker.mo@ucloud.cn>
> > ---
> >   buildrun.cxx | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/buildrun.cxx b/buildrun.cxx
> > index cef14ad..dcdb6e8 100644
> > --- a/buildrun.cxx
> > +++ b/buildrun.cxx
> > @@ -99,7 +99,7 @@ make_any_make_cmd(systemtap_session& s, const string& dir, const string& target)
> >     const char *oldpath = getenv("PATH");
> >     if (oldpath != NULL)
> >       {
> > -      newpath += ':';
> > +      newpath = "PATH=";
> >         newpath += oldpath;
> >       }
> >   
> 





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

end of thread, other threads:[~2018-12-28  7:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21  8:10 [PATCH] buildrun: no sanitize $PATH for kbuild invocation faicker.mo
2018-12-26  9:53 ` wyang
2018-12-28  7:10   ` Faicker Mo

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 read-only IMAP folder(s) and NNTP newsgroup(s).