Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chownr

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chownr - npm Package Compare versions

Comparing version 0.0.2 to 1.0.0

.travis.yml

15

chownr.js

@@ -17,3 +17,11 @@ module.exports = chownr

children.forEach(function (child) {
chownr(path.resolve(p, child), uid, gid, then)
var pathChild = path.resolve(p, child);
fs.lstat(pathChild, function(er, stats) {
if (er)
return cb(er)
if (!stats.isSymbolicLink())
chownr(pathChild, uid, gid, then)
else
then()
})
})

@@ -39,5 +47,8 @@ function then (er) {

children.forEach(function (child) {
chownrSync(path.resolve(p, child), uid, gid)
var pathChild = path.resolve(p, child)
var stats = fs.lstatSync(pathChild)
if (!stats.isSymbolicLink())
chownrSync(pathChild, uid, gid)
})
return fs.chownSync(p, uid, gid)
}

6

package.json

@@ -5,3 +5,3 @@ {

"description": "like `chown -R`",
"version": "0.0.2",
"version": "1.0.0",
"repository": {

@@ -13,5 +13,5 @@ "type": "git",

"devDependencies": {
"tap": "0.2",
"mkdirp": "0.3",
"rimraf": ""
"rimraf": "",
"tap": "^1.2.0"
},

@@ -18,0 +18,0 @@ "scripts": {

@@ -20,3 +20,3 @@ if (!process.getuid || !process.getgid) {

if (code) throw new Error("failed to run 'id' command")
groups = output.trim().split("groups=")[1].split(",").map(function (s) {
groups = output.trim().split("=")[3].split(",").map(function (s) {
return parseInt(s, 10)

@@ -27,3 +27,3 @@ }).filter(function (g) {

console.error([curUid, groups[0]], "uid, gid")
// console.error([curUid, groups[0]], "uid, gid")

@@ -59,3 +59,3 @@ rimraf("/tmp/chownr", function (er) {

test("should complete successfully", function (t) {
console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0])
// console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0])
chownr("/tmp/chownr", curUid, groups[0], function (er) {

@@ -62,0 +62,0 @@ t.ifError(er)

@@ -20,3 +20,3 @@ if (!process.getuid || !process.getgid) {

if (code) throw new Error("failed to run 'id' command")
groups = output.trim().split("groups=")[1].split(",").map(function (s) {
groups = output.trim().split("=")[3].split(",").map(function (s) {
return parseInt(s, 10)

@@ -27,3 +27,3 @@ }).filter(function (g) {

console.error([curUid, groups[0]], "uid, gid")
// console.error([curUid, groups[0]], "uid, gid")

@@ -56,3 +56,3 @@ rimraf("/tmp/chownr", function (er) {

test("should complete successfully", function (t) {
console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0])
// console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0])
chownr.sync("/tmp/chownr", curUid, groups[0])

@@ -59,0 +59,0 @@ t.end()

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