From 26a4d61d9eec3b2a46138ac41d98e77417983206 Mon Sep 17 00:00:00 2001 From: Elias Gabriel Amaral da Silva Date: Fri, 6 Aug 2010 10:00:52 -0300 Subject: now not reading from /dev/stdin (using cat instead) when one does sudo or su, /dev/stdin is owned by the parent user. so wgetpaste, inside su and receiving input from the tty, would be unable to read it. --- wgetpaste | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wgetpaste b/wgetpaste index 00eea19..2cdbba6 100755 --- a/wgetpaste +++ b/wgetpaste @@ -618,7 +618,7 @@ default="DEFAULT_NICK_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_NICK=${!defau default="DEFAULT_LANGUAGE_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_LANGUAGE=${!default} default="DEFAULT_EXPIRATION_$SERVICE" && [[ -n ${!default} ]] && DEFAULT_EXPIRATION=${!default} NICK=${NICK:-$(escape "${DEFAULT_NICK}")} -[[ -z $SOURCE ]] && SOURCE="stdin" && FILES[${#FILES[*]}]="/dev/stdin" +[[ -z $SOURCE ]] && SOURCE="stdin" CVT_TABS=No INFO_COMMAND=${INFO_COMMAND:-"emerge --info"} @@ -711,7 +711,14 @@ case "$SOURCE" in INPUT="$(x_cut)" fi ;; - files | stdin ) + stdin ) + if [[ $TEE ]]; then + tee "$TMPF" + else + INPUT="$(cat)" + fi + ;; + files ) if [[ ${#FILES[@]} -gt 1 ]]; then for f in "${FILES[@]}"; do [[ -r $f ]] || notreadable "$f" -- cgit v1.2.3