Socket
Socket
Sign inDemoInstall

downgrade-root

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

downgrade-root - npm Package Compare versions

Comparing version 1.1.0 to 1.2.2

17

index.js

@@ -6,8 +6,17 @@ 'use strict';

module.exports = function () {
if (isRoot() && process.setuid) {
var uid = parseInt(process.env.SUDO_UID, 10) || defaultUid();
if (uid && uid > 0) {
process.setuid(uid);
if (isRoot()) {
// setgid needs to happen before setuid to avoid EPERM
if (process.setgid) {
var gid = parseInt(process.env.SUDO_GID, 10);
if (gid && gid > 0) {
process.setgid(gid);
}
}
if (process.setuid) {
var uid = parseInt(process.env.SUDO_UID, 10) || defaultUid();
if (uid && uid > 0) {
process.setuid(uid);
}
}
}
};
{
"name": "downgrade-root",
"version": "1.1.0",
"version": "1.2.2",
"description": "Try to downgrade the permissions of a process with root privileges",

@@ -16,3 +16,3 @@ "license": "MIT",

"scripts": {
"test": "node test.js"
"test": "ava"
},

@@ -40,4 +40,4 @@ "files": [

"devDependencies": {
"ava": "0.0.4"
"ava": "*"
}
}
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