public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "D. Boland" <daniel@boland.nl>
To: cygwin@cygwin.com
Subject: Re: vi stealing SYSTEM-owned permissions and ownership
Date: Tue, 05 Nov 2013 05:54:00 -0000	[thread overview]
Message-ID: <52788702.B100AA7A@boland.nl> (raw)
In-Reply-To: <5274F396.A133C4CE@boland.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

  parent reply	other threads:[~2013-11-05  5:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-02 12:55 D. Boland
2013-11-02 13:36 ` Brian S. Wilson
2013-11-02 18:42   ` Andrey Repin
2013-11-02 21:58   ` D. Boland
2013-11-02 22:35     ` Andrey Repin
2013-11-03 18:47       ` D. Boland
2013-11-03 22:05         ` Andrey Repin
2013-11-04 11:23         ` Brian S. Wilson
2013-11-04 14:54           ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2013-11-04 17:05             ` Larry Hall (Cygwin)
2013-11-05  5:54 ` D. Boland [this message]
2013-11-05 17:38   ` Achim Gratz
2013-11-08 14:25     ` D. Boland
2013-11-08 15:59       ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
2013-11-08 20:20       ` Andrey Repin
2013-11-27 18:11   ` D. Boland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52788702.B100AA7A@boland.nl \
    --to=daniel@boland.nl \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).