diff mbox series

[langdale,28/30] combo-layer: dont use bb.utils.rename

Message ID 3d453183a7c31c85eeded3f270670aa69ac1a391.1671122751.git.steve@sakoman.com
State New
Headers show
Series [langdale,01/30] libarchive: CVE-2022-36227 NULL pointer dereference in archive_write.c | expand

Commit Message

Steve Sakoman Dec. 15, 2022, 7:20 p.m. UTC
From: Ross Burton <ross.burton@arm.com>

Bitbake may not be configured, and bb isn't imported anyway.

Instead just use os.rename(), and take the filename from the file object
instead of duplicating logic.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 528f4fb3683d048537604e4562ea758968060d62)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 scripts/combo-layer | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/scripts/combo-layer b/scripts/combo-layer
index c122f4b5e4..e467f390c1 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -507,7 +507,7 @@  def check_patch(patchfile):
     f.close()
     if of:
         of.close()
-        bb.utils.rename(patchfile + '.tmp', patchfile)
+        os.rename(of.name, patchfile)
 
 def drop_to_shell(workdir=None):
     if not sys.stdin.isatty():