public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/1] fix expansion of variables in SRC_URI of dpkg-prebuilt
@ 2024-07-12  9:22 'Felix Moessbauer' via isar-users
  2024-07-22  8:57 ` Uladzimir Bely
  2024-07-30  8:04 ` Uladzimir Bely
  0 siblings, 2 replies; 4+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2024-07-12  9:22 UTC (permalink / raw)
  To: isar-users; +Cc: adriaan.schmidt, Felix Moessbauer

The processing of the items in SRC_URI of dpkg-prebuilt previously was
executed on the non expanded variables. This was introduced to fix
credential leaks and to avoid absolute paths in the signatures (caching
issues). However, this does not work when putting whole SRC_URI entries
into variables (which potentially can be empty), as then the
unpack=false is added to the non-expanded variable which either might
already contain this, or is empty. This led to broken urls.

To fix this, the patch changes the processing logic to work on the
expanded string. As this would re-introduce the credential and caching
issues, we further add a vardepvalue with the non-expanded string. By
that, the signatures just contain the original string in its non
expanded version.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/dpkg-prebuilt.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg-prebuilt.bbclass
index a6187a07..ecf0d383 100644
--- a/meta/classes/dpkg-prebuilt.bbclass
+++ b/meta/classes/dpkg-prebuilt.bbclass
@@ -7,13 +7,16 @@ inherit dpkg-base
 
 python do_unpack:prepend() {
     # enforce unpack=false
-    src_uri = (d.getVar('SRC_URI', False) or '').split()
-    if len(src_uri) == 0:
+    src_uri_raw = d.getVar('SRC_URI', False)
+    src_uri_exp = (d.getVar('SRC_URI', True) or '').split()
+    if len(src_uri_exp) == 0:
         return
     def ensure_unpack_false(uri):
         return ';'.join([x for x in uri.split(';') if not x.startswith('unpack=')] + ['unpack=false'])
-    src_uri = [ensure_unpack_false(uri) for uri in src_uri]
+    src_uri = [ensure_unpack_false(uri) for uri in src_uri_exp]
     d.setVar('SRC_URI', ' '.join(src_uri))
+    if src_uri_raw:
+        d.appendVarFlag('SRC_URI', 'vardepvalue', src_uri_raw)
 }
 
 # also breaks inherited (from dpkg-base) dependency on sbuild_chroot
-- 
2.39.2

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240712092245.47054-1-felix.moessbauer%40siemens.com.

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

* Re: [PATCH 1/1] fix expansion of variables in SRC_URI of dpkg-prebuilt
  2024-07-12  9:22 [PATCH 1/1] fix expansion of variables in SRC_URI of dpkg-prebuilt 'Felix Moessbauer' via isar-users
