mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Update DOS Attributes patches to use ENOSYS and 'turn hexattr up to 11'.
This commit is contained in:
parent
f6749f92de
commit
72b64cb4f2
@ -1,15 +1,15 @@
|
||||
From 22ab27f48e94682fcca15fb7a3b79ff6764830d6 Mon Sep 17 00:00:00 2001
|
||||
From f94504464e6c2ec7a2071912536ca444c38c6996 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 ++++++++++++
|
||||
dlls/ntdll/file.c | 23 ++++++++++++++++++++++-
|
||||
dlls/ntdll/file.c | 22 +++++++++++++++++++++-
|
||||
include/wine/port.h | 8 ++++++++
|
||||
libs/port/Makefile.in | 3 ++-
|
||||
libs/port/xattr.c | 39 +++++++++++++++++++++++++++++++++++++++
|
||||
5 files changed, 83 insertions(+), 2 deletions(-)
|
||||
5 files changed, 82 insertions(+), 2 deletions(-)
|
||||
create mode 100644 libs/port/xattr.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
@ -39,7 +39,7 @@ index 2fa4dcc..3c91af3 100644
|
||||
|
||||
AC_SUBST(dlldir,"\${libdir}/wine")
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index b856b3d..c775664 100644
|
||||
index b856b3d..83d07e2 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -103,6 +103,22 @@ mode_t FILE_umask = 0;
|
||||
@ -65,19 +65,18 @@ index b856b3d..c775664 100644
|
||||
/* fetch the attributes of a file */
|
||||
static inline ULONG get_file_attributes( const struct stat *st )
|
||||
{
|
||||
@@ -120,12 +136,17 @@ static inline ULONG get_file_attributes( const struct stat *st )
|
||||
@@ -120,12 +136,16 @@ 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 )
|
||||
{
|
||||
- int ret;
|
||||
+ char hexattr[10];
|
||||
+ char hexattr[11];
|
||||
+ int len, ret;
|
||||
|
||||
*attr = 0;
|
||||
ret = fstat( fd, st );
|
||||
if (ret == -1) return ret;
|
||||
*attr |= get_file_attributes( st );
|
||||
+ /* retrieve any stored DOS attributes */
|
||||
+ len = xattr_fget( fd, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
|
||||
+ if (len == -1) return ret;
|
||||
+ *attr |= get_file_xattr( hexattr, len );
|
||||
@ -116,7 +115,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..2d37be9
|
||||
index 0000000..94b7713
|
||||
--- /dev/null
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -0,0 +1,39 @@
|
||||
@ -155,10 +154,10 @@ index 0000000..2d37be9
|
||||
+#if defined(HAVE_ATTR_XATTR_H)
|
||||
+ return fgetxattr( filedes, name, value, size );
|
||||
+#else
|
||||
+ errno = ENOTSUP;
|
||||
+ errno = ENOSYS;
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
--
|
||||
2.1.3
|
||||
1.9.1
|
||||
|
||||
|
@ -1,34 +1,33 @@
|
||||
From e07243c3f38d5a095d92de69dfdbd196a7e9cba4 Mon Sep 17 00:00:00 2001
|
||||
From f6b156b5bccac55814eeee4fd10013ea3a76f384 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
|
||||
NtQuery[Full]AttributesFile and NtQueryDirectoryFile.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 7 ++++++-
|
||||
dlls/ntdll/file.c | 6 +++++-
|
||||
include/wine/port.h | 1 +
|
||||
libs/port/xattr.c | 10 ++++++++++
|
||||
3 files changed, 17 insertions(+), 1 deletion(-)
|
||||
3 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index c775664..2331064 100644
|
||||
index 83d07e2..b977e45 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -153,7 +153,8 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
@@ -152,7 +152,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 )
|
||||
{
|
||||
- int ret;
|
||||
+ char hexattr[10];
|
||||
+ char hexattr[11];
|
||||
+ int len, ret;
|
||||
|
||||
*attr = 0;
|
||||
ret = lstat( path, st );
|
||||
@@ -166,6 +167,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@@ -165,6 +166,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
}
|
||||
*attr |= get_file_attributes( st );
|
||||
+ /* retrieve any stored DOS attributes */
|
||||
+ len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
|
||||
+ if (len == -1) return ret;
|
||||
+ *attr |= get_file_xattr( hexattr, len );
|
||||
@ -48,7 +47,7 @@ index 521246b..7977eb9 100644
|
||||
/* Interlocked functions */
|
||||
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index 2d37be9..6ddaa9c 100644
|
||||
index 94b7713..88e900d 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -37,3 +37,13 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
@ -61,10 +60,10 @@ index 2d37be9..6ddaa9c 100644
|
||||
+#if defined(HAVE_ATTR_XATTR_H)
|
||||
+ return getxattr( path, name, value, size );
|
||||
+#else
|
||||
+ errno = ENOTSUP;
|
||||
+ errno = ENOSYS;
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
--
|
||||
2.1.3
|
||||
1.9.1
|
||||
|
||||
|
@ -1,31 +1,29 @@
|
||||
From 764394b265187417d1123b975f05f955c461b774 Mon Sep 17 00:00:00 2001
|
||||
From c65dec8465c321f09ee3bfd0317994da8cd0c0c1 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.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 53 +++++++++++++++++++++++++++++------------------
|
||||
dlls/ntdll/tests/file.c | 8 +++----
|
||||
include/wine/port.h | 2 ++
|
||||
libs/port/xattr.c | 20 ++++++++++++++++++
|
||||
4 files changed, 59 insertions(+), 24 deletions(-)
|
||||
dlls/ntdll/file.c | 54 +++++++++++++++++++++++++++++++------------------
|
||||
dlls/ntdll/tests/file.c | 8 ++++----
|
||||
include/wine/port.h | 2 ++
|
||||
libs/port/xattr.c | 20 ++++++++++++++++++
|
||||
4 files changed, 60 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index fbfe882..635a316 100644
|
||||
index b977e45..521ab64 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -151,6 +151,38 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
@@ -149,6 +149,39 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/* set the stat info and file attributes for a file (by file descriptor) */
|
||||
+NTSTATUS fd_set_file_info( int fd, ULONG attr )
|
||||
+{
|
||||
+ char hexattr[10];
|
||||
+ char hexattr[11];
|
||||
+ struct stat st;
|
||||
+ int len;
|
||||
+
|
||||
+ /* convert the file attributes into Unix stat info */
|
||||
+ if (fstat( fd, &st ) == -1) return FILE_GetNtStatus();
|
||||
+ if (attr & FILE_ATTRIBUTE_READONLY)
|
||||
+ {
|
||||
@ -41,10 +39,13 @@ index fbfe882..635a316 100644
|
||||
+ }
|
||||
+ if (fchmod( fd, st.st_mode ) == -1) return FILE_GetNtStatus();
|
||||
+ attr &= ~FILE_ATTRIBUTE_NORMAL; /* do not store everything, but keep everything Samba can use */
|
||||
+ /* store/unset any possible DOS attributes */
|
||||
+ len = sprintf( hexattr, "0x%x", attr );
|
||||
+ if (attr != 0)
|
||||
+ {
|
||||
+ int len;
|
||||
+
|
||||
+ len = sprintf( hexattr, "0x%x", attr );
|
||||
+ xattr_fset( fd, SAMBA_XATTR_DOS_ATTRIB, hexattr, len );
|
||||
+ }
|
||||
+ else
|
||||
+ xattr_fremove( fd, SAMBA_XATTR_DOS_ATTRIB );
|
||||
+ return STATUS_SUCCESS;
|
||||
@ -53,7 +54,7 @@ index fbfe882..635a316 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 )
|
||||
{
|
||||
@@ -2326,7 +2358,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
@@ -2320,7 +2353,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
case FileBasicInformation:
|
||||
if (len >= sizeof(FILE_BASIC_INFORMATION))
|
||||
{
|
||||
@ -61,7 +62,7 @@ index fbfe882..635a316 100644
|
||||
const FILE_BASIC_INFORMATION *info = ptr;
|
||||
|
||||
if ((io->u.Status = server_get_unix_fd( handle, 0, &fd, &needs_close, NULL, NULL )))
|
||||
@@ -2336,25 +2367,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
@@ -2330,25 +2362,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)
|
||||
@ -142,7 +143,7 @@ index 7977eb9..cc572f3 100644
|
||||
|
||||
/* Interlocked functions */
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index 6ddaa9c..3ce5ffc 100644
|
||||
index 88e900d..6918c99 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -38,6 +38,26 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
@ -154,7 +155,7 @@ index 6ddaa9c..3ce5ffc 100644
|
||||
+#if defined(HAVE_ATTR_XATTR_H)
|
||||
+ return fremovexattr( filedes, name );
|
||||
+#else
|
||||
+ errno = ENOTSUP;
|
||||
+ errno = ENOSYS;
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
@ -164,7 +165,7 @@ index 6ddaa9c..3ce5ffc 100644
|
||||
+#if defined(HAVE_ATTR_XATTR_H)
|
||||
+ return fsetxattr( filedes, name, value, size, 0 );
|
||||
+#else
|
||||
+ errno = ENOTSUP;
|
||||
+ errno = ENOSYS;
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
@ -173,5 +174,5 @@ index 6ddaa9c..3ce5ffc 100644
|
||||
{
|
||||
#if defined(HAVE_ATTR_XATTR_H)
|
||||
--
|
||||
1.7.9.5
|
||||
1.9.1
|
||||
|
||||
|
@ -1,26 +1,26 @@
|
||||
From 60887da43c880bb75169b394b5d3ecedd44278aa Mon Sep 17 00:00:00 2001
|
||||
From ac9076b71ddda6d430fe80fcfe62a47c2dcc9dc9 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.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 79 ++++++++++++++++++++++++++----------------
|
||||
dlls/ntdll/tests/directory.c | 22 +++++-------
|
||||
include/wine/port.h | 2 ++
|
||||
libs/port/xattr.c | 20 +++++++++++
|
||||
dlls/ntdll/file.c | 79 ++++++++++++++++++++++++++++----------------
|
||||
dlls/ntdll/tests/directory.c | 22 +++++-------
|
||||
include/wine/port.h | 2 ++
|
||||
libs/port/xattr.c | 20 +++++++++++
|
||||
4 files changed, 80 insertions(+), 43 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 635a316..4f4dddb 100644
|
||||
index 521ab64..b4187d4 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -210,6 +210,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@@ -205,6 +205,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
return ret;
|
||||
}
|
||||
|
||||
+NTSTATUS set_file_info( const char *path, ULONG attr )
|
||||
+{
|
||||
+ char hexattr[10];
|
||||
+ char hexattr[11];
|
||||
+ int len;
|
||||
+
|
||||
+ /* Note: unix mode already set when called this way */
|
||||
@ -36,7 +36,7 @@ index 635a316..4f4dddb 100644
|
||||
/**************************************************************************
|
||||
* FILE_CreateFile (internal)
|
||||
* Open a file.
|
||||
@@ -221,6 +236,8 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -216,6 +231,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 635a316..4f4dddb 100644
|
||||
ANSI_STRING unix_name;
|
||||
BOOL created = FALSE;
|
||||
|
||||
@@ -264,39 +281,37 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -259,39 +276,37 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
io->u.Status = STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ index 635a316..4f4dddb 100644
|
||||
|
||||
if (io->u.Status == STATUS_SUCCESS)
|
||||
{
|
||||
@@ -318,6 +333,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -313,6 +328,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
io->Information = FILE_OVERWRITTEN;
|
||||
break;
|
||||
}
|
||||
@ -124,7 +124,7 @@ index 635a316..4f4dddb 100644
|
||||
}
|
||||
else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES)
|
||||
{
|
||||
@@ -325,6 +345,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -320,6 +340,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" );
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ index cc572f3..9e2b8165 100644
|
||||
/* Interlocked functions */
|
||||
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index 3ce5ffc..dc89a45 100644
|
||||
index 6918c99..683e7a6 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -67,3 +67,23 @@ int xattr_get( const char *path, const char *name, void *value, size_t size )
|
||||
@ -206,7 +206,7 @@ index 3ce5ffc..dc89a45 100644
|
||||
+#if defined(HAVE_ATTR_XATTR_H)
|
||||
+ return removexattr( path, name );
|
||||
+#else
|
||||
+ errno = ENOTSUP;
|
||||
+ errno = ENOSYS;
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
@ -216,10 +216,10 @@ index 3ce5ffc..dc89a45 100644
|
||||
+#if defined(HAVE_ATTR_XATTR_H)
|
||||
+ return setxattr( path, name, value, size, 0 );
|
||||
+#else
|
||||
+ errno = ENOTSUP;
|
||||
+ errno = ENOSYS;
|
||||
+ return -1;
|
||||
+#endif
|
||||
+}
|
||||
--
|
||||
1.7.9.5
|
||||
1.9.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 4abb908b47ae85da0eb37b9c08becda2694862ec Mon Sep 17 00:00:00 2001
|
||||
From f083b503de5dd5ae1805e633e191532a10896eab 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, 24 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 9de4fa0..efe4e01 100644
|
||||
index 3c91af3..68dca0a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -671,6 +671,9 @@ AC_CHECK_HEADERS([libprocstat.h],,,
|
||||
@ -23,7 +23,7 @@ index 9de4fa0..efe4e01 100644
|
||||
if test "x$with_xattr" = "xyes"
|
||||
then
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index dc89a45..2f20687 100644
|
||||
index 683e7a6..efc65c5 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -22,7 +22,10 @@
|
||||
@ -47,7 +47,7 @@ index dc89a45..2f20687 100644
|
||||
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
|
||||
return fgetxattr( filedes, name, value, size );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
@@ -40,7 +45,9 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
|
||||
int xattr_fremove( int filedes, const char *name )
|
||||
@ -58,7 +58,7 @@ index dc89a45..2f20687 100644
|
||||
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
|
||||
return fremovexattr( filedes, name );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
@@ -50,7 +57,9 @@ int xattr_fremove( int filedes, const char *name )
|
||||
|
||||
int xattr_fset( int filedes, const char *name, void *value, size_t size )
|
||||
@ -69,7 +69,7 @@ index dc89a45..2f20687 100644
|
||||
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
|
||||
return fsetxattr( filedes, name, value, size, 0 );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
@@ -60,7 +69,9 @@ int xattr_fset( int filedes, const char *name, void *value, size_t size )
|
||||
|
||||
int xattr_get( const char *path, const char *name, void *value, size_t size )
|
||||
@ -80,7 +80,7 @@ index dc89a45..2f20687 100644
|
||||
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
|
||||
return getxattr( path, name, value, size );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
@@ -70,7 +81,9 @@ int xattr_get( const char *path, const char *name, void *value, size_t size )
|
||||
|
||||
int xattr_remove( const char *path, const char *name )
|
||||
@ -91,7 +91,7 @@ index dc89a45..2f20687 100644
|
||||
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
|
||||
return removexattr( path, name );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
@@ -80,7 +93,9 @@ int xattr_remove( const char *path, const char *name )
|
||||
|
||||
int xattr_set( const char *path, const char *name, void *value, size_t size )
|
||||
@ -102,7 +102,7 @@ index dc89a45..2f20687 100644
|
||||
+#elif defined(HAVE_SYS_XATTR_H) || defined(HAVE_ATTR_XATTR_H)
|
||||
return setxattr( path, name, value, size, 0 );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
--
|
||||
2.1.3
|
||||
1.9.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 47dd345f3b2e59cbcd0912c75977dda9a5eff143 Mon Sep 17 00:00:00 2001
|
||||
From 64708643d4dc9454faaccd720ab9b8a53b5aecf9 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, 42 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 3e88371..3a79581 100644
|
||||
index 68dca0a..3b0da05 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -670,7 +670,7 @@ AC_CHECK_HEADERS([libprocstat.h],,,
|
||||
@ -22,7 +22,7 @@ index 3e88371..3a79581 100644
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/xattr.h>]], [[getxattr("", "", "", 0, 0, 0);]])],
|
||||
[AC_DEFINE(XATTR_ADDITIONAL_OPTIONS, 1, [Define if xattr functions take additional arguments (Mac OS X)])])])
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index 2f20687..70af249 100644
|
||||
index efc65c5..92a717e 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -26,17 +26,40 @@
|
||||
@ -64,7 +64,7 @@ index 2f20687..70af249 100644
|
||||
+ return extattr_get_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
|
||||
+ value, size );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
@@ -49,6 +72,9 @@ int xattr_fremove( int filedes, const char *name )
|
||||
return fremovexattr( filedes, name, 0 );
|
||||
@ -74,7 +74,7 @@ index 2f20687..70af249 100644
|
||||
+ if (!xattr_valid_namespace( name )) return -1;
|
||||
+ return extattr_delete_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN] );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
@@ -61,6 +87,10 @@ int xattr_fset( int filedes, const char *name, void *value, size_t size )
|
||||
return fsetxattr( filedes, name, value, size, 0, 0 );
|
||||
@ -85,7 +85,7 @@ index 2f20687..70af249 100644
|
||||
+ return extattr_set_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
|
||||
+ value, size );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
@@ -73,6 +103,10 @@ int xattr_get( const char *path, const char *name, void *value, size_t size )
|
||||
return getxattr( path, name, value, size, 0, 0 );
|
||||
@ -96,7 +96,7 @@ index 2f20687..70af249 100644
|
||||
+ return extattr_get_file( path, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
|
||||
+ value, size );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
@@ -85,6 +119,9 @@ int xattr_remove( const char *path, const char *name )
|
||||
return removexattr( path, name, 0 );
|
||||
@ -106,7 +106,7 @@ index 2f20687..70af249 100644
|
||||
+ if (!xattr_valid_namespace( name )) return -1;
|
||||
+ return extattr_delete_file( path, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN] );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
@@ -97,6 +134,10 @@ int xattr_set( const char *path, const char *name, void *value, size_t size )
|
||||
return setxattr( path, name, value, size, 0, 0 );
|
||||
@ -117,8 +117,8 @@ index 2f20687..70af249 100644
|
||||
+ return extattr_set_file( path, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
|
||||
+ value, size );
|
||||
#else
|
||||
errno = ENOTSUP;
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
--
|
||||
2.1.2
|
||||
1.9.1
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From def4cb3c6829c5b097bd24e7bb9eb0bd0a22f151 Mon Sep 17 00:00:00 2001
|
||||
From c2f89b20617d6d3e89c518c7ccb10f493d75efa4 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
|
||||
@ -6,9 +6,9 @@ Subject: ntdll: Perform the Unix-style hidden file check within the unified
|
||||
|
||||
---
|
||||
dlls/ntdll/directory.c | 13 +++++--------
|
||||
dlls/ntdll/file.c | 9 +++------
|
||||
dlls/ntdll/file.c | 10 ++++------
|
||||
dlls/ntdll/ntdll_misc.h | 2 +-
|
||||
3 files changed, 9 insertions(+), 15 deletions(-)
|
||||
3 files changed, 10 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index 9b10385..a85c5e1 100644
|
||||
@ -48,20 +48,21 @@ index 9b10385..a85c5e1 100644
|
||||
if (io->Information + total_len > max_length)
|
||||
{
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 8d0bd85..a7a7c08 100644
|
||||
index b4187d4..45caa2e 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -199,6 +199,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@@ -199,6 +199,10 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
if (S_ISDIR( st->st_mode )) *attr |= FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
}
|
||||
*attr |= get_file_attributes( st );
|
||||
+ /* convert Unix-style hidden files to a DOS hidden file attribute */
|
||||
+ if (DIR_is_hidden_file( path ))
|
||||
+ *attr |= FILE_ATTRIBUTE_HIDDEN;
|
||||
/* retrieve any stored DOS attributes */
|
||||
+ /* retrieve any stored DOS attributes */
|
||||
len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, hexattr, sizeof(hexattr)-1 );
|
||||
if (len == -1) return ret;
|
||||
@@ -2568,8 +2571,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
*attr |= get_file_xattr( hexattr, len );
|
||||
@@ -2567,8 +2571,6 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr,
|
||||
info->AllocationSize = std.AllocationSize;
|
||||
info->EndOfFile = std.EndOfFile;
|
||||
info->FileAttributes = basic.FileAttributes;
|
||||
@ -70,7 +71,7 @@ index 8d0bd85..a7a7c08 100644
|
||||
}
|
||||
RtlFreeAnsiString( &unix_name );
|
||||
}
|
||||
@@ -2597,11 +2598,7 @@ NTSTATUS WINAPI NtQueryAttributesFile( const OBJECT_ATTRIBUTES *attr, FILE_BASIC
|
||||
@@ -2596,11 +2598,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
|
||||
@ -96,5 +97,5 @@ index b7ea6dc..1ab120c 100644
|
||||
extern NTSTATUS DIR_get_unix_cwd( char **cwd ) DECLSPEC_HIDDEN;
|
||||
extern unsigned int DIR_get_drives_info( struct drive_info info[MAX_DOS_DRIVES] ) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.1.3
|
||||
1.9.1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user