Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-151498

Grub2-script-check does not detect missing command arguments

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • rhel-9.7.z
    • grub2
    • None
    • None
    • Moderate
    • rhel-bootloader
    • 1
    • 5
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • grub2 (bugs)
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      grub2-script-check does not check the syntax of grub commands. In the example provided, password_pbkdf2 is missing an argument:

      # grep -B3 -A3 superusers /boot/grub2/grub.cfg
      if [ -f ${prefix}/user.cfg ]; then
        source ${prefix}/user.cfg
        if [ -n "${GRUB2_PASSWORD}" ]; then
          set superusers="test"
      export superusers
          password_pbkdf2 "test"
        fi
      fi
      

      Causing grub2 to error during boot:

      error: ../../grub-core/commands/password_pdkdf2.c:94:two arguments expected
      

      grub2-script-check does not report any error, it considers the configuration file to be okay.

      What is the impact of this issue to you?

      Can't-boot issues even after checking the configuration file.

      Please provide the package NVR for which the bug is seen:

      grub2-tools-2.06-114.el9_7.x86_64

      How reproducible is this bug?:

      Always

      Steps to reproduce

      1.  Create a grub.cfg file with correct grub commands but missing arguments.
      2.  Run the check with grub2-script-check

              bootloader-eng-team bootloader -eng-team
              rhn-support-jeperez Jesus Perez
              bootloader -eng-team bootloader -eng-team
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: