diff options
author | jlam <jlam> | 2006-06-14 03:00:03 +0000 |
---|---|---|
committer | jlam <jlam> | 2006-06-14 03:00:03 +0000 |
commit | 173a2bc82d7fd7a3a91eec5d9c0788c3b2a813bd (patch) | |
tree | ea609582282d19da2f86ee16fcfe4faab699c45e /sysutils | |
parent | 49223a0b9a7b27ff272c9d2b4b25dfe898533b82 (diff) | |
download | pkgsrc-173a2bc82d7fd7a3a91eec5d9c0788c3b2a813bd.tar.gz |
Fix error with just-in-time su when installing dependencies. The code
to install dependencies looked roughly like this:
${CAT} ${_DEPENDS_FILE} |
while read type pattern dir; do
cd $$dir && ${MAKE} install
done
In the code above, tghe recursive make invoked to install each dependency
does a just-in-time su to acquire root privileges for the installation,
but the su tries to get terminal settings for standard input (from
the pipe) using tcgetattr(), which fails and subsequently causes su
to exit with a puzzling "conversation failure" error. Rewrite the
loop to look (roughly) like this:
set -- `${CAT} ${_DEPENDS_FILE}`
while test $# -gt 0; do
type=$1; pattern=$2; dir=$3; shift 3
cd $$dir && ${MAKE} install
done
Note that this is potentially bad for shells with very low limits on
the maximum command line length, but at least this preserves file
descriptor 1 to reference the controlling tty unless the user does
something weird with input redirection when invoking make.
Diffstat (limited to 'sysutils')
0 files changed, 0 insertions, 0 deletions