delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/04/02/16:50:28

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <424F1265.3080508@joesbox.cjb.net>
Date: Sat, 02 Apr 2005 16:45:09 -0500
From: Josef Drexler <nospam0405 AT joesbox DOT cjb DOT net>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: cygwin 1.5.12 & 1.5.13 break utime() on Windows 98
X-IsSubscribed: yes

Hi,

[Note, when replying personally to me instead of the list, *don't* 
remove the nospam part in my addy, it's valid as-is.]

I just upgraded to cygwin 1.5.13, and since I did so, the utime() system 
call stopped working on my Windows 98 system.  It returns a "permission 
denied" error when it should succeed instead.  Prior to 1.5.12 it was 
working fine.  It also still works fine using the -mno-cygwin option to 
gcc to bypass cygwin.

The only related questions to this I've found using Google or searching 
the mailing list archives relate to NT permissions, which don't apply on 
Windows 98.  As a result, setting nontea or nontsec in CYGWIN makes no 
difference.  The drive in question in a FAT32 partition mounted as 
/cygdrive/d, but the problem occurs for the / partition as well as SMB 
mounted drives as well.

The following test file reproduces the bug (test.c)
---8<---
#include <stdlib.h>
#include <errno.h>
#include <utime.h>
int main() {
   struct utimbuf x;
   x.actime = time(NULL) + 600;
   x.modtime= time(NULL) + 1200;
   int ret = utime("foo", &x);
   printf("ret = %d, foo: %s\n", ret, strerror(errno));
   return 0;
}
---8<---

Using 1.5.12 or 1.5.13:

BASH-2.05b$ gcc -o test test.c
BASH-2.05b$ ls -l foo
ls: foo: No such file or directory
BASH-2.05b$ ./test
ret = -1, foo: No such file or directory
BASH-2.05b$ echo > foo
BASH-2.05b$ ./test
ret = -1, foo: Permission denied
BASH-2.05b$ gcc -o test test.c -mno-cygwin
BASH-2.05b$ ./test
ret = 0, foo: No error
BASH-2.05b$

The first error is expected and correct since `foo' doesn't exist at 
first.  The second error is new in 1.5.12 and is wrong.  I do have 
permission to do anything to `foo', as evidenced by the fact that I 
could create and write to it using `echo'.

The same sequence using 1.5.11:

BASH-2.05b$ gcc -o test test.c
BASH-2.05b$ ls -l foo
ls: foo: No such file or directory
BASH-2.05b$ ./test
ret = -1, foo: No such file or directory
BASH-2.05b$ echo > foo
BASH-2.05b$ ./test
ret = 0, foo: No error
BASH-2.05b$ gcc -o test test.c -mno-cygwin
BASH-2.05b$ ./test
ret = 0, foo: No error
BASH-2.05b$

Again, the first error is expected and correct.  Note how the second 
command returns "No error" as it should, but doesn't, in 1.5.12&13.

In both cases, -mno-cygwin gives the expected behaviour too, so I can 
only conclude that this must be a bug in cygwin itself.

For reference, the output of cygcheck -s -v -r -h for both versions can 
be found here:
http://joesbox.cjb.net/~jdrexler/cygcheck-1.5.11.txt
http://joesbox.cjb.net/~jdrexler/cygcheck-1.5.13.txt

Any clues?

-- 
    Josef Drexler                 |       http://jdrexler.com/home/
---------------------------------+----------------------------------------
  Please help Conserve Gravity    |  Email address is *valid*.
  Use tape&glue, no paperweights  |  Don't remove the "nospam" part.

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