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: fstab.d/username


Jerome Haltom wrote:
> Using the textual user name is very bad form on Windows, as it is
> subject to change. The settings *should* be stored in the registry or
> the user's AppData\Local directories. These are mapped properly even
> when the user's name changes.

You can also use the user's SID rather than name (and the SID doesn't
change).  Furthermore, the "username" in /etc/fstab.d/username is NOT,
necessarily, the *Windows* username.  It's the *cygwin* username mapped
to the user's SID via /etc/passwd:

cygwin_username:unused:1000:513:Long Descriptive Name,U-MACHINE\Win32
User Name With
Spaces,S-1-5-21-NNNNNNNNNN-NNNNNNNNNN-NNNNNNNNNN-1000:/home/cygwin_username:/bin/bash

So, this account's SID is
S-1-5-21-NNNNNNNNNN-NNNNNNNNNN-NNNNNNNNNN-1000

The Win32 username is "Win32 User Name With Spaces" (on machine
"MACHINE"). You can change that username to whatever you want, but the
SID will remain constant. ('Course, each time you do that, you'll need
to regenerate your /etc/passwd).

The cygwin username is 'cygwin_username' -- and the user mount file is
/etc/fstab.d/cygwin_username

However -- I don't think you'll see much concern over supporting
"renaming" user accounts.  Technically the username is, as you say,
subject to change.  That doesn't mean it's a good idea, or that it
happens anywhere CLOSE to often.


--
Chuck

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