diff options
author | Stefan Kost <ensonic@users.sourceforge.net> | 2008-07-26 18:17:15 +0000 |
---|---|---|
committer | Stefan Kost <ensonic@users.sourceforge.net> | 2008-07-26 18:17:15 +0000 |
commit | 2046a46c15951da0005f3508cfaf3f5001fb598e (patch) | |
tree | 55be05b7ddbd3ebc26f5456424083f4356c6c54e /gst-plugin | |
parent | aeadb64d5f15795482c02edee5ff30bcddaff7d5 (diff) |
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.
Diffstat (limited to 'gst-plugin')
-rw-r--r-- | gst-plugin/ChangeLog | 6 | ||||
-rwxr-xr-x | gst-plugin/tools/make_element | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gst-plugin/ChangeLog b/gst-plugin/ChangeLog index 9667c46..171a248 100644 --- a/gst-plugin/ChangeLog +++ b/gst-plugin/ChangeLog @@ -1,3 +1,9 @@ +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: diff --git a/gst-plugin/tools/make_element b/gst-plugin/tools/make_element index 5d59ffc..6b2c07c 100755 --- a/gst-plugin/tools/make_element +++ b/gst-plugin/tools/make_element @@ -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>" |