New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

balena-settings-storage

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

balena-settings-storage - npm Package Compare versions

Comparing version 7.0.0-raise-eacces-errors-08b9d2bdfa7e006ee5dc5ee3f443a88ef0f32fa6 to 7.0.0-raise-eacces-errors-1995a3799b2589f9ff86e0a4b59f110b22007523

1

CHANGELOG.md

@@ -10,2 +10,3 @@ # Change Log

* WIP: Fix tests to run on CI (2) [Paulo Castro]
* Remove package-lock.json because it is not recommended for libraries 'package-lock.json' cannot be published to the npm registry, and will be ignored when npm-installed by packages that depend on resin-multibuild. This can lead to dependency-related errors being masked when resin-multibuild is tested in isolation. Reference: https://docs.npmjs.com/files/package-lock.json [josecoelho]

@@ -12,0 +13,0 @@ * Change to raise error when file has no permission [josecoelho]

2

package.json
{
"name": "balena-settings-storage",
"version": "7.0.0-raise-eacces-errors-08b9d2bdfa7e006ee5dc5ee3f443a88ef0f32fa6",
"version": "7.0.0-raise-eacces-errors-1995a3799b2589f9ff86e0a4b59f110b22007523",
"description": "Balena settings storage utilities",

@@ -5,0 +5,0 @@ "main": "build/storage.js",

@@ -155,5 +155,7 @@ import * as BalenaSettingsClientModule from 'balena-settings-client';

it('should raise an error', () => {
return m.chai
.expect(storage.get('bar'))
.to.eventually.be.rejectedWith(BalenaSettingsPermissionError);
return runAsNobody(() => {
return m.chai
.expect(storage.get('bar'))
.to.eventually.be.rejectedWith(BalenaSettingsPermissionError);
});
});

@@ -205,1 +207,26 @@ });

});
async function runAsNobody(
action: (...args: any) => Chai.PromisedAssertion,
args: any[] = [],
) {
const euid = process.geteuid();
const restoreEUID = () => {
if (euid === 0) {
process.seteuid(euid);
}
};
if (euid === 0) {
process.seteuid('nobody');
}
return action(...args).then(
(result) => {
restoreEUID();
return result;
},
(error) => {
restoreEUID();
throw error;
},
);
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc