Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10993

cordova creates shared /tmp/git directory that's only writable by current user

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 6.0.0
    • None
    • cordova-cli

    Description

      I have a Linux machine where multiple users run cordova. They use a project whose config.xml has a plugin which specifies a particular revision:

      <plugin name="cordova-plugin-statusbar" spec="https://github.com/apache/cordova-plugin-statusbar#244eb71" />
      

      When they cordova prepare the project, it ends up calling
      /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/gitclone.js, which creates a directory /tmp/git.

      But the directory is only writable by the current user. So when the next user runs it, they get an error:

          [exec] Fetching plugin "https://github.com/apache/cordova-plugin-statusbar" via git clone
          [exec] shell.js: internal error
          [exec] Error: EACCES: permission denied, mkdir '/tmp/git/1459363203511'
          [exec]     at Error (native)
          [exec]     at Object.fs.mkdirSync (fs.js:799:18)
          [exec]     at mkdirSyncRecursive (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/src/mkdir.js:11:8)
          [exec]     at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/src/mkdir.js:63:7
          [exec]     at Array.forEach (native)
          [exec]     at Object._mkdir (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/src/mkdir.js:48:8)
          [exec]     at Object.mkdir (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/node_modules/shelljs/src/common.js:186:23)
          [exec]     at Object.clone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/gitclone.js:45:11)
          [exec]     at Object.module.exports.clonePluginGitRepo (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/plugins.js:42:18)
          [exec]     at Object.module.exports.clonePluginGit (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/util/plugins.js:32:31)
      

      This could be solved by using a temporary directory within the user's home directory, or by making /tmp/git world-writable.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jweber Jacob Weber
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: