Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 May 2002 23:12:40 +0100 (BST)
From:      Harry Newton <harry_newton@telinco.co.uk>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   gnu/37910: PATCH: make send-pr(1) respect &'s in /etc/{master.}passwd
Message-ID:  <200205092212.g49MCeM3075624@basilisk.locus>

next in thread | raw e-mail | index | archive | help

>Number:         37910
>Category:       gnu
>Synopsis:       PATCH: make send-pr(1) respect &'s in /etc/{master.}passwd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 09 15:20:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Harry Newton
>Release:        FreeBSD 4.6-PRERELEASE i386
>Organization:
GAUDEAMUS
>Environment:
System: FreeBSD basilisk.locus 4.6-PRERELEASE FreeBSD 4.6-PRERELEASE #0: Tue May 7 21:23:01 BST 2002 root@basilisk.locus:/usr/obj/usr/src/sys/BASILISK i386


	
>Description:
The password files /etc/passwd and /etc/master.passwd allow ampersands (&)
in the GECOS fields to represent the username, initially capitalised ( see
passwd(5) ).
This convention isn't respected by send-pr(1): the enclosed path fixes this.

>How-To-Repeat:
send-pr
>Fix:
*** send-pr	Thu May  9 22:19:59 2002
--- send-pr.new	Thu May  9 22:52:55 2002
***************
*** 92,102 ****
    ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
  else
    PTEMP=`mktemp -t p` || exit 1
    # Must use temp file due to incompatibilities in quoting behavior
    # and to protect shell metacharacters in the expansion of $LOGNAME
!   $PW usershow $LOGNAME | awk -F: '{ print $8 }' | sed -e 's/,.*//' > $PTEMP
    ORIGINATOR="`cat $PTEMP`"
    rm -f $PTEMP
  fi
  
  FROM="$ORIGINATOR <$LOGNAME>"
--- 92,108 ----
    ORIGINATOR="`sed -e '1q' $HOME/.fullname`"
  else
    PTEMP=`mktemp -t p` || exit 1
+   PTEMP2=`mktemp -t p` || exit 1
    # Must use temp file due to incompatibilities in quoting behavior
    # and to protect shell metacharacters in the expansion of $LOGNAME
!   $ECHON1 $LOGNAME | awk '{print toupper(substr($1,1,1))substr($1,2)}' > $PTEMP2
!   ICLOGNAME="`cat $PTEMP2`"
!   $PW usershow $LOGNAME | awk -F: '{ print $8 }'    \
!                         | sed -e "s/\&/$ICLOGNAME/" \
!                         | sed -e 's/,.*//' > $PTEMP
    ORIGINATOR="`cat $PTEMP`"
    rm -f $PTEMP
+   rm -f $PTEMP2
  fi
  
  FROM="$ORIGINATOR <$LOGNAME>"

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205092212.g49MCeM3075624>