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

Fix auth_socket to build on OpenBSD / Bitrig

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.29
    • Fix Version/s: 5.5.30
    • Component/s: None
    • Labels:
      None
    • Environment:
      OpenBSD

      Description

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

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

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

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

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

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

            Added one more patch I missed.

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

            Any chance of getting this reviewed and into the tree?

            Show
            brad0 Brad Smith added a comment - Any chance of getting this reviewed and into the tree?
            Hide
            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.

            Show
            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.
            Hide
            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()
            *******************************************************************

            Show
            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

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 20 minutes
                  20m