mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-13 17:20:55 +00:00
Use getent instead of grepping /etc/passwd.
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.
This commit is contained in:
parent
47e263fa7f
commit
64cc8a1c1e
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user