| Message ID | 20250515114409.1456854-1-michael@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path:
<linux-amarula+bncBCXK73FY3AFRBD5HS7AQMGQEQKXEMOA@amarulasolutions.com>
X-Original-To: linux-amarula@patchwork.amarulasolutions.com
Delivered-To: linux-amarula@patchwork.amarulasolutions.com
Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com
[209.85.128.71])
by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 1DB103F049
for <linux-amarula@patchwork.amarulasolutions.com>;
Thu, 15 May 2025 13:44:16 +0200 (CEST)
Received: by mail-wm1-f71.google.com with SMTP id
5b1f17b1804b1-43d4d15058dsf7589885e9.0
for <linux-amarula@patchwork.amarulasolutions.com>;
Thu, 15 May 2025 04:44:16 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1747309456; cv=pass;
d=google.com; s=arc-20240605;
b=X4DhLKhaG8kbe0yOfPdVCCvRmuTK/M8OteiowI5RC5JNzEMuE28969BOM2ZmSvYad0
TVawtNoKyLS0UHkLhQRQIFM5KDWJCDQr1x9OxItoRTCR5arKcu1tACK9lphwUjGXcNE6
G6tft0VILrVDmh0Y13MLR04YQt3U6ccxf8C42fZ/xieQqzwdqJ2VxYIO/WC9t0W6sKjS
Ndc642u1nhZ1/BF6XWyuZiaxMhJRqtAf8i8ii0U7TDNf8h3X2u+wk2ehFjsA0DaCFW4i
MRE1y0f9th7zAEaqnb+9E0TJKeZ0xO+IYMeBOKGzc49UyF1voINpt6oUa6aDNGjnZ3nK
tPjQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:mime-version:message-id:date:subject:cc:to
:from:dkim-signature;
bh=3KqM+s6n/dnsoak2/lwGunHPSu9TFTUcMlrXV1k78/4=;
fh=ubxBBzvgrvJTh03yILJ/kdoHXSRz3eqytKBVV9c+1KM=;
b=CeodLn6azDMoi3X+qBMxZctnM0QnpN05g0h0BvcMuMYMzVV3OnQIOZ3YhuP5il+7H3
L+oduvqU9ppYDtWYlnP99b8k02PcZqJt8NtfndTMTKMwxXxPVdSHnCwICVyYvGfYe5O+
ndkk85GVxUdptg6EdZmhX7KVGRJCj1jYCzYZCWua+tQDuSvHBoB5ErCD1Xf8Y59953Lf
xTAOU9RLMHlwsskXY/H/B7OvdFcxyuH3l8QF730AaYrtQbRNgK5so3B8dH+V3R0FTbHP
xmLepuCzW2gM6SOB05qKpU0L6yrizwyaDzVTE9OR47r/r9q5VURWKarxXzOAg27OJ06n
gBjg==;
darn=patchwork.amarulasolutions.com
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=LE0em2Ww;
spf=pass (google.com: domain of michael@amarulasolutions.com designates
209.85.220.41 as permitted sender)
smtp.mailfrom=michael@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amarulasolutions.com; s=google; t=1747309456; x=1747914256;
darn=patchwork.amarulasolutions.com;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:x-original-authentication-results
:x-original-sender:mime-version:message-id:date:subject:cc:to:from
:from:to:cc:subject:date:message-id:reply-to;
bh=3KqM+s6n/dnsoak2/lwGunHPSu9TFTUcMlrXV1k78/4=;
b=pLvnT0idtb0rtvcvJk6Kl8igMWN9hRw/QJLdHr8XOTpl069zgmjWr1tH5vLJZ4MgGE
2Vy3kYkRqAhpsxv4O8I1wIZCjtJR1xydHCNd2Eh7d2rvXSNPgEkzmupdtAj/RYGygbFQ
jaRrHviE8NbElSPBilgraMcI5kBxYGMOFpHbA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1747309456; x=1747914256;
h=list-unsubscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:x-original-authentication-results:x-original-sender:mime-version
:message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=3KqM+s6n/dnsoak2/lwGunHPSu9TFTUcMlrXV1k78/4=;
b=lo87FUp/Gp/v7kH9moJG4dDufAiJr6g/zSiKZ4yCQHBZV+Sgdvq30ACWqkfnQbG+sJ
9ub0ZOexaxUSsfSjJAJhqsJLMj8y0ddJy1wVhw84Ykl1qjiHTKZQcvcfGpHTXthVBx0n
h/VkuIPFGSxPZ531Rx0MZtmxiplx5LqSAmpDduzXbo/ISXoTwlw0h1lsml8TFlRG2gtX
/EjNuaqd/3ZbqMScljwS4omolb5+NQhhb0Xjc5njK6M81KOQaukRakr2HKHdXXw26jYM
AxuxutixkzZBF0Va69SXiA6taItobi7jMkLFN94uj8tmZCEHBGcrRc2KTsryyWD3TgAC
EB2g==
X-Forwarded-Encrypted: i=2;
AJvYcCWKXQvBJxeIkc0MA+D98pCeKUf641K95ZkncDUu3pkAK9JEC43QMcN7KnQqPXxUgYjqvbM3FHB41OpaTipV@patchwork.amarulasolutions.com
X-Gm-Message-State: AOJu0YxvSioXI5I1wsnNS4PjwNkqmRiKXgtLtmK6iXe+pcvMMyvBnkC4
A+kEu/i1+i0A0V/ezCXUNxpPm8tLTYMYlmsrHHcMSxuv8oiyILMTdiLctm7wI7JQOA==
X-Google-Smtp-Source:
AGHT+IEZHn7ibNEUPtainjw0B9FCAEkrpSlmOS08V6L5Db+0rfcU6dBDOYOeT51wVfpBoZrDjB5d5g==
X-Received: by 2002:a05:600c:358b:b0:442:e9ec:4654 with SMTP id
5b1f17b1804b1-442f20e1ad3mr70309475e9.8.1747309455618;
Thu, 15 May 2025 04:44:15 -0700 (PDT)
X-BeenThere: linux-amarula@amarulasolutions.com;
h=AVT/gBGR8N7vKGZhHz2ffsWvvk8lnFCW7sZYDQnDwrcB46OA1A==
Received: by 2002:a05:600c:350e:b0:43c:fccf:bf4c with SMTP id
5b1f17b1804b1-442f8774bb3ls4175945e9.2.-pod-prod-07-eu; Thu, 15 May 2025
04:44:13 -0700 (PDT)
X-Forwarded-Encrypted: i=2;
AJvYcCUDBKMFpQmdbZ+m6z3ganl4rgOKmo/r+d3ApVUgusNDl/Ivqnn7be0275gRJ5mJIfcLkSsaZh9DthelHoos@amarulasolutions.com
X-Received: by 2002:a05:600c:5286:b0:440:66a4:8d1a with SMTP id
5b1f17b1804b1-442f20ba9fbmr65669195e9.7.1747309453201;
Thu, 15 May 2025 04:44:13 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1747309453; cv=none;
d=google.com; s=arc-20240605;
b=Ua+suqYA+j0gKxpm2GX+U9UlWvydTxW6B7eJ9bu7Kvft8xwNEiAsk+9Rd+6G0vnOFH
JR2sPe6ZV1QXwH70tEW/26AoIjzDyAZxNS2PNN7IyjU99FXqOC6gqEqPEmiY40zbXtBa
fHNHllEp69MI3m7Vpmhl/8VaSVOoCypdjH0EaNSXHguFPx2OGmqbyshPBuO2O5SORlhP
Ozi42qndHXl+13XhE86wpk32tXazDx5r9E0Bg6375rmwF6/oNnjqKjwSbiPnVsZxNv0n
z5LmiioRF5I6zwd8bzoQKEXKPrg5KliN3A5t0YyEW+6/zObA7jabODjOJRKJosGRcPbg
r4Ag==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:dkim-signature;
bh=kGvWrXqFdmBy33k+JCEo0oh9W8n7yartqNOfjRp9nKM=;
fh=9PpOu9h1fPLpc2QYxCHqnDHE7sC70o3KrqVr74QyLSU=;
b=QW476LAQXfLfckYbWtDC+y+7zVE6dpm27VX2n3zEfi22BLRDKE8IpRN3SqEP0rOnwM
QAzvxNzz90yQL/vUhYBpBSI8PDJEah7RgbM8NFvDkL47TtX47jrCyH/EA6VknZ+SrZhG
2nj1LFHxDATAYqKWgHl6dxqjQb/hODQniLF/SNMQCgXzTQThXjZbEVdvUDmBiLy0NceG
7dlzr2z3QCySHCRVbVtyccnuNYcYDz8qOrchJnmw4CaOcUsdz9bWJ0/uKBiJZk76PIeM
vn/UwsSMdg7K+biOtNRNBBiBqNQi5tSBAgvJ3JELeiB9UIRgSzjRDwSFIUUGZ0KVUi1h
LWug==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=LE0em2Ww;
spf=pass (google.com: domain of michael@amarulasolutions.com designates
209.85.220.41 as permitted sender)
smtp.mailfrom=michael@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com.
[209.85.220.41])
by mx.google.com with SMTPS id
5b1f17b1804b1-442d680c97asor52094455e9.4.2025.05.15.04.44.13
for <linux-amarula@amarulasolutions.com>
(Google Transport Security);
Thu, 15 May 2025 04:44:13 -0700 (PDT)
Received-SPF: pass (google.com: domain of michael@amarulasolutions.com
designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Forwarded-Encrypted: i=1;
AJvYcCVDXeJq30mWENdMIUA3en+ks1bgOYWej0MDGA7K0sdBTPeOsdxOvjcCPADaN7UiBCPbkgbzdteUp+Rfi4wZ@amarulasolutions.com
X-Gm-Gg: ASbGncshWqFfK2OgNafzuG3L9OWmeETvpnyKWoOXb0h+w/VaBuIwpfSBHwuTh0kbVsT
HBtJeTxxdMSLBqxxrt/dkhs1VFF1ocI2SMtSDq1u5U+jfD1bWRq6E08q2JUXtl9eUIUU/mS6mFg
QtzBFWK1ChMVjlLWruy1Cl1r2kZ30M6Q93vR2lO6ypcC4JuUVVfXYtI0NGwUFUUQpMT67lVXBoS
S0FUMXi5acs6ZnWHWR6LfHLO67EZq/o1giHBYEKIf1MOAS0uRH2tV+WinnB3jcQ23uL9rUq27Jb
e4Tbzc8G+T8Aak02IPup2VKZGb/1ji7sk/TfV3eW7Ug5ge1VefnCTHYk/KX2bf7ws7iHoNQuwne
PTFoNpIdLvLe/UiJffCm5ewgjrzh5xxmZBEHN0AJuBZu0q/QOe88=
X-Received: by 2002:a05:600c:5286:b0:440:66a4:8d1a with SMTP id
5b1f17b1804b1-442f20ba9fbmr65669015e9.7.1747309452794;
Thu, 15 May 2025 04:44:12 -0700 (PDT)
Received: from panicking.amarulasolutions.com (p5b26784b.dip0.t-ipconnect.de.
[91.38.120.75])
by smtp.gmail.com with ESMTPSA id
5b1f17b1804b1-442f397b6fbsm66608565e9.39.2025.05.15.04.44.11
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 15 May 2025 04:44:12 -0700 (PDT)
From: Michael Trimarchi <michael@amarulasolutions.com>
To: connman@lists.linux.dev
Cc: denkenz@gmail.com,
linux-amarula@amarulasolutions.com,
Michael Trimarchi <michael@amarulasolutions.com>,
Andrea Ricchi <andrea.ricchi@amarulasolutions.com>
Subject: [PATCH V2] timezone: Fix compare_file comparison in timezone checking
Date: Thu, 15 May 2025 13:44:09 +0200
Message-ID: <20250515114409.1456854-1-michael@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
X-Original-Sender: michael@amarulasolutions.com
X-Original-Authentication-Results: mx.google.com; dkim=pass
header.i=@amarulasolutions.com header.s=google header.b=LE0em2Ww;
spf=pass (google.com: domain of michael@amarulasolutions.com designates
209.85.220.41 as permitted sender)
smtp.mailfrom=michael@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=pass header.i=@amarulasolutions.com
Content-Type: text/plain; charset="UTF-8"
Precedence: list
Mailing-list: list linux-amarula@amarulasolutions.com;
contact linux-amarula+owners@amarulasolutions.com
List-ID: <linux-amarula.amarulasolutions.com>
X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com
X-Google-Group-Id: 476853432473
List-Post:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>,
<mailto:linux-amarula@amarulasolutions.com>
List-Help:
<https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>,
<mailto:linux-amarula+help@amarulasolutions.com>
List-Archive:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/>
List-Unsubscribe:
<mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>,
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe>
|
| Series |
[V2] timezone: Fix compare_file comparison in timezone checking
|
|
Commit Message
Michael Trimarchi
May 15, 2025, 11:44 a.m. UTC
The original condition incorrectly returned -1 when the real path and the provided pathname matched, due to a flawed use of `g_strcmp0`. This patch corrects the logic to return 0 (success) when the paths match, ensuring proper file comparison behavior. Signed-off-by: Andrea Ricchi <andrea.ricchi@amarulasolutions.com> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> --- V1->V2: Improve commit message --- src/timezone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi Michael, On 5/15/25 6:44 AM, Michael Trimarchi wrote: > The original condition incorrectly returned -1 when the real path and the > provided pathname matched, due to a flawed use of `g_strcmp0`. This patch > corrects the logic to return 0 (success) when the paths match, ensuring > proper file comparison behavior. > > Signed-off-by: Andrea Ricchi <andrea.ricchi@amarulasolutions.com> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> No Signed-off-by used by ConnMan, I dropped these. > --- > V1->V2: Improve commit message > --- > src/timezone.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied, thanks. Regards, -Denis To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
Hello: This patch was applied to connman.git (master) by Denis Kenzior <denkenz@gmail.com>: On Thu, 15 May 2025 13:44:09 +0200 you wrote: > The original condition incorrectly returned -1 when the real path and the > provided pathname matched, due to a flawed use of `g_strcmp0`. This patch > corrects the logic to return 0 (success) when the paths match, ensuring > proper file comparison behavior. > > Signed-off-by: Andrea Ricchi <andrea.ricchi@amarulasolutions.com> > Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> > > [...] Here is the summary with links: - [V2] timezone: Fix compare_file comparison in timezone checking https://git.kernel.org/pub/scm/network/connman/connman.git/?id=f20ccd19a62b You are awesome, thank you!
diff --git a/src/timezone.c b/src/timezone.c index 89c44895..fba8b925 100644 --- a/src/timezone.c +++ b/src/timezone.c @@ -124,8 +124,8 @@ static int compare_file(void *src_map, struct stat *src_st, DBG("real path %s path name %s", real_path, pathname); - if (real_path && g_strcmp0(real_path, pathname)) - return -1; + if (real_path && !g_strcmp0(real_path, pathname)) + return 0; fd = open(pathname, O_RDONLY | O_CLOEXEC); if (fd < 0)