@ 2024-07-22  8:57 ` Uladzimir Bely
  2024-07-22 12:05   ` 'MOESSBAUER, Felix' via isar-users
  2024-07-30  8:04 ` Uladzimir Bely
  1 sibling, 1 reply; 4+ messages in thread
From: Uladzimir Bely @ 2024-07-22  8:57 UTC (permalink / raw)
  To: Felix Moessbauer, isar-users

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

On Fri, 2024-07-12 at 11:22 +0200, 'Felix Moessbauer' via isar-users
wrote:
> The processing of the items in SRC_URI of dpkg-prebuilt previously
> was
> executed on the non expanded variables. This was introduced to fix
> credential leaks and to avoid absolute paths in the signatures
> (caching
> issues). However, this does not work when putting whole SRC_URI
> entries
> into variables (which potentially can be empty), as then the
> unpack=false is added to the non-expanded variable which either might
> already contain this, or is empty. This led to broken urls.
> 
> To fix this, the patch changes the processing logic to work on the
> expanded string. As this would re-introduce the credential and
> caching
> issues, we further add a vardepvalue with the non-expanded string. By
> that, the signatures just contain the original string in its non
> expanded version.
> 

Yes, this change currently seems to break CI (test_sstate fails). I
haven't investigated it deeply yet, so for now just attaching the log.

> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  meta/classes/dpkg-prebuilt.bbclass | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg-
> prebuilt.bbclass
> index a6187a07..ecf0d383 100644
> --- a/meta/classes/dpkg-prebuilt.bbclass
> +++ b/meta/classes/dpkg-prebuilt.bbclass
> @@ -7,13 +7,16 @@ inherit dpkg-base
>  
>  python do_unpack:prepend() {
>      # enforce unpack=false
> -    src_uri = (d.getVar('SRC_URI', False) or '').split()
> -    if len(src_uri) == 0:
> +    src_uri_raw = d.getVar('SRC_URI', False)
> +    src_uri_exp = (d.getVar('SRC_URI', True) or '').split()
> +    if len(src_uri_exp) == 0:
>          return
>      def ensure_unpack_false(uri):
>          return ';'.join([x for x in uri.split(';') if not
> x.startswith('unpack=')] + ['unpack=false'])
> -    src_uri = [ensure_unpack_false(uri) for uri in src_uri]
> +    src_uri = [ensure_unpack_false(uri) for uri in src_uri_exp]
>      d.setVar('SRC_URI', ' '.join(src_uri))
> +    if src_uri_raw:
> +        d.appendVarFlag('SRC_URI', 'vardepvalue', src_uri_raw)
>  }
>  
>  # also breaks inherited (from dpkg-base) dependency on sbuild_chroot
> -- 
> 2.39.2
> 

-- 
Best regards,
Uladzimir.



-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/00df27852fd8647508ebcfd9a460e49970f90a76.camel%40ilbers.de.

[-- Attachment #2: debug.log --]
[-- Type: text/x-log, Size: 10727 bytes --]

[stdlog] 2024-07-22 09:57:03,979 avocado.test test             L0313 INFO | INIT 1-/build/isar_ub_devel/453/testsuite/citest.py:SstateTest.test_sstate
[stdlog] 2024-07-22 09:57:03,979 avocado.test parameters       L0141 DEBUG| PARAMS (key=timeout, path=*, default=None) => None
[stdlog] 2024-07-22 09:57:03,979 avocado.test parameters       L0141 DEBUG| PARAMS (key=timeout_factor, path=*, default=1.0) => 1.0
[stdlog] 2024-07-22 09:57:03,979 avocado.test test             L0345 DEBUG| Test metadata:
[stdlog] 2024-07-22 09:57:03,979 avocado.test test             L0347 DEBUG|   filename: /build/isar_ub_devel/453/testsuite/citest.py
[stdlog] 2024-07-22 09:57:03,979 avocado.test test             L0353 DEBUG|   teststmpdir: /var/tmp/avocado_jhxl7vix
[stdlog] 2024-07-22 09:57:03,979 avocado.test test             L0354 DEBUG|   original timeout: None
[stdlog] 2024-07-22 09:57:03,979 avocado.test test             L0355 DEBUG|   timeout factor: 1.0
[stdlog] 2024-07-22 09:57:03,979 avocado.test test             L0356 DEBUG|   actual timeout: None
[stdlog] 2024-07-22 09:57:03,980 avocado.test test             L0548 INFO | START 1-/build/isar_ub_devel/453/testsuite/citest.py:SstateTest.test_sstate
[stdlog] 2024-07-22 09:57:03,993 avocado.test parameters       L0141 DEBUG| PARAMS (key=quiet, path=*, default=1) => 1
[stdlog] 2024-07-22 09:57:03,993 avocado.test cibuilder        L0107 INFO | ===================================================
[stdlog] Configuring build_dir /build/isar_ub_devel/453/build-sstate
[stdlog]   compat_arch = True
[stdlog]   cross = True
[stdlog]   debsrc_cache = False
[stdlog]   offline = False
[stdlog]   container = False
[stdlog]   ccache = False
[stdlog]   sstate = True
[stdlog]   gpg_pub_key = None
[stdlog]   wic_deploy_parts = False
[stdlog]   source_date_epoch = None 
[stdlog]   use_apt_snapshot = False 
[stdlog]   dl_dir = /build/isar_ub_devel/453/downloads
[stdlog]   sstate_dir = 
[stdlog]   ccache_dir = ${TOPDIR}/ccache
[stdlog]   image_install = None
[stdlog] ===================================================
[stdlog] 2024-07-22 09:57:03,993 avocado.utils.process process          L0657 INFO | Running '/build/isar_ub_devel/453/scripts/isar-sstate lint /build/isar_ub_devel/453/build-sstate/sstate-cache --build-dir /build/isar_ub_devel/453/build-sstate --sources-dir /build/isar_ub_devel/453'
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr] Traceback (most recent call last):
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]   File "/build/isar_ub_devel/453/scripts/isar-sstate", line 940, in <module>
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]     sys.exit(main())
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]              ^^^^^^
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]   File "/build/isar_ub_devel/453/scripts/isar-sstate", line 936, in main
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]     return globals()[f'sstate_{args.command}'](**vars(args))
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]   File "/build/isar_ub_devel/453/scripts/isar-sstate", line 872, in sstate_lint
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]     val = val.lstrip()
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr]           ^^^^^^^^^^
[stdlog] 2024-07-22 09:57:04,235 avocado.utils.process process          L0473 DEBUG| [stderr] AttributeError: 'NoneType' object has no attribute 'lstrip'
[stdlog] 2024-07-22 09:57:04,249 avocado.utils.process process          L0714 INFO | Command '/build/isar_ub_devel/453/scripts/isar-sstate lint /build/isar_ub_devel/453/build-sstate/sstate-cache --build-dir /build/isar_ub_devel/453/build-sstate --sources-dir /build/isar_ub_devel/453' finished with 1 after 0.255344121s
[stdlog] 2024-07-22 09:57:04,249 avocado.test stacktrace       L0040 ERROR| 
[stdlog] 2024-07-22 09:57:04,249 avocado.test stacktrace       L0042 ERROR| Reproduced traceback from: /usr/lib/python3/dist-packages/avocado/core/test.py:638
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR| Traceback (most recent call last):
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR|   File "/build/isar_ub_devel/453/testsuite/citest.py", line 333, in test_sstate
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR|     self.perform_sstate_test(image_target, package_target)
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR|   File "/build/isar_ub_devel/453/testsuite/cibase.py", line 173, in perform_sstate_test
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR|     result = process.run(f'{isar_root}/scripts/isar-sstate lint {self.build_dir}/sstate-cache '
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR|              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR|   File "/usr/lib/python3/dist-packages/avocado/utils/process.py", line 1012, in run
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR|     raise CmdError(cmd, sp.result)
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR| avocado.utils.process.CmdError: Command '/build/isar_ub_devel/453/scripts/isar-sstate lint /build/isar_ub_devel/453/build-sstate/sstate-cache --build-dir /build/isar_ub_devel/453/build-sstate --sources-dir /build/isar_ub_devel/453' failed.
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR| stdout: b''
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR| stderr: b'Traceback (most recent call last):\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 940, in <module>\n    sys.exit(main())\n             ^^^^^^\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 936, in main\n    return globals()[f\'sstate_{args.command}\'](**vars(args))\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 872, in sstate_lint\n    val = val.lstrip()\n          ^^^^^^^^^^\nAttributeError: \'NoneType\' object has no attribute \'lstrip\'\n'
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0049 ERROR| additional_info: None
[stdlog] 2024-07-22 09:57:04,253 avocado.test stacktrace       L0050 ERROR| 
[stdlog] 2024-07-22 09:57:04,253 avocado.test test             L0642 DEBUG| Local variables:
[stdlog] 2024-07-22 09:57:04,267 avocado.test test             L0645 DEBUG|  -> self <class 'citest.SstateTest'>: 1-/build/isar_ub_devel/453/testsuite/citest.py:SstateTest.test_sstate
[stdlog] 2024-07-22 09:57:04,267 avocado.test test             L0645 DEBUG|  -> image_target <class 'str'>: mc:qemuamd64-bullseye:isar-image-base
[stdlog] 2024-07-22 09:57:04,267 avocado.test test             L0645 DEBUG|  -> package_target <class 'str'>: mc:qemuamd64-bullseye:hello
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0719 ERROR| Traceback (most recent call last):
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0719 ERROR|   File "/usr/lib/python3/dist-packages/avocado/core/test.py", line 646, in _run_test
[stdlog]     raise details
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0719 ERROR|   File "/usr/lib/python3/dist-packages/avocado/core/test.py", line 633, in _run_test
[stdlog]     testMethod()
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0719 ERROR|   File "/build/isar_ub_devel/453/testsuite/citest.py", line 333, in test_sstate
[stdlog]     self.perform_sstate_test(image_target, package_target)
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0719 ERROR|   File "/build/isar_ub_devel/453/testsuite/cibase.py", line 173, in perform_sstate_test
[stdlog]     result = process.run(f'{isar_root}/scripts/isar-sstate lint {self.build_dir}/sstate-cache '
[stdlog]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0719 ERROR|   File "/usr/lib/python3/dist-packages/avocado/utils/process.py", line 1012, in run
[stdlog]     raise CmdError(cmd, sp.result)
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0719 ERROR| avocado.utils.process.CmdError: Command '/build/isar_ub_devel/453/scripts/isar-sstate lint /build/isar_ub_devel/453/build-sstate/sstate-cache --build-dir /build/isar_ub_devel/453/build-sstate --sources-dir /build/isar_ub_devel/453' failed.
[stdlog] stdout: b''
[stdlog] stderr: b'Traceback (most recent call last):\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 940, in <module>\n    sys.exit(main())\n             ^^^^^^\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 936, in main\n    return globals()[f\'sstate_{args.command}\'](**vars(args))\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 872, in sstate_lint\n    val = val.lstrip()\n          ^^^^^^^^^^\nAttributeError: \'NoneType\' object has no attribute \'lstrip\'\n'
[stdlog] additional_info: None
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0740 ERROR| ERROR 1-/build/isar_ub_devel/453/testsuite/citest.py:SstateTest.test_sstate -> CmdError: Command '/build/isar_ub_devel/453/scripts/isar-sstate lint /build/isar_ub_devel/453/build-sstate/sstate-cache --build-dir /build/isar_ub_devel/453/build-sstate --sources-dir /build/isar_ub_devel/453' failed.
[stdlog] stdout: b''
[stdlog] stderr: b'Traceback (most recent call last):\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 940, in <module>\n    sys.exit(main())\n             ^^^^^^\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 936, in main\n    return globals()[f\'sstate_{args.command}\'](**vars(args))\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/build/isar_ub_devel/453/scripts/isar-sstate", line 872, in sstate_lint\n    val = val.lstrip()\n          ^^^^^^^^^^\nAttributeError: \'NoneType\' object has no attribute \'lstrip\'\n'
[stdlog] additional_info: None
[stdlog] 2024-07-22 09:57:04,268 avocado.test test             L0733 INFO | 

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

* Re: [PATCH 1/1] fix expansion of variables in SRC_URI of dpkg-prebuilt
  2024-07-22  8:57 ` Uladzimir Bely
