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

file_key_management should support reading from a named pipe

Details

    Description

      It would be nice if file_key_management supported reading from a named pipe. Currently, it seeks through the file to determine its size before reading it; that's impossible with a named pipe.

      Perhaps the plugin could instead read the file in chunks and exit if it has read more than MAX_KEY_FILE_SIZE?

      Attachments

        Issue Links

          Activity

            A key file is a small file with the list of keys, it's not supposed to be more than 1Mb, and if it is — it's considered invalid, that's what the error says.

            May be it could be optimized by not reading the file at all in this case, but it's not the code path we need to optimize, so either behavior is fine.

            as for 2. — did you try to pipe a >64K file? because the message says "read bytes: 65536, max key file size: 1048576 bytes", so max size is 1Mb.

            serg Sergei Golubchik added a comment - A key file is a small file with the list of keys, it's not supposed to be more than 1Mb, and if it is — it's considered invalid, that's what the error says. May be it could be optimized by not reading the file at all in this case, but it's not the code path we need to optimize, so either behavior is fine. as for 2. — did you try to pipe a >64K file? because the message says "read bytes: 65536, max key file size: 1048576 bytes", so max size is 1Mb.
            susil.behera Susil Behera added a comment -

            did you try to pipe a >64K file?
            sergYes, I tried piping a ~1MB file. But it reads only 64K bytes and then errors out.

            susil.behera Susil Behera added a comment - did you try to pipe a >64K file? serg Yes, I tried piping a ~1MB file. But it reads only 64K bytes and then errors out.

            okay. 64K is a default fifo buffer size. I'll do something about it, thanks.

            serg Sergei Golubchik added a comment - okay. 64K is a default fifo buffer size. I'll do something about it, thanks.

            pushed fixes for both 1 and 2

            serg Sergei Golubchik added a comment - pushed fixes for both 1 and 2
            susil.behera Susil Behera added a comment -

            I'm closing testing after covering the following test cases,
            1. Pipe valid key:value data
            2. Multiple writes into a single pipe
            3. Pipe key:value data without the mandatory key 1
            4. Pipe key:value data exceeding max size of 1MB
            5. Pipe with no data
            6. Use a key not present in the piped data
            7. Install with non-existing pipe
            8. Install with already pipe by another program
            9. CRATE TABLE/ALTER TABLE with valid encryption key
            10. CRATE TABLE/ALTER TABLE with invalid encryption key

            The test results are looking good. OK to push from QA.

            susil.behera Susil Behera added a comment - I'm closing testing after covering the following test cases, 1. Pipe valid key:value data 2. Multiple writes into a single pipe 3. Pipe key:value data without the mandatory key 1 4. Pipe key:value data exceeding max size of 1MB 5. Pipe with no data 6. Use a key not present in the piped data 7. Install with non-existing pipe 8. Install with already pipe by another program 9. CRATE TABLE/ALTER TABLE with valid encryption key 10. CRATE TABLE/ALTER TABLE with invalid encryption key The test results are looking good. OK to push from QA.

            People

              serg Sergei Golubchik
              kolbe Kolbe Kegel (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              9 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.