From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19337 invoked by alias); 5 Nov 2013 05:54:48 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 19324 invoked by uid 89); 5 Nov 2013 05:54:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: plane.gmane.org Received: from Unknown (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 05 Nov 2013 05:54:46 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VdZb2-000137-0v for cygwin@cygwin.com; Tue, 05 Nov 2013 06:54:36 +0100 Received: from boland.xs4all.nl ([213.84.69.3]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Nov 2013 06:54:36 +0100 Received: from daniel by boland.xs4all.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 05 Nov 2013 06:54:36 +0100 To: cygwin@cygwin.com From: "D. Boland" Subject: Re: vi stealing SYSTEM-owned permissions and ownership Date: Tue, 05 Nov 2013 05:54:00 -0000 Message-ID: <52788702.B100AA7A@boland.nl> References: <5274F396.A133C4CE@boland.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00125.txt.bz2 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