public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH common 01/10] section config: do not add isolated property lists on lookups
Date: Sun,  1 Nov 2026 22:34:50 +0100	[thread overview]
Message-ID: <20261101213835.353604-2-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20261101213835.353604-1-t.lamprecht@proxmox.com>

With isolated properties in use, looking up a property of a type that
has no isolated property list, like a plugin that is not isolated or an
unknown type, created an empty list for that type as a side effect.
Only init() reads these lists, and it starts from scratch, so nothing
depended on the extra entries. Still, a lookup should not modify the
plugin data, especially when the type comes from a config file.

No semantic change intended.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 src/PVE/SectionConfig.pm                       | 3 ++-
 test/section_config_property_isolation_test.pl | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm
index 66375ac..1febf76 100644
--- a/src/PVE/SectionConfig.pm
+++ b/src/PVE/SectionConfig.pm
@@ -1306,7 +1306,8 @@ sub get_property_schema {
 
     my $schema;
     if ($class->has_isolated_properties()) {
-        $schema = $pdata->{isolatedPropertyList}->{$type}->{$key};
+        my $isolated = $pdata->{isolatedPropertyList}->{$type};
+        $schema = $isolated->{$key} if $isolated;
     }
     $schema //= $pdata->{propertyList}->{$key};
 
diff --git a/test/section_config_property_isolation_test.pl b/test/section_config_property_isolation_test.pl
index 4c999c1..11b3142 100755
--- a/test/section_config_property_isolation_test.pl
+++ b/test/section_config_property_isolation_test.pl
@@ -472,6 +472,15 @@ my $update_schema = Conf->updateSchema();
 my $expected_update_schema = make_schema(1);
 is_deeply($update_schema, $expected_update_schema, "property-isolation update schema test");
 
+ok(
+    !defined(Conf->get_property_schema('unknown', 'another')),
+    "unknown type has no isolated properties",
+);
+ok(
+    !exists(Conf->private()->{isolatedPropertyList}->{unknown}),
+    "property lookup does not add a property list",
+);
+
 done_testing();
 
 1;
-- 
2.47.3





  reply	other threads:[~2026-11-01 21:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 21:34 [PATCH common,qemu-server,network,manager 0/10] mark secrets in schemas and redact them from the system report Thomas Lamprecht
2026-11-01 21:34 ` Thomas Lamprecht [this message]
2026-11-01 21:34 ` [PATCH common 02/10] schema: allow marking properties as sensitive Thomas Lamprecht
2026-11-01 21:34 ` [PATCH common 03/10] schema: add helpers to redact sensitive values Thomas Lamprecht
2026-11-01 21:34 ` [PATCH common 04/10] section config: add redaction of sensitive values in raw configs Thomas Lamprecht
2026-11-01 21:34 ` [PATCH qemu-server 05/10] cloud-init: mark the password as sensitive Thomas Lamprecht
2026-11-01 21:34 ` [PATCH qemu-server 06/10] config: hide sensitive values of unparsable lines in warnings Thomas Lamprecht
2026-11-01 21:34 ` [PATCH network 07/10] sdn: ipam, dns: mark API tokens as sensitive Thomas Lamprecht
2026-11-01 21:34 ` [PATCH manager 08/10] report: redact sensitive values from guest, storage and SDN configs Thomas Lamprecht
2026-11-01 21:34 ` [PATCH manager 09/10] report: redact credentials in URLs, options and environment variables Thomas Lamprecht
2026-11-01 21:34 ` [PATCH manager 10/10] pvereport: man page: document which values get redacted 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=20261101213835.353604-2-t.lamprecht@proxmox.com \
    --to=t.lamprecht@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal