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 posix = tryRequire('posix');
|
||||
|
||||
function _getConfigUidGid(prefix) {
|
||||
let uid = process.getuid();
|
||||
let gid = process.getgid();
|
||||
function _getConfigUidGid(prefix, defaultUid, defaultGid) {
|
||||
let uid = defaultUid;
|
||||
let gid = defaultGid;
|
||||
|
||||
if (posix) {
|
||||
try {
|
||||
|
@ -36,11 +36,12 @@ function _getConfigUidGid(prefix) {
|
|||
}
|
||||
|
||||
function getConfigUidGid() {
|
||||
return _getConfigUidGid('');
|
||||
return _getConfigUidGid('', process.getuid(), process.getgid());
|
||||
}
|
||||
|
||||
function getConfigROUidGid() {
|
||||
return _getConfigUidGid('ro');
|
||||
let rwIds = getConfigUidGid();
|
||||
return _getConfigUidGid('ro', rwIds.uid, rwIds.gid);
|
||||
}
|
||||
|
||||
function ensureMailtrainOwner(file, callback) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue