X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Tue, 30 Oct 2007 11:16:32 +0100 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: "My Documents" directory not listed as writable? Message-ID: <20071030101632.GK20400@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On Oct 30 08:11, John Cooper wrote: > [I'm using Cygwin 1.5.24-2 on Windows XP and Vista] > > Does anyone know why, by default, the "My Documents" directory is not > listed as writable? : > $ ls -ld $USERPROFILE/My\ Documents > dr-x------+ 22 John None 0 Oct 20 18:26 C:\Documents and > Settings\John/My Documents/ > > .. even though it actually is writable: > > $ touch $USERPROFILE/My\ Documents/foo I tried to find the same situation on my machine and what shall I say? I found it in my "$USERPROFILE/My Documents" directory. The ACL of my "My Documents" dir gives me full access, byt Cygwin shows that the directory is not writable. When debugging, I found to my honest surprise that the "My Documents" directory has the good old "Read-Only" DOS attribute set. For as long as I'm working on Cygwin's security stuff, the R/O attribute removes the write bits from the file mode. What happens in stat(2) is basically: read ACL ==> st_mode = 0700 is DOS R/O set ==> st_mode = 0500 Apparently this was never correct for directories(*). Argh! Why did never anybody notice it before?!? Thanks for the report. I'll apply a fix in CVS. For the time being the best workaround for you would be to remove the R/O attribute from your "My Documents" directory: $ attrib "$USERPROFILE\My Documents" Corinna (*) http://msdn2.microsoft.com/en-us/library/aa364944.aspx states: "FILE_ATTRIBUTE_READONLY A file or directory that is read-only. For a file, applications can read the file, but cannot write to it or delete it. For a directory, applications cannot delete it." -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/