diff mbox series

[1/2] npm.bbclass: Fix file permissions before opening it for writing

Message ID 20220513134829.1895574-2-zboszor@pr.hu
State New
Headers show
Series [1/2] npm.bbclass: Fix file permissions before opening it for writing | expand

Commit Message

Böszörményi Zoltán May 13, 2022, 1:48 p.m. UTC
From: Zoltán Böszörményi <zboszor@gmail.com>

Some node module archives in npmjs.org contain wrong permissions.
I found a case with package.json in the archive being r-xr-xr-x
for which open(..., "w") fails. Set the manifest file permissions
to 0666 just in case.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
---
 meta/classes/npm.bbclass | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass
index ba50fcac20..7f52ec6061 100644
--- a/meta/classes/npm.bbclass
+++ b/meta/classes/npm.bbclass
@@ -202,6 +202,7 @@  python npm_do_configure() {
         if has_shrinkwrap_file:
             _update_manifest("devDependencies")
 
+    os.chmod(cached_manifest_file, 0o666)
     with open(cached_manifest_file, "w") as f:
         json.dump(cached_manifest, f, indent=2)