Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-06-22 18:53:05 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-06-22 18:53:05 +0400
commit30bbc55ee2759621c00bfb4d3382dc0da9ee3bc6 (patch)
treebe2c46a6d0ff366966a94b88aeac2ae00c84ba6e
parentc7b24005e644f1fb4b60015379cb8b74a7e1f485 (diff)
* flock.cc (allow_others_to_sync): Use small stack buffer rather
than big temp buffer. Fix typo in comment. (lf_setlock): Revert to using tmp_pathbuf. (lf_getlock): Ditto.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/flock.cc24
2 files changed, 19 insertions, 12 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 60bf6b44a..161c2003e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2010-06-22 Corinna Vinschen <corinna@vinschen.de>
+ * flock.cc (allow_others_to_sync): Use small stack buffer rather
+ than big temp buffer. Fix typo in comment.
+ (lf_setlock): Revert to using tmp_pathbuf.
+ (lf_getlock): Ditto.
+
+2010-06-22 Corinna Vinschen <corinna@vinschen.de>
+
* sec_acl.cc (setacl): Use the long time unused ACL_DEFAULT_SIZE
instead of a constant value.
* security.cc (alloc_sd): Ditto.
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc
index dd8d7df58..7d0436b11 100644
--- a/winsup/cygwin/flock.cc
+++ b/winsup/cygwin/flock.cc
@@ -105,7 +105,7 @@
#include "pinfo.h"
#include "sigproc.h"
#include "cygtls.h"
-#include "tmpbuf.h"
+#include "tls_pbuf.h"
#include "ntdll.h"
#include <sys/queue.h>
#include <wchar.h>
@@ -151,20 +151,20 @@ allow_others_to_sync ()
LPVOID ace;
ULONG len;
- /* Get this process DACL. We use a temporary buffer to avoid having to
- alloc 64K from the stack. Can't use tls functions at this point because
- this gets called during initialization when the tls is not really
- available. */
- tmpbuf sd;
+ /* Get this process DACL. We use a rather small stack buffer here which
+ should be more than sufficient for process ACLs. Can't use tls functions
+ at this point because this gets called during initialization when the tls
+ is not really available. */
+ PSECURITY_DESCRIPTOR sd = (PSECURITY_DESCRIPTOR) alloca (ACL_DEFAULT_SIZE);
status = NtQuerySecurityObject (NtCurrentProcess (),
DACL_SECURITY_INFORMATION, sd,
- NT_MAX_PATH * sizeof (WCHAR), &len);
+ ACL_DEFAULT_SIZE, &len);
if (!NT_SUCCESS (status))
{
debug_printf ("NtQuerySecurityObject: %p", status);
return;
}
- /* Create a valid dacl pointer and set it's size to be as big as
+ /* Create a valid dacl pointer and set its size to be as big as
there's room in the temporary buffer. Note that the descriptor
is in self-relative format. */
dacl = (PACL) ((char *) sd + (uintptr_t) sd->Dacl);
@@ -874,7 +874,7 @@ lf_setlock (lockf_t *lock, inode_t *node, lockf_t **clean, HANDLE fhdl)
lockf_t **head = lock->lf_head;
lockf_t **prev, *overlap;
int ovcase, priority, old_prio, needtolink;
- tmpbuf tp;
+ tmp_pathbuf tp;
/*
* Set the priority
@@ -886,7 +886,7 @@ lf_setlock (lockf_t *lock, inode_t *node, lockf_t **clean, HANDLE fhdl)
* Scan lock list for this file looking for locks that would block us.
*/
/* Create temporary space for the all locks list. */
- node->i_all_lf = (lockf_t *) (void *) tp;
+ node->i_all_lf = (lockf_t *) (void *) tp.w_get ();
while ((block = lf_getblock(lock, node)))
{
DWORD ret;
@@ -1228,10 +1228,10 @@ static int
lf_getlock (lockf_t *lock, inode_t *node, struct __flock64 *fl)
{
lockf_t *block;
- tmpbuf tp;
+ tmp_pathbuf tp;
/* Create temporary space for the all locks list. */
- node->i_all_lf = (lockf_t *) (void * ) tp;
+ node->i_all_lf = (lockf_t *) (void * ) tp.w_get ();
if ((block = lf_getblock (lock, node)))
{
if (block->lf_obj)