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: How to properly set up /etc/passwd and /etc/group


On Mar  3 12:31, Wes Barris wrote:
> Dave Korn wrote:
> >On 03/03/2010 00:34, Wes Barris wrote:
> >
> >>My W: drive is a mapped network drive.  However, it is mapped to a
> >>share coming from the same physical computer.  This drive contains
> >>all of my data including a folder that I wish to use as my home
> >>directory (W: is mapped to //mycomputer/share/home).
> >
> >  Just to check the obvious: is it mapped with the default (i.e., read-only!)
> >permissions, or did you open it up?
> 
> When I enabled sharing on that drive I checked the box that would
> allow network users to modify the files.
> 
> >>The contents of this drive was copied from my previous computer
> >>on which I used the same username.
> >
> >  Argh.  Ouch.  That's probably part of the problem.  Using the same username
> >on a different computer does *not* give your user account the same identity,
> >when we're talking about local machine accounts rather than domain/workgroup
> >accounts.
> >
> >  How *exactly* did you copy "the contents of this drive" across?
> 
> I put the two drives into the same computer and used Windows to
> copy the contents from one drive to the other.  This was done
> in the new computer.  I have also re-installed Windows on the
> new computer.  Does re-installing Windows change the machine
> portion of the SID or is the SID tied to hardware?

The machine SID is a random number chosen at installation time.
It's not bound to the hardware.  Only a Windows domain guarantees
that you can use the same (domain) user SID on different machines.

What you can do is to fetch the SID of your old account.  It should be
visible via the security dialog of a file.  Let's assume it's
S-1-5-21-11111-22222-33333-1004.  Now add a matching dummy entry to
/etc/passwd by hand, like this:

  dummy:*:123456:545:,S-1-5-21-11111-22222-33333-1004::

Now call ls -l and check that the SID is now recognized by Cygwin.
If so, you can now call chown as administrator to convert the
file ownership:

  find /cygdrive/w -user dummy -print0 | xargs -0 chown wes:users

That's just off the top of my head, but it should basically work.


Corinna

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

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


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