public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Another call for filesystem testing
@ 2011-12-09 20:36 Corinna Vinschen
  2011-12-09 20:50 ` David Rothenberger
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Corinna Vinschen @ 2011-12-09 20:36 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2298 bytes --]

Hi guys,


I have a well-known problem.  I just don't have all filesystems
available for testing.  What I need are testers for a certain, very
simple functionality on any filesystem you can get hold of.

I tested it locally on NTFS and FAT, as well as CDFS, as well as on 3.x
Samba and via NFS.  I tested from W2K, W2K3 and W7.  I would be very
interested to learn if this functionality is supported by other
filesystems as well.

Testing is simple.  Attached you'll find the source code of a very
simple testcase which calls certain native NT functions.  For ease of
use, the application allows to enter a Cygwin POSIX path and converts
that to native NT notation by itself.

You have access to AFS, MVFS, NWFS, NcFsd, Netapp, UDF, UNIXFS, SUNWNFS,
any CIFS or old Samba versions?  Please test!  Also, if you try it on
local or remote NTFS or FAT filesystems and it fails, I'd like to see
the results.

For testing, run the application twice per filesystem, one time for a
directory, one time for a file.  Also, please report your OS version per
the output of `uname -s'.  It's possible that different OSes show
different results.

So, here's how you do it.  Build it like this:

  $ gcc -o test-qfif test-qfif.c -lntdll

Then test for existing local dir and file:

  $ uname -s
  CYGWIN_NT-x.x
  $ /usr/lib/csih/getVolInfo //server/share
  Device Type        : 7
  Characteristics    : 20
  [...etc...]
  $ ./test-qfif /cygdrive/d/dir /cygdrive/d/dir/file
  NtQueryFullAttributesFile(\??\D:\dir) by name works
  NtQueryFullAttributesFile(\??\D:\dir) by handle works
  NtQueryFullAttributesFile(\??\D:\dir\file) by name works
  NtQueryFullAttributesFile(\??\D:\dir\file) by handle works

Or for a share (with example for a failure):

  $ uname -s
  CYGWIN_NT-x.x
  $ /usr/lib/csih/getVolInfo //server/share
  [...]
  $ ./test-qfif //server/share //server/share/file
  NtQueryFullAttributesFile(\??\D:\dir) by name works
  NtQueryFullAttributesFile(\??\D:\dir) by handle fails, status code 0xc000000d
  NtQueryFullAttributesFile(\??\D:\dir\file) by name works
  NtQueryFullAttributesFile(\??\D:\dir\file) by handle works


Thanks for your help,
Corinna

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

