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   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-23 23:26:15 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Harald Reindl 2012-09-12 07:26:33 EDT
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!

[harry@rh:~]$ ssh builduser@testserver
Last login: Wed Sep 12 13:17:26 2012 from
[builduser@testserver:~]$ echo $PATH
Comment 1 Roman Rakus 2012-09-12 09:30:57 EDT
No, it's not a bug:
$ bash -c 'unset PATH; ./test.sh'
$ 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 09:34:15 EDT
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 09:47:15 EDT
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 10:10:15 EDT
(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 10:15:05 EDT
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!
echo $PATH
Comment 6 Harald Reindl 2012-09-12 10:17:29 EDT
i am surely using the latest version

the short script above is NOT the same as "ssh user@host command"
Comment 7 Roman Rakus 2012-09-12 11:27:12 EDT
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 12:33:32 EDT
openssh-6.1p1-1.fc18 has been submitted as an update for Fedora 18.
Comment 9 Fedora Update System 2012-09-16 15:16:18 EDT
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:
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2012-09-23 23:26:15 EDT
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 06:35:03 EDT
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 12:19:54 EDT
openssh-5.9p1-27.fc17 has been submitted as an update for Fedora 17.
Comment 13 Harald Reindl 2012-10-31 14:18:09 EDT
this looks MUCH better

[harry@srv-rhsoft:~]$ ssh buildserver "echo \$PATH"

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