* [PATCH 0/1] pseudo: Make realpath() remove trailing slashes
@ 2019-12-23 9:24 Robert Yang
2019-12-23 9:24 ` [PATCH 1/1] " Robert Yang
2019-12-23 9:32 ` ✗ patchtest: failure for " Patchwork
0 siblings, 2 replies; 3+ messages in thread
From: Robert Yang @ 2019-12-23 9:24 UTC (permalink / raw)
To: openembedded-core
The following changes since commit d6c62cc0305ab082e990041da104fedb5798e0e4:
oeqa: reproducible: Test core-image-sato and core-image-full-cmdline (2019-12-18 10:17:49 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/pseudo
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/pseudo
Robert Yang (1):
pseudo: Make realpath() remove trailing slashes
.../0001-realpath.c-Remove-trailing-slashes.patch | 57 ++++++++++++++++++++++
meta/recipes-devtools/pseudo/pseudo_git.bb | 1 +
2 files changed, 58 insertions(+)
create mode 100644 meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] pseudo: Make realpath() remove trailing slashes
2019-12-23 9:24 [PATCH 0/1] pseudo: Make realpath() remove trailing slashes Robert Yang
@ 2019-12-23 9:24 ` Robert Yang
2019-12-23 9:32 ` ✗ patchtest: failure for " Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Robert Yang @ 2019-12-23 9:24 UTC (permalink / raw)
To: openembedded-core
Linux system's realpath() remove trailing slashes, but pseudo's doesn't, need
make them identical.
E.g., the following code (rel.c) prints '/tmp' with system's realpath, but
pseudo's realpath prints '/tmp/':
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
int main() {
char out[PATH_MAX];
printf("%s\n", realpath("/tmp/", out));
return 0;
}
$ bitbake base-passwd -cdevshell # For pseudo env
$ gcc rel.c
$ ./a.out
/tmp/ (but should be /tmp)
This patch fixes the problem.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
.../0001-realpath.c-Remove-trailing-slashes.patch | 57 ++++++++++++++++++++++
meta/recipes-devtools/pseudo/pseudo_git.bb | 1 +
2 files changed, 58 insertions(+)
create mode 100644 meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch
diff --git a/meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch b/meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch
new file mode 100644
index 0000000..7566623
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/0001-realpath.c-Remove-trailing-slashes.patch
@@ -0,0 +1,57 @@
+From 86c9a5610e3333ad6aaadb1ac1e8b5a2c948d119 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 25 Nov 2019 18:46:45 +0800
+Subject: [PATCH] realpath.c: Remove trailing slashes
+
+Linux system's realpath() remove trailing slashes, but pseudo's doesn't, need
+make them identical.
+
+E.g., the following code (rel.c) prints '/tmp' with system's realpath, but
+pseudo's realpath prints '/tmp/':
+
+ #include <stdio.h>
+ #include <limits.h>
+ #include <stdlib.h>
+
+ int main() {
+ char out[PATH_MAX];
+ printf("%s\n", realpath("/tmp/", out));
+ return 0;
+ }
+
+$ bitbake base-passwd -cdevshell # For pseudo env
+$ gcc rel.c
+$ ./a.out
+/tmp/ (but should be /tmp)
+
+This patch fixes the problem.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ ports/unix/guts/realpath.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/ports/unix/guts/realpath.c b/ports/unix/guts/realpath.c
+--- a/ports/unix/guts/realpath.c
++++ b/ports/unix/guts/realpath.c
+@@ -14,7 +14,14 @@
+ errno = ENAMETOOLONG;
+ return NULL;
+ }
+- if ((len = strlen(rname)) >= pseudo_sys_path_max()) {
++ len = strlen(rname);
++ char *ep = rname + len - 1;
++ while (ep > rname && *ep == '/') {
++ --len;
++ *(ep--) = '\0';
++ }
++
++ if (len >= pseudo_sys_path_max()) {
+ errno = ENAMETOOLONG;
+ return NULL;
+ }
+--
+2.7.4
+
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 1f2df4a..7c75293 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -8,6 +8,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo \
file://toomanyfiles.patch \
file://0001-maketables-wrappers-use-Python-3.patch \
file://0001-Add-statx.patch \
+ file://0001-realpath.c-Remove-trailing-slashes.patch \
"
SRCREV = "060058bb29f70b244e685b3c704eb0641b736f73"
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* ✗ patchtest: failure for pseudo: Make realpath() remove trailing slashes
2019-12-23 9:24 [PATCH 0/1] pseudo: Make realpath() remove trailing slashes Robert Yang
2019-12-23 9:24 ` [PATCH 1/1] " Robert Yang
@ 2019-12-23 9:32 ` Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2019-12-23 9:32 UTC (permalink / raw)
To: Robert Yang; +Cc: openembedded-core
== Series Details ==
Series: pseudo: Make realpath() remove trailing slashes
Revision: 1
URL : https://patchwork.openembedded.org/series/21736/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:
* Issue Upstream-Status is Submitted, but it is not mentioned where [test_upstream_status_presence_format]
Suggested fix Include where 0001-realpath.c-Remove-trailing-slashes.patch was submitted
Current Upstream-Status: Submitted
Standard format Upstream-Status: Submitted [where]
If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-23 9:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-23 9:24 [PATCH 0/1] pseudo: Make realpath() remove trailing slashes Robert Yang
2019-12-23 9:24 ` [PATCH 1/1] " Robert Yang
2019-12-23 9:32 ` ✗ patchtest: failure for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox