summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElias Gabriel Amaral da Silva <tolkiendili@gmail.com>2010-08-06 10:00:52 -0300
committerBo Ørsted Andresen <zlin@exherbo.org>2010-08-06 13:15:04 +0000
commit26a4d61d9eec3b2a46138ac41d98e77417983206 (patch)
tree0a31af4567d281a4e04e4184671ee7de488e29c9
parente6916cfdb3dfc887c22b6430a337ea5bbab8389f (diff)
downloadwgetpaste-26a4d61d9eec3b2a46138ac41d98e77417983206.tar.gz
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.
-rwxr-xr-xwgetpaste11
1 files 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"