This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: vi stealing SYSTEM-owned permissions and ownership
- From: "D. Boland" <daniel at boland dot nl>
- To: cygwin at cygwin dot com
- Date: Tue, 05 Nov 2013 06:49:54 +0100
- Subject: Re: vi stealing SYSTEM-owned permissions and ownership
- Authentication-results: sourceware.org; auth=none
- References: <5274F396 dot A133C4CE at boland dot nl>
Thanks for the input, guys.
I think I have new information on the stealing of ownership. Below test has been
performed on the Apache folder, placed in the Windows Program Files folder by the
Apache msi installer:
"/cygdrive/c/Program Files (x86)/Apache Group/Apache2/"
But if I perform the same test in my Cygwin home directory, vi behaves beautifully.
So, I was thinking this difference must be related to the Windows ACL assigments on
the "Program Files" folder.
Maybe vi is confused within this folder, because it is a system folder which
recursively forces extra permissions on its subfolders.
This means I could solve the issue by telling the Apache installer to put the files
in a "neutral" folder, like:
/cygdrive/c/apache/
But then the question would stay, nagging in my mind: why would vi be confused and
nano (and notepad.exe by the way) not?
Also, Larry Hall pointed out:
"When I looked at the information provided, I was left with the distinct impression
that the 'vi' in use was not a Cygwin version. The fact that the file edited with
it had no POSIX permissions was a red flag for me."
I initially used the original version of "vi" that came with the standard distro of
Cygwin. When I noticed the problem, I installed "vim" and went on, testing with
that.
I really, really would like to persue this issue some more in the direction Larry
points to.
Cincerely,
Daniel
"D. Boland" wrote:
>
> Meanwhile, I accidentally found sort of a solution: deleting the file without write
> permissions on the containing folder, restores the permissions set by Administrator.
>
> As Administrator:
> chmod 0700 .
> touch test.txt
> chown SYSTEM:apache test.txt
> chmod 0770 test.txt
>
> Results in:
>
> -rwxrwx---+ 1 SYSTEM apache 0 2 nov 13:26 test.txt
>
> As "normal" user:
> Edit the file with vi. After, permissions will look like:
>
> ----------+ 1 Daniel None 9 2 nov 13:29 test.txt
>
> $ getfacl.exe test.txt
> # file: test.txt
> # owner: Daniel
> # group: None
> user::---
> group::---
> group:SYSTEM:rwx
> group:Administrators:rwx
> group:Gebruikers:r-x
> group:apache:rwx
> mask:rwx
> other:---
>
> To "solve" this, simply delete the file:
>
> rm test.txt
>
> The file is not deleted because of 0700 on the containing folder. But the original
> permissions, set by Admin are restored!!
>
> -rwxrwx---+ 1 SYSTEM apache 9 2 nov 13:29 test.txt
>
> $ getfacl.exe test.txt
> # file: test.txt
> # owner: SYSTEM
> # group: apache
> user::rwx
> group::rwx
> group:Administrators:rwx
> group:Gebruikers:r-x
> mask:rwx
> other:---
--
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