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

Fix auth_socket to build on OpenBSD / Bitrig

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.5.29
    • 5.5.30
    • None
    • None
    • OpenBSD

    Description

      The attached patches for MariaDB 5.5 and newer allow the auth_socket plugin to build on OpenBSD and Bitrig.

      Attachments

        Activity

          Why did you add #include <my_global.h> into plugin/auth_socket/auth_socket.c ?

          serg Sergei Golubchik added a comment - Why did you add #include <my_global.h> into plugin/auth_socket/auth_socket.c ?
          brad0 Brad Smith added a comment - - edited

          That is where the define is set for ucred vs sockpeercred.

          brad0 Brad Smith added a comment - - edited That is where the define is set for ucred vs sockpeercred.
          brad0 Brad Smith added a comment -

          Added one more patch I missed.

          brad0 Brad Smith added a comment - Added one more patch I missed.
          brad0 Brad Smith added a comment -

          Any chance of getting this reviewed and into the tree?

          brad0 Brad Smith added a comment - Any chance of getting this reviewed and into the tree?

          yes
          it has "Fix Version: 5.5.30" - it doesn't matter when it's reviewed as long as it's before 5.5.30 release.
          You can start worrying only if the priority is decreased or he fix-version changes.

          serg Sergei Golubchik added a comment - yes it has "Fix Version: 5.5.30" - it doesn't matter when it's reviewed as long as it's before 5.5.30 release. You can start worrying only if the priority is decreased or he fix-version changes.

          I'd prefer to avoid changing files outside of the plugin directory.
          Could you please check the following patch and see if it works for you?
          *******************************************************************
          === modified file 'plugin/auth_socket/CMakeLists.txt'
          — plugin/auth_socket/CMakeLists.txt 2011-07-12 12:34:47 +0000
          +++ plugin/auth_socket/CMakeLists.txt 2013-03-07 14:49:43 +0000
          @@ -21,7 +21,19 @@ int main()

          { struct ucred cred; getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0); }

          " HAVE_PEERCRED)
          +
          +IF (NOT HAVE_PEERCRED)
          + # Hi, OpenBSD!
          + CHECK_CXX_SOURCE_COMPILES(
          + "#include <sys/types.h>
          + #include <sys/socket.h>
          + int main()

          { + struct sockpeercred cred; + getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0); + }

          " HAVE_SOCKPEERCRED)
          + ADD_DEFINITIONS(-Ducred=sockpeercred)
          +ENDIF()

          -IF(HAVE_PEERCRED)
          +IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED)
          MYSQL_ADD_PLUGIN(auth_socket auth_socket.c MODULE_ONLY)
          ENDIF()
          *******************************************************************

          serg Sergei Golubchik added a comment - I'd prefer to avoid changing files outside of the plugin directory. Could you please check the following patch and see if it works for you? ******************************************************************* === modified file 'plugin/auth_socket/CMakeLists.txt' — plugin/auth_socket/CMakeLists.txt 2011-07-12 12:34:47 +0000 +++ plugin/auth_socket/CMakeLists.txt 2013-03-07 14:49:43 +0000 @@ -21,7 +21,19 @@ int main() { struct ucred cred; getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0); } " HAVE_PEERCRED) + +IF (NOT HAVE_PEERCRED) + # Hi, OpenBSD! + CHECK_CXX_SOURCE_COMPILES( + "#include <sys/types.h> + #include <sys/socket.h> + int main() { + struct sockpeercred cred; + getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0); + } " HAVE_SOCKPEERCRED) + ADD_DEFINITIONS(-Ducred=sockpeercred) +ENDIF() -IF(HAVE_PEERCRED) +IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED) MYSQL_ADD_PLUGIN(auth_socket auth_socket.c MODULE_ONLY) ENDIF() *******************************************************************

          People

            serg Sergei Golubchik
            brad0 Brad Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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