delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/07/26/19:29:05

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,TW_MK
X-Spam-Check-By: sourceware.org
Message-ID: <4E2F4D9E.5070208@tlinx.org>
Date: Tue, 26 Jul 2011 16:28:30 -0700
From: Linda Walsh <cygwin AT tlinx DOT org>
Reply-To: Linda Walsh <cygwin AT tlinx DOT org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RFE: adjustment of HOME in default /etc/profile
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019