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

[RHEL10.2] bd_dm_node_from_name() Returns "mapper" for Empty String

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

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • None
    • rhel-10.2
    • libblockdev
    • None
    • None
    • None
    • rhel-storage-management
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

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

      What is the impact of this issue to you?

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

      How reproducible is this bug?:

      Steps to reproduce

      1.  
      2.  
      3.  

      Expected results

      Should return `NULL` (None in Python) or raise a `GError` because:

      • Empty string is not a valid DM map name
      • There is no DM device with an empty name
      • "mapper" is not a valid DM node name for an empty map

       

      Actual results

       

      Returns `"mapper"`, which is:

      • Incorrect - there is no DM node named "mapper"
      • Misleading - suggests empty string is a valid map name
      • Derived from the `/dev/mapper` directory path, not a real device

       

       

      The function `bd_dm_node_from_name()` returns the string `"mapper"` when called with an empty string `""` as the map name, instead of returning `NULL` or raising an error. This violates the API contract and can lead to incorrect behavior in calling code.

       

      ```python
      import gi
      gi.require_version("BlockDev", "3.0")
      from gi.repository import BlockDev as bdbd.init(None, None)# Call with empty string
      result = bd.dm_node_from_name("")print(f"Result: {repr(result)}")  # Prints: "mapper" (incorrect!)
      ```
      

       

      libblockdev-3.4.0-2.el10.x86_64

              vtrefny@redhat.com Vojtěch Trefný
              guazhang@redhat.com Guangwu Zhang
              Vojtěch Trefný Vojtěch Trefný
              Guangwu Zhang Guangwu Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: