<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>136027</bug_id>
          
          <creation_ts>2006-06-07 22:45 0000</creation_ts>
          <short_desc>app-admin/sudo and hardcoded $PATH problems with gcc</short_desc>
          <delta_ts>2006-08-06 09:34:55 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gentoo@davidb.org</reporter>
          <assigned_to>lcars@gentoo.org</assigned_to>
          <cc>agriffis@gentoo.org</cc>
    
    <cc>gentoo@brooks1.net</cc>
    
    <cc>jkt@gentoo.org</cc>
    
    <cc>kanaka@gentoo.org</cc>
    
    <cc>taviso@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>gentoo@davidb.org</who>
            <bug_when>2006-06-07 22:45:13 0000</bug_when>
            <thetext>The &apos;app-admin/sudo&apos; package hardcodes the ROOT_PATH into its executable.  If a user changes GCC versions, but doesn&apos;t rebuild sudo, then commands executed via sudo will still use the old gcc version.  It would be useful to mention this in the gcc-upgrade manual.

The rebuild of sudo is a little tricky, since if you use sudo to do it, it will still get the old path.  The easiest way to do it is:

  % sudo bash -l
  # emerge app-admin/sudo

With the &apos;bash -l&apos; giving a login shell, which will run the /etc/profile again.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@brooks1.net</who>
            <bug_when>2006-06-23 19:13:58 0000</bug_when>
            <thetext>This issue is not a documentation issue -- there&apos;s a fix to this.

The gcc wrapper that is provided by gcc-config checks $PATH in the
user&apos;s environment first but will fall back and check /etc/env.d/05gcc
if $PATH does not contain a gcc-bin path. See:

    /usr/portage/sys-devel/gcc-config/files/wrapper-1.4.7.c

Since sudo is always configured --with-secure-path=&quot;$ROOTPATH&quot;,
$ROOTPATH should have the gcc-bin stripped from it.

I think it&apos;s pretty clear that since the gcc-bin path is specific to
a compiler version, compiling it into sudo will necessarily result in
a broken sudo. In my opinion the correct action is to strip gcc-bin
from $PATH allowing the gcc wrapper to check the more up to date value
in /etc/env.d/.

I&apos;m attaching a patch to sudo-1.6.8_p9-r2.ebuild which performs the
above. This patch works on my system.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@brooks1.net</who>
            <bug_when>2006-06-23 19:18:20 0000</bug_when>
            <thetext>Created an attachment (id=89971)
Patch against sys-admin/sudo-1.6.8_p9-r2 removing ../gcc-bin/.. path elements

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nightmorph@gentoo.org</who>
            <bug_when>2006-06-24 08:40:42 0000</bug_when>
            <thetext>Not a documentation bug; reassigning.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@brooks1.net</who>
            <bug_when>2006-06-28 19:36:58 0000</bug_when>
            <thetext>Created an attachment (id=90397)
Patch against sys-admin/sudo-1.6.8_p9-r2 removing ../gcc-bin/.. path elements

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@brooks1.net</who>
            <bug_when>2006-08-02 17:17:59 0000</bug_when>
            <thetext>Is there anything happening with this bug? The current behavior of
sudo breaks gcc-wrapper functionality, making it impossible to switch
gcc profiles while using sudo. This should be fixed. The attached
patch is sufficient to create the correct behavior.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2006-08-06 09:34:55 0000</bug_when>
            <thetext>p12-r1 in cvs fixes this issue, it&apos;s ~x86 currently but assuming everything goes well I&apos;ll file a stable request soon.

Thanks for the patch.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>89971</attachid>
            <date>2006-06-23 19:18 0000</date>
            <desc>Patch against sys-admin/sudo-1.6.8_p9-r2 removing ../gcc-bin/.. path elements (oops. reverse patch -- sorry)</desc>
            <filename>sudo-1.6.8_p9-r2.ebuild.patch-remove-gcc-bin-from-path</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC9ob21lL2Ficm9va3MvcG9ydGFnZS9hcHAtYWRtaW4vc3Vkby9zdWRvLTEuNi44X3A5LXIy
