Openembedded Devel Discussions
 help / color / mirror / Atom feed
* [recipes-extended][PATCH] pax: strip off file name's trailing slash
@ 2016-07-12  7:15 Zhang Xiao
  2016-07-12  7:26 ` Gary Thomas
  2016-07-19 11:00 ` Martin Jansa
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Xiao @ 2016-07-12  7:15 UTC (permalink / raw)
  To: openembedded-devel

When extracting packaes, the trailing slash of the file name
has no means but may cause some issue on system call lstat.
Remove it.

Upstream-Status: Pending

Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
---
 .../pax-strip-off-file-name-s-trailing-slash.patch | 48 ++++++++++++++++++++++
 meta/recipes-extended/pax/pax_3.4.bb               |  4 +-
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch

diff --git a/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
new file mode 100644
index 0000000..a602b30
--- /dev/null
+++ b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
@@ -0,0 +1,48 @@
+From aa8ba118869b75a2a9cd681b2f0362d9d8f1c7ec Mon Sep 17 00:00:00 2001
+From: Zhang Xiao <xiao.zhang@windriver.com>
+Date: Tue, 12 Jul 2016 11:34:45 +0800
+Subject: [PATCH] pax: strip off file name's trailing slash
+
+When extracting packaes, the trailing slash of the file name
+has no means but may cause some issue on system call lstat.
+Remove it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+---
+ src/pat_rep.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/src/pat_rep.c b/src/pat_rep.c
+index b9a4636..4cbf6bf 100644
+--- a/src/pat_rep.c
++++ b/src/pat_rep.c
+@@ -605,7 +605,7 @@ int
+ mod_name(ARCHD *arcn)
+ {
+ 	int res = 0;
+-
++	char *pt;
+ 	/*
+ 	 * Strip off leading '/' if appropriate.
+ 	 * Currently, this option is only set for the tar format.
+@@ -639,6 +639,15 @@ mod_name(ARCHD *arcn)
+ 	}
+ 
+ 	/*
++	 * strip off trailing slash.
++	 */
++	pt = &(arcn->name[strlen(arcn->name) - 1]);
++	if (*pt == '/') {
++		 *pt = '\0';
++		arcn->nlen = strlen(arcn->name);
++	}
++
++	/*
+ 	 * IMPORTANT: We have a problem. what do we do with symlinks?
+ 	 * Modifying a hard link name makes sense, as we know the file it
+ 	 * points at should have been seen already in the archive (and if it
+-- 
+1.8.5.2.233.g932f7e4
+
diff --git a/meta/recipes-extended/pax/pax_3.4.bb b/meta/recipes-extended/pax/pax_3.4.bb
index 9d1abfb..7ce43ce 100644
--- a/meta/recipes-extended/pax/pax_3.4.bb
+++ b/meta/recipes-extended/pax/pax_3.4.bb
@@ -16,7 +16,9 @@ DEPENDS_append_libc-musl = " fts "
 
 SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
 	file://fix_for_compile_with_gcc-4.6.0.patch \
-	file://pax-3.4_fix_for_x32.patch"
+	file://pax-3.4_fix_for_x32.patch \
+	file://pax-strip-off-file-name-s-trailing-slash.patch \
+"
 
 SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
                              file://0001-use-strtoll-instead-of-strtoq.patch \
-- 
2.1.4



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

* Re: [recipes-extended][PATCH] pax: strip off file name's trailing slash
  2016-07-12  7:15 [recipes-extended][PATCH] pax: strip off file name's trailing slash Zhang Xiao
@ 2016-07-12  7:26 ` Gary Thomas
  2016-07-12 14:24   ` Joe MacDonald
  2016-07-19 11:00 ` Martin Jansa
  1 sibling, 1 reply; 4+ messages in thread
From: Gary Thomas @ 2016-07-12  7:26 UTC (permalink / raw)
  To: openembedded-devel

On 2016-07-12 09:15, Zhang Xiao wrote:
> When extracting packaes, the trailing slash of the file name
> has no means but may cause some issue on system call lstat.
> Remove it.
>
> Upstream-Status: Pending
>
> Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
> ---
>   .../pax-strip-off-file-name-s-trailing-slash.patch | 48 ++++++++++++++++++++++
>   meta/recipes-extended/pax/pax_3.4.bb               |  4 +-
>   2 files changed, 51 insertions(+), 1 deletion(-)
>   create mode 100644 meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
>
> diff --git a/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> new file mode 100644
> index 0000000..a602b30
> --- /dev/null
> +++ b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> @@ -0,0 +1,48 @@
> +From aa8ba118869b75a2a9cd681b2f0362d9d8f1c7ec Mon Sep 17 00:00:00 2001
> +From: Zhang Xiao <xiao.zhang@windriver.com>
> +Date: Tue, 12 Jul 2016 11:34:45 +0800
> +Subject: [PATCH] pax: strip off file name's trailing slash
> +
> +When extracting packaes, the trailing slash of the file name
> +has no means but may cause some issue on system call lstat.
> +Remove it.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
> +---
> + src/pat_rep.c | 11 ++++++++++-
> + 1 file changed, 10 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/pat_rep.c b/src/pat_rep.c
> +index b9a4636..4cbf6bf 100644
> +--- a/src/pat_rep.c
> ++++ b/src/pat_rep.c
> +@@ -605,7 +605,7 @@ int
> + mod_name(ARCHD *arcn)
> + {
> + 	int res = 0;
> +-
> ++	char *pt;
> + 	/*
> + 	 * Strip off leading '/' if appropriate.
> + 	 * Currently, this option is only set for the tar format.
> +@@ -639,6 +639,15 @@ mod_name(ARCHD *arcn)
> + 	}
> +
> + 	/*
> ++	 * strip off trailing slash.
> ++	 */
> ++	pt = &(arcn->name[strlen(arcn->name) - 1]);

This looks incorrect if the file name is only a single character.  You
should only attempt this if strlen(arcn->name) >= 2

> ++	if (*pt == '/') {
> ++		 *pt = '\0';
> ++		arcn->nlen = strlen(arcn->name);
> ++	}
> ++
> ++	/*
> + 	 * IMPORTANT: We have a problem. what do we do with symlinks?
> + 	 * Modifying a hard link name makes sense, as we know the file it
> + 	 * points at should have been seen already in the archive (and if it
> +--
> +1.8.5.2.233.g932f7e4
> +
> diff --git a/meta/recipes-extended/pax/pax_3.4.bb b/meta/recipes-extended/pax/pax_3.4.bb
> index 9d1abfb..7ce43ce 100644
> --- a/meta/recipes-extended/pax/pax_3.4.bb
> +++ b/meta/recipes-extended/pax/pax_3.4.bb
> @@ -16,7 +16,9 @@ DEPENDS_append_libc-musl = " fts "
>
>   SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
>   	file://fix_for_compile_with_gcc-4.6.0.patch \
> -	file://pax-3.4_fix_for_x32.patch"
> +	file://pax-3.4_fix_for_x32.patch \
> +	file://pax-strip-off-file-name-s-trailing-slash.patch \
> +"
>
>   SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
>                                file://0001-use-strtoll-instead-of-strtoq.patch \
>


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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

* Re: [recipes-extended][PATCH] pax: strip off file name's trailing slash
  2016-07-12  7:26 ` Gary Thomas
@ 2016-07-12 14:24   ` Joe MacDonald
  0 siblings, 0 replies; 4+ messages in thread
From: Joe MacDonald @ 2016-07-12 14:24 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 4301 bytes --]

[Re: [oe] [recipes-extended][PATCH] pax: strip off file name's trailing slash] On 16.07.12 (Tue 09:26) Gary Thomas wrote:

> On 2016-07-12 09:15, Zhang Xiao wrote:
> >When extracting packaes, the trailing slash of the file name
> >has no means but may cause some issue on system call lstat.
> >Remove it.
> >
> >Upstream-Status: Pending
> >
> >Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
> >---
> >  .../pax-strip-off-file-name-s-trailing-slash.patch | 48 ++++++++++++++++++++++
> >  meta/recipes-extended/pax/pax_3.4.bb               |  4 +-
> >  2 files changed, 51 insertions(+), 1 deletion(-)
> >  create mode 100644 meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> >
> >diff --git a/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> >new file mode 100644
> >index 0000000..a602b30
> >--- /dev/null
> >+++ b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> >@@ -0,0 +1,48 @@
> >+From aa8ba118869b75a2a9cd681b2f0362d9d8f1c7ec Mon Sep 17 00:00:00 2001
> >+From: Zhang Xiao <xiao.zhang@windriver.com>
> >+Date: Tue, 12 Jul 2016 11:34:45 +0800
> >+Subject: [PATCH] pax: strip off file name's trailing slash
> >+
> >+When extracting packaes, the trailing slash of the file name
> >+has no means but may cause some issue on system call lstat.
> >+Remove it.
> >+
> >+Upstream-Status: Pending
> >+
> >+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
> >+---
> >+ src/pat_rep.c | 11 ++++++++++-
> >+ 1 file changed, 10 insertions(+), 1 deletion(-)
> >+
> >+diff --git a/src/pat_rep.c b/src/pat_rep.c
> >+index b9a4636..4cbf6bf 100644
> >+--- a/src/pat_rep.c
> >++++ b/src/pat_rep.c
> >+@@ -605,7 +605,7 @@ int
> >+ mod_name(ARCHD *arcn)
> >+ {
> >+ 	int res = 0;
> >+-
> >++	char *pt;
> >+ 	/*
> >+ 	 * Strip off leading '/' if appropriate.
> >+ 	 * Currently, this option is only set for the tar format.
> >+@@ -639,6 +639,15 @@ mod_name(ARCHD *arcn)
> >+ 	}
> >+
> >+ 	/*
> >++	 * strip off trailing slash.
> >++	 */
> >++	pt = &(arcn->name[strlen(arcn->name) - 1]);
> 
> This looks incorrect if the file name is only a single character.  You
> should only attempt this if strlen(arcn->name) >= 2

Also, isn't this already covered:

pax-3.4/src/pat_rep.c:

 363       /*
 364        * strip off any trailing /, this should really never happen
 365        */
 366       len = pt->plen - 1;
 367       if (*(pt->pstr + len) == '/') {
 368          *(pt->pstr + len) = '\0';
 369          pt->plen = len;
 370       }
 371       pt->flgs = DIR_MTCH | MTCH;
 372       arcn->pat = pt;
 373       return(0);

At the very least, it's probably worth doing it in the same way as it is
elsewhere in the file.

-J.

> 
> >++	if (*pt == '/') {
> >++		 *pt = '\0';
> >++		arcn->nlen = strlen(arcn->name);
> >++	}
> >++
> >++	/*
> >+ 	 * IMPORTANT: We have a problem. what do we do with symlinks?
> >+ 	 * Modifying a hard link name makes sense, as we know the file it
> >+ 	 * points at should have been seen already in the archive (and if it
> >+--
> >+1.8.5.2.233.g932f7e4
> >+
> >diff --git a/meta/recipes-extended/pax/pax_3.4.bb b/meta/recipes-extended/pax/pax_3.4.bb
> >index 9d1abfb..7ce43ce 100644
> >--- a/meta/recipes-extended/pax/pax_3.4.bb
> >+++ b/meta/recipes-extended/pax/pax_3.4.bb
> >@@ -16,7 +16,9 @@ DEPENDS_append_libc-musl = " fts "
> >
> >  SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
> >  	file://fix_for_compile_with_gcc-4.6.0.patch \
> >-	file://pax-3.4_fix_for_x32.patch"
> >+	file://pax-3.4_fix_for_x32.patch \
> >+	file://pax-strip-off-file-name-s-trailing-slash.patch \
> >+"
> >
> >  SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
> >                               file://0001-use-strtoll-instead-of-strtoq.patch \
> >
> 
> 
> -- 
> ------------------------------------------------------------
> Gary Thomas                 |  Consulting for the
> MLB Associates              |    Embedded world
> ------------------------------------------------------------
-- 
-Joe MacDonald.
:wq

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 484 bytes --]

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

* Re: [recipes-extended][PATCH] pax: strip off file name's trailing slash
  2016-07-12  7:15 [recipes-extended][PATCH] pax: strip off file name's trailing slash Zhang Xiao
  2016-07-12  7:26 ` Gary Thomas
@ 2016-07-19 11:00 ` Martin Jansa
  1 sibling, 0 replies; 4+ messages in thread
From: Martin Jansa @ 2016-07-19 11:00 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 3489 bytes --]

On Tue, Jul 12, 2016 at 03:15:17PM +0800, Zhang Xiao wrote:
> When extracting packaes, the trailing slash of the file name
> has no means but may cause some issue on system call lstat.
> Remove it.
> 
> Upstream-Status: Pending
> 
> Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
> ---
>  .../pax-strip-off-file-name-s-trailing-slash.patch | 48 ++++++++++++++++++++++
>  meta/recipes-extended/pax/pax_3.4.bb               |  4 +-

Wrong ML and wrong subject tag.

>  2 files changed, 51 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> 
> diff --git a/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> new file mode 100644
> index 0000000..a602b30
> --- /dev/null
> +++ b/meta/recipes-extended/pax/pax/pax-strip-off-file-name-s-trailing-slash.patch
> @@ -0,0 +1,48 @@
> +From aa8ba118869b75a2a9cd681b2f0362d9d8f1c7ec Mon Sep 17 00:00:00 2001
> +From: Zhang Xiao <xiao.zhang@windriver.com>
> +Date: Tue, 12 Jul 2016 11:34:45 +0800
> +Subject: [PATCH] pax: strip off file name's trailing slash
> +
> +When extracting packaes, the trailing slash of the file name
> +has no means but may cause some issue on system call lstat.
> +Remove it.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
> +---
> + src/pat_rep.c | 11 ++++++++++-
> + 1 file changed, 10 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/pat_rep.c b/src/pat_rep.c
> +index b9a4636..4cbf6bf 100644
> +--- a/src/pat_rep.c
> ++++ b/src/pat_rep.c
> +@@ -605,7 +605,7 @@ int
> + mod_name(ARCHD *arcn)
> + {
> + 	int res = 0;
> +-
> ++	char *pt;
> + 	/*
> + 	 * Strip off leading '/' if appropriate.
> + 	 * Currently, this option is only set for the tar format.
> +@@ -639,6 +639,15 @@ mod_name(ARCHD *arcn)
> + 	}
> + 
> + 	/*
> ++	 * strip off trailing slash.
> ++	 */
> ++	pt = &(arcn->name[strlen(arcn->name) - 1]);
> ++	if (*pt == '/') {
> ++		 *pt = '\0';
> ++		arcn->nlen = strlen(arcn->name);
> ++	}
> ++
> ++	/*
> + 	 * IMPORTANT: We have a problem. what do we do with symlinks?
> + 	 * Modifying a hard link name makes sense, as we know the file it
> + 	 * points at should have been seen already in the archive (and if it
> +-- 
> +1.8.5.2.233.g932f7e4
> +
> diff --git a/meta/recipes-extended/pax/pax_3.4.bb b/meta/recipes-extended/pax/pax_3.4.bb
> index 9d1abfb..7ce43ce 100644
> --- a/meta/recipes-extended/pax/pax_3.4.bb
> +++ b/meta/recipes-extended/pax/pax_3.4.bb
> @@ -16,7 +16,9 @@ DEPENDS_append_libc-musl = " fts "
>  
>  SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
>  	file://fix_for_compile_with_gcc-4.6.0.patch \
> -	file://pax-3.4_fix_for_x32.patch"
> +	file://pax-3.4_fix_for_x32.patch \
> +	file://pax-strip-off-file-name-s-trailing-slash.patch \
> +"
>  
>  SRC_URI_append_libc-musl = " file://0001-Fix-build-with-musl.patch \
>                               file://0001-use-strtoll-instead-of-strtoq.patch \
> -- 
> 2.1.4
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

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

end of thread, other threads:[~2016-07-19 11:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12  7:15 [recipes-extended][PATCH] pax: strip off file name's trailing slash Zhang Xiao
2016-07-12  7:26 ` Gary Thomas
2016-07-12 14:24   ` Joe MacDonald
2016-07-19 11:00 ` Martin Jansa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox