Merge pull request #541 from lolcow/patch-2

Fix uid variable name duplication/ambiguity
This commit is contained in:
Calvin Montgomery 2015-12-11 20:45:47 -08:00
commit 1f9e396e05
1 changed files with 7 additions and 7 deletions

View File

@ -9,9 +9,9 @@ var needPermissionsFixed = [
path.join(__dirname, "..", "google-drive-subtitles") path.join(__dirname, "..", "google-drive-subtitles")
]; ];
function fixPermissions(uid, gid) { function fixPermissions(user, group) {
uid = resolveUid(uid); var uid = resolveUid(user);
gid = resolveGid(uid); var gid = resolveGid(group);
needPermissionsFixed.forEach(function (dir) { needPermissionsFixed.forEach(function (dir) {
if (fs.existsSync(dir)) { if (fs.existsSync(dir)) {
fs.chownSync(dir, uid, gid); fs.chownSync(dir, uid, gid);
@ -19,12 +19,12 @@ function fixPermissions(uid, gid) {
}); });
} }
function resolveUid(uid) { function resolveUid(user) {
return parseInt(execSync('id -u ' + uid), 10); return parseInt(execSync('id -u ' + user), 10);
} }
function resolveGid(uid) { function resolveGid(group) {
return parseInt(execSync('id -g ' + uid), 10); return parseInt(execSync('id -g ' + group), 10);
} }
if (Config.get("setuid.enabled")) { if (Config.get("setuid.enabled")) {