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: chmod suddenly ceased to work on old files - NEW FINDINGS


> Yes, it's a Window permission problem as you have 
> identified. The "bad" files were probably created by a
> Windows program, or by Cygwin with nontsec. The "good"
> files were created by Cygwin with ntsec.
> The "bad" files inherit insufficient default permissions, 
> which don't give
> the owner enough access rights to chmod. You can change the default,
> as well as changing existing permissions, by using the advanced
> Windows properties (as you have done). At the bottom there
> should be a checkbox offering to reset permissions on all
> child objects. That will take care of your problems if you change
> the permissions in a top directory.

Indeed, this worked fine. So far I don't see permission problems
anymore.

> Now, there are still three mysteries.
> The first is why having uid = 400 makes any difference for ssh.
> As you can see, Windows doesn't care a bit about your uid,
> nor about upper/lower cases.

Windows doesn't, but maybe ssh. This (OpenSSH) is a cygwin application.

Note that I installed OpenSSH long ago, before having installed cygwin.
I can see that OpenSSH installed in its directory some cygwin stuff,
such as mkpasswd.exe and cygwin1.dll, so I guess it has created a
minimal
"cygwin environment" to work. Maybe in this minimal environment, it
assumed that it works for user id 400. But when I run it now, ssh
suddenly
knows that it is on a computer with a full blown cygwin installed, so
it looks at /etc/passwd for the uid. When it is different, ssh thinks
that
the current user is not the one for whom the id_rsa file was generated,
so it is not granted to use it.

Could this be an explanation?

> Can you confirm the ssh problem is really true?
> Edit /etc/passwd, change the uid to its "normal" value. Reboot
> your machine. Is there still a problem with ssh?

It is reproducible, and I don't even need to reboot: I suffices to
change the /etc/passwd and open a new shell (cygwin shell or Windows
command shell), and it refuses to work.

> 
> The second one is why chmod stopped working. 
> When is the last time it worked on a "bad" file? Is the problem
> related  to changing /etc/passwd (unlikely), or updating Cygwin?
> Simply save your existing passwd file, generate a new one
> with mkpasswd -l (only), and launch a new shell (rebooting
> should not be necessary). Your uid will be 400.
> Does chmod now work? I doubt it.

As you have guessed, the chmod problem was not related to the change in
user id and was not affected. I have resolved this - thanks to many
helpful answers in this mailing list - by fixing the Windows access
rights in the top level directory. 

Since this directory is on a network drive, which is accessible by the
domain administrators, it could well be that it was changed by them
(or by one of the "cleanup programs" which are run periodically, in
which case I expect the problem to pop up soon again).

> The third is that even though Windows does not give you the
> right permissions, it gives Full permissions to Administrators
> (at least on the file tg.pl, VORDEFINIERT\Administrators:F) 
> and "id" indicates that you are a member of the Administrators
> group. Thus you should be able to access the file...
> Can you verify in the Windows security GUI that Administrators
> can "Berechtigungen andern"? 

They can, and - for example - I didn't have problems setting a
file to readonly via Windows Explorer. I really have no explanation
here and am just happy that everything is working right now. Will
observe it closely over the next couple of weeks.

Kind regards,

Ronald

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