Lines 7-30
Link Here
|
7 |
|
7 |
|
8 |
IFS=':' |
8 |
IFS=':' |
9 |
|
9 |
|
|
|
10 |
outputfile=/tmp/chownOut |
10 |
for path in ${PATH}; do |
11 |
for path in ${PATH}; do |
11 |
[[ -x ${path}/${scriptname} ]] || continue |
12 |
[[ -x ${path}/${scriptname} ]] || continue |
12 |
[[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue |
13 |
[[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue |
13 |
IFS=$' \t\n' |
14 |
IFS=$' \t\n' |
14 |
output=$("${path}/${scriptname}" "$@" 2>&1) |
15 |
"${path}/${scriptname}" "$@" 2>&1 > ${outputfile} |
15 |
if [[ $? -ne 0 ]] ; then |
16 |
if [ -f ${outputfile} ] ; then |
16 |
source "${PORTAGE_BIN_PATH:-/big/local/gentoo-prefix/usr/lib/portage/bin}"/isolated-functions.sh |
17 |
source "${PORTAGE_BIN_PATH:-/big/local/gentoo-prefix2/usr/lib/portage/bin}"/isolated-functions.sh |
17 |
|
18 |
|
18 |
if ! ___eapi_has_prefix_variables; then |
19 |
if ! ___eapi_has_prefix_variables; then |
19 |
EPREFIX= |
20 |
EPREFIX= |
20 |
fi |
21 |
fi |
21 |
msg="${scriptname} failure ignored with unprivileged user:\n ${scriptname} $*\n ${output}" |
|
|
22 |
# Reverse expansion of ${D} and ${EPREFIX}, for readability. |
22 |
# Reverse expansion of ${D} and ${EPREFIX}, for readability. |
23 |
msg=${msg//${D}/'${D}'} |
23 |
sed -i "s/${D}/'${D}'/g" ${outputfile} |
24 |
if [[ -n ${EPREFIX} ]] ; then |
24 |
if [[ -n ${EPREFIX} ]] ; then |
25 |
msg=${msg//${EPREFIX}/'${EPREFIX}'} |
25 |
sed -i "s/${EPREFIX}/'${EPREFIX}'/g" ${outputfile} |
26 |
msg=${msg//${EPREFIX#/}/'${EPREFIX}'} |
26 |
sed -i "s/${EPREFIX#/}/'${EPREFIX}'/g" ${outputfile} |
27 |
fi |
27 |
fi |
|
|
28 |
|
29 |
output=$(<${outputfile}) |
30 |
msg="${scriptname} failure ignored with unprivileged user:\n ${scriptname} $*\n ${output}" |
28 |
ewarn "${msg}" |
31 |
ewarn "${msg}" |
29 |
fi |
32 |
fi |
30 |
exit 0 |
33 |
exit 0 |