www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/28/08:30:47

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 28 Jul 2008 14:31:14 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: opendir/readdir failure on non-Samba Unix-hosted remote volumess
Message-ID: <20080728123114.GM29031@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <2870 DOT 139 DOT 153 DOT 254 DOT 191 DOT 1217245935 DOT squirrel AT www DOT cs DOT stir DOT ac DOT uk>
MIME-Version: 1.0
In-Reply-To: <2870.139.153.254.191.1217245935.squirrel@www.cs.stir.ac.uk>
User-Agent: Mutt/1.5.16 (2007-06-09)
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 Jul 28 12:52, Sam Nelson wrote:
> Our main fileserver is Solaris running TotalNet Advanced Server (TAS),
> which is `Samba-like, but not Samba' from the Windows PoV at least.  In

Means what?  Samba is recognized by the fact that the file system
returns "NTFS" as file system type, plus a specific set of file system
flags

  fs_flags & ~(FILE_VOLUME_QUOTAS
	       | FILE_SUPPORTS_OBJECT_IDS
	       | FILE_UNICODE_ON_DISK)
  == (FILE_CASE_SENSITIVE_SEARCH
      | FILE_CASE_PRESERVED_NAMES
      | FILE_PERSISTENT_ACLS)

the type or the flags don't match, it's not Samba from Cygwin's POV.
This could be the case for old Samba versions before 3.0 and derived
products.  But read on.

> When I run `strace ls' (the TAS-mounted filesystem is H:\ in this case) I
> get the following (excerpt):
> 
> ----------------------------------------------------------------
> [...]
>   747  153425 [main] ls 1624 geterrno_from_win_error: windows error 50 ==
> errno 88
>   376  153801 [main] ls 1624 fhandler_disk_file::readdir: 88 = readdir
> (0x692AB0, 0x22C6D4) (***)

Unfortunately the strace output in 1.5.x doesn't show us the exact
NT status code which has been returned by NtQueryDirectoryFile.
I *assume* your TAS doesn't support the FileIdBothDirectoryInformation
info class at all and chokes heavily on that for some reason.
Usually, if NtQueryDirectoryFile(FileIdBothDirectoryInformation)
fails with one of three status codes (STATUS_INVALID_LEVEL,
STATUS_INVALID_PARAMETER, STATUS_INVALID_INFO_CLASS), Cygwin falls
back to the good old FileBothDirectoryInformation info class.
This doesn't seem to happen (though I can't be sure from the strace).
Two possible reasons come to mind:

 - The status code returned by TAS is not one of those three
 - The status code returned by TAS is one of those three, but the
   first call with FileIdBothDirectoryInformation has screwed up
   TAS for some reason.

You need to debug this further for a solution.  What you should
do:

- Fetch the source code of a small test application called GetVolInfo
  from http://cygwin.de/GetVolInfo.c
  Build it with `gcc -g -o GetVolInfo GetVolInfo.c -lntdll'
  and run it like this: `./GetVolInfo /cygdrive/h'.  Paste the output
  in a reply to this mail.
  This gives us an idea what TAS returns, fs type and flag-wise.

- Build the latest Cygwin 1.5.25 from source

  http://cygwin.com/faq/faq-nochunks.html#faq.programming.building-cygwin

  and right in front of the comment starting in line 1713 in
  fhandler_disk_file.cc add

    if (!NT_SUCCESS (status))
      debug_printf ("NtQueryDirectoryFile failed, status %p, win32 error %lu",
		    status, RtlNtStatusToDosError (status));
  
  Add the same lines preceeding the closing brace in line 1728.

  Then replace the cygwin1.dll with your own built cygwin1.dll and
  rerun strace like in your mail.

  The idea is to get the exact status codes.

Both of the above actions allow us to find a workaround which might
find its way into the upcoming Cygwin release 1.7.  However, if TAS
is is behaving like really old versions of Samba, I can't promise we
will support it.


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