mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
server-Stored_ACLs: Define xattr_valid_namespace() where it's first used.
This commit is contained in:
parent
d7b71f0bb4
commit
8229c98169
@ -1,15 +1,15 @@
|
||||
From 8f38d8b6dd8bdb5ab7f7ebe9c619566cc0430065 Mon Sep 17 00:00:00 2001
|
||||
From c7290ab262bd880a7cae7401ff19e6692e047412 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Mon, 30 Mar 2015 13:04:23 +0200
|
||||
Subject: [PATCH] server: Store file security attributes with extended file
|
||||
attributes. (v8)
|
||||
|
||||
---
|
||||
server/file.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 66 insertions(+)
|
||||
server/file.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 78 insertions(+)
|
||||
|
||||
diff --git a/server/file.c b/server/file.c
|
||||
index 74199126f59..ba27eab5957 100644
|
||||
index 64e59307aab..39c64180b6e 100644
|
||||
--- a/server/file.c
|
||||
+++ b/server/file.c
|
||||
@@ -32,6 +32,7 @@
|
||||
@ -58,10 +58,22 @@ index 74199126f59..ba27eab5957 100644
|
||||
struct file
|
||||
{
|
||||
struct object obj; /* object header */
|
||||
@@ -204,6 +229,44 @@ int is_file_executable( const char *name )
|
||||
@@ -205,6 +230,56 @@ int is_file_executable( const char *name )
|
||||
return len >= 4 && (!strcasecmp( name + len - 4, ".exe") || !strcasecmp( name + len - 4, ".com" ));
|
||||
}
|
||||
|
||||
+#ifdef HAVE_SYS_EXTATTR_H
|
||||
+static inline int xattr_valid_namespace( const char *name )
|
||||
+{
|
||||
+ if (strncmp( XATTR_USER_PREFIX, name, XATTR_USER_PREFIX_LEN ) != 0)
|
||||
+ {
|
||||
+ errno = EPERM;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static int xattr_fset( int filedes, const char *name, void *value, size_t size )
|
||||
+{
|
||||
+#if defined(XATTR_ADDITIONAL_OPTIONS)
|
||||
@ -103,7 +115,7 @@ index 74199126f59..ba27eab5957 100644
|
||||
static struct object *create_file( struct fd *root, const char *nameptr, data_size_t len,
|
||||
unsigned int access, unsigned int sharing, int create,
|
||||
unsigned int options, unsigned int attrs,
|
||||
@@ -623,6 +686,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid,
|
||||
@@ -625,6 +700,9 @@ int set_file_sd( struct object *obj, struct fd *fd, mode_t *mode, uid_t *uid,
|
||||
*mode = (*mode & S_IFMT) | new_mode;
|
||||
}
|
||||
|
||||
@ -114,5 +126,5 @@ index 74199126f59..ba27eab5957 100644
|
||||
obj->sd = new_sd;
|
||||
return 1;
|
||||
--
|
||||
2.28.0
|
||||
2.29.2
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
From 15413f95effeff3ffaa30097b7c71ac12a8870c9 Mon Sep 17 00:00:00 2001
|
||||
From 2e1ccaecb562ddcbd9cd305927f800810fa735e9 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Fri, 18 Apr 2014 14:01:35 -0600
|
||||
Subject: [PATCH] server: Retrieve file security attributes with extended file
|
||||
attributes. (try 7)
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 19 +++++------
|
||||
server/file.c | 62 ++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 68 insertions(+), 13 deletions(-)
|
||||
dlls/advapi32/tests/security.c | 19 ++++++-------
|
||||
server/file.c | 50 ++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 56 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index f0545f1871c..2006c9cd0a9 100644
|
||||
index 29d6d86524e..df5ce2a5463 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -3645,7 +3645,7 @@ static void test_CreateDirectoryA(void)
|
||||
@ -62,7 +62,7 @@ index f0545f1871c..2006c9cd0a9 100644
|
||||
LocalFree(pSD);
|
||||
|
||||
diff --git a/server/file.c b/server/file.c
|
||||
index 48a2934aa0c..e81d32726f1 100644
|
||||
index fe98068c6cd..590f2e6ac14 100644
|
||||
--- a/server/file.c
|
||||
+++ b/server/file.c
|
||||
@@ -47,6 +47,7 @@
|
||||
@ -83,22 +83,10 @@ index 48a2934aa0c..e81d32726f1 100644
|
||||
#ifndef XATTR_SIZE_MAX
|
||||
#define XATTR_SIZE_MAX 65536
|
||||
#endif
|
||||
@@ -229,6 +233,34 @@ int is_file_executable( const char *name )
|
||||
return len >= 4 && (!strcasecmp( name + len - 4, ".exe") || !strcasecmp( name + len - 4, ".com" ));
|
||||
@@ -242,6 +246,22 @@ static inline int xattr_valid_namespace( const char *name )
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef HAVE_SYS_EXTATTR_H
|
||||
+static inline int xattr_valid_namespace( const char *name )
|
||||
+{
|
||||
+ if (strncmp( XATTR_USER_PREFIX, name, XATTR_USER_PREFIX_LEN ) != 0)
|
||||
+ {
|
||||
+ errno = EPERM;
|
||||
+ return 0;
|
||||
+ }
|
||||
+ return 1;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+static int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
+{
|
||||
+#if defined(XATTR_ADDITIONAL_OPTIONS)
|
||||
@ -118,7 +106,7 @@ index 48a2934aa0c..e81d32726f1 100644
|
||||
static int xattr_fset( int filedes, const char *name, void *value, size_t size )
|
||||
{
|
||||
#if defined(XATTR_ADDITIONAL_OPTIONS)
|
||||
@@ -527,6 +559,29 @@ static void convert_generic_sd( struct security_descriptor *sd )
|
||||
@@ -541,6 +561,29 @@ static void convert_generic_sd( struct security_descriptor *sd )
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,7 +136,7 @@ index 48a2934aa0c..e81d32726f1 100644
|
||||
struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode,
|
||||
uid_t *uid )
|
||||
{
|
||||
@@ -542,9 +597,10 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode
|
||||
@@ -556,9 +599,10 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode
|
||||
(st.st_uid == *uid))
|
||||
return obj->sd;
|
||||
|
||||
@ -163,5 +151,5 @@ index 48a2934aa0c..e81d32726f1 100644
|
||||
|
||||
*mode = st.st_mode;
|
||||
--
|
||||
2.28.0
|
||||
2.29.2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user