[PATCH 1/1] br2-external: Check for invalid BR2_EXTERNAL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH 1/1] br2-external: Check for invalid BR2_EXTERNAL

Matthew Weber
From: Judd Meinders <[hidden email]>

This patch checks for BR2_EXTERNAL paths that begin with "../" which
do not work with multiple external support.

Signed-off-by: Judd Meinders <[hidden email]>
Signed-off-by: Matt Weber <[hidden email]>
---
 support/scripts/br2-external | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/support/scripts/br2-external b/support/scripts/br2-external
index 00cb57d..b695400 100755
--- a/support/scripts/br2-external
+++ b/support/scripts/br2-external
@@ -75,6 +75,10 @@ do_validate_one() {
     local br2_ext="${1}"
     local br2_name br2_desc n d
 
+    # Check for BR2_EXTERNAL paths that begin with "../"
+    if [[ "${br2_ext}" =~ ^\.\./ ]]; then
+        error "'%s': BR2_EXTERNAL must begin as an absolute path" "${br2_ext}"
+    fi
     if [ ! -d "${br2_ext}" ]; then
         error "'%s': no such file or directory\n" "${br2_ext}"
     fi
--
1.9.1

_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH 1/1] br2-external: Check for invalid BR2_EXTERNAL

Yann E. MORIN-2
Matt, All,

On June 16, 2017 9:37:09 PM GMT+02:00, Matt Weber <[hidden email]> wrote:
>From: Judd Meinders <[hidden email]>
>
>This patch checks for BR2_EXTERNAL paths that begin with "../" which
>do not work with multiple external support.

What do you consider broken with such relative paths?
Can you provide an example?

Ftr, relative paths are supposed to be supported, so I'd prefer we
fix by allowing rather than excluding it.

Regards,
Yann E. MOIRIN.

>Signed-off-by: Judd Meinders <[hidden email]>
>Signed-off-by: Matt Weber <[hidden email]>
>---
> support/scripts/br2-external | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/support/scripts/br2-external
>b/support/scripts/br2-external
>index 00cb57d..b695400 100755
>--- a/support/scripts/br2-external
>+++ b/support/scripts/br2-external
>@@ -75,6 +75,10 @@ do_validate_one() {
>     local br2_ext="${1}"
>     local br2_name br2_desc n d
>
>+    # Check for BR2_EXTERNAL paths that begin with "../"
>+    if [[ "${br2_ext}" =~ ^\.\./ ]]; then
>+        error "'%s': BR2_EXTERNAL must begin as an absolute path"
>"${br2_ext}"
>+    fi
>     if [ ! -d "${br2_ext}" ]; then
>         error "'%s': no such file or directory\n" "${br2_ext}"
>     fi


--
Sent from my phone. Please excuse my brevity.
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Loading...