public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/topic/posix_acl_funcs] acl_create_entry: Don't invalidate existing entry_d and permset_d.
@ 2016-02-08 14:54 Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2016-02-08 14:54 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ce971886f6a87c37722cc7e0221072b01213a085

commit ce971886f6a87c37722cc7e0221072b01213a085
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Jan 6 23:00:51 2016 +0100

    acl_create_entry: Don't invalidate existing entry_d and permset_d.
    
    	* sec_posixacl .cc (__acl_dup): Remove.
    	(acl_dup): Fold __acl_dup functionality into this function.
    	(acl_create_entry): Don't create new acl_t.  Just realloc
    	acl->entry to make room for new aclent_t.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sec_posixacl.cc | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/winsup/cygwin/sec_posixacl.cc b/winsup/cygwin/sec_posixacl.cc
index 54bac8f..8760ad5 100644
--- a/winsup/cygwin/sec_posixacl.cc
+++ b/winsup/cygwin/sec_posixacl.cc
@@ -48,22 +48,21 @@ acl_init (int count)
   return acl;
 }
 
-static acl_t
-__acl_dup (acl_t acl, int max)
+extern "C" acl_t
+acl_dup (acl_t acl)
 {
   __try
     {
-      acl_t new_acl = acl_init (max);
+      acl_t new_acl = acl_init (acl->max_count);
       if (new_acl)
 	{
-	  int new_idx = 0;
+	  uint16_t new_idx = 0;
 
 	  for (uint16_t idx = 0; idx < acl->count; ++idx)
 	    if (acl->entry[idx].a_type != ACL_DELETED_TAG)
 	      new_acl->entry[new_idx++] = acl->entry[idx];
 	  new_acl->magic = ACL_MAGIC;
 	  new_acl->count = new_idx;
-	  new_acl->max_count = max;
 	  return new_acl;
 	}
     }
@@ -72,12 +71,6 @@ __acl_dup (acl_t acl, int max)
   return NULL;
 }
 
-extern "C" acl_t
-acl_dup (acl_t acl)
-{
-  return __acl_dup (acl, acl->max_count);
-}
-
 extern "C" int
 acl_free (void *obj_p)
 {
@@ -159,12 +152,14 @@ acl_create_entry (acl_t *acl_p, acl_entry_t *entry_p)
 	}
       if (acl->count >= acl->max_count)
 	{
-	  acl_t new_acl = __acl_dup (acl, acl->count + 1);
-	  if (!new_acl)
+	  aclent_t *new_e;
+
+	  new_e = (aclent_t *) realloc (acl->entry,
+					_ENTRY_SIZE (acl->max_count + 1));
+	  if (!new_e)
 	    __leave;
-	  *acl_p = new_acl;
-	  acl_free (acl);
-	  acl = *acl_p;
+	  acl->entry = new_e;
+	  ++acl->max_count;
 	}
       idx = acl->count++;
       *entry_p = __to_entry (acl, idx);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [newlib-cygwin/topic/posix_acl_funcs] acl_create_entry: Don't invalidate existing entry_d and permset_d.
@ 2016-01-28 21:08 Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2016-01-28 21:08 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=04b07ae6df0383dab14ccaa2ec83d75633f1a95b

commit 04b07ae6df0383dab14ccaa2ec83d75633f1a95b
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Jan 6 23:00:51 2016 +0100

    acl_create_entry: Don't invalidate existing entry_d and permset_d.
    
    	* sec_posixacl .cc (__acl_dup): Remove.
    	(acl_dup): Fold __acl_dup functionality into this function.
    	(acl_create_entry): Don't create new acl_t.  Just realloc
    	acl->entry to make room for new aclent_t.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sec_posixacl.cc | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/winsup/cygwin/sec_posixacl.cc b/winsup/cygwin/sec_posixacl.cc
index 54bac8f..8760ad5 100644
--- a/winsup/cygwin/sec_posixacl.cc
+++ b/winsup/cygwin/sec_posixacl.cc
@@ -48,22 +48,21 @@ acl_init (int count)
   return acl;
 }
 
-static acl_t
-__acl_dup (acl_t acl, int max)
+extern "C" acl_t
+acl_dup (acl_t acl)
 {
   __try
     {
-      acl_t new_acl = acl_init (max);
+      acl_t new_acl = acl_init (acl->max_count);
       if (new_acl)
 	{
-	  int new_idx = 0;
+	  uint16_t new_idx = 0;
 
 	  for (uint16_t idx = 0; idx < acl->count; ++idx)
 	    if (acl->entry[idx].a_type != ACL_DELETED_TAG)
 	      new_acl->entry[new_idx++] = acl->entry[idx];
 	  new_acl->magic = ACL_MAGIC;
 	  new_acl->count = new_idx;
-	  new_acl->max_count = max;
 	  return new_acl;
 	}
     }
@@ -72,12 +71,6 @@ __acl_dup (acl_t acl, int max)
   return NULL;
 }
 