LmVidWlsZAkyMDA2LTA2LTIwIDIxOjM5OjExLjAwMDAwMDAwMCAtMDQwMAorKysgL3Vzci9wb3J0
YWdlL2FwcC1hZG1pbi9zdWRvL3N1ZG8tMS42LjhfcDktcjIuZWJ1aWxkCTIwMDYtMDItMTYgMDU6
MzU6MjEuMDAwMDAwMDAwIC0wNTAwCkBAIC0xMDksOSArMTA5LDYgQEAKIAkJIyByZW1vdmUgYW55
IGR1cGxpY2F0ZSBlbnRyaWVzCiAJCVJPT1RQQVRIPSQoY2xlYW5wYXRoIC9iaW46L3NiaW46L3Vz
ci9iaW46L3Vzci9zYmluOi91c3IvbG9jYWwvYmluOi91c3IvbG9jYWwvc2Jpbjovb3B0L2JpbiR7
Uk9PVFBBVEg6Kzoke1JPT1RQQVRIfX0pCiAKLQkJIyBsZXQgZ2NjLWNvbmZpZyBkbyBpdHMgam9i
OyByZW1vdmUgZ2NjIHBhdGggZnJvbSBST09UUEFUSAotCQlybXBhdGggUk9PVFBBVEggJyovZ2Nj
LWJpbi8qJwotCiAJZWluZm8gIi4uLmRvbmUuIgogCiAJIyBYWFg6IC0tZGlzYWJsZS1wYXRoLWlu
Zm8gY2xvc2VzIGFuIGluZm8gbGVhaywgYnV0IG1heSBiZSBjb25mdXNpbmcuCkBAIC0xNzUsMjAg
KzE3Miw2IEBACiAJZG9uZTsgZWNobyAiJHtwYXRoc1sqXX0iCiB9CiAKLSMgc3ludGF4OiBybXBh
dGggUEFUSHZhciBlbGVtZW50MSBbIGVsZW1lbnQyIC4uLiBdCi0jIGV4YW1wbGU6Ci0jICAgICBy
bXBhdGggTUFOUEFUSCAvdXNyL2xvY2FsL21hbgotIyAoY291cnRlc3kgYWdyaWZmaXMpCi1ybXBh
dGgoKSB7Ci0JZGVjbGFyZSBlIG5ld3BhdGggb2xkcGF0aD0keyExfSBQQVRIdmFyPSQxIHRoaXNw
IElGUz06Ci0Jc2hpZnQKLQlmb3IgdGhpc3AgaW4gJG9sZHBhdGg7IGRvCi0JCWZvciBlOyBkbyBb
WyAkdGhpc3AgPT0gJGUgXV0gJiYgY29udGludWUgMjsgZG9uZQotCQluZXdwYXRoPSRuZXdwYXRo
OiR0aGlzcAotCWRvbmUKLQlldmFsICRQQVRIdmFyPScke25ld3BhdGgjOn0nCi19Ci0KICMgYWRk
ICQxIHRvIGRlZmF1bHQgZW52X2RlbGV0ZSBsaXN0Lgogc3Vkb19iYWRfdmFyKCkgewogCWxvY2Fs
IHRhcmdldD0nZW52LmMnIG1hcmtlcj0nXCppbml0aWFsX2JhZGVudl90YWJsZVxbXF0nCg==
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>90397</attachid>
            <date>2006-06-28 19:36 0000</date>
            <desc>Patch against sys-admin/sudo-1.6.8_p9-r2 removing ../gcc-bin/.. path elements</desc>
            <filename>sudo-1.6.8_p9-r2.ebuild.patch-remove-gcc-bin-from-path</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIC91c3IvcG9ydGFnZS9hcHAtYWRtaW4vc3Vkby9zdWRvLTEuNi44X3A5LXIyLmVidWlsZAky
MDA2LTAyLTE2IDA1OjM1OjIxLjAwMDAwMDAwMCAtMDUwMAorKysgL2hvbWUvYWJyb29rcy9wb3J0
YWdlL2FwcC1hZG1pbi9zdWRvL3N1ZG8tMS42Lj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PScke25ld3BhdGgjOn0nCit9CisKICMgYWRk
ICQxIHRvIGRlZmF1bHQgZW52X2RlbGV0ZSBsaXN0Lgogc3Vkb19iYWRfdmFyKCkgewogCWxvY2Fs
IHRhcmdldD0nZW52LmMnIG1hcmtlcj0nXCppbml0aWFsX2JhZGVudl90YWJsZVxbXF0nCg==
</data>        

          </attachment>
    </bug>

</bugzilla>