FreeBSD Bugzilla – Attachment 7974 Details for
Bug 16942
send-pr(1) creates unsafe temp files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.60 KB, created by
Colin Phipps
on 2000-02-23 20:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Colin Phipps
Created:
2000-02-23 20:30:01 UTC
Size:
2.60 KB
patch
obsolete
>*** /usr/bin/send-pr Tue Feb 22 11:54:39 2000 >--- ./send-pr Wed Feb 23 19:43:16 2000 >*************** >*** 73,84 **** > > # > >- [ -z "$TMPDIR" ] && TMPDIR=/tmp >- >- TEMP=$TMPDIR/p$$ >- BAD=$TMPDIR/pbad$$ >- REF=$TMPDIR/pf$$ >- > if [ -z "$LOGNAME" -a -n "$USER" ]; then > LOGNAME=$USER > fi >--- 73,78 ---- >*************** >*** 93,111 **** > ORIGINATOR="`sed -e '1q' $HOME/.fullname`" > elif [ -f /bin/domainname ]; then > if [ "`/bin/domainname`" != "" -a -f /usr/bin/ypcat ]; then > # Must use temp file due to incompatibilities in quoting behavior > # and to protect shell metacharacters in the expansion of $LOGNAME > /usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" | >! cut -f5 -d':' | sed -e 's/,.*//' > $TEMP >! ORIGINATOR="`cat $TEMP`" >! rm -f $TEMP > fi > fi > > if [ "$ORIGINATOR" = "" ]; then >! grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $TEMP >! ORIGINATOR="`cat $TEMP`" >! rm -f $TEMP > fi > > if [ -n "$ORGANIZATION" ]; then >--- 87,107 ---- > ORIGINATOR="`sed -e '1q' $HOME/.fullname`" > elif [ -f /bin/domainname ]; then > if [ "`/bin/domainname`" != "" -a -f /usr/bin/ypcat ]; then >+ PTEMP=`mktemp -t pt` || exit 1 > # Must use temp file due to incompatibilities in quoting behavior > # and to protect shell metacharacters in the expansion of $LOGNAME > /usr/bin/ypcat passwd 2>/dev/null | cat - /etc/passwd | grep "^$LOGNAME:" | >! cut -f5 -d':' | sed -e 's/,.*//' > $PTEMP >! ORIGINATOR="`cat $PTEMP`" >! rm -f $PTEMP > fi > fi > > if [ "$ORIGINATOR" = "" ]; then >! PTEMP=`mktemp -t pt` || exit 1 >! grep "^$LOGNAME:" /etc/passwd | cut -f5 -d':' | sed -e 's/,.*//' > $PTEMP >! ORIGINATOR="`cat $PTEMP`" >! rm -f $PTEMP > fi > > if [ -n "$ORGANIZATION" ]; then >*************** >*** 251,256 **** >--- 247,255 ---- > HOW_TO_REPEAT_C='<Code/input/activities to reproduce the problem (multiple lines)>' > FIX_C='' > >+ # Create temporary files, safely >+ REF=`mktemp -t pf` || exit 1 >+ TEMP=`mktemp -t pf` || exit 1 > # Catch some signals. ($xs kludge needed by Sun /bin/sh) > xs=0 > trap 'rm -f $REF $TEMP; exit $xs' 0 >*************** >*** 482,487 **** >--- 481,487 ---- > case "$input" in > a*) > if [ -z "$BATCH" ]; then >+ BAD=`mktemp -t pbad` > echo "$COMMAND: the problem report remains in $BAD and is not sent." > mv $TEMP $BAD > else >*************** >*** 542,547 **** >--- 542,548 ---- > else > echo "$COMMAND: mysterious mail failure." > if [ -z "$BATCH" ]; then >+ BAD=`mktemp -t pbad` > echo "$COMMAND: the problem report remains in $BAD and is not sent." > mv $REF $BAD > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16942
: 7974