Message ID | 20210706180018.342553-3-francis.laniel@amarulasolutions.com |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBDNPHDVBZ4JBBUNUSKDQMGQEBDH6ENY@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::437; helo=mail-wr1-x437.google.com; envelope-from=swupdate+bncbdnphdvbz4jbbunuskdqmgqebdh6eny@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=Zg7wFCL1; dkim-atps=neutral Received: from mail-wr1-x437.google.com (mail-wr1-x437.google.com [IPv6:2a00:1450:4864:20::437]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GK9Mq0Qkmz9sWX for <incoming@patchwork.ozlabs.org>; Wed, 7 Jul 2021 04:00:54 +1000 (AEST) Received: by mail-wr1-x437.google.com with SMTP id k3-20020a5d52430000b0290138092aea94sf662552wrc.20 for <incoming@patchwork.ozlabs.org>; Tue, 06 Jul 2021 11:00:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1625594450; cv=pass; d=google.com; s=arc-20160816; b=Z2FSBT8eiooYWk+b6UhigSFLhDj8kW2n391VEe7y673Uy9rTiPBnKvi6vtPZpnV5mS vmrvuHHk6FYF/ZySdj2+pp9ivufHbjFpuLx8aiCGrK6wXr9LaDsDFNusrMt5a6kLodJM DQnoi3nI3U9qWo5i+ChsfOF9M2EU6jys5ZA9JCfj+PfKyniwX5NjDhQ0wjfljiLO9njf cJ9d/c/kvF7Kqf6zxEelr0/25hCvV9Rw0+qpRdVy3nbSI1jcil/z0AZtPvE1VZHTIuGF 4zsZFC6WojYUviYDnH4bqidhyZ97gDiJgOsGrk+n9dkk7vX00mh/o+dB7HJ93p0/nLV8 MTrw== 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:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=OzYHFwwMikaMBcx5SDEXlRv57kZORB7p29mFWqBWBk0=; b=SWIXyAzIFlp9nj8PSy5mT11BerDn+efJ/fKAtOqI1HUB4oFbw1YCksJqJSGtdjqArO K1CfO0PJwdcX56mgnEHLsM5brr4mnzr2vK4MzDs9UPPTR1C2qPq50YzULbuNNKzN/PiE Bqv9PK3/bCUdUiYIQ4Cd5zjjSlg85+Mv1G5ULT1UJzNDKTR0R7/NS674Lm5oJq7LDY8O NbB466Jm8SfjAbdRODw9FBGaFtl7t2AQ13sIQfkCeFC3+aX+X7kyN6Jzpp7V2lXip3ta jvzk3IN+RLiwnF3Dxb5GzWuOAh/SI5VP/rB6wYqN8VdGhrpaG6svBFahf2e5pa67YKxw wHdQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Do9yxBmG; spf=pass (google.com: domain of francis.laniel@amarulasolutions.com designates 2a00:1450:4864:20::42a as permitted sender) smtp.mailfrom=francis.laniel@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=OzYHFwwMikaMBcx5SDEXlRv57kZORB7p29mFWqBWBk0=; b=Zg7wFCL1h0O4XM/ESXRkAWvOt4wQ2YY5Ja/yEJ/DbPPUyIWtoADZiI3Smklz4/ctbE p2jhW9TPV2c6x4/p9ucLMwTheWuQD6iS2UM2xgsRFtQNiwveIHNTw+FOoLJR3++eiKLP DNKf1uWFOCTR/5FqdvkQKah5ydj+aslDtCyMVCco+mGnFHnhgLNNP0ebwfXH565l5TTJ meuhjAEPV8A0GVlxwCTnUHO6haNg2FXOOrT6a3JG/tsSrqmgfgDdA7Ne/yoqinyd2XMF yc1MRKBy7mS4hLiblWHY/rrNWL4CdHRiyEfe0m65omnw/BxbCh7yBwMwGy94KgYILVT9 qvIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=OzYHFwwMikaMBcx5SDEXlRv57kZORB7p29mFWqBWBk0=; b=W+CP58Oti8UWGhu6TyrqJWOMw+6tPckHNqQxU+4fg50j6BALddf6nsBL+ftzl23yy3 sZAeCPkLuyiEhP/39xQ+gA80i803JrYw6Mn4d/BjMKEvaDPIuqQW39AQhCSWSxXose9C msBjp35pU1kZdyp/Rb9Hz3hnd2pbAMPvqWoHSsbMbczSXxG1b2VupKi7q0F+xL1A8pgk DXrZa4kHQpZ//1YoGwlrR5wP9SgY8AofTMV6jgtMB49RuqZGpOxaxBaASEcxGjtFn7vd sWNy1CqDLlf9DqGEuFABoiXexhu5wpGp2GMzQo3Wst6KAl3TYgbjeMUkHYqNvd4cRnLM /1bw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532SUP5yzxf+zN2tAo7lKtIGeqA+WXPMvz0HRg3yQ4t7jRsXwqW/ yXadndpl0Cl48qGfWUh3yHc= X-Google-Smtp-Source: ABdhPJxRneG5F2GKvR12uXIMCFFgfCkk0WN/DDMIRr7YQVV3apFG4uFFiEFnCLQPro3WvYDxkaHpmg== X-Received: by 2002:a05:600c:290c:: with SMTP id i12mr20574205wmd.85.1625594450064; Tue, 06 Jul 2021 11:00:50 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:adf:dd86:: with SMTP id x6ls285893wrl.1.gmail; Tue, 06 Jul 2021 11:00:49 -0700 (PDT) X-Received: by 2002:adf:dd82:: with SMTP id x2mr22842447wrl.303.1625594449303; Tue, 06 Jul 2021 11:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625594449; cv=none; d=google.com; s=arc-20160816; b=mL2ny6NaRmkLw9coSER7EoF2ZvVvB7prjffOcxK9271eOq7Xt2c36EmpTc8Uswyw/i pscj2HWPjZtpR/UQuF1uV5JWN2kYLlVyOHbjL2f3qNxtGO/yMm4PlGczptEz7vHXEl4E s18oRXR65fQx5hsRR7WD8GOAAc1Vu/MmfyFIu5LDxpaDRYxmYpaYbFgdmqqY11PPbkgx PV7m3DU95s+lbK/mU/kW19rtA6dqT9ITHHNLnrbUOGJaV/P2R4fmDgD4EL7WebM0+lSK uwHYggKQdcq6tEPbqdddAmCB3P2NGGAS10Q9OduPwroZSFWtQXTypvD+qgYFo+mlmodG mUYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=xEK/3UspyJGHZQeFwQJ6vysaZBFPUII+ENM4WwwRA1s=; b=O+/sXViOxidqfxD+tFpx0Y/139264uvyrJiVstNnIVl4VZouFte+H39Xd3f+XPMsTy vw6t1MihAUkOjPEnjuD/ws/4s56YEudRK6fI5j0WQSVgN3f2kUQ0tDvTLMbPnTHDTSsS HTcujTUe2kUTWfXUTIlmgbKo819g4KFifZsMp6NR3c59QqoffOU19s5+yfB3Kma+L9ZR mhx2wtGhb6bSqAnm8FryX62tvDDtNnPab68kJGjj/ODEPkMm+aATVRnzcLCf6ZDb9lS9 WWK+ptZvEeBhrrvUz4HEKFPT6b3LAoRsXFt/DFYUkwSovYPx7hJogTgtJ0DqFaKCxXOw QRHg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Do9yxBmG; spf=pass (google.com: domain of francis.laniel@amarulasolutions.com designates 2a00:1450:4864:20::42a as permitted sender) smtp.mailfrom=francis.laniel@amarulasolutions.com Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com. [2a00:1450:4864:20::42a]) by gmr-mx.google.com with ESMTPS id k18si249868wmj.0.2021.07.06.11.00.49 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Jul 2021 11:00:49 -0700 (PDT) Received-SPF: pass (google.com: domain of francis.laniel@amarulasolutions.com designates 2a00:1450:4864:20::42a as permitted sender) client-ip=2a00:1450:4864:20::42a; Received: by mail-wr1-x42a.google.com with SMTP id d2so74141wrn.0 for <swupdate@googlegroups.com>; Tue, 06 Jul 2021 11:00:49 -0700 (PDT) X-Received: by 2002:adf:e607:: with SMTP id p7mr23118081wrm.80.1625594449014; Tue, 06 Jul 2021 11:00:49 -0700 (PDT) Received: from pwmachine.home ([2a01:cb14:983:1f00:9e94:185:dd8d:7317]) by smtp.gmail.com with ESMTPSA id o8sm15838573wrx.28.2021.07.06.11.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 11:00:48 -0700 (PDT) From: Francis Laniel <francis.laniel@amarulasolutions.com> To: swupdate@googlegroups.com, sbabic@denx.de Cc: michael@amarulasolutions.com, ondrej@amarulasolutions.com, Francis Laniel <francis.laniel@amarulasolutions.com> Subject: [swupdate] [RFC PATCH v2 2/3] libubootenv: Forbid to give empty variable name to fw_setenv. Date: Tue, 6 Jul 2021 20:00:17 +0200 Message-Id: <20210706180018.342553-3-francis.laniel@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210706180018.342553-1-francis.laniel@amarulasolutions.com> References: <20210706180018.342553-1-francis.laniel@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: francis.laniel@amarulasolutions.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Do9yxBmG; spf=pass (google.com: domain of francis.laniel@amarulasolutions.com designates 2a00:1450:4864:20::42a as permitted sender) smtp.mailfrom=francis.laniel@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[RFC,v2,1/3] main: Check libuboot_set_env() result.
|
expand
|
diff --git a/src/uboot_env.c b/src/uboot_env.c index 30c39eb..b97507a 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -1333,6 +1333,14 @@ int libuboot_set_env(struct uboot_ctx *ctx, const char *varname, const char *val if (strchr(varname, '=')) return -EINVAL; + /* + * Giving empty variable name will lead to having "=value" in U-Boot + * environment which will lead to problem during load of it and U-Boot + * will then load default environment. + */ + if (*varname == '\0') + return -EINVAL; + entry = __libuboot_get_env(envs, varname); if (entry) { if (libuboot_validate_flags(entry, value)) {