-extern "C" acl_t
-acl_dup (acl_t acl)
-{
-  return __acl_dup (acl, acl->max_count);
-}
-
 extern "C" int
 acl_free (void *obj_p)
 {
@@ -159,12 +152,14 @@ acl_create_entry (acl_t *acl_p, acl_entry_t *entry_p)
 	}
       if (acl->count >= acl->max_count)
 	{
-	  acl_t new_acl = __acl_dup (acl, acl->count + 1);
-	  if (!new_acl)
+	  aclent_t *new_e;
+
+	  new_e = (aclent_t *) realloc (acl->entry,
+					_ENTRY_SIZE (acl->max_count + 1));
+	  if (!new_e)
 	    __leave;
-	  *acl_p = new_acl;
-	  acl_free (acl);
-	  acl = *acl_p;
+	  acl->entry = new_e;
+	  ++acl->max_count;
 	}
       idx = acl->count++;
       *entry_p = __to_entry (acl, idx);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [newlib-cygwin/topic/posix_acl_funcs] acl_create_entry: Don't invalidate existing entry_d and permset_d.
@ 2016-01-27 14:56 Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2016-01-27 14:56 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7a2f4662534f4d8e0483044454070796b1c6a239

commit 7a2f4662534f4d8e0483044454070796b1c6a239
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Jan 6 23:00:51 2016 +0100

    acl_create_entry: Don't invalidate existing entry_d and permset_d.
    
    	* sec_posixacl .cc (__acl_dup): Remove.
    	(acl_dup): Fold __acl_dup functionality into this function.
    	(acl_create_entry): Don't create new acl_t.  Just realloc
    	acl->entry to make room for new aclent_t.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sec_posixacl.cc | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/winsup/cygwin/sec_posixacl.cc b/winsup/cygwin/sec_posixacl.cc
index 54bac8f..8760ad5 100644
--- a/winsup/cygwin/sec_posixacl.cc
+++ b/winsup/cygwin/sec_posixacl.cc
@@ -48,22 +48,21 @@ acl_init (int count)
   return acl;
 }
 
-static acl_t
-__acl_dup (acl_t acl, int max)
+extern "C" acl_t
+acl_dup (acl_t acl)
 {
   __try
     {
-      acl_t new_acl = acl_init (max);
+      acl_t new_acl = acl_init (acl->max_count);
       if (new_acl)
 	{
-	  int new_idx = 0;
+	  uint16_t new_idx = 0;
 
 	  for (uint16_t idx = 0; idx < acl->count; ++idx)
 	    if (acl->entry[idx].a_type != ACL_DELETED_TAG)
 	      new_acl->entry[new_idx++] = acl->entry[idx];
 	  new_acl->magic = ACL_MAGIC;
 	  new_acl->count = new_idx;
-	  new_acl->max_count = max;
 	  return new_acl;
 	}
     }
@@ -72,12 +71,6 @@ __acl_dup (acl_t acl, int max)
   return NULL;
 }
 
-extern "C" acl_t
-acl_dup (acl_t acl)
-{
-  return __acl_dup (acl, acl->max_count);
-}
-
 extern "C" int
 acl_free (void *obj_p)
 {
@@ -159,12 +152,14 @@ acl_create_entry (acl_t *acl_p, acl_entry_t *entry_p)
 	}
       if (acl->count >= acl->max_count)
 	{
-	  acl_t new_acl = __acl_dup (acl, acl->count + 1);
-	  if (!new_acl)
+	  aclent_t *new_e;
+
+	  new_e = (aclent_t *) realloc (acl->entry,
+					_ENTRY_SIZE (acl->max_count + 1));
+	  if (!new_e)
 	    __leave;
-	  *acl_p = new_acl;
-	  acl_free (acl);
-	  acl = *acl_p;
+	  acl->entry = new_e;
+	  ++acl->max_count;
 	}
       idx = acl->count++;
       *entry_p = __to_entry (acl, idx);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [newlib-cygwin/topic/posix_acl_funcs] acl_create_entry: Don't invalidate existing entry_d and permset_d.
@ 2016-01-24 10:31 Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2016-01-24 10:31 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=936fd531f195346f6a9a9bd8877c68396b230622

