[Groonga-commit] droonga/droonga-http-server at 1f1e844 [master] Set read permission for group correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Sep 25 17:40:37 JST 2014


YUKI Hiroshi	2014-09-25 17:40:37 +0900 (Thu, 25 Sep 2014)

  New Revision: 1f1e844390091bcdba881c83490780d86818014d
  https://github.com/droonga/droonga-http-server/commit/1f1e844390091bcdba881c83490780d86818014d

  Message:
    Set read permission for group correctly

  Modified files:
    bin/droonga-http-server-configure
    package.json

  Modified: bin/droonga-http-server-configure (+9 -3)
===================================================================
--- bin/droonga-http-server-configure    2014-09-25 17:34:45 +0900 (1ed5627)
+++ bin/droonga-http-server-configure    2014-09-25 17:40:37 +0900 (449de3d)
@@ -1,7 +1,8 @@
 #!/usr/bin/env node
 // -*- js -*-
 
-var exec     = require('child_process').exec,
+var chmod    = require('chmod'),
+    exec     = require('child_process').exec,
     fs       = require('fs'),
     mkdirp   = require('mkdirp'),
     path     = require('path'),
@@ -310,10 +311,15 @@ function writeNewConfigs() {
 
     if (serviceUserExists) {
       uid(serviceUserName, serviceGroupName, function(error, uid, gid) {
+        if (error)
+          return reject(error);
         var path = configFilePathSync();
         fs.chownSync(path, uid, gid);
-        fs.chmodSync(path, 'g+r');
-        resolve();
+        chmod(path, { group: { read: true }}, function(error) {
+          if (error)
+            return reject(error);
+          resolve();
+        });
       });
     }
     else {

  Modified: package.json (+1 -0)
===================================================================
--- package.json    2014-09-25 17:34:45 +0900 (2e4d3a2)
+++ package.json    2014-09-25 17:40:37 +0900 (7be5798)
@@ -19,6 +19,7 @@
   },
   "license": "MIT",
   "dependencies": {
+    "chmod": "*",
     "cookie-parser": "*",
     "commander": "*",
     "daemon": "*",
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index