[elbe-devel] [PATCH 2/2] Protect 'ln' command in finetuning from excursion.

Bastian Germann bage at linutronix.de
Fri Jul 26 11:19:16 CEST 2019


> From: Olivier Dion <dion at linutronix.de>
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>  elbepack/finetuning.py | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
> index 7f20436e..dd037025 100644
> --- a/elbepack/finetuning.py
> +++ b/elbepack/finetuning.py
> @@ -209,10 +209,12 @@ class LnAction(FinetuningAction):
>          FinetuningAction.__init__(self, node)
>  
>      def execute(self, log, _buildenv, target):
> -        with target:
> +        target_name = self.node.et.attrib['path']
> +        link_name = self.node.et.text
> +        with target.protect({link_name}):
>              log.chroot(
> -                target.path, """/bin/sh -c 'ln -s %s "%s"' """ %
> -                (self.node.et.attrib['path'], self.node.et.text))
> +                target.path, """/bin/sh -c 'ln -sf %s "%s"' """ %
> +                (target_name, link_name))
>  
>  
>  @FinetuningAction.register('buildenv_mv')
> 



More information about the elbe-devel mailing list