From patchwork Fri May 31 12:28:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Babic X-Patchwork-Id: 1942091 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=ODozlnrQ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::137; helo=mail-lf1-x137.google.com; envelope-from=swupdate+bncbd2zdgn6sekrb54e46zamgqebhc7ugi@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lf1-x137.google.com (mail-lf1-x137.google.com [IPv6:2a00:1450:4864:20::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VrMqT2g7zz20QB for ; Fri, 31 May 2024 22:28:51 +1000 (AEST) Received: by mail-lf1-x137.google.com with SMTP id 2adb3069b0e04-52b88765386sf674079e87.0 for ; Fri, 31 May 2024 05:28:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717158521; cv=pass; d=google.com; s=arc-20160816; b=JfsFYbp4am+UnmTOPdVwaxwdzAV0vnF+1MX8Jg/Dk0P9JCijVjHv3zJdCvrVVRiVMj 60+z4HdsTJrC8kyxV/RrK0PIER5pzV0Al/xg538JJ+Q3aHSddFgCe9ng2w7tDzZXI/My o61JEDkbktCuwKjYzVGMvE4GHaKEt0laP7xQDVtNmMYWqZsV45hzF4IZMNicsekmiPBO 2pTN5eo0Ek8tkXwVxpzmeJvZ9EFGhwH6Yp3dxJlw4SZdZQqoXzyhkMUllyT9Qe9ezAEx 2lto7Q2QE/KCs/lN0bDM4Sih8FzvHL7eXidP27HcCxmxUvMZDOoG/+x2FX2nTu9RNCq0 2gSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=d3TjpaC6Xvc4AVSmuSKk6ywIq6/avCDPUJlYBaT09S0=; fh=6BkeB9tcPmhesq25RGpoLMBTruRZXFJPxdeb15kL5ak=; b=wWhYDAFmcOkUvfHmxmVT8Gplfay1VnGGfmrbJz2V8rm3w73HBuXFKW9K/sykmFv1Yy 0TVKwkm9d3YLPX6qYaGmmJERq/1s6QN0nQObHZbwLmnhTsjJKrxPP4T8AHK53UqwPg1p OZB9t1T9Y0BYpc/Txt48JtqdQg9g5wrxJz4X3RsT8GE/J06b3plj7e+Op+bbPHUAtcZX bDFcs7T1/phVEb5kGrdIj+Qspt32yELLHSqsLjkl3OSe469rxNMIVAZz8n/sJp77aPhl ZQB6KFe9hItds4dOmvW8nUrcAAtiTioDav9ycZo40BXvELaLB8HKjZjyIqPQStQ3JXAo I30A==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b="OKi5/zkI"; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1717158521; x=1717763321; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:message-id:date :subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=d3TjpaC6Xvc4AVSmuSKk6ywIq6/avCDPUJlYBaT09S0=; b=ODozlnrQGM7ZTMh1kpQpqkgxj7PPMSNQeUohAQWLpkiJ0Vf0kfpSETuT58XF69dQIQ wxE2iUYmzSumJFa9X9YfPaT+pQTlLYAh0XxKdX7ojAPpfmG1u+NePRjLrPA1TE9Uq/X3 DESbaoCYPanQ1SSexPT4gCwMDE9NpPz5gzg8qKg3tIXwu5tGGtAw86KpbahXxytnXkFo BNRpHOJu12tnZTRfAn2Z5ZGcUNaZcF5RVsIYCs8eMI2ifOjcbMlXlxMCWT9sC3rJ4Wcw oD3yFPuqr27DXDo3IJSfA/hu6bPRIuqxRlBnaN6kNngpdKDeOc6/eg4rtAPdcgHiKa7J AKAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717158521; x=1717763321; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=d3TjpaC6Xvc4AVSmuSKk6ywIq6/avCDPUJlYBaT09S0=; b=f01QUcH9bpw+MigWoI8qLxqyqqFFvHhwu/qXmhDiRhF1KUVGk/JmcOOHYOszq255ui lY5iWoQ8tQVIZR7eGQYR7jDY88YnxaSz/+yLGhIRJugZrAR0p78zQRKF1g1vYvoICzXw 2YqeY4SQq409RyI3wM/tTMdx7u7Bb+2WclnoqvDJlTU9u4jhqKXEVvyusrp6woNWXbrP RZaSjc7vXtpraagl9VqN4raAoWAf7Db/y9MJBpouanXGKf9Xv6TJdMFzfkkPnthjgj+T iyQ22ENrsgRmsQz3s7jVwT+UF6Pek/YXgp1BYHl8wlwqJi3lUEZqYXQb+7vrWBn/715p WhfA== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCX2AZpJAvfn79Db98lnMk6pI+gFa2m91blh+dzFK8XBa22SpII7DEH8yyQw+3n0s3rAoHHODKAbn0qq4ZstCl6HxB8vwMg5huLOTEbzvg== X-Gm-Message-State: AOJu0YwPmcmFw+qd51KRAmy2fLhKWRXpz5/fS5WBml0HS2D2hU98IdsA rG+QMmuVlQwCJWuFdIJMZL8FhNE2UnGlQI6qlHRMEvEm1EG7z+Lo X-Google-Smtp-Source: AGHT+IGrt9fyw+sy50yJ1yN8vLxaHmxTgUQNxiZHkrjDlCwDn5jro8Cbac423Yeg+HwK3NG8rqOxIQ== X-Received: by 2002:a19:384d:0:b0:529:c0c6:faad with SMTP id 2adb3069b0e04-52b89596984mr1175580e87.28.1717158520498; Fri, 31 May 2024 05:28:40 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ac2:5191:0:b0:519:6fe8:c02e with SMTP id 2adb3069b0e04-52b7c818021ls23916e87.0.-pod-prod-03-eu; Fri, 31 May 2024 05:28:37 -0700 (PDT) X-Received: by 2002:ac2:5a4c:0:b0:529:ed29:dc94 with SMTP id 2adb3069b0e04-52b896c7adcmr1151926e87.44.1717158516793; Fri, 31 May 2024 05:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717158516; cv=none; d=google.com; s=arc-20160816; b=L3GE3jfib6r30bAFtVi60ObrUkPfMmE6RBzL58QRB3jTYg1phzP9nM50RZyIbYj+oE nAH4k6sZe7aWDsO65csxf+MIRwXTjkupYFnemJjVgI/TrVqN6nmApwJLMBkhS5z+h0tm fjDTeNBniGs7YKSUKwsDIBn8b/hw4pdHIrTg9gUg/E1xfESH8A86BS5GYOir5s4Xtp7H xUhUWVr7wup09EoKt4u643eaOdypZwXvMeF9QZOg6korLNsrvFqDwG0Qzsd04ycnepSI cS9U7FxOzuyqilbdUlaL0MXRiRneDAkns6XCfVPRZxzkd5pou7BThsKyw35RSU2xxWRV FeJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:dkim-signature; bh=ERdbsWO+lk6MNy3CWJ3vz+/m1U6UV8KKPkcWy2ICs0w=; fh=BeBIh3RcaIvLvchNldgBWZyKgRnQIUIPJvMX5Pb5emE=; b=epA0waCZWqQTrEyrXobaAscC3+1+a12LBR2T/yfpbGSKccp3WTJI5u38hmrctWE30N RiqTIE72To4PwW1g8PZ/Cc5+X4dp5rB7hGDV0YdjILu6w8tjRNMOIFYhs/jMi+X4Hq61 YrcGJ17QDZvXC19l6xHnGE5EisTlHRnoK7OviBBZXTgor3BOnElh4fD1wfLnSZVR2TWt yVA/LpQ9ny9UcJpIvtxgHcn+1uCsIpq2jo7K6Pb9VsXEHW2yS7S0G3bccNla5Z92YbLl W4UtD2j+PusDUCi76DHBw/UJQffVOCsmIJwysDt24bBsHONYgubEYq16+w4Twrf60CJn wczA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b="OKi5/zkI"; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24]) by gmr-mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31cb36c0si47475a12.4.2024.05.31.05.28.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 05:28:36 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) client-ip=212.227.17.24; X-UI-Sender-Class: 55c96926-9e95-11ee-ae09-1f7a4046a0f6 Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue106 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MdNHa-1sm58l44VE-00aQz3; Fri, 31 May 2024 14:28:36 +0200 From: Stefano Babic To: swupdate@googlegroups.com Cc: Stefano Babic , Michael Glembotzki Subject: [swupdate] [PATCH] Use bool for verbose Date: Fri, 31 May 2024 14:28:32 +0200 Message-Id: <20240531122832.792589-1-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:1lCuLQ2GMbpB+ywdfsIh35KQ2fpoPSf7h3ecd3sGR7F6zSIW2C9 6XX2cs/ipw+3K38ELbFz5K1r9qWGAow8y8myijvoSCRs6C7YpiR40/qtGNk5m1cCQ2sENnH AcvmYbnTHmEnf7pa8qRU6WXhJI84Tru7cAZfpPUIn3d5RtDYkFQzuygJqoiZ4rbalCWqhFH 46fliBiLlcyv/KSbyOD5A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:Q51VDn5saKQ=;IeGWIK/w27IN/iZCdIXPerFOkxg BHzxQndGk5O/oODhLx1yyFM/OAtlOpYLb4tB9bTQsu2GCL+lorlbWlQLYddpfo1MWx7KGk6aw o1LnhBWep4nRi+BfKaa1rkFJ8ZVanYZ639mhrS72oogF5mc+5z+BboAcydZIwpiAZ7hutbTWz hfKM2sNkOOKtySOip1EgWcih6x7B7Um07bBocq+a5A6wMl8XoxtcbwCwRimOvLBipFuiwBkB3 dhDtQ5Q9WsmXZ21mhMH7h4lvYmmmLm4ATYGdx9VNRrUojPSTvqzfVFcUxqVrLUd8AUeRw+KIc s/cC8ZK+2TflqXWmm32QRtgEoGc8fuLkvg9N7o/rViXT8QSL57WD10rhR93GamiHm8KxYQWJ1 EVbtkMyZgLUpYwnYcUrFvBcK8b9mk/OLHm5y5QZhgwAQPjF02jYEDBZhH1MThpgfiIG2LQIOv tMc0F7nzGIfJoR4kBmftRdTJBWA5gjcB2OLeHqnzWEOjdVWi9K0LBhJUsHbez/02N7JDO94/1 pyE8aV9qBDAK2msh1nzjYVxI30SptonbS9G7eJpWNsfblQLECKQwV1jfn8oFIer/zfIYIPcnM 2asJlMsq0YTNEtK4qlYVOioaR2vJPnNCnR2xTbW4tkXs3EFTAYSpTpnaEqYWdpJfoHJeUd5zo 7jFrB2cfY8jfjivpiEZlped8sUhPIcCxe7Tw4/iriFA8wrHPUVswn5Q26XHWRVOISFXUkimyT nVpSz8AvQ3dnFabUbw/7/2KROWPfK1oWPHjRPV7ei6Frdwri56ZKls= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b="OKi5/zkI"; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Global "verbose" attribute was used as boolean, but defined as int. In swupdate.cfg is verbose correctly described as boolean. Recent commit 1db0aefe creates a regression because it checks for type and requires that the type is int, conflicting with what is declared in swupdate.cfg. This solves the conflict and changes the type for verbose to bool. Signed-off-by: Stefano Babic Reported-by: Michael Glembotzki Tested-by: Michael Glembotzki --- core/swupdate.c | 2 +- corelib/swupdate_gpg_verify.c | 2 +- include/sslapi.h | 2 +- include/swupdate.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) -- 2.34.1 diff --git a/core/swupdate.c b/core/swupdate.c index 084eb11a..80f2229a 100644 --- a/core/swupdate.c +++ b/core/swupdate.c @@ -329,7 +329,7 @@ static int read_globals_settings(void *elem, void *data) WARN("Default Namaspace for SWUpdate vars cannot be set, possible side-effects"); } - GET_FIELD_INT(LIBCFG_PARSER, elem, "verbose", &sw->verbose); + GET_FIELD_BOOL(LIBCFG_PARSER, elem, "verbose", &sw->verbose); GET_FIELD_INT(LIBCFG_PARSER, elem, "loglevel", &sw->loglevel); GET_FIELD_BOOL(LIBCFG_PARSER, elem, "syslog", &sw->syslog_enabled); GET_FIELD_STRING(LIBCFG_PARSER, elem, diff --git a/corelib/swupdate_gpg_verify.c b/corelib/swupdate_gpg_verify.c index 8a00f204..5e1a061d 100644 --- a/corelib/swupdate_gpg_verify.c +++ b/corelib/swupdate_gpg_verify.c @@ -81,7 +81,7 @@ int swupdate_verify_file(struct swupdate_digest *dgst, const char *sigfile, gpgme_set_protocol(ctx, protocol); gpgme_set_status_cb(ctx, status_cb, NULL); - if (dgst->verbose == 1) { + if (dgst->verbose) { gpgme_set_ctx_flag(ctx, "full-status", "1"); } gpgme_set_locale(ctx, LC_ALL, setlocale(LC_ALL, "")); diff --git a/include/sslapi.h b/include/sslapi.h index b23628be..64640184 100644 --- a/include/sslapi.h +++ b/include/sslapi.h @@ -112,7 +112,7 @@ struct swupdate_digest { #endif #ifdef CONFIG_SIGALG_GPG char *gpg_home_directory; - int verbose; + bool verbose; char *gpgme_protocol; #endif }; diff --git a/include/swupdate.h b/include/swupdate.h index ecad2d82..7cf42104 100644 --- a/include/swupdate.h +++ b/include/swupdate.h @@ -68,7 +68,7 @@ struct swupdate_cfg { bool no_state_marker; bool reboot_required; bool check_max_version; - int verbose; + bool verbose; int loglevel; int cert_purpose; struct hw_type hw;