commit 936fd531f195346f6a9a9bd8877c68396b230622
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Jan 6 23:00:51 2016 +0100

    acl_create_entry: Don't invalidate existing entry_d and permset_d.
    
    	* sec_posixacl .cc (__acl_dup): Remove.
    	(acl_dup): Fold __acl_dup functionality into this function.
    	(acl_create_entry): Don't create new acl_t.  Just realloc
    	acl->entry to make room for new aclent_t.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sec_posixacl.cc | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/winsup/cygwin/sec_posixacl.cc b/winsup/cygwin/sec_posixacl.cc
index 54bac8f..8760ad5 100644
--- a/winsup/cygwin/sec_posixacl.cc
+++ b/winsup/cygwin/sec_posixacl.cc
@@ -48,22 +48,21 @@ acl_init (int count)
   return acl;
 }
 
-static acl_t
-__acl_dup (acl_t acl, int max)
+extern "C" acl_t
+acl_dup (acl_t acl)
 {
   __try
     {
-      acl_t new_acl = acl_init (max);
+      acl_t new_acl = acl_init (acl->max_count);
       if (new_acl)
 	{
-	  int new_idx = 0;
+	  uint16_t new_idx = 0;
 
 	  for (uint16_t idx = 0; idx < acl->count; ++idx)
 	    if (acl->entry[idx].a_type != ACL_DELETED_TAG)
 	      new_acl->entry[new_idx++] = acl->entry[idx];
 	  new_acl->magic = ACL_MAGIC;
 	  new_acl->count = new_idx;
-	  new_acl->max_count = max;
 	  return new_acl;
 	}
     }
@@ -72,12 +71,6 @@ __acl_dup (acl_t acl, int max)
   return NULL;
 }
 
-extern "C" acl_t
-acl_dup (acl_t acl)
-{
-  return __acl_dup (acl, acl->max_count);
-}
-
 extern "C" int
 acl_free (void *obj_p)
 {
@@ -159,12 +152,14 @@ acl_create_entry (acl_t *acl_p, acl_entry_t *entry_p)
 	}
       if (acl->count >= acl->max_count)
 	{
-	  acl_t new_acl = __acl_dup (acl, acl->count + 1);
-	  if (!new_acl)
+	  aclent_t *new_e;
+
+	  new_e = (aclent_t *) realloc (acl->entry,
+					_ENTRY_SIZE (acl->max_count + 1));
+	  if (!new_e)
 	    __leave;
-	  *acl_p = new_acl;
-	  acl_free (acl);
-	  acl = *acl_p;
+	  acl->entry = new_e;
+	  ++acl->max_count;
 	}
       idx = acl->count++;
       *entry_p = __to_entry (acl, idx);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [newlib-cygwin/topic/posix_acl_funcs] acl_create_entry: Don't invalidate existing entry_d and permset_d.
@ 2016-01-16 13:34 Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2016-01-16 13:34 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=230eede23a459d4b63dbacdb4336d6c03afabdc9

commit 230eede23a459d4b63dbacdb4336d6c03afabdc9
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Jan 6 23:00:51 2016 +0100

    acl_create_entry: Don't invalidate existing entry_d and permset_d.
    
    	* sec_posixacl .cc (__acl_dup): Remove.
    	(acl_dup): Fold __acl_dup functionality into this function.
    	(acl_create_entry): Don't create new acl_t.  Just realloc
    	acl->entry to make room for new aclent_t.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sec_posixacl.cc | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/winsup/cygwin/sec_posixacl.cc b/winsup/cygwin/sec_posixacl.cc
index 54bac8f..8760ad5 100644
--- a/winsup/cygwin/sec_posixacl.cc
+++ b/winsup/cygwin/sec_posixacl.cc
@@ -48,22 +48,21 @@ acl_init (int count)
   return acl;
 }
 
-static acl_t
-__acl_dup (acl_t acl, int max)
+extern "C" acl_t
+acl_dup (acl_t acl)
 {
   __try
     {
-      acl_t new_acl = acl_init (max);
+      acl_t new_acl = acl_init (acl->max_count);
       if (new_acl)
 	{
-	  int new_idx = 0;
+	  uint16_t new_idx = 0;
 
 	  for (uint16_t idx = 0; idx < acl->count; ++idx)
 	    if (acl->entry[idx].a_type != ACL_DELETED_TAG)
 	      new_acl->entry[new_idx++] = acl->entry[idx];
 	  new_acl->magic = ACL_MAGIC;
 	  new_acl->count = new_idx;
-	  new_acl->max_count = max;
 	  return new_acl;
 	}
     }
@@ -72,12 +71,6 @@ __acl_dup (acl_t acl, int max)
   return NULL;
 }
 
-extern "C" acl_t
-acl_dup (acl_t acl)
-{
-  return __acl_dup (acl, acl->max_count);
-}
-
 extern "C" int
 acl_free (void *obj_p)
 {
@@ -159,12 +152,14 @@ acl_create_entry (acl_t *acl_p, acl_entry_t *entry_p)
 	}
       if (acl->count >= acl->max_count)
 	{
-	  acl_t new_acl = __acl_dup (acl, acl->count + 1);
-	  if (!new_acl)
+	  aclent_t *new_e;
+
+	  new_e = (aclent_t *) realloc (acl->entry,
+					_ENTRY_SIZE (acl->max_count + 1));
+	  if (!new_e)
 	    __leave;
-	  *acl_p = new_acl;
-	  acl_free (acl);
-	  acl = *acl_p;
+	  acl->entry = new_e;
+	  ++acl->max_count;
 	}
       idx = acl->count++;
       *entry_p = __to_entry (acl, idx);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [newlib-cygwin/topic/posix_acl_funcs] acl_create_entry: Don't invalidate existing entry_d and permset_d.
@ 2016-01-14 15:17 Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2016-01-14 15:17 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0955cd0c88185f56ca5d6717d578a815baf9c6c3

commit 0955cd0c88185f56ca5d6717d578a815baf9c6c3
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Jan 6 23:00:51 2016 +0100

    acl_create_entry: Don't invalidate existing entry_d and permset_d.
    
    	* sec_posixacl .cc (__acl_dup): Remove.
    	(acl_dup): Fold __acl_dup functionality into this function.
    	(acl_create_entry): Don't create new acl_t.  Just realloc
    	acl->entry to make room for new aclent_t.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/sec_posixacl.cc | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/winsup/cygwin/sec_posixacl.cc b/winsup/cygwin/sec_posixacl.cc
index 54bac8f..8760ad5 100644
--- a/winsup/cygwin/sec_posixacl.cc
+++ b/winsup/cygwin/sec_posixacl.cc
@@ -48,22 +48,21 @@ acl_init (int count)
   return acl;
 }
 
-static acl_t
-__acl_dup (acl_t acl, int max)
+extern "C" acl_t
+acl_dup (acl_t acl)
 {
   __try
     {
-      acl_t new_acl = acl_init (max);
+      acl_t new_acl = acl_init (acl->max_count);
       if (new_acl)
 	{
-	  int new_idx = 0;
+	  uint16_t new_idx = 0;
 
 	  for (uint16_t idx = 0; idx < acl->count; ++idx)
 	    if (acl->entry[idx].a_type != ACL_DELETED_TAG)
 	      new_acl->entry[new_idx++] = acl->entry[idx];
 	  new_acl->magic = ACL_MAGIC;
 	  new_acl->count = new_idx;
-	  new_acl->max_count = max;
 	  return new_acl;
 	}
     }
@@ -72,12 +71,6 @@ __acl_dup (acl_t acl, int max)
   return NULL;
 }
 
-extern "C" acl_t
-acl_dup (acl_t acl)
-{
-  return __acl_dup (acl, acl->max_count);
-}
-
 extern "C" int
 acl_free (void *obj_p)
 {
@@ -159,12 +152,14 @@ acl_create_entry (acl_t *acl_p, acl_entry_t *entry_p)
 	}
       if (acl->count >= acl->max_count)
 	{
-	  acl_t new_acl = __acl_dup (acl, acl->count + 1);
-	  if (!new_acl)
+	  aclent_t *new_e;
+
+	  new_e = (aclent_t *) realloc (acl->entry,
+					_ENTRY_SIZE (acl->max_count + 1));
+	  if (!new_e)
 	    __leave;
-	  *acl_p = new_acl;
-	  acl_free (acl);
-	  acl = *acl_p;
+	  acl->entry = new_e;
+	  ++acl->max_count;
 	}
       idx = acl->count++;
       *entry_p = __to_entry (acl, idx);


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-08 14:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 14:54 [newlib-cygwin/topic/posix_acl_funcs] acl_create_entry: Don't invalidate existing entry_d and permset_d Corinna Vinschen
  -- strict thread matches above, loose matches on Subject: below --
2016-01-28 21:08 Corinna Vinschen
2016-01-27 14:56 Corinna Vinschen
2016-01-24 10:31 Corinna Vinschen
2016-01-16 13:34 Corinna Vinschen
2016-01-14 15:17 Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).