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

better error should be thrown when invalid character is in hostname

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • None
    • rhel-net-mgmt
    • ssg_networking
    • 2
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • Hide

      Given a RHEL user has executed the nmcli general hostname command

      When the hostname contains characters other than lowercase letters, numbers, or hyphens

      Then NetworkManager should check the hostname for invalid characters before sending it via dbus and it should return an error message to the user explaining which characters are invalid and that the hostname was not set and the previous hostname should remain unchanged.

      Definition of done

      • The implementation meets the acceptance criteria
      • The code is part of a downstream build attached to an errata
      Show
      Given a RHEL user has executed the  nmcli general hostname  command When the hostname contains characters other than lowercase letters, numbers, or hyphens Then NetworkManager should check the hostname for invalid characters before sending it via dbus and it should return an error message to the user explaining which characters are invalid and that the hostname was not set and the previous hostname should remain unchanged. Definition of done The implementation meets the acceptance criteria The code is part of a downstream build attached to an errata
    • None
    • None
    • If docs needed, set a value
    • None
    • 0

      Description of problem:
      $ sudo nmcli general hostname ng_benjoband
      (15:41:10) vbenes: Error: failed to set hostname: Saving the hostname failed: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: Invalid static hostname 'ng_benjoband'

      While we have just [a-z] [0-9] and - allowed, NM should check first before sending via dbus and tell the user what's wrong.

      Version-Release number of selected component (if applicable):
      NetworkManager-1.40.0-1.el9.x86_64

      Acceptance Criteria:
      Given a RHEL user has executed the nmcli general hostname command

      When the hostname contains characters other than lowercase letters, numbers, or hyphens

      Then NetworkManager should check the hostname for invalid characters before sending it via dbus and it should return an error message to the user explaining which characters are invalid and that the hostname was not set and the previous hostname should remain unchanged.

      Definition of done

      • The implementation meets the acceptance criteria
      • The code is part of a downstream build attached to an errata

              rh-ee-sfaye Stanislas Faye
              rhn-engineering-vbenes Vladimir Benes
              Network Management Team Network Management Team
              Desktop QE Desktop QE
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: