]> git.lyx.org Git - features.git/commitdiff
Use getent instead of grepping /etc/passwd.
authorEnrico Forestieri <forenr@lyx.org>
Sun, 3 Aug 2014 16:59:54 +0000 (18:59 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 3 Aug 2014 16:59:54 +0000 (18:59 +0200)
Forthcoming versions of cygwin will use a different mechanism for
obtaining passwd/group information based on /etc/nsswitch.conf.
Thus, it will not be guaranteed that the files /etc/passwd and
/etc/group even exist. The recommended way for obtaining those
info is by using the getent command, which already works in
current versions.

development/cygwin/lyxprofile
status.21x

index f51bd556f1c41b25fe831a51d12b2073834e21e0..afa21beb41825f1d32d9080a1cc2c1ebe302d370 100644 (file)
@@ -1,7 +1,7 @@
 # Set up the home directory if not already set in the system environment.
 if [ -z "${HOME}" ]; then
   USER=`id -un`
-  HOME=`grep "^${USER}:" /etc/passwd | cut -d: -f6`
+  HOME=`getent passwd "${USER}" | cut -d: -f6`
   if [ -z "${HOME}" -o ! -d "${HOME}" ]; then
     HOME="/home/${USER}"
     test -d "${HOME}" || HOME=/tmp
index 452841120db5650e271298d4fcb1863f1838796e..716e014951f972435a462bb54691d0606f00ab0e 100644 (file)
@@ -46,6 +46,9 @@ What's new
 
 - Fix compatibility issue with 64-bit cygwin.
 
+- On Cygwin, use getent instead of grepping /etc/passwd for determining
+  the user's home directory when launching LyX through the gui wrapper.
+
 
 
 ** Bug fixes: