🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

bin-links

Package Overview
Dependencies
Maintainers
4
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-links - npm Package Compare versions

Comparing version
6.0.0
to
6.0.2
+7
-3
lib/check-bin.js

@@ -5,3 +5,3 @@ // check to see if a bin is allowed to be overwritten

const binTarget = require('./bin-target.js')
const { resolve, dirname } = require('path')
const { resolve, dirname, sep } = require('path')
const readCmdShim = require('read-cmd-shim')

@@ -38,3 +38,5 @@ const { readlink } = require('fs/promises')

if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) {
const resolvedLower = resolved.toLowerCase()
const pathLower = path.toLowerCase()
if (resolvedLower !== pathLower && !resolvedLower.startsWith(pathLower + sep)) {
return failEEXIST({ target })

@@ -70,3 +72,5 @@ }

if (resolved.toLowerCase().indexOf(path.toLowerCase()) !== 0) {
const resolvedLower = resolved.toLowerCase()
const pathLower = path.toLowerCase()
if (resolvedLower !== pathLower && !resolvedLower.startsWith(pathLower + sep)) {
return failEEXIST({ target: shim })

@@ -73,0 +77,0 @@ }

@@ -7,3 +7,3 @@ // if the thing isn't there, skip it

const { resolve, dirname } = require('path')
const { resolve, dirname, sep } = require('path')
const { lstat, mkdir, readlink, rm, symlink } = require('fs/promises')

@@ -67,3 +67,3 @@ const { log } = require('proc-log')

target = resolve(dirname(to), target)
if (target.indexOf(path) === 0 || force) {
if (target === path || target.startsWith(path + sep) || force) {
return rm(to, rmOpts).then(() => CLOBBER)

@@ -70,0 +70,0 @@ }

@@ -1,2 +0,2 @@

const { resolve, dirname } = require('path')
const { resolve, dirname, sep } = require('path')
const { lstat } = require('fs/promises')

@@ -67,3 +67,4 @@ const throwNonEnoent = er => {

target = resolve(dirname(to), target)
if (target.indexOf(resolve(path)) !== 0) {
const base = resolve(path)
if (target !== base && !target.startsWith(base + sep)) {
return failEEXIST({ from, to, path })

@@ -70,0 +71,0 @@ }

{
"name": "bin-links",
"version": "6.0.0",
"version": "6.0.2",
"description": "JavaScript package binary linker",

@@ -35,3 +35,3 @@ "main": "./lib/index.js",

"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.27.1",
"@npmcli/template-oss": "4.30.0",
"require-inject": "^1.4.4",

@@ -59,5 +59,7 @@ "tap": "^16.0.1"

"windowsCI": false,
"version": "4.27.1",
"publish": true
"version": "4.30.0",
"publish": true,
"updateNpm": false,
"latestCiVersion": 24
}
}