www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/28/14:38:14

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 28 Aug 2009 20:37:54 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [1.7] Admins can write to readonly files
Message-ID: <20090828183754.GB27217@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1MgyLg-0CvIW00 AT fwd04 DOT aul DOT t-online DOT de> <4A97B5DB DOT 6010008 AT gmail DOT com> <4A981A80 DOT 2080006 AT t-online DOT de>
MIME-Version: 1.0
In-Reply-To: <4A981A80.2080006@t-online.de>
User-Agent: Mutt/1.5.19 (2009-02-20)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Aug 28 19:57, Christian Franke wrote:
> Dave Korn wrote:
>> Christian Franke wrote:
>>   
>>> For members of Admin group, Cygwin 1.7 allows to overwrite files without
>>> write permission, but Cygwin 1.5 does not.
>>>     
>>
>>   You are the root user, this is Unix.  Of course you can overwrite files
>> without write permission.
>>
>>   
>
> This is not true when 'chmod -w ...' was done before the upgrade to 1.7.
> Cygwin 1.5 sets R/O attribute, then open for write fails with permission  
> denied also on 1.7.

That's why 1.7 tries not to set the R/O DOS attribute anymore.  But yes,
that's not quite consistent.  open(2) should open these files for writing
as well.  Unfortunately this requires to remove the R/O attribute before
trying to open the file for writing.  There's no atomic way to accomplish
this.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019