summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-04-17 15:51:09 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-04-17 15:51:09 +0000
commitb5efa8990ffc6e09a09605108d06fcde97127a08 (patch)
tree4a2a5e98c88f73d4161fd8d027c3cd3f93b12412
parent7cdcd90ca146cd1322051385d92114b9b927776b (diff)
downloadcygnal-b5efa8990ffc6e09a09605108d06fcde97127a08.tar.gz
cygnal-b5efa8990ffc6e09a09605108d06fcde97127a08.tar.bz2
cygnal-b5efa8990ffc6e09a09605108d06fcde97127a08.zip
* sec_helper.cc (get_null_sd): Make static. Use PSECURITY_DESCRIPTOR
instead of SECURITY_DESCRIPTOR *. (sec_acl): Fix fomratting. * security.h (get_null_sd): Drop declaration.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/sec_helper.cc9
-rw-r--r--winsup/cygwin/security.h2
3 files changed, 11 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index e7331627c..d54883bdb 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * sec_helper.cc (get_null_sd): Make static. Use PSECURITY_DESCRIPTOR
+ instead of SECURITY_DESCRIPTOR *.
+ (sec_acl): Fix fomratting.
+ * security.h (get_null_sd): Drop declaration.
+
2010-04-16 Corinna Vinschen <corinna@vinschen.de>
* cygerrno.h (seterrno_from_nt_status): Declare.
diff --git a/winsup/cygwin/sec_helper.cc b/winsup/cygwin/sec_helper.cc
index cab2feddb..a29900166 100644
--- a/winsup/cygwin/sec_helper.cc
+++ b/winsup/cygwin/sec_helper.cc
@@ -444,17 +444,16 @@ set_cygwin_privileges (HANDLE token)
/* Function to return a common SECURITY_DESCRIPTOR that
allows all access. */
-
-SECURITY_DESCRIPTOR *__stdcall
+static inline PSECURITY_DESCRIPTOR
get_null_sd ()
{
static NO_COPY SECURITY_DESCRIPTOR sd;
- static NO_COPY SECURITY_DESCRIPTOR *null_sdp;
+ static NO_COPY PSECURITY_DESCRIPTOR null_sdp;
if (!null_sdp)
{
InitializeSecurityDescriptor (&sd, SECURITY_DESCRIPTOR_REVISION);
- SetSecurityDescriptorDacl (&sd, TRUE, 0, FALSE);
+ SetSecurityDescriptorDacl (&sd, TRUE, NULL, FALSE);
null_sdp = &sd;
}
return null_sdp;
@@ -478,7 +477,7 @@ init_global_security ()
bool
sec_acl (PACL acl, bool original, bool admins, PSID sid1, PSID sid2, DWORD access2)
{
- size_t acl_len = MAX_DACL_LEN(5);
+ size_t acl_len = MAX_DACL_LEN (5);
LPVOID pAce;
cygpsid psid;
diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h
index d239d0714..dcc080f2f 100644
--- a/winsup/cygwin/security.h
+++ b/winsup/cygwin/security.h
@@ -427,8 +427,6 @@ void set_cygwin_privileges (HANDLE token);
#define pop_self_privilege() pop_thread_privilege()
/* shared.cc: */
-/* Retrieve a security descriptor that allows all access */
-SECURITY_DESCRIPTOR *__stdcall get_null_sd ();
/* Various types of security attributes for use in Create* functions. */
extern SECURITY_ATTRIBUTES sec_none, sec_none_nih, sec_all, sec_all_nih;