This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Login behaviour oddities: won't run .profile


On Sep 20 18:10, luke.kendall@cisra.canon.com.au wrote:
> I looked into a problem reported today, that ~/.profile is not executed
> if you use Cygwin to create your home directory, instead of using
> Windows Explorer to create the directory.
> 
> The user who reported it and I played around for a while, with getfacl
> and setfacl to try to find the difference and fix them.  While setfacl
> doesn't seem to allow you to do everything you need (specifically, you
> can't use it to delete the default group ACL for ~ since you have to
> specify a group, but there is no group for the default group), ACLs may
> not be the full explanation anyway.

get/setfacl are not designed to manipulate the ACLs in a WIndows way,
but in a Unixy way.  Keep in mind that you always have a primary
group and always primary group permission bits in the POSIX permissions.
You can't delete them, just set them to --- if you like.  To get rid of
the primary group ACE entirely, either use NT tools (cacls) or change
the primary group for the file first.

> We managed to set the two directories to appear to have identical ACLs
> according to the Advanced security tab in the Windows Explorer
> properties - but that still didn't help!
> 
> Cygwin will only run ~/.profile if "~" was created via Win Explorer.
> (This seems to be reasonably new behaviour - we've got a lot of users
> who would have been affected every day, if this had been true for a
> long time.)

Sorry but this is bogus.  There's no difference whether a directory is
created using Cygwin or Windows.

bash gets its idea of where the home directory is from the setting of
$HOME.  When starting up `bash --login' locally, then the Cygwin DLL
constructs $HOME using the following rule:

- If $HOME is present in the environment, convert it to a POSIX path
  and use it.
- Otherwise, if the user has an /etc/passwd entry and this entry contains
  a non-empty pw_dir field, use this as $HOME.
- Otherwise, if $HOMEDRIVE and $HOMEPATH are set in the Windows environment
  (they usually are), use them to create a POSIXy $HOME from them.
- Otherwise use "/" as $HOME.

Does that help?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]