Update DOS Attributes patches to better detect whether xattr functions take extra parameters.

This commit is contained in:
Erich E. Hoover 2014-10-05 14:25:02 -06:00
parent e4d758a10b
commit 05fbac8c95
6 changed files with 49 additions and 36 deletions

View File

@ -1,4 +1,4 @@
From 4cb2a0572c67b968247d66e503407b3cf327b4ff Mon Sep 17 00:00:00 2001
From 99abe6c857a1545a92ca416239387747d5affa4f 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,39 +1,52 @@
From 3cf3113adf2a711e7da70462a515e0e11b999bde Mon Sep 17 00:00:00 2001
From 99b76efdda74c2eb093cfa4b9e2a2da1ae0e1932 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
NtQueryInformationFile.
---
configure.ac | 12 ++++++++++
configure.ac | 25 ++++++++++++++++++++
dlls/ntdll/file.c | 30 +++++++++++++++++++++++-
include/wine/port.h | 11 +++++++++
libs/port/Makefile.in | 3 ++-
libs/port/xattr.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 115 insertions(+), 2 deletions(-)
5 files changed, 128 insertions(+), 2 deletions(-)
create mode 100644 libs/port/xattr.c
diff --git a/configure.ac b/configure.ac
index f1f721d..c824cdd 100644
index f1f721d..d9bff03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,2 +77,3 @@ AC_ARG_WITH(tiff, AS_HELP_STRING([--without-tiff],[do not use TIFF]))
AC_ARG_WITH(v4l, AS_HELP_STRING([--without-v4l],[do not use v4l1 (v4l support)]))
+AC_ARG_WITH(xattr, AS_HELP_STRING([--without-xattr],[do not use xattr (security attributes support)]))
AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]),
@@ -667,6 +668,17 @@ AC_CHECK_HEADERS([libprocstat.h],,,
@@ -667,6 +668,30 @@ AC_CHECK_HEADERS([libprocstat.h],,,
#include <sys/socket.h>
#endif])
+if test "x$with_xattr" != "xno"
+then
+ AC_CHECK_HEADERS(attr/xattr.h sys/xattr.h sys/extattr.h ,HAVE_XATTR=1)
+ AC_CHECK_HEADERS(attr/xattr.h sys/xattr.h sys/extattr.h, HAVE_XATTR=1)
+fi
+if test "x$with_xattr" == "xyes"
+then
+ WINE_ERROR_WITH(xattr,[test "x$HAVE_XATTR" = "x"],[xattr ${notice_platform}development files not \
+found. Wine will be built without extended attribute support, which probably isn't what you want. \
+You will need to install ${notice_platform}development packages of libacl at the very least.])
+ WINE_ERROR_WITH(xattr,[test "x$HAVE_XATTR" = "x"],[xattr ${notice_platform}development files \
+not found. Wine will be built without extended attribute support, which probably isn't what you \
+want. You will need to install ${notice_platform}development packages of libacl at the very least.])
+fi
+if test "x$HAVE_XATTR" != "x"
+then
+ AC_CACHE_CHECK([whether xattr functions take additional options],
+ wine_cv_xattr_additional_options,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/xattr.h>]],
+ [[getxattr("", "", "", 0, 0, 0);]])],
+ [wine_cv_xattr_additional_options=yes],
+ [wine_cv_xattr_additional_options=no]))
+ if test "$wine_cv_xattr_additional_options" = "yes"
+ then
+ AC_DEFINE(XATTR_ADDITIONAL_OPTIONS, 1, [Define if xattr takes additional arguments (Mac OS X)])
+ fi
+fi
+
dnl **** Check for working dll ****
@ -128,7 +141,7 @@ index 65f1714..67efbc7 100644
+ xattr.c
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
new file mode 100644
index 0000000..8b64867
index 0000000..70fd047
--- /dev/null
+++ b/libs/port/xattr.c
@@ -0,0 +1,61 @@
@ -181,10 +194,10 @@ index 0000000..8b64867
+int xattr_fget( int filedes, const char *name, void *value, size_t size )
+{
+ if (!xattr_valid_namespace( name )) return -1;
+#if defined(HAVE_ATTR_XATTR_H)
+ return fgetxattr( filedes, name, value, size );
+#elif defined(HAVE_SYS_XATTR_H)
+#if defined(XATTR_ADDITIONAL_OPTIONS)
+ return fgetxattr( filedes, name, value, size, 0, 0 );
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
+ return fgetxattr( filedes, name, value, size );
+#elif defined(HAVE_SYS_EXTATTR_H)
+ return extattr_get_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
+ value, size );

View File

@ -1,4 +1,4 @@
From 7c377afcd99d564b1e59b9d8c1e9abff926cb6b9 Mon Sep 17 00:00:00 2001
From 6dbb49c2ada44eba6d4f77ebb7059e91b435fb73 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
@ -48,7 +48,7 @@ index 715a9e2..7d8ea1a 100644
/* Interlocked functions */
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
index 8b64867..0d77ce3 100644
index 70fd047..ab50758 100644
--- a/libs/port/xattr.c
+++ b/libs/port/xattr.c
@@ -59,3 +59,19 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
@ -59,10 +59,10 @@ index 8b64867..0d77ce3 100644
+int xattr_get( const char *path, const char *name, void *value, size_t size )
+{
+ if (!xattr_valid_namespace( name )) return -1;
+#if defined(HAVE_ATTR_XATTR_H)
+ return getxattr( path, name, value, size );
+#elif defined(HAVE_SYS_XATTR_H)
+#if defined(XATTR_ADDITIONAL_OPTIONS)
+ return getxattr( path, name, value, size, 0, 0 );
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
+ return getxattr( path, name, value, size );
+#elif defined(HAVE_SYS_EXTATTR_H)
+ return extattr_get_file( path, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
+ value, size );

View File

@ -1,4 +1,4 @@
From ce0c947ee0beb91b3f686819f489decb2715b1f4 Mon Sep 17 00:00:00 2001
From 931ab03f342fb65cece5c1fc83b8ef1fee22c1df 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.
@ -142,7 +142,7 @@ index 7d8ea1a..af052da 100644
/* Interlocked functions */
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
index 0d77ce3..2668cf9 100644
index ab50758..61c9f33 100644
--- a/libs/port/xattr.c
+++ b/libs/port/xattr.c
@@ -60,6 +60,37 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
@ -152,10 +152,10 @@ index 0d77ce3..2668cf9 100644
+int xattr_fremove( int filedes, const char *name )
+{
+ if (!xattr_valid_namespace( name )) return -1;
+#if defined(HAVE_ATTR_XATTR_H)
+ return fremovexattr( filedes, name );
+#elif defined(HAVE_SYS_XATTR_H)
+#if defined(XATTR_ADDITIONAL_OPTIONS)
+ return fremovexattr( filedes, name, 0 );
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
+ return fremovexattr( filedes, name );
+#elif defined(HAVE_SYS_EXTATTR_H)
+ return extattr_delete_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN] );
+#else
@ -167,10 +167,10 @@ index 0d77ce3..2668cf9 100644
+int xattr_fset( int filedes, const char *name, void *value, size_t size )
+{
+ if (!xattr_valid_namespace( name )) return -1;
+#if defined(HAVE_ATTR_XATTR_H)
+ return fsetxattr( filedes, name, value, size, 0 );
+#elif defined(HAVE_SYS_XATTR_H)
+#if defined(XATTR_ADDITIONAL_OPTIONS)
+ return fsetxattr( filedes, name, value, size, 0, 0 );
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
+ return fsetxattr( filedes, name, value, size, 0 );
+#elif defined(HAVE_SYS_EXTATTR_H)
+ return extattr_set_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
+ value, size );

View File

@ -1,4 +1,4 @@
From 4452b09a5a97994ff9e8d8acc85c55d932db50e2 Mon Sep 17 00:00:00 2001
From 86638b3b8cdc371ce6381d9ba1ad39e23d7de332 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.
@ -193,7 +193,7 @@ index af052da..f989731 100644
/* Interlocked functions */
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
index 2668cf9..3093ecf 100644
index 61c9f33..09491a4 100644
--- a/libs/port/xattr.c
+++ b/libs/port/xattr.c
@@ -106,3 +106,34 @@ int xattr_get( const char *path, const char *name, void *value, size_t size )
@ -204,10 +204,10 @@ index 2668cf9..3093ecf 100644
+int xattr_remove( const char *path, const char *name )
+{
+ if (!xattr_valid_namespace( name )) return -1;
+#if defined(HAVE_ATTR_XATTR_H)
+ return removexattr( path, name );
+#elif defined(HAVE_SYS_XATTR_H)
+#if defined(XATTR_ADDITIONAL_OPTIONS)
+ return removexattr( path, name, 0 );
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
+ return removexattr( path, name );
+#elif defined(HAVE_SYS_EXTATTR_H)
+ return extattr_delete_file( path, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN] );
+#else
@ -219,10 +219,10 @@ index 2668cf9..3093ecf 100644
+int xattr_set( const char *path, const char *name, void *value, size_t size )
+{
+ if (!xattr_valid_namespace( name )) return -1;
+#if defined(HAVE_ATTR_XATTR_H)
+ return setxattr( path, name, value, size, 0 );
+#elif defined(HAVE_SYS_XATTR_H)
+#if defined(XATTR_ADDITIONAL_OPTIONS)
+ return setxattr( path, name, value, size, 0, 0 );
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
+ return setxattr( path, name, value, size, 0 );
+#elif defined(HAVE_SYS_EXTATTR_H)
+ return extattr_set_file( path, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
+ value, size );

View File

@ -1,4 +1,4 @@
From ccdbe855a2b105e9da88a9408f426329543a78a1 Mon Sep 17 00:00:00 2001
From 6d70e3b84dd0ae01bec2b4c2b27b4c5d046bd385 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