This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: regarding a problem that you know how to fix


On 22 April 2006 16:17, Dave Korn wrote:

> On 22 April 2006 15:40, Robert J. Cristel wrote:

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

  I need to clarify the exact problem here, I could have been more accurate
first time round.  Sorry.

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

  Sorry, I was too vague here.  In fact, the condition is 

http://www.opengroup.org/onlinepubs/009695399/functions/utime.html

" The effective user ID of the process shall match the owner of the file, or
the process has write permission to the file or has appropriate privileges, to
use utime() in this manner. "

  So, saying "the relevant unix perms" was wrong, because the "relevant" unix
perm is write permission, and this is a read-only file in all cases.  The
/actual/ difference between POSIX utime and MSVCRT utime is that first
condition: if you own a file, you can utime it, regardless of the write perms,
and that's the extra condition that MSVCRT doesn't implement but would need
to.

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

  Or as another option, you could patch the mingw version of tar to
temporarily chmod+w the file when it needs to utime it, then restore the
original perms.


    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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]