delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/22/11:17:30

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: regarding a problem that you know how to fix
Date: Sat, 22 Apr 2006 16:17:18 +0100
Message-ID: <02f201c6661f$d88aeb40$a501a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <444A402A.7020506@sympatico.ca>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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 22 April 2006 15:40, Robert J. Cristel wrote:

> Hello Corinna,

  I'm not Corinna! 

> mingw-install-20060210
> is experiencing a problem
> "tar: ssl/man/man1/md2.1.lnk: Cannot
> utime: Permission denied"
> with win98 that you solved a while back
> http://www.cygwin.com/ml/cygwin/2002-05/msg00901.html
> 
> We would like to apply the same medicine
> that you found.  What would you suggest?
> 
> -Robert J. Cristel
> Montreal, Canada

  My suggestion: check the ChangeLog around that date, then look in the cvs
history to find the patches, then see how they worked.  Let's see:

2002-05-17  Corinna Vinschen  

	* times.cc (utimes): Use FILE_WRITE_ATTRIBUTES even on 9x/Me when
	opening file for writing timestamp.
	* wincap.cc: Remove flag has_specific_access_rights.
	* wincap.h: Ditto.

  Looks like the patch you're looking for.  Probably all you need to do is
modify the mingw utimes implementation in the same way?  Let's see...

http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/times.cc?cvsroot=src

  Uhuh.  It's rev. 1.32.  Let's take a look at it:

http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/times.cc.diff?r1=1.31&r
2=1.32&cvsroot=src

===================================================================
RCS file: /cvs/src/src/winsup/cygwin/times.cc,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- src/winsup/cygwin/times.cc	2002/05/12 01:50:38	1.31
+++ src/winsup/cygwin/times.cc	2002/05/17 08:32:29	1.32
@@ -440,12 +440,11 @@
     }
 
   /* MSDN suggests using FILE_FLAG_BACKUP_SEMANTICS for accessing
-     the times of directories.  FIXME: what about Win95??? */
+     the times of directories.  */
   /* Note: It's not documented in MSDN that FILE_WRITE_ATTRIBUTES is
      sufficient to change the timestamps... */
   HANDLE h = CreateFileA (win32.get_win32 (),
-			  wincap.has_specific_access_rights () ?
-			  FILE_WRITE_ATTRIBUTES : GENERIC_WRITE,
+			  FILE_WRITE_ATTRIBUTES,
 			  FILE_SHARE_READ | FILE_SHARE_WRITE,
 			  &sec_none_nih,
 			  OPEN_EXISTING,

  Right, so the answer is you need to open the file with write perms if you
want to change the timestamp.

  Ah, it seems mingw doesn't provide it's own utime implementation but relies
on the one in msvcrt, which is documented to return:-

" EACCES
Path specifies directory or read-only file "

which is a problem; tar expects utime to behave in a POSIX compliant way, and
to be able to set the timestamp if the relevant unix perms exist.  I don't use
mingw so I'm not sure, but wouldn't running tar under MSYS provide it with the
sort of POSIX-alike environment it needs?  Otherwise perhaps it's possible to
re-implement utime as a wrapper in the mingw runtime library?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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

- Raw text -


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