From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 18A3F69073 for ; Sat, 5 Dec 2020 16:23:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0E48214B4C for ; Sat, 5 Dec 2020 16:23:01 +0100 (CET) Received: from elsa.proxmox.com (212-186-127-178.static.upcbusiness.at [212.186.127.178]) by firstgate.proxmox.com (Proxmox) with ESMTP id 98DC714B44 for ; Sat, 5 Dec 2020 16:23:00 +0100 (CET) Received: by elsa.proxmox.com (Postfix, from userid 0) id 738AFAE3F60; Sat, 5 Dec 2020 16:23:00 +0100 (CET) From: Dietmar Maurer To: pbs-devel@lists.proxmox.com Date: Sat, 5 Dec 2020 16:22:57 +0100 Message-Id: <20201205152257.6002-1-dietmar@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -1.039 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [access.rs] Subject: [pbs-devel] [PATH proxmox-backup] fix bug #3189: fix change_password permission checks, run protected X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Dec 2020 15:23:01 -0000 --- src/api2/access.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api2/access.rs b/src/api2/access.rs index 3b59b3d3..2f7fb6ec 100644 --- a/src/api2/access.rs +++ b/src/api2/access.rs @@ -181,6 +181,7 @@ fn create_ticket( } #[api( + protected: true, input: { properties: { userid: { @@ -195,7 +196,6 @@ fn create_ticket( description: "Anybody is allowed to change there own password. In addition, users with 'Permissions:Modify' privilege may change any password.", permission: &Permission::Anybody, }, - )] /// Change user password /// @@ -215,7 +215,7 @@ fn change_password( let mut allowed = userid == current_user; - if userid == "root@pam" { allowed = true; } + if current_user == "root@pam" { allowed = true; } if !allowed { let user_info = CachedUserInfo::new()?; -- 2.20.1