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

mariadb-install-db shows warning on missing directory $pamtooldir/auth_pam_tool_dir

Details

    Description

      The problem shows up if you compile MariaDB without PAM.
      The fix is trivial. Before doing chown, the script should check if directory exists.
      Inside the file ./scripts/mysql_install_db.sh
      change line 496 from

        if test -z "$srcdir" -a "$in_rpm" -eq 0
      

      to

        if test -z "$srcdir" -a "$in_rpm" -eq 0 -a -d "$pamtooldir/auth_pam_tool_dir"
      

      Attachments

        Activity

          heyingquan Yingquan He added a comment -

          I would love to fix this.

          heyingquan Yingquan He added a comment - I would love to fix this.
          heyingquan Yingquan He added a comment - - edited

          https://github.com/MariaDB/server/pull/2761

          Do I need to provide a test case for this PR?
          There are 6 affected versions, but currently, I've only created a PR for version 10.4 because I'm not sure if I need a test case for this PR.

          heyingquan Yingquan He added a comment - - edited https://github.com/MariaDB/server/pull/2761 Do I need to provide a test case for this PR? There are 6 affected versions, but currently, I've only created a PR for version 10.4 because I'm not sure if I need a test case for this PR.

          Thanks!
          I think it's fine without a test case. 10.4 is correct. But, please, explain in the commit comment why there can be no auth_pam_tool_dir — bug report suggest that it happens when one compiles without PAM plugin

          serg Sergei Golubchik added a comment - Thanks! I think it's fine without a test case. 10.4 is correct. But, please, explain in the commit comment why there can be no auth_pam_tool_dir — bug report suggest that it happens when one compiles without PAM plugin
          heyingquan Yingquan He added a comment -

          Hi Sergei,

          I've looked up a lot of documentation and even read the PAM source code, and I just learned that the auth_pam_tool_dir directory is created by the Linux distribution's package manager when installing PAM-related packages, but I don't know exactly which program or script creates it.

          I see the specified program path in the plugin/auth_pam/auth_pam.c file:

          static const char *tool_name= "auth_pam_tool_dir/auth_pam_tool";
          

          This program is started in the pam_auth function via the posix_spawn function.

          I'm wondering if the person who wrote this code might have more insight into why the auth_pam_tool_dir directory is missing. Would it be a good idea to reach out to them for advice?

          heyingquan Yingquan He added a comment - Hi Sergei, I've looked up a lot of documentation and even read the PAM source code, and I just learned that the auth_pam_tool_dir directory is created by the Linux distribution's package manager when installing PAM-related packages, but I don't know exactly which program or script creates it. I see the specified program path in the plugin/auth_pam/auth_pam.c file: static const char *tool_name= "auth_pam_tool_dir/auth_pam_tool" ; This program is started in the pam_auth function via the posix_spawn function. I'm wondering if the person who wrote this code might have more insight into why the auth_pam_tool_dir directory is missing. Would it be a good idea to reach out to them for advice?

          To create test case, remove pam-devel package from your build server.
          Alternatively, pass these params to cmake (build):

          -DPLUGIN_AUTH_PAM=NO -DPLUGIN_AUTH_PAM_V1=NO 
          

          Actually I didn't test second option. I just build without pam-devel.

          Karol Karol Roslaniec added a comment - To create test case, remove pam-devel package from your build server. Alternatively, pass these params to cmake (build): -DPLUGIN_AUTH_PAM=NO -DPLUGIN_AUTH_PAM_V1=NO Actually I didn't test second option. I just build without pam-devel.

          People

            danblack Daniel Black
            Karol Karol Roslaniec
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.