public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* NTSEC db_home
@ 2015-04-17 16:07 Jim Reisert AD1C
  2015-04-17 16:29 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Reisert AD1C @ 2015-04-17 16:07 UTC (permalink / raw)
  To: cygwin

I'm having a little trouble with the db_home: setting at work
(corporate network, not using /etc/passwd or /etc/group).  Regarding:

  https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch-home

I tried "db_home: /%H" and although my MINTTY session started in the
correct directory, ssh-keygen wanted to use the directory defined by
HOMESHARE instead, which points somewhere else (a local Unix server).
Note that both HOMEDRIVE (+HOMEPATH) and HOMESHARE ultimately point to
the same place:

DOS view of the world:

c:\>set | grep HOME
HOME=C:\Home
HOMEDRIVE=P:
HOMEPATH=\
HOMESHARE=\\corp.ad.broadcom.com\DENA\home\reisert

(mintty window with bash)

[LTDENA-REISERT:~] $ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key
(//corp.ad.broadcom.com/DENA/home/reisert/.ssh/id_rsa):

Cygwin view of the world:

[LTDENA-REISERT:~] $ set | grep -i home
CDPATH=.:/cygdrive/c/Home:/cygdrive/c/Home/dx4win:/cygdrive/c
HISTFILE=/cygdrive/c/Home/.bash_history
HOME=/cygdrive/c/Home
HOMEDRIVE=P:
HOMEPATH='\'
HOMESHARE='\\corp.ad.broadcom.com\DENA\home\reisert'
PWD=/cygdrive/c/Home

I can't explain what's going on.  I changed db_home to:

    db_home:   /cygdrive/C/Home

and it's working as expected.

-- 
Jim Reisert AD1C, <jjreisert@alum.mit.edu>, http://www.ad1c.us

--
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: NTSEC db_home
  2015-04-17 16:07 NTSEC db_home Jim Reisert AD1C
@ 2015-04-17 16:29 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2015-04-17 16:29 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2133 bytes --]

On Apr 17 10:07, Jim Reisert AD1C wrote:
> I'm having a little trouble with the db_home: setting at work
> (corporate network, not using /etc/passwd or /etc/group).  Regarding:
> 
>   https://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping-nsswitch-home
> 
> I tried "db_home: /%H" and although my MINTTY session started in the
> correct directory, ssh-keygen wanted to use the directory defined by
> HOMESHARE instead, which points somewhere else (a local Unix server).
> Note that both HOMEDRIVE (+HOMEPATH) and HOMESHARE ultimately point to
> the same place:
> 
> DOS view of the world:
> 
> c:\>set | grep HOME
> HOME=C:\Home

Bzzz.

You seem to misinterpret what %H means.  It's the same thing as setting
db_home to the windows scheme.  Here's the relevant part from the docs:

  windows

    The user's home directory is set to the same directory which is used
    as Windows home directory. This is the homeDirectory AD attribute.
    For SAM accounts, this is equivalent to the "Home folder" setting in
    SAM. If both attributes are unset, Cygwin falls back to the user's
    local profile directory, typically something along the lines of
    C:\Users\$USERNAME. Of course, the Windows directory is converted to
    POSIX-style by Cygwin. 

Check with `getent passwd $USER'.  Your home dir from the Cygwin POV 
is what *Windows* sets, not your personal $HOME setting from the
environment.  I bet you'll see "//corp.ad.broadcom.com/DENA/home/reisert"
in the getent output.

By setting $HOME to a directory different from your home dir in the
passwd entry, you're confusing your tools.  Some of them will happily
use $HOME, others will use the entry from the account DB (what getent
returns).

The bottom line is, don't do that.  You have enough configuration
methods in /etc/nsswitch.conf, AD, or SAM to set your home dir
correctly.  Setting $HOME manually to a differnet value is just
asking for trouble.


HTH,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-17 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-17 16:07 NTSEC db_home Jim Reisert AD1C
2015-04-17 16:29 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).