Mail Archives: cygwin/2011/07/26/19:29:05
Currently Cygwin uses a pretty good method of setting 'home', however,
it's not very robust in dealing with home dirs on network connections.
I currently have some func's in my local init scripts that override HOME,
but would be better if they were in the standard scripts..
# handy function turns t/f if on cygwin (but use your own method)
# as I use the same startup scripts on my linux machines as on cygwin
# or try to anyway...
#
if [[ $OSTYPE =~ Cygwin ]]; then
function cygwin () { return 0; }
else
function cygwin () { return 1; }
fi
export -f cygwin
# basically, if I can't find my .bashrc
if cygwin; then
[[ ! -e $HOME/.bashrc ]] && {
export HOME=$(cygpath "$USERPROFILE")
}
fi
There may be a better file to test, but for me that's a good one, since
my bash will likely not be initialized correctly if it isn't there.
So if I can't access it on my HOME (defined by mkpasswd -lD) to
be //<Domain>/<User>.
Of course 'screwyly enough', it should be in //<Domain>/<USER.V2>,
but that's a windows bug...(since Win7, puts all your files in user.v2, as
profile layout has changed).
The above, of course means, my home dir is set to my 'XP' Home dir.
Not so useful, as it 'seems' to synchronize my local home dir with
USER.V2, on logout -- NOT USER... but that's just another Winbug.
Primary focus -- if user's home dir is on a NW share, and it isn't
accessible,
then default them to
their USERPROFILE dir.. which is their 'home' dir on the local machine
(and gets
copied to and fro as part of a domain profile!)...
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
- Raw text -