@ 2024-07-22 12:05   ` 'MOESSBAUER, Felix' via isar-users
  0 siblings, 0 replies; 4+ messages in thread
From: 'MOESSBAUER, Felix' via isar-users @ 2024-07-22 12:05 UTC (permalink / raw)
  To: ubely, isar-users; +Cc: Schmidt, Adriaan

On Mon, 2024-07-22 at 11:57 +0300, Uladzimir Bely wrote:
> On Fri, 2024-07-12 at 11:22 +0200, 'Felix Moessbauer' via isar-users
> wrote:
> > The processing of the items in SRC_URI of dpkg-prebuilt previously
> > was
> > executed on the non expanded variables. This was introduced to fix
> > credential leaks and to avoid absolute paths in the signatures
> > (caching
> > issues). However, this does not work when putting whole SRC_URI
> > entries
> > into variables (which potentially can be empty), as then the
> > unpack=false is added to the non-expanded variable which either
> > might
> > already contain this, or is empty. This led to broken urls.
> > 
> > To fix this, the patch changes the processing logic to work on the
> > expanded string. As this would re-introduce the credential and
> > caching
> > issues, we further add a vardepvalue with the non-expanded string.
> > By
> > that, the signatures just contain the original string in its non
> > expanded version.
> > 
> 
> Yes, this change currently seems to break CI (test_sstate fails). I
> haven't investigated it deeply yet, so for now just attaching the
> log.

Hi, this looks unrelated, but uncovered a bug in the isar-sstate
script. I just send a patch for that, which should be applied prior to
this one: "fix(isar-sstate): continue on missing varvals value".

Felix

> 
> > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> > ---
> >  meta/classes/dpkg-prebuilt.bbclass | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/meta/classes/dpkg-prebuilt.bbclass
> > b/meta/classes/dpkg-
> > prebuilt.bbclass
> > index a6187a07..ecf0d383 100644
> > --- a/meta/classes/dpkg-prebuilt.bbclass
> > +++ b/meta/classes/dpkg-prebuilt.bbclass
> > @@ -7,13 +7,16 @@ inherit dpkg-base
> >  
> >  python do_unpack:prepend() {
> >      # enforce unpack=false
> > -    src_uri = (d.getVar('SRC_URI', False) or '').split()
> > -    if len(src_uri) == 0:
> > +    src_uri_raw = d.getVar('SRC_URI', False)
> > +    src_uri_exp = (d.getVar('SRC_URI', True) or '').split()
> > +    if len(src_uri_exp) == 0:
> >          return
> >      def ensure_unpack_false(uri):
> >          return ';'.join([x for x in uri.split(';') if not
> > x.startswith('unpack=')] + ['unpack=false'])
> > -    src_uri = [ensure_unpack_false(uri) for uri in src_uri]
> > +    src_uri = [ensure_unpack_false(uri) for uri in src_uri_exp]
> >      d.setVar('SRC_URI', ' '.join(src_uri))
> > +    if src_uri_raw:
> > +        d.appendVarFlag('SRC_URI', 'vardepvalue', src_uri_raw)
> >  }
> >  
> >  # also breaks inherited (from dpkg-base) dependency on
> > sbuild_chroot
> > -- 
> > 2.39.2
> > 
> 

-- 
Siemens AG, Technology
Linux Expert Center


-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/0c21f06c029c59c217bdd9d98337d3ee06fd7b5c.camel%40siemens.com.

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

* Re: [PATCH 1/1] fix expansion of variables in SRC_URI of dpkg-prebuilt
  2024-07-12  9:22 [PATCH 1/1] fix expansion of variables in SRC_URI of dpkg-prebuilt 'Felix Moessbauer' via isar-users
  2024-07-22  8:57 ` Uladzimir Bely
@ 2024-07-30  8:04 ` Uladzimir Bely
  1 sibling, 0 replies; 4+ messages in thread
From: Uladzimir Bely @ 2024-07-30  8:04 UTC (permalink / raw)
  To: Felix Moessbauer, isar-users

On Fri, 2024-07-12 at 11:22 +0200, 'Felix Moessbauer' via isar-users
wrote:
> The processing of the items in SRC_URI of dpkg-prebuilt previously
> was
> executed on the non expanded variables. This was introduced to fix
> credential leaks and to avoid absolute paths in the signatures
> (caching
> issues). However, this does not work when putting whole SRC_URI
> entries
> into variables (which potentially can be empty), as then the
> unpack=false is added to the non-expanded variable which either might
> already contain this, or is empty. This led to broken urls.
> 
> To fix this, the patch changes the processing logic to work on the
> expanded string. As this would re-introduce the credential and
> caching
> issues, we further add a vardepvalue with the non-expanded string. By
> that, the signatures just contain the original string in its non
> expanded version.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>  meta/classes/dpkg-prebuilt.bbclass | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/classes/dpkg-prebuilt.bbclass b/meta/classes/dpkg-
> prebuilt.bbclass
> index a6187a07..ecf0d383 100644
> --- a/meta/classes/dpkg-prebuilt.bbclass
> +++ b/meta/classes/dpkg-prebuilt.bbclass
> @@ -7,13 +7,16 @@ inherit dpkg-base
>  
>  python do_unpack:prepend() {
>      # enforce unpack=false
> -    src_uri = (d.getVar('SRC_URI', False) or '').split()
> -    if len(src_uri) == 0:
> +    src_uri_raw = d.getVar('SRC_URI', False)
> +    src_uri_exp = (d.getVar('SRC_URI', True) or '').split()
> +    if len(src_uri_exp) == 0:
>          return
>      def ensure_unpack_false(uri):
>          return ';'.join([x for x in uri.split(';') if not
> x.startswith('unpack=')] + ['unpack=false'])
> -    src_uri = [ensure_unpack_false(uri) for uri in src_uri]
> +    src_uri = [ensure_unpack_false(uri) for uri in src_uri_exp]
>      d.setVar('SRC_URI', ' '.join(src_uri))
> +    if src_uri_raw:
> +        d.appendVarFlag('SRC_URI', 'vardepvalue', src_uri_raw)
>  }
>  
>  # also breaks inherited (from dpkg-base) dependency on sbuild_chroot
> -- 
> 2.39.2
> 

Applied to next, thanks.

-- 
Best regards,
Uladzimir.



-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/60af4ba0a930954a347838e850a7c039f6043036.camel%40ilbers.de.

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

end of thread, other threads:[~2024-07-30  8:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-12  9:22 [PATCH 1/1] fix expansion of variables in SRC_URI of dpkg-prebuilt 'Felix Moessbauer' via isar-users
2024-07-22  8:57 ` Uladzimir Bely
2024-07-22 12:05   ` 'MOESSBAUER, Felix' via isar-users
2024-07-30  8:04 ` Uladzimir Bely

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