Bug 856590

Summary: there is still /bin/ in PATH of NON-interactive shells
Product: [Fedora] Fedora Reporter: Harald Reindl <h.reindl>
Component: opensshAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 17CC: laurent.rineau__fedora, mattias.ellert, maxamillion, mgrepl, ooprala, plautrba, rrakus, tmraz
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-24 03:26:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harald Reindl 2012-09-12 11:26:33 UTC
see also https://bugzilla.redhat.com/show_bug.cgi?id=856584

i am pretty sure that rpmbuild defines the WRONG dependency because
the non-interactive shell has STILL /bin/ in from of /usr/bin

i have reported this hardcoded stuff and it seems only to be fixed
for interactive shells
________________________________

[harry@rh:~]$ ssh builduser@testserver "echo \$PATH"
Be careful or some guy will kill you!
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin

[harry@rh:~]$ ssh builduser@testserver
Last login: Wed Sep 12 13:17:26 2012 from 91.118.73.99
[builduser@testserver:~]$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/home/builduser/bin:/usr/local/scripts

Comment 1 Roman Rakus 2012-09-12 13:30:57 UTC
No, it's not a bug:
$ bash -c 'unset PATH; ./test.sh'
hB
/usr/local/bin:/usr/bin
$ cat ./test.sh 
echo $-
echo $PATH

Probably you have somewhere set PATH, in rc file or in profile file.

Comment 2 Harald Reindl 2012-09-12 13:34:15 UTC
there is NO profile/rc in NON-INTARCTIVE shells
what you are showing here is a INTERACTIVE shell

Comment 3 Harald Reindl 2012-09-12 13:47:15 UTC
and WHAT is this in "bash-2.03-paths.patch"?
_________________________

"/usr/local/bin:/bin:/usr/bin" reflects exactly the idiotic "/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin" while calling "ssh builduser@testserver "echo \$PATH""
_________________________

-  "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:."
+  "/usr/local/bin:/bin:/usr/bin"

-  "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
+  "/bin:/usr/bin:/usr/sbin:/sbin"

Comment 4 Roman Rakus 2012-09-12 14:10:15 UTC
(In reply to comment #2)
> there is NO profile/rc in NON-INTARCTIVE shells
> what you are showing here is a INTERACTIVE shell

echo $- is showing you that it is NOT interactive shell - there is not `i'.

(In reply to comment #3)
> and WHAT is this in "bash-2.03-paths.patch"?
> _________________________
> 
> "/usr/local/bin:/bin:/usr/bin" reflects exactly the idiotic
> "/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin" while calling "ssh
> builduser@testserver "echo \$PATH""
> _________________________
> 
> -  "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:."
> +  "/usr/local/bin:/bin:/usr/bin"
> 
> -  "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
> +  "/bin:/usr/bin:/usr/sbin:/sbin"

It's override by flag, where DDEFAULT_PATH_VALUE is set to "/usr/local/bin:/usr/bin\", what is perfectly what is the short script above showing;
make "CPPFLAGS=-D_GNU_SOURCE -DRECYCLES_PIDS -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"'  `getconf LFS_CFLAGS`"

And I'm talking about bash-4.2.37-2.fc17.

Check your version on target system.

Comment 5 Harald Reindl 2012-09-12 14:15:05 UTC
i tried to fix this patch and rebuild bash
but with no luck

there is no single config on the system which would explain from 
where "/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin" comes

but it is a HUGE problem
__________________________________

[harry@rh:~]$ ssh builduser@testserver "/home/builduser/test.sh; echo '-----------------'; cat /home/builduser/test.sh"
Be careful or some guy will kill you!
/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin
-----------------
echo $PATH

Comment 6 Harald Reindl 2012-09-12 14:17:29 UTC
i am surely using the latest version
bash-4.2.37-2.fc17.20120912.rh.x86_64

the short script above is NOT the same as "ssh user@host command"

Comment 7 Roman Rakus 2012-09-12 15:27:12 UTC
That path comes from openssh; the path is hardcoded during configuration part:
        --with-default-path=/usr/local/bin:/bin:/usr/bin \
        --with-superuser-path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin \

Comment 8 Fedora Update System 2012-09-15 16:33:32 UTC
openssh-6.1p1-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/openssh-6.1p1-1.fc18

Comment 9 Fedora Update System 2012-09-16 19:16:18 UTC
Package openssh-6.1p1-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openssh-6.1p1-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-13976/openssh-6.1p1-1.fc18
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2012-09-24 03:26:15 UTC
openssh-6.1p1-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Harald Reindl 2012-09-24 10:35:03 UTC
can someone explain why we submit the Fedora Version (17 in this case) and ALWAYS updates are pushed for alpha/beta/next-releases? F18 does not bother me in any way this time!

so "If problems still persist"is logically true

Comment 12 Fedora Update System 2012-10-31 16:19:54 UTC
openssh-5.9p1-27.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/openssh-5.9p1-27.fc17

Comment 13 Harald Reindl 2012-10-31 18:18:09 UTC
this looks MUCH better

[harry@srv-rhsoft:~]$ ssh buildserver "echo \$PATH"
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin

it needed a lot of time to find out what happens here, especially the implications running rpmbuild in a ssh-session, that's why i am conservative to "features" like UsrMove with zero benefit and a high potential to break things all over the system in random ways and push such features with careless pressure to fedora-releases while most maintainers having not the time to realize that their packages are a part of the puzzle