@profullstack/threatcrush 0.13.26 → 0.13.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/daemon.js +20 -4
- package/dist/daemon.js.map +1 -1
- package/dist/index.js +23 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31633,10 +31633,12 @@ var IpcServer = class {
|
|
|
31633
31633
|
}
|
|
31634
31634
|
const isRoot4 = process.platform === "linux" && typeof process.getuid === "function" && process.getuid() === 0;
|
|
31635
31635
|
if (isRoot4) {
|
|
31636
|
-
|
|
31637
|
-
|
|
31638
|
-
|
|
31639
|
-
|
|
31636
|
+
const gid = admGid();
|
|
31637
|
+
if (gid !== null) {
|
|
31638
|
+
try {
|
|
31639
|
+
nodeFs.chownSync(PATHS.socket, 0, gid);
|
|
31640
|
+
} catch {
|
|
31641
|
+
}
|
|
31640
31642
|
}
|
|
31641
31643
|
}
|
|
31642
31644
|
resolve6();
|
|
@@ -31841,6 +31843,20 @@ var IpcServer = class {
|
|
|
31841
31843
|
}
|
|
31842
31844
|
}
|
|
31843
31845
|
};
|
|
31846
|
+
function admGid(readGroup = () => (0, import_node_fs24.readFileSync)("/etc/group", "utf-8"), statAuthLog = () => (0, import_node_fs24.statSync)("/var/log/auth.log")) {
|
|
31847
|
+
try {
|
|
31848
|
+
for (const line of readGroup().split("\n")) {
|
|
31849
|
+
const [name, , gid] = line.split(":");
|
|
31850
|
+
if (name === "adm" && gid !== void 0 && /^\d+$/.test(gid)) return Number(gid);
|
|
31851
|
+
}
|
|
31852
|
+
} catch {
|
|
31853
|
+
}
|
|
31854
|
+
try {
|
|
31855
|
+
return statAuthLog().gid;
|
|
31856
|
+
} catch {
|
|
31857
|
+
return null;
|
|
31858
|
+
}
|
|
31859
|
+
}
|
|
31844
31860
|
|
|
31845
31861
|
// src/daemon/module-host.ts
|
|
31846
31862
|
var import_node_fs28 = require("fs");
|
|
@@ -36122,9 +36138,9 @@ function ensureSystemDirs(configDir) {
|
|
|
36122
36138
|
// it here only lasts until the next reboot. The unit's RuntimeDirectory=
|
|
36123
36139
|
// recreates it on every start instead.
|
|
36124
36140
|
];
|
|
36125
|
-
let
|
|
36141
|
+
let admGid2 = null;
|
|
36126
36142
|
try {
|
|
36127
|
-
|
|
36143
|
+
admGid2 = (0, import_node_fs37.statSync)("/var/log/auth.log").gid;
|
|
36128
36144
|
} catch {
|
|
36129
36145
|
}
|
|
36130
36146
|
for (const { path, groupWritable, sticky } of dirs) {
|
|
@@ -36133,7 +36149,7 @@ function ensureSystemDirs(configDir) {
|
|
|
36133
36149
|
} catch {
|
|
36134
36150
|
}
|
|
36135
36151
|
try {
|
|
36136
|
-
if (groupWritable &&
|
|
36152
|
+
if (groupWritable && admGid2 !== null) {
|
|
36137
36153
|
(0, import_node_fs37.chmodSync)(path, sticky ? 1533 : 509);
|
|
36138
36154
|
(0, import_node_child_process13.execSync)(`chgrp adm ${path}`, { stdio: "ignore" });
|
|
36139
36155
|
} else {
|