delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/24/10:57:51

X-Spam-Check-By: sourceware.org
Date: Fri, 24 Aug 2007 16:56:30 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: cygwin1.dll bug in open(O_EXCL)
Message-ID: <20070824145630.GT23854@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <46CEDC45 DOT 7070704 AT byu DOT net>
Mime-Version: 1.0
In-Reply-To: <46CEDC45.7070704@byu.net>
User-Agent: Mutt/1.4.2.2i
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 24 07:25, Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> I finally found root cause for the tar issue reported here:
> http://cygwin.com/ml/cygwin/2007-08/msg00553.html
> 
> $ cat foo.c
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <errno.h>
> #include <string.h>
> #include <fcntl.h>
> 
> int main(int argc, char**argv)
> {
>   int fd;
>   symlink ("oops", "broken");
>   fd = open ("broken", O_WRONLY|O_CREAT|O_EXCL, 0600);
>   printf ("fd=%d, errno=%d: %s\n", fd, errno, strerror (errno));
>   return 0;
> }
> $ ./foo
> fd=3, errno=0: No error
> $ ls -F oops broken
> broken@  oops
> 
> According to POSIX, this should have failed with EEXIST, and oops should
> not have been created.

If I understand this right, it means that O_EXCL implies not following
symlinks.  I've applied a matching patch to CVS.  Please give it a try.


Thanks,
Corinna

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

- Raw text -


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