Wrong file permissions

Eliot Moss moss@cs.umass.edu
Fri Aug 19 15:22:00 GMT 2016


On 8/19/2016 8:27 AM, Björn Kautler wrote:
> Hi,
>
> I have a problem I hope you can help me to solve.
> I switched to a new box at work and copied over my whole cygwin folder via
> rsync from the old box to the new one.
> But now if I do "touch tmp", the file gets 060 permissions and not 644 like
> before.
> This is very disturbing, as not even "cat <<<foo" works but errors out with
> "bash: cannot create temp file for here-document: Permission denied".
>
> I hope you can help me with this one.

First, I suspect that Corinna, et al., will be interested in the output
of icacls applied to a file/folder in question, and possibly cygcheck
output.  Second, rsync'ing your stuff over probably does not respect
that you almost certainly have a new Windows SID on your new box.  You
probably need to change over ownership.  And any group(s) you assigned
probably did not carry over either.  Yeah, it's a pain moving to a new
box.  I suspect others on the list will have suggestions as to best
procedure to follow when moving over.

In any case, this suggests using Windows commands (manipulation from
a File Explorer opened with admin privileges) to insure that all your
files have the right owner, and (if you follow my scheme mentioned
below) to add a new group to the files (that can also be done using
a recursive chgrp once things are in a state to allow it).

For my part, I have found it helpful (or to my taste anyway) to create
a new group, distinct from my user identity.  (Windows typically kind
of conflates the two, i.e., each user *is* a group, and that group is
typically the primary group of files for which you are the primary
user / creator.)  I then chgrp all my Cygwin files to that group, and
also set folders to propagate their group to newly created files
(g+s, or 2000, permission on directories).  For my backup programs
to work I also set for all files/folders to have read access by
SYSTEM and for that to propagate from folders.  For files created by
Windows programs I still sometimes need to adjust their group manually
(sigh).

I hope this hasn't been too terse for you to get some useful guidance.

Cygwin community: Do we have guidance in the FAQ about moving a Cygwin
installation to a new box?  (I mean the user's files, not the install
done by setup -- which (IMO) should be redone on a new box, not copied.)

Regards -- Eliot Moss

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



More information about the Cygwin mailing list