all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer 2/2] sys: net: fix error-message for interface names first character
Date: Tue, 18 Nov 2025 16:15:27 +0100	[thread overview]
Message-ID: <20251118151532.592423-3-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20251118151532.592423-1-s.ivanov@proxmox.com>

This follows the similar commit for the TUI installer, but as the
validation here was in accordance to the one in pve-common, only
adapts the error-message (and affected test-cases).

Fixes: 2033a35 ("sys: net: pinning: make interface name checks stricter")
Reported-by: Robert Obkircher <r.obkircher@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
 Proxmox/Sys/Net.pm            | 2 +-
 test/validate-link-pin-map.pl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Proxmox/Sys/Net.pm b/Proxmox/Sys/Net.pm
index f6a0940..37feee1 100644
--- a/Proxmox/Sys/Net.pm
+++ b/Proxmox/Sys/Net.pm
@@ -341,7 +341,7 @@ sub validate_link_pin_map : prototype($) {
         }
 
         if ($name !~ m/^[a-z]/) {
-            die "interface name '$name' for '$mac' is invalid: name must start with a letter\n";
+            die "interface name '$name' for '$mac' is invalid: name must start with a lower-case letter\n";
         }
 
         if ($name !~ m/^[a-zA-Z_][a-zA-Z0-9_]*$/) {
diff --git a/test/validate-link-pin-map.pl b/test/validate-link-pin-map.pl
index 3a95aab..3fbd0e4 100755
--- a/test/validate-link-pin-map.pl
+++ b/test/validate-link-pin-map.pl
@@ -45,14 +45,14 @@ is(
 eval { validate_link_pin_map({ 'ab:cd:ef:12:34:56' => '0nic' }) };
 is(
     $@,
-    "interface name '0nic' for 'ab:cd:ef:12:34:56' is invalid: name must start with a letter\n",
+    "interface name '0nic' for 'ab:cd:ef:12:34:56' is invalid: name must start with a lower-case letter\n",
     "name starting with number is rejected",
 );
 
 eval { validate_link_pin_map({ 'ab:cd:ef:12:34:56' => '_a' }) };
 is(
     $@,
-    "interface name '_a' for 'ab:cd:ef:12:34:56' is invalid: name must start with a letter\n",
+    "interface name '_a' for 'ab:cd:ef:12:34:56' is invalid: name must start with a lower-case letter\n",
     "name starting with underscore is rejected",
 );
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  parent reply	other threads:[~2025-11-18 15:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18 15:15 [pve-devel] [PATCH installer 0/2] nic pinning: require first character to be lower-case Stoiko Ivanov
2025-11-18 15:15 ` [pve-devel] [PATCH installer 1/2] common: pinning: require first character to be lower-case ascii Stoiko Ivanov
2025-11-18 15:15 ` Stoiko Ivanov [this message]
2025-11-18 16:31 ` [pve-devel] applied: [PATCH installer 0/2] nic pinning: require first character to be lower-case Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251118151532.592423-3-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal