Update DOS Attribute patches with latest submitted version.

This commit is contained in:
Erich E. Hoover 2014-10-13 13:54:53 -06:00
parent b757d6fe5c
commit 71db25dc7d
8 changed files with 34 additions and 41 deletions

View File

@ -1,4 +1,4 @@
From 99abe6c857a1545a92ca416239387747d5affa4f Mon Sep 17 00:00:00 2001
From 01aeace03a70da092579a341399296c562f7ae42 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 19 Aug 2014 20:31:00 -0600
Subject: ntdll: Unify retrieving the attributes of a file.

View File

@ -1,4 +1,4 @@
From 6d3f985054009a9030276bc6fa7ff9cd6ee3bf29 Mon Sep 17 00:00:00 2001
From 6a744d7489e7bc7047c2c7235e5dc91d938bf927 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 19 Aug 2014 22:10:49 -0600
Subject: ntdll: Implement retrieving DOS attributes in
@ -6,15 +6,15 @@ Subject: ntdll: Implement retrieving DOS attributes in
---
configure.ac | 12 ++++++++++++
dlls/ntdll/file.c | 30 +++++++++++++++++++++++++++++-
dlls/ntdll/file.c | 23 ++++++++++++++++++++++-
include/wine/port.h | 8 ++++++++
libs/port/Makefile.in | 3 ++-
libs/port/xattr.c | 39 +++++++++++++++++++++++++++++++++++++++
5 files changed, 90 insertions(+), 2 deletions(-)
5 files changed, 83 insertions(+), 2 deletions(-)
create mode 100644 libs/port/xattr.c
diff --git a/configure.ac b/configure.ac
index f1f721d..fe06575 100644
index 240ce29..fd760e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,2 +77,3 @@ AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF]))
@ -40,21 +40,14 @@ index f1f721d..fe06575 100644
AC_SUBST(dlldir,"\${libdir}/wine")
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 53cce85..83eaeba 100644
index 53cce85..e258ca1 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -103,6 +103,29 @@ mode_t FILE_umask = 0;
@@ -103,6 +103,22 @@ mode_t FILE_umask = 0;
static const WCHAR ntfsW[] = {'N','T','F','S'};
+/* Match the conventions as Samba 3 for storing DOS file attributes;
+ * see {get,set}_ea_dos_attribute() in http://gitweb.samba.org/?p=samba.git;a=blob;f=source3/smbd/dosmode.c
+ * In particular, encode FILE_ATTRIBUTE_* as the string 0x followed by one or two hexadecimal digits.
+ * Differences from Samba 3:
+ * Wine currently only stores hidden and system in xattrs;
+ * Samba 3 also seems to store the readonly and directory bits.
+ * Samba 4 additionally supports NT security descriptors with a different xattr
+ */
+/* Match the Samba conventions for storing DOS file attributes */
+#define SAMBA_XATTR_DOS_ATTRIB XATTR_USER_PREFIX "DOSATTRIB"
+/* We are only interested in some attributes, the others have corresponding Unix attributes */
+#define XATTR_ATTRIBS_MASK (FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM)
@ -73,7 +66,7 @@ index 53cce85..83eaeba 100644
/* fetch the attributes of a file */
static inline ULONG get_file_attributes( const struct stat *st )
{
@@ -120,13 +143,18 @@ static inline ULONG get_file_attributes( const struct stat *st )
@@ -120,13 +136,18 @@ static inline ULONG get_file_attributes( const struct stat *st )
/* get the stat info and file attributes for a file (by file descriptor) */
int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
{

View File

@ -1,4 +1,4 @@
From 5b894c0d08fec1e1a1fd902703213cf783de196f Mon Sep 17 00:00:00 2001
From 687be4357bfb0143f0cade40fa4bb8f483e5c312 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 16:04:34 -0600
Subject: ntdll: Implement retrieving DOS attributes in
@ -11,10 +11,10 @@ Subject: ntdll: Implement retrieving DOS attributes in
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 83eaeba..73a2789 100644
index e258ca1..fbfe882 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -161,7 +161,8 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
@@ -154,7 +154,8 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
/* get the stat info and file attributes for a file (by name) */
int get_file_info( const char *path, struct stat *st, ULONG *attr )
{
@ -24,7 +24,7 @@ index 83eaeba..73a2789 100644
*attr = 0;
/* stat the file and don't follow symbol links */
@@ -177,6 +178,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
@@ -170,6 +171,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
}
/* convert the Unix stat info into file attributes */
*attr |= get_file_attributes( st );

View File

@ -1,4 +1,4 @@
From 52e1d7d25db39c1bd748c8994a33c6d0e5664997 Mon Sep 17 00:00:00 2001
From 764394b265187417d1123b975f05f955c461b774 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 00:08:52 -0600
Subject: ntdll: Implement storing DOS attributes in NtSetInformationFile.
@ -11,10 +11,10 @@ Subject: ntdll: Implement storing DOS attributes in NtSetInformationFile.
4 files changed, 59 insertions(+), 24 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 73a2789..4619058 100644
index fbfe882..635a316 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -158,6 +158,38 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
@@ -151,6 +151,38 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
return ret;
}
@ -53,7 +53,7 @@ index 73a2789..4619058 100644
/* get the stat info and file attributes for a file (by name) */
int get_file_info( const char *path, struct stat *st, ULONG *attr )
{
@@ -2333,7 +2365,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
@@ -2326,7 +2358,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
case FileBasicInformation:
if (len >= sizeof(FILE_BASIC_INFORMATION))
{
@ -61,7 +61,7 @@ index 73a2789..4619058 100644
const FILE_BASIC_INFORMATION *info = ptr;
if ((io->u.Status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL )))
@@ -2343,25 +2374,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
@@ -2336,25 +2367,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
io->u.Status = set_file_times( fd, &info->LastWriteTime, &info->LastAccessTime );
if (io->u.Status == STATUS_SUCCESS && info->FileAttributes)

View File

@ -1,4 +1,4 @@
From 1a4daa5330fd749be070bcd9be85f57fae1b6a15 Mon Sep 17 00:00:00 2001
From 60887da43c880bb75169b394b5d3ecedd44278aa Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 15:28:00 -0600
Subject: ntdll: Implement storing DOS attributes in NtCreateFile.
@ -11,10 +11,10 @@ Subject: ntdll: Implement storing DOS attributes in NtCreateFile.
4 files changed, 80 insertions(+), 43 deletions(-)
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 4619058..7582ff1 100644
index 635a316..4f4dddb 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -217,6 +217,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
@@ -210,6 +210,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
return ret;
}
@ -36,7 +36,7 @@ index 4619058..7582ff1 100644
/**************************************************************************
* FILE_CreateFile (internal)
* Open a file.
@@ -228,6 +243,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
@@ -221,6 +236,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
ULONG attributes, ULONG sharing, ULONG disposition,
ULONG options, PVOID ea_buffer, ULONG ea_length )
{
@ -45,7 +45,7 @@ index 4619058..7582ff1 100644
ANSI_STRING unix_name;
BOOL created = FALSE;
@@ -271,39 +288,37 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
@@ -264,39 +281,37 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
io->u.Status = STATUS_SUCCESS;
}
@ -112,7 +112,7 @@ index 4619058..7582ff1 100644
if (io->u.Status == STATUS_SUCCESS)
{
@@ -325,6 +340,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
@@ -318,6 +333,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
io->Information = FILE_OVERWRITTEN;
break;
}
@ -124,7 +124,7 @@ index 4619058..7582ff1 100644
}
else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES)
{
@@ -332,6 +352,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
@@ -325,6 +345,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" );
}

View File

@ -1,4 +1,4 @@
From 6dc0676e0cb53e392207fbbd4d0465399456804f Mon Sep 17 00:00:00 2001
From a9e7952601fa6bbe52cb9c01ef48f5f90c67109d Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Mon, 6 Oct 2014 14:21:11 -0600
Subject: libport: Add support for Mac OS X style extended attributes.
@ -9,7 +9,7 @@ Subject: libport: Add support for Mac OS X style extended attributes.
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index fe06575..e6d8d94 100644
index fd760e3..d691c73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -671,6 +671,9 @@ AC_CHECK_HEADERS([libprocstat.h],,,

View File

@ -1,4 +1,4 @@
From 1d57df0cf9dfaaa4ef8e28b4e3a35c9b3145acdb Mon Sep 17 00:00:00 2001
From 314ee71bd95c3561bb71f6ef6f8d214c2e4e5394 Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Mon, 6 Oct 2014 14:26:24 -0600
Subject: libport: Add support for FreeBSD style extended attributes.
@ -9,7 +9,7 @@ Subject: libport: Add support for FreeBSD style extended attributes.
2 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index e6d8d94..08c2011 100644
index d691c73..7500350 100644
--- a/configure.ac
+++ b/configure.ac
@@ -670,7 +670,7 @@ AC_CHECK_HEADERS([libprocstat.h],,,

View File

@ -1,4 +1,4 @@
From ed60b546ccfbb8f7640b330aee7c080052ab53a8 Mon Sep 17 00:00:00 2001
From f60e37ead65a6eb67377037aea3dfc991406983e Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Wed, 20 Aug 2014 11:26:48 -0600
Subject: ntdll: Perform the Unix-style hidden file check within the unified
@ -48,10 +48,10 @@ index 9b10385..a85c5e1 100644
if (io->Information + total_len > max_length)
{
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 7582ff1..216d9c9 100644
index 4f4dddb..b694beb 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -210,6 +210,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
@@ -203,6 +203,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
}
/* convert the Unix stat info into file attributes */
*attr |= get_file_attributes( st );
@ -61,7 +61,7 @@ index 7582ff1..216d9c9 100644
/* retrieve any stored DOS attributes */
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
if (len == -1) return ret;
@@ -2579,8 +2582,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
@@ -2572,8 +2575,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
info->AllocationSize = std.AllocationSize;
info->EndOfFile = std.EndOfFile;
info->FileAttributes = basic.FileAttributes;
@ -70,7 +70,7 @@ index 7582ff1..216d9c9 100644
}
RtlFreeAnsiString( &unix_name );
}
@@ -2608,11 +2609,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
@@ -2601,11 +2602,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
else if (!S_ISREG(st.st_mode) && !S_ISDIR(st.st_mode))
status = STATUS_INVALID_INFO_CLASS;
else