X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=xfW2ae0J5gt6fsbicYkeQpA6CseJsfl52+Frg/A9UUsS+y7lyTk3n 59vwp0E/MuuP68EkGSO2Awm7E1eKKWfib004lQMwuebk6Y/H1UTghu39sMl/HO8/ cobuuFUUuNH7TEA+hy3yPKjj44ybzjY0KiNAVrbYI24zYL1wPsGfjQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; s=default; bh=DBCHWylVVD6nNO5x300jYR5WfwQ=; b=KYe4RAEgh532tMgtSPKUGANQ6+O4 h8UDNGAaP5QZddyb9b+FML9ONVty9szZspxr4pJuqqysfBFL8CrHPNLqyRaqb3QJ 3xDtadfvATzT6ZR+0r+/EacOlDqtEvjuvsO5SGKgaD1Ho+r+jcDN4Nx+z1JVOW6G YeSReOGPIk+iVvc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 To: cygwin AT cygwin DOT com From: "D. Boland" Subject: Re: vi stealing SYSTEM-owned permissions and ownership Date: Tue, 05 Nov 2013 06:49:54 +0100 Lines: 92 Message-ID: <52788702.B100AA7A@boland.nl> References: <5274F396 DOT A133C4CE AT boland DOT nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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