From nobody Sat Nov 23 11:50:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=canonical.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1716190173760462.77364163103414; Mon, 20 May 2024 00:29:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AD1A31DE5; Mon, 20 May 2024 03:29:32 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id C4DD51EBF; Mon, 20 May 2024 03:10:27 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BE0961CDA; Sun, 19 May 2024 11:49:56 -0400 (EDT) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id DEAFC1C3C for ; Sun, 19 May 2024 11:49:55 -0400 (EDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id E67E43F171 for ; Sun, 19 May 2024 15:41:02 +0000 (UTC) Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-34dc7b83209so6299626f8f.2 for ; Sun, 19 May 2024 08:41:02 -0700 (PDT) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c34c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b17808sm1356129366b.217.2024.05.19.08.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 08:41:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-Greylist: delayed 531 seconds by postgrey-1.37 at lists.libvirt.org; Sun, 19 May 2024 11:49:55 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1716133262; bh=fBfXJMcUZSzu6k1Eo83uQ7Pi/epd+v2YByoZapMDyGQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=kZu5Itp6VpnQjwPX/iT9Ovd0C0gYnPwpN6WA8L920ch1eECbFwUirZc8WtB1Cq3c+ O6lHMsv2smruh1h8qvxk5TX2QN6Lo0+M+7XgOU2cTTFGlihGHJnvqcsm47zWNaweR8 JzNx7j0jGeOgD4NlDl4A1bzR7P13QI26xP/I5Jnl05vSJj7YT8BtevNHMyoint21UH IljFAnoDdP5/i0bs4gPT4fBJmx8UpaUudJL6wNAm2mcziiHN/8qakI04WvAnWCUmBd 8+/tr2W4bRCbcaKRD4kgfcX9aeIyH0AqXH1SuMVxk+AdIWQz/HSxkWzKIp+WDhI9w7 XCvv10kXfsuXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716133262; x=1716738062; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fBfXJMcUZSzu6k1Eo83uQ7Pi/epd+v2YByoZapMDyGQ=; b=k4Dtjo3p7eP1qqXveIgZf/F9kheqqE+QxWILeQ6NzAET/CYTwVckjfTauvNhb1sVhp k+95fmm2Z0T+CNiLRDLJp1jSJj3/4iQtKHwdJxr7oyaNkR6le7rLtr4LDPG0818I7Son 64XCjbD2TSXF3/7FSOrqOsyIH1w/OzfAnnnk9X1HVot6wOeORN/2Y8Blf+WZXkkiw9JA cQf2K8oRTrnc58qYUMmh4GjwYoAFwTS2+sS7MSmKbLjy84/WDxKbHIA/Xpd1gtvqGDBS 22LBYLq7lzjTcYjxH5XakmGjfjuSz98AHMivMXjNLcHplsXtJ+mH6gwtD5bjt+XqZQyi OR7A== X-Gm-Message-State: AOJu0YwxAmmG/J9HQrCCzsC0NmqpvlLWT+pD1jqsun3uw7A2tw0NghNq calH2zfP/6OwjpPrMicJbBwbGMnsBhPpczbybNNeYKdZI0uXfdh3jNAalqwD5Q4+Kahk3ZL5NJ1 QX9lLlhl/oAewhpF1zgYTxG4kFKrdSQbcPZbTSzyFDHi1ZcYbfYWivMMxyH6o43hFGb/fbpbBYX Nd19o6IA== X-Received: by 2002:a05:6000:2a01:b0:354:ba86:3a2 with SMTP id ffacd0b85a97d-354ba8608abmr3216975f8f.64.1716133262215; Sun, 19 May 2024 08:41:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZAE3iUd2plfWmzxxcf8NCeZM1LUmsBuEgQoCOBW3AvDQXSmRMgqKz5Ng/LMa6i4ctg5UO4g== X-Received: by 2002:a05:6000:2a01:b0:354:ba86:3a2 with SMTP id ffacd0b85a97d-354ba8608abmr3216966f8f.64.1716133261799; Sun, 19 May 2024 08:41:01 -0700 (PDT) From: David Negreira To: devel@lists.libvirt.org Subject: [PATCH] fix virLogCleanerParseFilename logic Date: Sun, 19 May 2024 17:40:36 +0200 Message-Id: <20240519154036.104016-1-david.negreira@canonical.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: david.negreira@canonical.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: ENXJABODLWWXAR6RSKGMG6GAJKZMVKKM X-Message-ID-Hash: ENXJABODLWWXAR6RSKGMG6GAJKZMVKKM X-Mailman-Approved-At: Mon, 20 May 2024 07:09:46 -0400 CC: David Negreira X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZM-MESSAGEID: 1716190175915100001 Content-Type: text/plain; charset="utf-8" We should return the full filename path when we don't have a match on the third group of the regex. Signed-off-by: David Negreira --- src/logging/log_cleaner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging/log_cleaner.c b/src/logging/log_cleaner.c index 4ee91843aa..d8e6ce9cdd 100644 --- a/src/logging/log_cleaner.c +++ b/src/logging/log_cleaner.c @@ -82,7 +82,7 @@ virLogCleanerParseFilename(const char *path, *rotated_index =3D 0; rotated_index_str =3D g_match_info_fetch(matchInfo, 3); =20 - if (!rotated_index_str) + if (rotated_index_str) return chain_prefix; =20 if (virStrToLong_i(rotated_index_str, NULL, 10, rotated_index) < 0) { --=20 2.40.1