ntdll-Junction_Points: Updates from Erich E. Hoover.

Includes a fundamental rewrite of the way reparse points are stored.
This commit is contained in:
Zebediah Figura
2022-09-11 19:36:38 -05:00
parent 533337e25e
commit 1ed196f0ef
59 changed files with 3005 additions and 3985 deletions

View File

@@ -1,4 +1,4 @@
From fcd07d80234de455880990e2b2c488e9795f9dc0 Mon Sep 17 00:00:00 2001
From bab7a4b5d00822b0a7965ac338a73538e06b5aa7 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 3 Apr 2015 03:58:47 +0200
Subject: [PATCH] server: Allow to open files without any permission bits. (try
@@ -13,10 +13,10 @@ Changes in v2:
2 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index ed91ccc39d3..c534d1453d9 100644
index 51bf60d0f36..ed8db358ab8 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3713,17 +3713,13 @@ static void test_CreateDirectoryA(void)
@@ -3782,17 +3782,13 @@ static void test_CreateDirectoryA(void)
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
@@ -40,7 +40,7 @@ index ed91ccc39d3..c534d1453d9 100644
CloseHandle(hTemp);
/* Test inheritance of ACLs in NtCreateFile without security descriptor */
@@ -3792,17 +3788,13 @@ static void test_CreateDirectoryA(void)
@@ -3861,17 +3857,13 @@ static void test_CreateDirectoryA(void)
error = pGetNamedSecurityInfoA(tmpfile, SE_FILE_OBJECT,
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
(PSID *)&owner, NULL, &pDacl, NULL, &pSD);
@@ -65,10 +65,10 @@ index ed91ccc39d3..c534d1453d9 100644
done:
diff --git a/server/fd.c b/server/fd.c
index bf59359de03..323dd92e653 100644
index db265a9b1b8..f025d51a1e0 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2044,6 +2044,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2006,6 +2006,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
int root_fd = -1;
int rw_mode;
char *path;
@@ -76,7 +76,7 @@ index bf59359de03..323dd92e653 100644
int created = (flags & O_CREAT);
if (((options & FILE_DELETE_ON_CLOSE) && !(access & DELETE)) ||
@@ -2116,6 +2117,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2074,6 +2075,23 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
if ((access & FILE_UNIX_WRITE_ACCESS) || (flags & O_CREAT))
fd->unix_fd = open( name, O_RDONLY | (flags & ~(O_TRUNC | O_CREAT | O_EXCL)), *mode );
}
@@ -100,7 +100,7 @@ index bf59359de03..323dd92e653 100644
if (fd->unix_fd == -1)
{
@@ -2124,6 +2142,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2082,6 +2100,8 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
set_error( STATUS_OBJECT_NAME_INVALID );
else
file_set_error();
@@ -109,12 +109,12 @@ index bf59359de03..323dd92e653 100644
goto error;
}
}
@@ -2134,6 +2154,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
@@ -2097,6 +2117,7 @@ struct fd *open_fd( struct fd *root, const char *name, struct unicode_str nt_nam
closed_fd->unix_fd = fd->unix_fd;
closed_fd->unlink = 0;
closed_fd->unlink_name = fd->unlink_name;
closed_fd->unix_name = fd->unix_name;
+ if (do_chmod) chmod( name, *mode );
lstat( fd->unlink_name, &st );
fstat( fd->unix_fd, &st );
*mode = st.st_mode;
--