[-- Attachment #2: test-qfif.c --]
[-- Type: text/plain, Size: 2022 bytes --]

#include <stdio.h>
#include <string.h>
#include <wchar.h>
#include <errno.h>
#include <locale.h>
#include <windows.h>
#include <ddk/ntifs.h>
#include <sys/cygwin.h>

int
main (int argc, char **argv)
{
  WCHAR pathbuf[1024]; /* Should be big enough for this test */
  WCHAR *path;
  UNICODE_STRING upath;
  OBJECT_ATTRIBUTES attr, attr2;
  NTSTATUS status;
  HANDLE h;
  IO_STATUS_BLOCK io;
  FILE_NETWORK_OPEN_INFORMATION fnoi;

  if (argc < 2)
    {
      fprintf (stderr, "Usage: %s path\n", argv[0]);
      return 1;
    }
  setlocale (LC_ALL, "");
  while (--argc > 0)
    {
      if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, *++argv, pathbuf + 6,
			1024 * sizeof (WCHAR)))
	{
	  fprintf (stderr, "%s: Path conversion failed: %s\n",
		   strerror (errno));
	  continue;
	}
      if (pathbuf[6] == L'\\' && pathbuf[7] == L'\\')
	path = wcsncpy (pathbuf, L"\\??\\UNC", 7);
      else
	path = wcsncpy (pathbuf + 2, L"\\??\\", 4);

      RtlInitUnicodeString (&upath, path);
      InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE,
				  NULL, NULL);
      status = NtQueryFullAttributesFile (&attr, &fnoi);
      if (!NT_SUCCESS (status))
	printf ("NtQueryFullAttributesFile(%ls) by name failed,\n"
		"status code 0x%08lx\n", path, status);
      else
	printf ("NtQueryFullAttributesFile(%ls) by name works\n", path);

      status = NtOpenFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES, &attr, &io,
			   FILE_SHARE_VALID_FLAGS, 0);
      if (!NT_SUCCESS (status))
	{
	  fprintf (stderr, "NtOpenFile(%ls) failed, status code 0x%08lx\n",
		   path, status);
	  continue;
	}

      RtlInitUnicodeString (&upath, L"");
      InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE, h, NULL);
      status = NtQueryFullAttributesFile (&attr, &fnoi);
      if (!NT_SUCCESS (status))
	printf ("NtQueryFullAttributesFile(%ls) by handle failed,\n"
		"status code 0x%08lx\n", path, status);
      else
	printf ("NtQueryFullAttributesFile(%ls) by handle works\n", path);
      NtClose (h);
    }
  return 0;
}


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Another call for filesystem testing
@ 2011-12-12  9:57 Fergus
  2011-12-12 11:09 ` Corinna Vinschen
  0 siblings, 1 reply; 11+ messages in thread
From: Fergus @ 2011-12-12  9:57 UTC (permalink / raw)
  To: Cygwin ML; +Cc: Fergus

XP Pro SP3

I get the following failure whether I use the current cygwin1.dll
CYGWIN_NT-5.1 lunatick 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin
or today's test cygwin1.dll
CYGWIN_NT-5.1 lunatick 1.7.10s(0.255/5/3) 20111212 01:22:59 i686 Cygwin
(as not certain what you were asking).

Assume unimportant, but I have
~> mount -m
none / cygdrive binary,user 0 0
so /cygdrive/q/ shorthands to /q/.

Just checking, where Q: is FAT32

~> ./test-qfif.exe /q/wrk
NtQueryFullAttributesFile(\??\Q:\wrk) by name works
NtQueryFullAttributesFile(\??\Q:\wrk) by handle works
~> ./test-qfif.exe /q/wrk/Wording.txt
NtQueryFullAttributesFile(\??\Q:\wrk\Wording.txt) by name works
NtQueryFullAttributesFile(\??\Q:\wrk\Wording.txt) by handle works

all ok, as expected. BUT

X: is ext2, made accessible to Windows using the software at 
http://www.fs-driver.org/. There is a failure as follows:

~> ./test-qfif.exe /x/wrk
NtQueryFullAttributesFile(\??\X:\wrk) by name works
NtQueryFullAttributesFile(\??\X:\wrk) by handle works
~> ./test-qfif.exe /x/wrk/Wording.txt
NtQueryFullAttributesFile(\??\X:\wrk\Wording.txt) by name works
NtQueryFullAttributesFile(\??\X:\wrk\Wording.txt) by handle failed,
status code 0xc000003a

Fergus



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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Another call for filesystem testing
@ 2011-12-12 15:30 Fergus
  0 siblings, 0 replies; 11+ messages in thread
From: Fergus @ 2011-12-12 15:30 UTC (permalink / raw)
  To: Cygwin ML; +Cc: Fergus

 > Btw., can you please provide the output from
 > /usr/lib/csih/getVolInfo /x/wrk
 > I never saw the volume information returned by this ext2 driver yet.

~> /usr/lib/csih/getVolInfo.exe /x/wrk
Device Type        : 7
Characteristics    : 20
Volume Name        : <>
Serial Number      : 2548180820
Max Filenamelength : 255
Filesystemname     : <Ext2>
Flags              : 7
   FILE_CASE_SENSITIVE_SEARCH  : TRUE
   FILE_CASE_PRESERVED_NAMES   : TRUE
   FILE_UNICODE_ON_DISK        : TRUE
   FILE_PERSISTENT_ACLS        : FALSE
   FILE_FILE_COMPRESSION       : FALSE
   FILE_VOLUME_QUOTAS          : FALSE
   FILE_SUPPORTS_SPARSE_FILES  : FALSE
   FILE_SUPPORTS_REPARSE_POINTS: FALSE
   FILE_SUPPORTS_REMOTE_STORAGE: FALSE
   FILE_VOLUME_IS_COMPRESSED   : FALSE
   FILE_SUPPORTS_OBJECT_IDS    : FALSE
   FILE_SUPPORTS_ENCRYPTION    : FALSE
   FILE_NAMED_STREAMS          : FALSE
   FILE_READ_ONLY_VOLUME       : FALSE
   FILE_SEQUENTIAL_WRITE_ONCE  : FALSE
   FILE_SUPPORTS_TRANSACTIONS  : FALSE
~>


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-12-13 11:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-09 20:36 Another call for filesystem testing Corinna Vinschen
2011-12-09 20:50 ` David Rothenberger
2011-12-12  5:56 ` Heiko Elger
2011-12-12  9:09   ` Corinna Vinschen
2011-12-12 13:03 ` Franz Sirl
2011-12-12 13:20   ` Corinna Vinschen
2011-12-12 19:43 ` Charles Wilson
2011-12-13 11:43   ` Corinna Vinschen
2011-12-12  9:57 Fergus
2011-12-12 11:09 ` Corinna Vinschen
2011-12-12 15:30 Fergus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).