Commit 2046a46c authored by Stefan Kost's avatar Stefan Kost

tools/make_element: Fix username detection. tries getent first and falls back...

tools/make_element: Fix username detection. tries getent first and falls back to grep passwd. Spotted by Karoly Segesdi.

Original commit message from CVS:
* tools/make_element:
Fix username detection. tries getent first and falls back to grep
passwd. Spotted by Karoly Segesdi.
parent aeadb64d
common @ e7987985
Subproject commit 46ec7dfc1c09ff550ed6b7a4e0d3f2b2ac7d3ee8
Subproject commit e79879859bc866545379eb77e1378a906dc30ebf
2008-07-26 Stefan Kost <ensonic@users.sf.net>
* tools/make_element:
Fix username detection. tries getent first and falls back to grep
passwd. Spotted by Karoly Segesdi.
2008-06-09 Jan Schmidt <jan.schmidt@sun.com>
* src/gstplugin.c:
......
......@@ -26,7 +26,13 @@ Template=$(echo $Template | tr -d _)
YEAR=`date "+%Y"`
if [ -z "$REAL_NAME" ]; then
REAL_NAME=`grep `id -u` /etc/passwd | awk -F":" '{ print $5 }' | awk -F"," '{ print $1 }'`
user=`id -u`
if [ `which 2>/dev/null getent` ]; then
entry=`getent passwd $user`
else
entry=`grep $user /etc/passwd`
fi
REAL_NAME=`echo $entry | awk -F":" '{ print $5 }' | awk -F"," '{ print $1 }'`
fi
if [ -z "$EMAIL_ADDRESS" ]; then
EMAIL_ADDRESS="<user@hostname.org>"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment