Skip to content
This repository has been archived by the owner on Oct 20, 2020. It is now read-only.

Commit

Permalink
windows fixes for privileges and loading correct wmi module
Browse files Browse the repository at this point in the history
  • Loading branch information
maier committed Oct 16, 2017
1 parent 6b21e69 commit f937616
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nad",
"version": "2.5.0",
"version": "2.5.1",
"private": true,
"license": "SEE LICENSE IN LICENSE",
"description": "Circonus Node Agent",
Expand Down
8 changes: 7 additions & 1 deletion sbin/nad.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ log.info({ name: settings.app_name, version: settings.app_version }, 'initializi
if (settings.is_windows) {
try {
log.info('loading WMI module for Windows platform');
circwmi = require('circwmi');
circwmi = require(path.join(nad.lib_dir, 'circwmi'));
} catch (err) {
const msg = 'unable to load circwmi module';

Expand Down Expand Up @@ -394,6 +394,12 @@ function start_statsd() {
* @returns {Object} promise
*/
function drop_privileges() {
if (settings.is_windows) {
log.warn('running on windows (drop privileges not supported), skipping drop privileges');

return Promise.resolve();
}

return new Promise((resolve, reject) => {
// NOTE: primary benefits of performing this drop in situ:
// 1. nad can only run as root intentionally (e.g. user
Expand Down

0 comments on commit f937616

Please sign in to comment.