Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 85005

Summary: ebuild-daemon.sh gives "env_receiving_failed" with weird env vars
Product: Portage Development Reporter: TGL <tom.gl>
Component: CoreAssignee: Portage team <dev-portage>
Status: VERIFIED DUPLICATE    
Severity: normal    
Priority: High    
Version: 2.2   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description TGL 2005-03-12 11:02:44 UTC
I tried HEAD today and got this:

>>> emerge (1 of 1) sys-apps/portage-20050312 to /
cleansing builddir/var/tmp/portage/portage-20050312
*** Adjusting cvs-src permissions for portage user...
>>> md5 src_uri ;-) portage-20050312.tar.bz2
creating temp dir
*** Adjusting ccache permissions for portage user...
Calculating dependencies ...done!
>>> emerge (1 of 1) sys-apps/portage-20050312 to /
cleansing builddir/var/tmp/portage/portage-20050312
>>> md5 src_uri ;-) portage-20050312.tar.bz2
creating temp dir
*** Adjusting ccache permissions for portage user...
/usr/lib/portage/bin/ebuild-daemon.sh: line 242: tee: command not found
swapping processors for ['unpack', 'compile', 'test']
/usr/lib/portage/bin/ebuild-daemon.sh: line 242: tee: command not found
phases failed
>>> pids file is not a regular file
/usr/lib/portage/bin/ebuild-daemon.sh: line 184: }: command not found
err, env receiving threw an error for 'SUDO_COMMAND=$'/bin/su -c /bin/bash -l -c '{ cd "/home/thomas/bidouille/portage/cvs" ; "emerge" "--oneshot" "portage" ; }''': 0
env_receiving_failed
phases failed
>>> pids file is not a regular file

And then it exits.

Ok, that deserves some explanations. I have this function in my user environment that for various reasons i use instead of a simple sudo:
root() {
	local command="/bin/bash -l"
	if [ -n "${*}" ]; then
		command="${command} -c '{ cd \"${PWD}\" ;"
		while [ -n "${*}" ] ; do
			command="${command} \"${1}\""
			shift
		done
		command="${command} ; }'"
	fi
	sudo su -c "${command}"
}

The error above was while trying a:
% root emerge --oneshot portage

It seems that the weird SUDO_COMMAND in the env is really killing ebuild-daemon.sh.  If I add an "unset SUDO_COMMAND" in the to-be-executed command in my root() function, then everything is fine. 

I don't have a fix so far, not even a simpler test case.

Reproducible: Always
Steps to Reproduce:
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-08-12 23:07:20 UTC

*** This bug has been marked as a duplicate of 102126 ***
Comment 2 Brian Harring (RETIRED) gentoo-dev 2005-08-23 02:08:24 UTC
This was fixed prior to alpha's release via dsd.