From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id A1D4F1FF191 for ; Tue, 23 Sep 2025 10:21:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A94E2784C; Tue, 23 Sep 2025 10:21:48 +0200 (CEST) Message-ID: <1a8c3ae4-2849-473b-87a3-43b48ccdc05c@proxmox.com> Date: Tue, 23 Sep 2025 10:21:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: pmg-devel@lists.proxmox.com References: <20250922160514.350896-1-m.limbeck@proxmox.com> Content-Language: en-US From: Mira Limbeck In-Reply-To: <20250922160514.350896-1-m.limbeck@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758615662933 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.287 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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. [main.rs] Subject: Re: [pmg-devel] [PATCH pmg-log-tracker] fix wrong QID argument handling X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pmg-devel-bounces@lists.proxmox.com Sender: "pmg-devel" Sorry, git removed the line between the ```. On 9/22/25 18:05, Mira Limbeck wrote: > This fixes the mail lookup based on QID when only time and line info was > available, not a valid QID, which resulted in the following error in the > GUI: > `Error entry 'T68CD4EC2L00000003' not found (500)` > > Somewhere between pmg-log-tracker 2.5.0 and 3.0 the behavior of > libc::sscanf seemed to have changed. It now requires mutable access to > the variables passed in, rather than immutable ones. > > With 3.0 the behavior changed so that the following was printed: > ``` The following was printed (time = 0, line = 0) # QID: T 0L00000000 > ``` > Both `time` and `line` were kept at 0, the value they are initialized to > before sscanf is called. > > By changing the variables to mutable the values are now parsed and set > correctly. > > Signed-off-by: Mira Limbeck > --- > src/main.rs | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/src/main.rs b/src/main.rs > index 0a4f192..0299be5 100644 > --- a/src/main.rs > +++ b/src/main.rs > @@ -1964,12 +1964,19 @@ impl Parser { > }; > > while let Some(q) = args.opt_value_from_str::<_, String>(["-q", "--queue-id"])? { > - let ltime: time_t = 0; > - let rel_line_nr: libc::c_ulong = 0; > + let mut ltime: time_t = 0; > + let mut rel_line_nr: libc::c_ulong = 0; > let input = CString::new(q.as_str())?; > let bytes = concat!("T%08lXL%08lX", "\0"); > let format = unsafe { std::ffi::CStr::from_bytes_with_nul_unchecked(bytes.as_bytes()) }; > - if unsafe { libc::sscanf(input.as_ptr(), format.as_ptr(), <ime, &rel_line_nr) == 2 } { > + if unsafe { > + libc::sscanf( > + input.as_ptr(), > + format.as_ptr(), > + &mut ltime, > + &mut rel_line_nr, > + ) == 2 > + } { > self.options > .match_list > .push(Match::RelLineNr(ltime, rel_line_nr)); _______________________________________________ pmg-devel mailing list pmg-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel