Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20873

Keyfile permissions are changed using chmod 644 during test execution

    • Fully Compatible
    • ALL
    • Security B 10/30/15, TIG C (11/20/15)

      After SERVER-20414, multiple replica set tests are run simultaneously. It is important to note that

      1. jstests/replsets/auth1.js may no longer be the first test that uses keyfiles, which had incidentally set their permissions to be 600 for the remainder of the suite. Each test that uses the keyfiles (or the test infrastructure in the shell) needs to set the permission to 600 before starting up its replica set.
      2. jstests/replsets/auth1.js changes the permission of the keyfiles to 644 during its test, which may cause concurrently running tests to fail spuriously with "permissions on keyfile are too open."

      If a test is going to modify the permissions of a keyfile during its execution to something other than 600, it should probably use its own keyfile.

      Example failure:

      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.181+0000 d20768| 2015-10-10T04:32:53.181+0000 I ACCESS   [main] permissions on /data/mci/src/jstests/libs/key1 are too open
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.365+0000 2015-10-10T04:32:53.361+0000 W NETWORK  [thread1] Failed to connect to 127.0.0.1:20768, reason: errno:111 Connection refused
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.420+0000 Could not start mongo program at 20768, process ended
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.420+0000 2015-10-10T04:32:53.362+0000 E QUERY    [thread1] Error: Failed to start node 2 :
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.420+0000 ReplSetTest.prototype.start@src/mongo/shell/replsettest.js:770:1
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.420+0000 ReplSetTest.prototype.startSet@src/mongo/shell/replsettest.js:278:16
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.420+0000 start@jstests/replsets/localhostAuthBypass.js:107:5
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.421+0000 runNonlocalTest@jstests/replsets/localhostAuthBypass.js:187:14
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.421+0000 @jstests/replsets/localhostAuthBypass.js:219:1
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.421+0000
      [js_test:localhostAuthBypass] 2015-10-10T04:32:53.421+0000 failed to load: jstests/replsets/localhostAuthBypass.js
      

            Assignee:
            jonathan.abrahams Jonathan Abrahams
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: