Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-41161

Add OpenBSD getexecpath() support to my_get_exepath()

    XMLWordPrintable

Details

    Description

      Some MariaDB binaries (e.g. mariadb-backup) might need to fetch the program name for the running process. E.g. they might need to respawn themselves so they'd need that.
      But reading argv[0] is not a very reliable way to do this: some OSes might spoof it.
      So the code takes extra measures to acquire the actual executable name from the OS, where available.
      On OpenBSD there is a getexecpath() API that provides this. But it was not called by my_get_exepath(). As a result, on that OS, it was falling back to argv[0] which is not a very reliable source as already established.

      Fixed my_get_exepath() to use getexecpath() if available. Added a test to cover this.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            brad0 Brad Smith
            Oleksandr Byelkin Oleksandr Byelkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 0d
                0d
                Remaining:
                Remaining Estimate - 3h
                3h
                Logged:
                Time Spent - Not Specified
                Not Specified

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.