delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/01/09:27:11

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 1 Mar 2010 15:26:58 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Directory named "." created at /: seems to have happened during update
Message-ID: <20100301142658.GZ5683@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4B8BA03F DOT 9090402 AT bonhard DOT uklinux DOT net> <20100301113255 DOT GU5683 AT calimero DOT vinschen DOT de> <20100301120520 DOT GV5683 AT calimero DOT vinschen DOT de> <20100301121148 DOT GW5683 AT calimero DOT vinschen DOT de> <20100301130528 DOT GY5683 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20100301130528.GY5683@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
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 Mar  1 14:05, Corinna Vinschen wrote:
> On Mar  1 13:11, Corinna Vinschen wrote:
> > On Mar  1 13:05, Corinna Vinschen wrote:
> > > On Mar  1 12:32, Corinna Vinschen wrote:
> > > > On Mar  1 11:08, Fergus wrote:
> > > > > My Cygwin [1.7] is located at the root of a mobile hard drive and a
> > > > > simple DOS dir command now shows a directory named . as in
> > > > > [...]
> > > > 
> > > > Oh boy.  I didn't even know that NT allows that.
> > > > 
> > > > That's two bugs in one.  The lilypond package has paths with leading
> > > > "./" in it, and setup.exe does not recognize that and remove the dot
> > > > path.
> > > > 
> > > > For now I have removed the latest lilypond package from the distro.
> > > > Jan, can you please fix your package not to have leading ./ in the path?
> > > > 
> > > > As for setup.exe, I have to have a look how to avoid that.
> > > 
> > > The problem is, I can't reproduce it.  I created two test packages,
> > > one with a file "./file" in it, the other with a file "tmp/./file".
> > > In both cases, setup.exe failed to create the file and showed a
> > > message "unable to extract ...".
> > > 
> > > This was on Windows 7.  What Windows are you using?  Maybe an older
> > > version allows it.  Unless I can create the "." directory myself,
> > > I can't fix it.
> > 
> > On Windows XP I can't reproduce it either.  Hmm.
> 
> Are you sure the directory name is really "."?  Could you please have
> a look if the directory isn't called ". " with one or more trailing
> spaces?  Creating such directories is no problem and removing isn't
> a problem either:
> 
>   $ rmdir ". "

And, just for completeness, I tested to create a file and a directory
with the name ".", using the native NT function NtCreateFile(*), as
setup and Cygwin do.  Both tests resulted in the status code 0xC0000033,
STATUS_OBJECT_NAME_INVALID.  So I'm pretty sure the name of the
directory is not ".".  Alternatively, you have some software running
which installs a filesystem filter driver, and that filter driver
overrides or skips these sanity checks in the OS.


Corinna


(*)
==== SNIP ====
#include <windows.h>
#include <ntsecapi.h>
#include <ddk/ntifs.h>
#include <ddk/winddk.h>
#include <stdio.h>

#define FNAME L"\\??\\C:\\cygwin\\tmp\\dot\\."

int
main (int argc, char **argv)
{
  UNICODE_STRING fname;
  OBJECT_ATTRIBUTES attr;
  NTSTATUS stat;
  HANDLE fh;
  IO_STATUS_BLOCK io;

  printf ("Full NT path: %ls\n", FNAME);
  RtlInitUnicodeString (&fname, FNAME);
  InitializeObjectAttributes (&attr, &fname, OBJ_CASE_INSENSITIVE, NULL, NULL);
  stat = NtCreateFile (&fh, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
		       &attr, &io, NULL, 0, FILE_SHARE_VALID_FLAGS,
		       FILE_CREATE,
#if 0
		       FILE_DIRECTORY_FILE |
#else
		       FILE_NON_DIRECTORY_FILE |
#endif
		       FILE_SYNCHRONOUS_IO_NONALERT,
		       NULL, 0);
  if (!NT_SUCCESS (stat)) {
    printf ("Unable to create %ls, status = 0x%08X\n", FNAME, stat);
    return 1;
  }
  NtClose(fh);
  NtDeleteFile (&attr);
  return 0;
}
==== SNAP ====

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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