Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-5389

start-stash.sh script preserves environment variables with -m flag causing permission issues

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.5.0
    • 3.3.2
    • None

    Description

      The start-stash.sh passes the -m flag to su which preserves environment variables. If the script is started by root, this can cause permission issues because the HOME environment variable is set to /root and the atlstash user does not have permission to set Git config options.

      ...
          if [ "$PRGRUNMODE" == "true" ] ; then
              $sucmd -m $STASH_USER -c "$PRGDIR/catalina.sh run $@"
          else
              $sucmd -m $STASH_USER -c "$PRGDIR/startup.sh $@"
          fi
      ...

      Results in the following errors when run as root:

      warning: unable to access '/root/.config/git/config': Permission denied
      warning: unable to access '/root/.gitconfig': Permission denied
      warning: unable to access '/root/.config/git/config': Permission denied
      warning: unable to access '/root/.gitconfig': Permission denied

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jethomas Jeff Thomas
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: