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

detect-libc

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detect-libc - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

35

lib/detect-libc.js

@@ -31,2 +31,9 @@ 'use strict';

function safeReaddirSync (path) {
try {
return readdirSync(path);
} catch (e) {}
return [];
}
var family = '';

@@ -56,19 +63,19 @@ var version = '';

// Try filesystem (family only)
try {
var lib = readdirSync('/lib');
var usrSbin = readdirSync('/usr/sbin');
if (lib.some(contains('-linux-gnu'))) {
var lib = safeReaddirSync('/lib');
if (lib.some(contains('-linux-gnu'))) {
family = GLIBC;
method = 'filesystem';
} else if (lib.some(contains('libc.musl-'))) {
family = MUSL;
method = 'filesystem';
} else if (lib.some(contains('ld-musl-'))) {
family = MUSL;
method = 'filesystem';
} else {
var usrSbin = safeReaddirSync('/usr/sbin');
if (usrSbin.some(contains('glibc'))) {
family = GLIBC;
method = 'filesystem';
} else if (lib.some(contains('libc.musl-'))) {
family = MUSL;
method = 'filesystem';
} else if (lib.some(contains('ld-musl-'))) {
family = MUSL;
method = 'filesystem';
} else if (usrSbin.some(contains('glibc'))) {
family = GLIBC;
method = 'filesystem';
}
} catch (e) {}
}
}

@@ -75,0 +82,0 @@ }

2

package.json
{
"name": "detect-libc",
"version": "1.0.2",
"version": "1.0.3",
"description": "Node.js module to detect the C standard library (libc) implementation family and version",

@@ -5,0 +5,0 @@ "main": "lib/detect-libc.js",

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