summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/grp.cc
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-18 16:27:44 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-18 16:27:44 -0700
commitd00eca5a10a69be3ccabf0e165de98ab19ef25b2 (patch)
treebbe5bad8b471215e12c894c3fd837818a5fbb2c0 /winsup/cygwin/grp.cc
parent5bb41d641c4658b44e9a8a7047498a028cdc8bb1 (diff)
downloadcygnal-2.5.2.tar.gz
cygnal-2.5.2.tar.bz2
cygnal-2.5.2.zip
Use Windows values in passwd and HOME env var.cygnal-2.5.2
In this patch, the path to the Windows command interpreter is reported in the shell field of struct passwd by getpwent by default rather than "/bin/bash". The value of USERPROFILE is used for the home field rather than "/home/<user>". Also, the HOME environment variable is stuffed with a copy of USERPROFILE. The HOME issue solves the following problem: some OSS programs on Windows, such as Vim, respond to a HOME variable. If it has garbage contents that make no sense like "/home/bob", they don't behave well. * winsup/cygwin/grp.cc (pwdgrp::init_grp): Initialize new pwd_sep member. * winsup/cygwin/passwd.cc (pwdgrp::parse_passwd): Use pwd_sep rather than hard-coded colon. (pwdgrp::init_pwd): Initialize pwd_sep. * winsup/cygwin/pwdgrp.h (class pwdgrp): New member, pwd_sep. * winsup/cygwin/uinfo.cc (cygheap_user::ontherange): Copy value of USERPROFILE into HOME. (pwdgrp::next_num, pwdgrp::fetch_account_from_line): Use pwd_sep rather than ':'. (pwdgrp::next_num, pwdgrp::fetch_account_from_windows): Get real Windows shell as default shell field. Get USERPROFILE as home directory. Use '|' as the field separator because these fields contain colons. Set pwd_sep to '|'.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index d66acad99..40f85feec 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -57,6 +57,7 @@ pwdgrp::init_grp ()
{
pwdgrp_buf_elem_size = sizeof (pg_grp);
parse = &pwdgrp::parse_group;
+ pwd_sep = ':';
}
struct group *