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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 3.5.0
    • Affects Version/s: 3.3.2
    • Component/s: None

      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

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

                Created:
                Updated:
                Resolved: