public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2024-02-09 17:38 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:38 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9920e9108949d8031a61369a4623fa359ee13925
commit 9920e9108949d8031a61369a4623fa359ee13925
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6ea3b062f0..70d5c54838 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 145744199b..e6f39455ff 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2024-04-17 20:14 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:14 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8beedb84fede61ed8ad4554bc5de37ee5f13c2e5
commit 8beedb84fede61ed8ad4554bc5de37ee5f13c2e5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6ea3b062f0..70d5c54838 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 145744199b..e6f39455ff 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2024-04-02 16:00 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 16:00 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c7ab9782fa3bd7b0cc2f85a49e761f1783e9add1
commit c7ab9782fa3bd7b0cc2f85a49e761f1783e9add1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6ea3b062f0..70d5c54838 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 145744199b..e6f39455ff 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2024-02-07 14:13 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:13 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=67722207ece36642860eff68481793ea963b5cd5
commit 67722207ece36642860eff68481793ea963b5cd5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6ea3b062f0..70d5c54838 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 145744199b..e6f39455ff 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2024-01-29 18:04 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 18:04 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c1ac467a9c8da6125122a9945fe7b7892cead826
commit c1ac467a9c8da6125122a9945fe7b7892cead826
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6ea3b062f0..70d5c54838 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 145744199b..e6f39455ff 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2023-12-21 19:00 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 19:00 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e8f7029902f2b98931db14607540be672b87fe5c
commit e8f7029902f2b98931db14607540be672b87fe5c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6559954247..9e6f9b2c36 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 998fc2d94d..f8888c388c 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2023-09-28 17:58 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:58 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c1fa35997693da03bcef1b96682de2b76b1c2550
commit c1fa35997693da03bcef1b96682de2b76b1c2550
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6559954247..9e6f9b2c36 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 998fc2d94d..f8888c388c 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests
@ 2023-08-30 12:43 Adhemerval Zanella
0 siblings, 0 replies; 8+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:43 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1dfc63225bee33ebf1281132c582eac9e11f63bb
commit 1dfc63225bee33ebf1281132c582eac9e11f63bb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Wed Aug 30 09:00:04 2023 -0300
posix: Remove the __strcpy_chk from glob tests
Not all compiler supports the builtin.
Diff:
---
posix/tst-glob_lstat_compat.c | 8 +++++++-
posix/tst-gnuglob-skeleton.c | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c
index 6559954247..9e6f9b2c36 100644
--- a/posix/tst-glob_lstat_compat.c
+++ b/posix/tst-glob_lstat_compat.c
@@ -173,7 +173,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
++dir->idx;
diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c
index 998fc2d94d..f8888c388c 100644
--- a/posix/tst-gnuglob-skeleton.c
+++ b/posix/tst-gnuglob-skeleton.c
@@ -35,6 +35,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <support/check.h>
#include <support/test-driver.h>
@@ -222,7 +223,13 @@ my_readdir (void *gdir)
dir->d.d_type = filesystem[dir->idx].type;
- __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX);
+ {
+ size_t len = strlen (filesystem[dir->idx].name);
+ if (len >= NAME_MAX)
+ FAIL_EXIT1 ("[%s] entry name larger than NAME_MAX (%d)", __func__,
+ NAME_MAX);
+ memcpy (dir->d.d_name, filesystem[dir->idx].name, len + 1);
+ }
if (test_verbose > 0)
printf ("info: my_readdir ({ level: %d, idx: %ld })"
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-04-17 20:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 17:38 [glibc/azanella/clang] posix: Remove the __strcpy_chk from glob tests Adhemerval Zanella
-- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:14 Adhemerval Zanella
2024-04-02 16:00 Adhemerval Zanella
2024-02-07 14:13 Adhemerval Zanella
2024-01-29 18:04 Adhemerval Zanella
2023-12-21 19:00 Adhemerval Zanella
2023-09-28 17:58 Adhemerval Zanella
2023-08-30 12:43 Adhemerval Zanella
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).