summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2008-07-26 18:17:15 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2008-07-26 18:17:15 +0000
commit2046a46c15951da0005f3508cfaf3f5001fb598e (patch)
tree55be05b7ddbd3ebc26f5456424083f4356c6c54e
parentaeadb64d5f15795482c02edee5ff30bcddaff7d5 (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.
m---------common0
-rw-r--r--gst-plugin/ChangeLog6
-rwxr-xr-xgst-plugin/tools/make_element8
3 files changed, 13 insertions, 1 deletions
diff --git a/common b/common
-Subproject 46ec7dfc1c09ff550ed6b7a4e0d3f2b2ac7d3ee
+Subproject e79879859bc866545379eb77e1378a906dc30eb
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>"