Fix free() of a const variable (Bug #1).

This commit is contained in:
Erich E. Hoover 2014-03-11 11:10:23 -06:00
parent c1edf8d5c4
commit b51c16c86a

View File

@ -1,6 +1,6 @@
From c361e711537ebbe23ef30dafe3eaa00923be804c Mon Sep 17 00:00:00 2001
From 9c6061a4e74991b1b02a1532d5c109600504d91e Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Tue, 25 Feb 2014 10:40:03 -0700
Date: Tue, 11 Mar 2014 11:09:00 -0600
Subject: server: Inherit security attributes from parent directories on
SetSecurityInfo.
@ -8,12 +8,12 @@ Subject: server: Inherit security attributes from parent directories on
dlls/advapi32/tests/security.c | 68 ++++++++++++++++++++++
include/winnt.h | 7 ++-
server/fd.c | 13 ++++-
server/file.c | 124 +++++++++++++++++++++++++++++++++++++++-
server/file.c | 125 +++++++++++++++++++++++++++++++++++++++-
server/file.h | 1 +
5 files changed, 205 insertions(+), 8 deletions(-)
5 files changed, 206 insertions(+), 8 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index fb3e17e..d5969c1 100644
index 68b63a0..c981c1b 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3350,6 +3350,74 @@ static void test_GetNamedSecurityInfoA(void)
@ -146,7 +146,7 @@ index fa8874c..9e6b9a8 100644
if (orig->inode)
diff --git a/server/file.c b/server/file.c
index c115ff7..c57783b 100644
index c115ff7..cb518f5 100644
--- a/server/file.c
+++ b/server/file.c
@@ -324,6 +324,105 @@ struct security_descriptor *inherit_sd( const struct security_descriptor *parent
@ -255,7 +255,7 @@ index c115ff7..c57783b 100644
static struct security_descriptor *file_get_parent_sd( struct fd *root, char *parent_name,
int is_dir )
{
@@ -921,16 +1020,31 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
@@ -921,16 +1020,32 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
return new_mode & ~denied_mode;
}
@ -263,7 +263,8 @@ index c115ff7..c57783b 100644
+int file_set_acls( struct object *obj, struct fd *fd, const struct security_descriptor *new_sd,
unsigned int set_info )
{
+ const struct security_descriptor *sd = new_sd, *parent_sd = NULL;
+ const struct security_descriptor *sd = new_sd;
+ struct security_descriptor *parent_sd = NULL;
int unix_fd = get_unix_fd( fd );
const SID *owner;
struct stat st;
@ -288,7 +289,7 @@ index c115ff7..c57783b 100644
if (set_info & OWNER_SECURITY_INFORMATION)
{
owner = sd_get_owner( sd );
@@ -962,10 +1076,14 @@ int file_set_acls( struct object *obj, struct fd *fd, const struct security_desc
@@ -962,10 +1077,14 @@ int file_set_acls( struct object *obj, struct fd *fd, const struct security_desc
if (((st.st_mode ^ mode) & (S_IRWXU|S_IRWXG|S_IRWXO)) && fchmod( unix_fd, mode ) == -1)
{
file_set_error();