]> git.proxmox.com Git - pve-access-control.git/commitdiff
api: user: limit maximum length for certain properties
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 8 Feb 2024 09:45:41 +0000 (10:45 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 8 Feb 2024 14:59:31 +0000 (15:59 +0100)
The user.cfg file resides on the cluster filesystem where files have
a maximum allowed size (currently 1 MiB).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
src/PVE/API2/User.pm

index 2220d8f5c73b57c3ecc892d093114efbc465777b..8e0f4405294c807a3f8c1dbc49752d63d9507122 100644 (file)
@@ -29,10 +29,19 @@ register_standard_option('user-expire', {
     minimum => 0,
     optional => 1,
 });
-register_standard_option('user-firstname', { type => 'string', optional => 1 });
-register_standard_option('user-lastname', { type => 'string', optional => 1 });
-register_standard_option('user-email', { type => 'string', optional => 1, format => 'email-opt' });
-register_standard_option('user-comment', { type => 'string', optional => 1 });
+register_standard_option('user-firstname', { type => 'string', optional => 1, maxLength => 1024, });
+register_standard_option('user-lastname', { type => 'string', optional => 1, maxLength => 1024, });
+register_standard_option('user-email', {
+    type => 'string',
+    optional => 1,
+    format => 'email-opt',
+    maxLength => 4096,
+});
+register_standard_option('user-comment', {
+    type => 'string',
+    optional => 1,
+    maxLength => 8192,
+});
 register_standard_option('user-keys', {
     description => "Keys for two factor auth (yubico).",
     type => 'string',