Remove upstreamed patchfiles 0001-0009
This commit is contained in:
parent
940c11c52d
commit
6e20f53ca3
@ -1,40 +0,0 @@
|
||||
From a9957ec35dfd2368c25d02b27859066299cf849c Mon Sep 17 00:00:00 2001
|
||||
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
|
||||
Date: Wed, 26 Feb 2020 19:22:54 +0530
|
||||
Subject: [PATCH 1/8] README: Update reporting bugs/contributions section
|
||||
|
||||
We have moved to a new home at GitHub. Update the reporting
|
||||
bugs/contributions sections to reflect GitHub's work flow.
|
||||
|
||||
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
|
||||
---
|
||||
README | 15 ++++++++++-----
|
||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/README b/README
|
||||
index 6deefcf..bd1f832 100644
|
||||
--- a/README
|
||||
+++ b/README
|
||||
@@ -62,9 +62,14 @@ sysfsutils/lib/LGPL
|
||||
4. Reporting Bugs
|
||||
-----------------
|
||||
|
||||
-Please direct all bugs to either the linux-diag mailing list -
|
||||
-linux-diag-devel@lists.sourceforge.net - or to the authors:
|
||||
+Feel free to report bugs by opening an issue in the GitHub Issue Tracker.
|
||||
|
||||
-Ananth Mavinakayanahalli <ananth@in.ibm.com>
|
||||
-Daniel Stekloff <dsteklof@us.ibm.com>
|
||||
-Mohan Kumar <mohan@in.ibm.com>
|
||||
+5. Contributions
|
||||
+----------------
|
||||
+
|
||||
+For submitting patches, open a GitHub pull request. Please make sure that they
|
||||
+are rebased on top of the current master. Code submission guidelines are the
|
||||
+same as the Linux Kernel contribution guidelines.
|
||||
+
|
||||
+You probably want to read the through Linux kernel Documentation/SubmittingPatches
|
||||
+for guidance.
|
||||
--
|
||||
2.28.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,43 +0,0 @@
|
||||
From 88b1ba388e6908e1bca3ef1779325e5b9a688f9c Mon Sep 17 00:00:00 2001
|
||||
From: Lee Duncan <lduncan@suse.com>
|
||||
Date: Thu, 25 Jun 2020 10:04:40 -0700
|
||||
Subject: [PATCH 3/8] Use stat() not lstat() to find link target.
|
||||
|
||||
The test was backwards? We are trying to find what the
|
||||
link points at, not info about the link.
|
||||
|
||||
path_is_file() should call stat(), not lstat()
|
||||
---
|
||||
lib/sysfs_utils.c | 2 +-
|
||||
test/test.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/sysfs_utils.c b/lib/sysfs_utils.c
|
||||
index bd6f9c1..bddf722 100644
|
||||
--- a/lib/sysfs_utils.c
|
||||
+++ b/lib/sysfs_utils.c
|
||||
@@ -292,7 +292,7 @@ int sysfs_path_is_file(const char *path)
|
||||
errno = EINVAL;
|
||||
return 1;
|
||||
}
|
||||
- if ((lstat(path, &astats)) != 0) {
|
||||
+ if ((stat(path, &astats)) != 0) {
|
||||
dprintf("stat() failed\n");
|
||||
return 1;
|
||||
}
|
||||
diff --git a/test/test.c b/test/test.c
|
||||
index ab2397d..41a470c 100644
|
||||
--- a/test/test.c
|
||||
+++ b/test/test.c
|
||||
@@ -165,7 +165,7 @@ static int path_is_dir(const char *path)
|
||||
{
|
||||
struct stat astats;
|
||||
|
||||
- if ((lstat(path, &astats)) != 0)
|
||||
+ if ((stat(path, &astats)) != 0)
|
||||
goto direrr;
|
||||
|
||||
if (S_ISDIR(astats.st_mode))
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
From d4a7c673f65ac4ed257be7d3c380108a88f5c510 Mon Sep 17 00:00:00 2001
|
||||
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
|
||||
Date: Mon, 29 Jun 2020 14:26:30 +0530
|
||||
Subject: [PATCH 4/8] config.guess: linux - Add support for ppc64le machine
|
||||
|
||||
Configure fails to guess ppc64le machine type under the Linux system.
|
||||
This patch adds support to recognize ppc64le by adding it to the list
|
||||
of valid Linux systems.
|
||||
|
||||
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
|
||||
---
|
||||
config.guess | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/config.guess b/config.guess
|
||||
index 2fc3acc..9b3e674 100644
|
||||
--- a/config.guess
|
||||
+++ b/config.guess
|
||||
@@ -864,6 +864,9 @@ EOF
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-${VENDOR:-unknown}-linux-gnu
|
||||
exit 0 ;;
|
||||
+ ppc64le:Linux:*:*)
|
||||
+ echo powerpc64le-${VENDOR:-unknown}-linux-gnu
|
||||
+ exit 0 ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
From 0277758bed2870a6feb3757ffd88930b7128f31a Mon Sep 17 00:00:00 2001
|
||||
From: Lee Duncan <lduncan@suse.com>
|
||||
Date: Fri, 3 Jul 2020 11:14:20 -0700
|
||||
Subject: [PATCH 5/8] Fix issue with sysfs name comparisons.
|
||||
|
||||
It turns out that cdev_name_equal() is used
|
||||
by dlist_find_custom() to compare sysfs
|
||||
entry names to ones already seen. But it was
|
||||
comparing using the length of the shortest string
|
||||
as a maximum, so when it compared, for example,
|
||||
"eth1" and "eth10", it thought they were the same.
|
||||
So now just return failure if the strings
|
||||
aren't the same length, else go ahead and
|
||||
compare them.
|
||||
---
|
||||
lib/sysfs_class.c | 21 +++++++++++++++++++--
|
||||
1 file changed, 19 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/sysfs_class.c b/lib/sysfs_class.c
|
||||
index 4fe0b82..c696ff0 100644
|
||||
--- a/lib/sysfs_class.c
|
||||
+++ b/lib/sysfs_class.c
|
||||
@@ -60,13 +60,30 @@ void sysfs_close_class(struct sysfs_class *cls)
|
||||
}
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * pass this function to dlist_find_custom()
|
||||
+ * so it can compare device names
|
||||
+ *
|
||||
+ * return 1 if pathnames are equal, else 0
|
||||
+ */
|
||||
static int cdev_name_equal(void *a, void *b)
|
||||
{
|
||||
+ size_t length_a, length_b;
|
||||
+ char *str_a, *str_b;
|
||||
+
|
||||
if (!a || !b)
|
||||
return 0;
|
||||
|
||||
- if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name,
|
||||
- strlen((char *)a)) == 0)
|
||||
+ str_a = (char *)a;
|
||||
+ str_b = ((struct sysfs_class_device *)b)->name;
|
||||
+
|
||||
+ length_a = strnlen(str_a, SYSFS_NAME_LEN+1);
|
||||
+ length_b = strnlen(str_b, SYSFS_NAME_LEN+1);
|
||||
+
|
||||
+ if (length_a != length_b)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (strncmp(str_a, str_b, SYSFS_NAME_LEN+1) == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From 34df9af8e15e331f45c3a453852d5a24486744ed Mon Sep 17 00:00:00 2001
|
||||
From: Lee Duncan <lduncan@suse.com>
|
||||
Date: Wed, 8 Jul 2020 11:17:18 -0700
|
||||
Subject: [PATCH 6/8] Limit cdev name length comparsion to strlen()+1
|
||||
|
||||
In commit 270af678d4241306 cdev_name_equal() was updated
|
||||
so that "eth1" and "eth10" did not match, but the limit
|
||||
on the length of the compare was too large, as we know
|
||||
the length of both strings. This is just a cleanup, and
|
||||
should cause no functional change.
|
||||
---
|
||||
lib/sysfs_class.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/sysfs_class.c b/lib/sysfs_class.c
|
||||
index c696ff0..fcaa488 100644
|
||||
--- a/lib/sysfs_class.c
|
||||
+++ b/lib/sysfs_class.c
|
||||
@@ -83,7 +83,7 @@ static int cdev_name_equal(void *a, void *b)
|
||||
if (length_a != length_b)
|
||||
return 0;
|
||||
|
||||
- if (strncmp(str_a, str_b, SYSFS_NAME_LEN+1) == 0)
|
||||
+ if (strncmp(str_a, str_b, length_a+1) == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,175 +0,0 @@
|
||||
From b93c115b71c08a2f19262e6adccfdb5a5e5b2a78 Mon Sep 17 00:00:00 2001
|
||||
From: Christopher Engelhard <ce@lcts.de>
|
||||
Date: Tue, 28 Jul 2020 17:35:05 +0200
|
||||
Subject: [PATCH 7/8] Fix bug in sysfs_get_link
|
||||
|
||||
This fixes RHBZ #447220/Debian Bug #481015 by applying the patch
|
||||
provided in those bugs.
|
||||
---
|
||||
lib/sysfs_utils.c | 128 +++++++++++++++++++++++++++-------------------
|
||||
1 file changed, 76 insertions(+), 52 deletions(-)
|
||||
|
||||
diff --git a/lib/sysfs_utils.c b/lib/sysfs_utils.c
|
||||
index bddf722..e9bc555 100644
|
||||
--- a/lib/sysfs_utils.c
|
||||
+++ b/lib/sysfs_utils.c
|
||||
@@ -117,80 +117,104 @@ int sysfs_get_link(const char *path, char *target, size_t len)
|
||||
{
|
||||
char devdir[SYSFS_PATH_MAX];
|
||||
char linkpath[SYSFS_PATH_MAX];
|
||||
- char temp_path[SYSFS_PATH_MAX];
|
||||
- char *d = NULL, *s = NULL;
|
||||
- int slashes = 0, count = 0;
|
||||
+ char *d, *s;
|
||||
+ int count;
|
||||
|
||||
if (!path || !target || len == 0) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
- memset(devdir, 0, SYSFS_PATH_MAX);
|
||||
- memset(linkpath, 0, SYSFS_PATH_MAX);
|
||||
- memset(temp_path, 0, SYSFS_PATH_MAX);
|
||||
- safestrcpy(devdir, path);
|
||||
-
|
||||
- if ((readlink(path, linkpath, SYSFS_PATH_MAX)) < 0) {
|
||||
+ count = readlink(path, linkpath, SYSFS_PATH_MAX);
|
||||
+ if (count < 0)
|
||||
return -1;
|
||||
- }
|
||||
- d = linkpath;
|
||||
+ else
|
||||
+ linkpath[count] = '\0';
|
||||
/*
|
||||
* Three cases here:
|
||||
* 1. relative path => format ../..
|
||||
* 2. absolute path => format /abcd/efgh
|
||||
* 3. relative path _from_ this dir => format abcd/efgh
|
||||
*/
|
||||
- switch (*d) {
|
||||
- case '.':
|
||||
+ if (*linkpath == '/') {
|
||||
+ /* absolute path - copy as is */
|
||||
+ safestrcpymax(target, linkpath, len);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ safestrcpy(devdir, path);
|
||||
+ s = strrchr(devdir, '/');
|
||||
+ if (s == NULL)
|
||||
+ s = devdir - 1;
|
||||
+ d = linkpath;
|
||||
+ while (*d == '.') {
|
||||
+ if (*(d+1) == '/') {
|
||||
/*
|
||||
* handle the case where link is of type ./abcd/xxx
|
||||
*/
|
||||
- safestrcpy(temp_path, devdir);
|
||||
- if (*(d+1) == '/')
|
||||
- d += 2;
|
||||
- else if (*(d+1) == '.')
|
||||
- goto parse_path;
|
||||
- s = strrchr(temp_path, '/');
|
||||
- if (s != NULL)
|
||||
- safestrcpy(s+1, d);
|
||||
- else
|
||||
- safestrcpy(temp_path, d);
|
||||
- safestrcpymax(target, temp_path, len);
|
||||
- break;
|
||||
+ d += 2;
|
||||
+ while (*d == '/')
|
||||
+ d++;
|
||||
+ continue;
|
||||
+ } else if (*(d+1) != '.' || *(d+2) != '/')
|
||||
/*
|
||||
- * relative path, getting rid of leading "../.."
|
||||
+ * relative path from this directory, starting
|
||||
+ * with a hidden directory
|
||||
*/
|
||||
-parse_path:
|
||||
- while (*d == '/' || *d == '.') {
|
||||
- if (*d == '/')
|
||||
- slashes++;
|
||||
- d++;
|
||||
- }
|
||||
- d--;
|
||||
- s = &devdir[strlen(devdir)-1];
|
||||
- while (s != NULL && count != (slashes+1)) {
|
||||
+ break;
|
||||
+
|
||||
+ /*
|
||||
+ * relative path, getting rid of leading "../.."; must
|
||||
+ * be careful here since any path component of devdir
|
||||
+ * could be a symlink again
|
||||
+ */
|
||||
+ for (;;) {
|
||||
+ while (s > devdir && *s == '/') {
|
||||
s--;
|
||||
- if (*s == '/')
|
||||
- count++;
|
||||
+ if (*s == '.'
|
||||
+ && (s == devdir || *(s-1) == '/'))
|
||||
+ s--;
|
||||
}
|
||||
- safestrcpymax(s, d, (SYSFS_PATH_MAX-strlen(devdir)));
|
||||
- safestrcpymax(target, devdir, len);
|
||||
- break;
|
||||
- case '/':
|
||||
- /* absolute path - copy as is */
|
||||
- safestrcpymax(target, linkpath, len);
|
||||
+ *(s+1) = '\0';
|
||||
+ if (*devdir == '\0' || sysfs_path_is_link(devdir))
|
||||
+ /*
|
||||
+ * condition will be true eventually
|
||||
+ * because we already know that all
|
||||
+ * but the last component of path
|
||||
+ * resolve to a directory
|
||||
+ */
|
||||
+ break;
|
||||
+ if (sysfs_get_link(devdir, devdir, SYSFS_PATH_MAX))
|
||||
+ return -1;
|
||||
+ s = devdir + strlen(devdir) - 1;
|
||||
+ }
|
||||
+ while (s >= devdir) {
|
||||
+ if (*s == '/') {
|
||||
+ if (*(s+1) != '.' || *(s+2) != '.'
|
||||
+ || *(s+3) != '\0') {
|
||||
+ d += 3;
|
||||
+ while (*d == '/')
|
||||
+ d++;
|
||||
+ } else
|
||||
+ s += 2;
|
||||
+ break;
|
||||
+ }
|
||||
+ s--;
|
||||
+ }
|
||||
+ if (s < devdir || *(s+1) == '\0')
|
||||
break;
|
||||
- default:
|
||||
- /* relative path from this directory */
|
||||
- safestrcpy(temp_path, devdir);
|
||||
- s = strrchr(temp_path, '/');
|
||||
- if (s != NULL)
|
||||
- safestrcpy(s+1, linkpath);
|
||||
- else
|
||||
- safestrcpy(temp_path, linkpath);
|
||||
- safestrcpymax(target, temp_path, len);
|
||||
}
|
||||
+
|
||||
+ /*
|
||||
+ * appending to devdir a slash and the (possibly shortened)
|
||||
+ * relative path to the link source
|
||||
+ */
|
||||
+ s++;
|
||||
+ if (s > devdir && *s == '\0')
|
||||
+ *s++ = '/';
|
||||
+ *s = '\0';
|
||||
+ safestrcpymax(s, d, SYSFS_PATH_MAX-(s-devdir));
|
||||
+ safestrcpymax(target, devdir, len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.28.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,52 +0,0 @@
|
||||
From 840b639f9e807e1dab4e14817fe72657b9252e53 Mon Sep 17 00:00:00 2001
|
||||
From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
|
||||
Date: Thu, 17 Sep 2020 20:31:25 +0530
|
||||
Subject: lib/sysfs_class: fix build failure reported on GCC-11
|
||||
|
||||
Christopher reported that, the build fails with GCC-11. It introduces a
|
||||
-Wstringop-overread, that warns about reading past the end in string
|
||||
functions. cdev_name_equal() does a comparison, which compares strings
|
||||
past SYSFS_NAME_LEN. It currently calculates the string lengths of both
|
||||
string and does a comparison on strings of equal length.
|
||||
|
||||
This patch refactors the function to compare, the strings until
|
||||
SYSFS_NAME_LEN, removing the string length comparison logic.
|
||||
|
||||
Fixes #12 ("Build failure with GCC-11 due to stringop-overread")
|
||||
Reported-by: Christopher Engelhard <ce@lcts.de>
|
||||
Tested-by: Christopher Engelhard <ce@lcts.de>
|
||||
Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
|
||||
---
|
||||
lib/sysfs_class.c | 9 +--------
|
||||
1 file changed, 1 insertion(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/sysfs_class.c b/lib/sysfs_class.c
|
||||
index fcaa488..6389892 100644
|
||||
--- a/lib/sysfs_class.c
|
||||
+++ b/lib/sysfs_class.c
|
||||
@@ -68,7 +68,6 @@ void sysfs_close_class(struct sysfs_class *cls)
|
||||
*/
|
||||
static int cdev_name_equal(void *a, void *b)
|
||||
{
|
||||
- size_t length_a, length_b;
|
||||
char *str_a, *str_b;
|
||||
|
||||
if (!a || !b)
|
||||
@@ -77,13 +76,7 @@ static int cdev_name_equal(void *a, void *b)
|
||||
str_a = (char *)a;
|
||||
str_b = ((struct sysfs_class_device *)b)->name;
|
||||
|
||||
- length_a = strnlen(str_a, SYSFS_NAME_LEN+1);
|
||||
- length_b = strnlen(str_b, SYSFS_NAME_LEN+1);
|
||||
-
|
||||
- if (length_a != length_b)
|
||||
- return 0;
|
||||
-
|
||||
- if (strncmp(str_a, str_b, length_a+1) == 0)
|
||||
+ if (strncmp(str_a, str_b, SYSFS_NAME_LEN) == 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
--
|
||||
2.26.2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user