config.user/group used if config.rouser/rogroup is not set
This commit is contained in:
parent
7a08ffa596
commit
92df915a7e
1 changed files with 6 additions and 5 deletions
|
@ -8,9 +8,9 @@ const fs = require('fs');
|
||||||
const tryRequire = require('try-require');
|
const tryRequire = require('try-require');
|
||||||
const posix = tryRequire('posix');
|
const posix = tryRequire('posix');
|
||||||
|
|
||||||
function _getConfigUidGid(prefix) {
|
function _getConfigUidGid(prefix, defaultUid, defaultGid) {
|
||||||
let uid = process.getuid();
|
let uid = defaultUid;
|
||||||
let gid = process.getgid();
|
let gid = defaultGid;
|
||||||
|
|
||||||
if (posix) {
|
if (posix) {
|
||||||
try {
|
try {
|
||||||
|
@ -36,11 +36,12 @@ function _getConfigUidGid(prefix) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConfigUidGid() {
|
function getConfigUidGid() {
|
||||||
return _getConfigUidGid('');
|
return _getConfigUidGid('', process.getuid(), process.getgid());
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConfigROUidGid() {
|
function getConfigROUidGid() {
|
||||||
return _getConfigUidGid('ro');
|
let rwIds = getConfigUidGid();
|
||||||
|
return _getConfigUidGid('ro', rwIds.uid, rwIds.gid);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ensureMailtrainOwner(file, callback) {
|
function ensureMailtrainOwner(file, callback) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue