Uploaded image for project: 'Percona Server for MySQL'
  1. Percona Server for MySQL
  2. PS-7788

Wildcard globbing in `procfs_files_spec` does not work

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • 8.0.25-15 (Q2 2021)
    • 8.0.26-16 (Q3 2021)
    • ProcFS
    • None

    Description

      By the spec given, basic path globbing "à la glob(7)" is supported in `procfs_files_spec`. The default value given for this variable attempts to make use of this feature, containing the value `/proc/irq/*/*` within it. However, while there is code in the plugin to implement support for globbing, it does not actually seem to work. Even when running SELinux in permissive mode (see PS-7787), the query `SELECT FILE FROM INFORMATION_SCHEMA.PROCFS WHERE FILE LIKE '/proc/irq/%';` does not produce any results with `procfs_files_spec`'s default value.

      Using strace, we can see that the plugin seems to actually iterate through the glob-matching filenames correctly (provided it has permission to do so) but nonetheless, the files matched by globs do not show up on the query:

      mysql> select @@procfs_files_spec;
      +---------------------+
      | @@procfs_files_spec |
      +---------------------+
      | /proc/irq/*/node    |
      +---------------------+
      1 row in set (0.00 sec)
      
      mysql> SELECT FILE FROM INFORMATION_SCHEMA.PROCFS;
      Empty set (0.04 sec)
      [[email protected] ~]$ sudo strace -e trace=file -f -p "$(sudo cat /var/run/mysqld/mysqld.pid)"
      strace: Process 8797 attached with 40 threads
      [pid  8842] openat(AT_FDCWD, "/proc/irq", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 39
      [pid  8842] openat(AT_FDCWD, "/proc/irq/0", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 40
      [pid  8842] lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq/0", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq/0/node", {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
      [pid  8842] openat(AT_FDCWD, "/proc/irq/1", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 40
      [pid  8842] lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq/1", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq/1/node", {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
      [pid  8842] openat(AT_FDCWD, "/proc/irq/2", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 40
      [pid  8842] lstat("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq/2", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
      [pid  8842] lstat("/proc/irq/2/node", {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
      [... more output omitted]

      Attachments

        Issue Links

          Activity

            People

              marcelo.altmann Marcelo Altmann
              noemi.lapresta Noemi Lapresta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist