You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Added patch to implement DOS hidden/system file attributes.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
From c6052d785f4419a80ca091d978ee1ff3e7400ca9 Mon Sep 17 00:00:00 2001
|
||||
From 4c0c7fc3e73d39e30be7cba5c2e63f8c6f6c2792 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Fri, 18 Apr 2014 14:08:36 -0600
|
||||
Subject: server: Inherit security attributes from parent directories on
|
||||
@@ -12,10 +12,10 @@ Subject: server: Inherit security attributes from parent directories on
|
||||
4 files changed, 179 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index 48a3291..f3a3c09 100644
|
||||
index 82c0639..3e88c2e 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -3030,10 +3030,11 @@ static void test_CreateDirectoryA(void)
|
||||
@@ -3117,10 +3117,11 @@ static void test_CreateDirectoryA(void)
|
||||
ACL_SIZE_INFORMATION acl_size;
|
||||
ACCESS_ALLOWED_ACE *ace;
|
||||
SECURITY_ATTRIBUTES sa;
|
||||
@@ -28,7 +28,7 @@ index 48a3291..f3a3c09 100644
|
||||
DWORD error;
|
||||
PACL pDacl;
|
||||
|
||||
@@ -3126,6 +3127,43 @@ static void test_CreateDirectoryA(void)
|
||||
@@ -3213,6 +3214,43 @@ static void test_CreateDirectoryA(void)
|
||||
}
|
||||
LocalFree(pSD);
|
||||
|
||||
@@ -73,10 +73,10 @@ index 48a3291..f3a3c09 100644
|
||||
HeapFree(GetProcessHeap(), 0, user);
|
||||
bret = RemoveDirectoryA(tmpdir);
|
||||
diff --git a/server/change.c b/server/change.c
|
||||
index 77c01bb..2cf1cab 100644
|
||||
index 27dbe25..0a82358 100644
|
||||
--- a/server/change.c
|
||||
+++ b/server/change.c
|
||||
@@ -287,7 +287,7 @@ static struct security_descriptor *dir_get_sd( struct object *obj )
|
||||
@@ -290,7 +290,7 @@ static struct security_descriptor *dir_get_sd( struct object *obj )
|
||||
assert( obj->ops == &dir_ops );
|
||||
|
||||
fd = dir_get_fd( obj );
|
||||
@@ -86,11 +86,11 @@ index 77c01bb..2cf1cab 100644
|
||||
return sd;
|
||||
}
|
||||
diff --git a/server/file.c b/server/file.c
|
||||
index 75f015b..6ce8806 100644
|
||||
index 3582493..1414ee6 100644
|
||||
--- a/server/file.c
|
||||
+++ b/server/file.c
|
||||
@@ -245,11 +245,141 @@ void set_xattr_sd( int fd, const struct security_descriptor *sd, const SID *user
|
||||
#endif
|
||||
@@ -248,11 +248,141 @@ void set_xattr_sd( int fd, const struct security_descriptor *sd, const SID *user
|
||||
xattr_fset( fd, WINE_XATTR_SD, buffer, len );
|
||||
}
|
||||
|
||||
+struct security_descriptor *inherit_sd( const struct security_descriptor *parent_sd, int is_dir )
|
||||
@@ -231,7 +231,7 @@ index 75f015b..6ce8806 100644
|
||||
const SID *owner = NULL, *group = NULL;
|
||||
struct object *obj = NULL;
|
||||
struct fd *fd;
|
||||
@@ -279,6 +409,10 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
|
||||
@@ -282,6 +412,10 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
|
||||
default: set_error( STATUS_INVALID_PARAMETER ); goto done;
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ index 75f015b..6ce8806 100644
|
||||
if (sd)
|
||||
{
|
||||
owner = sd_get_owner( sd );
|
||||
@@ -322,6 +456,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
|
||||
@@ -325,6 +459,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
|
||||
release_object( fd );
|
||||
|
||||
done:
|
||||
@@ -250,7 +250,7 @@ index 75f015b..6ce8806 100644
|
||||
free( name );
|
||||
return obj;
|
||||
}
|
||||
@@ -538,7 +673,7 @@ void convert_generic_sd( struct security_descriptor *sd )
|
||||
@@ -543,7 +678,7 @@ void convert_generic_sd( struct security_descriptor *sd )
|
||||
}
|
||||
|
||||
struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode_t *mode,
|
||||
@@ -259,7 +259,7 @@ index 75f015b..6ce8806 100644
|
||||
{
|
||||
int unix_fd = get_unix_fd( fd );
|
||||
struct stat st;
|
||||
@@ -556,7 +691,7 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode
|
||||
@@ -561,7 +696,7 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode
|
||||
user = security_unix_uid_to_sid( st.st_uid );
|
||||
group = token_get_primary_group( current->process->token );
|
||||
sd = get_xattr_sd( unix_fd );
|
||||
@@ -268,7 +268,7 @@ index 75f015b..6ce8806 100644
|
||||
if (!sd) sd = mode_to_sd( st.st_mode, user, group);
|
||||
if (!sd) return obj->sd;
|
||||
|
||||
@@ -576,7 +711,7 @@ static struct security_descriptor *file_get_sd( struct object *obj )
|
||||
@@ -581,7 +716,7 @@ static struct security_descriptor *file_get_sd( struct object *obj )
|
||||
assert( obj->ops == &file_ops );
|
||||
|
||||
fd = file_get_fd( obj );
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 04bbc2e2841b01a5a5344bb1f62c94ff84b25350 Mon Sep 17 00:00:00 2001
|
||||
From 6a598ee04025242f900fdf2726a21afe93d018bd Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Fri, 18 Apr 2014 14:10:49 -0600
|
||||
Subject: server: Inherit security attributes from parent directories on
|
||||
@@ -13,10 +13,10 @@ Subject: server: Inherit security attributes from parent directories on
|
||||
5 files changed, 207 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index 68b63a0..c981c1b 100644
|
||||
index 3e88c2e..952d001 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -3350,6 +3350,74 @@ static void test_GetNamedSecurityInfoA(void)
|
||||
@@ -3440,6 +3440,74 @@ static void test_GetNamedSecurityInfoA(void)
|
||||
"Administators Group ACE has unexpected mask (0x%x != 0x1f01ff)\n", ace->Mask);
|
||||
}
|
||||
LocalFree(pSD);
|
||||
@@ -92,10 +92,10 @@ index 68b63a0..c981c1b 100644
|
||||
CloseHandle(hTemp);
|
||||
|
||||
diff --git a/include/winnt.h b/include/winnt.h
|
||||
index 3f33c6b..5d2234f 100644
|
||||
index 709a93f..63882bb 100644
|
||||
--- a/include/winnt.h
|
||||
+++ b/include/winnt.h
|
||||
@@ -5057,14 +5057,15 @@ typedef struct _TAPE_GET_MEDIA_PARAMETERS {
|
||||
@@ -5078,14 +5078,15 @@ typedef struct _TAPE_GET_MEDIA_PARAMETERS {
|
||||
BOOLEAN WriteProtected;
|
||||
} TAPE_GET_MEDIA_PARAMETERS, *PTAPE_GET_MEDIA_PARAMETERS;
|
||||
|
||||
@@ -115,10 +115,10 @@ index 3f33c6b..5d2234f 100644
|
||||
#define REG_OPTION_NON_VOLATILE 0x00000000
|
||||
#define REG_OPTION_VOLATILE 0x00000001
|
||||
diff --git a/server/fd.c b/server/fd.c
|
||||
index fa8874c..9e6b9a8 100644
|
||||
index e3b722c..7d50ab6 100644
|
||||
--- a/server/fd.c
|
||||
+++ b/server/fd.c
|
||||
@@ -1629,6 +1629,16 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
|
||||
@@ -1634,6 +1634,16 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
|
||||
return fd;
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ index fa8874c..9e6b9a8 100644
|
||||
/* duplicate an fd object for a different user */
|
||||
struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sharing, unsigned int options )
|
||||
{
|
||||
@@ -1642,8 +1652,7 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
|
||||
@@ -1647,8 +1657,7 @@ struct fd *dup_fd_object( struct fd *orig, unsigned int access, unsigned int sha
|
||||
|
||||
if (orig->unix_name)
|
||||
{
|
||||
@@ -146,10 +146,10 @@ index fa8874c..9e6b9a8 100644
|
||||
|
||||
if (orig->inode)
|
||||
diff --git a/server/file.c b/server/file.c
|
||||
index 6ce8806..e29d06b 100644
|
||||
index 1414ee6..bbb9358 100644
|
||||
--- a/server/file.c
|
||||
+++ b/server/file.c
|
||||
@@ -325,6 +325,105 @@ struct security_descriptor *inherit_sd( const struct security_descriptor *parent
|
||||
@@ -328,6 +328,105 @@ struct security_descriptor *inherit_sd( const struct security_descriptor *parent
|
||||
return sd;
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ index 6ce8806..e29d06b 100644
|
||||
static struct security_descriptor *file_get_parent_sd( struct fd *root, const char *child_name,
|
||||
int child_len, int is_dir )
|
||||
{
|
||||
@@ -795,16 +894,33 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
|
||||
@@ -800,16 +899,33 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
|
||||
return new_mode & ~denied_mode;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ index 6ce8806..e29d06b 100644
|
||||
if (set_info & OWNER_SECURITY_INFORMATION)
|
||||
{
|
||||
owner = sd_get_owner( sd );
|
||||
@@ -854,10 +970,14 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri
|
||||
@@ -859,10 +975,14 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri
|
||||
if (((st.st_mode ^ mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, mode ) == -1)
|
||||
{
|
||||
file_set_error();
|
||||
|
Reference in New Issue
Block a user