Socket
Socket
Sign inDemoInstall

downgrade-root

Package Overview
Dependencies
Maintainers
1
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.0.0 to 1.1.0

6

index.js
'use strict';
var isRoot = require('is-root');
var defaultUid = require('default-uid');
module.exports = function () {
if (isRoot() && process.setuid) {
process.setuid(501);
var uid = parseInt(process.env.SUDO_UID, 10) || defaultUid();
if (uid && uid > 0) {
process.setuid(uid);
}
}
};

3

package.json
{
"name": "downgrade-root",
"version": "1.0.0",
"version": "1.1.0",
"description": "Try to downgrade the permissions of a process with root privileges",

@@ -35,2 +35,3 @@ "license": "MIT",

"dependencies": {
"default-uid": "^1.0.0",
"is-root": "^1.0.0"

@@ -37,0 +38,0 @@ },

@@ -5,5 +5,7 @@ # downgrade-root [![Build Status](https://travis-ci.org/sindresorhus/downgrade-root.svg?branch=master)](https://travis-ci.org/sindresorhus/downgrade-root)

Usually a process started with `sudo`.
Usually applies to a process started with `sudo`.
Windows is gracefully ignored as it lacks a way to [set UID](http://nodejs.org/api/process.html#process_process_setuid_id).
## Install

@@ -10,0 +12,0 @@

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