Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3E42C11F64 for ; Mon, 28 Jun 2021 19:49:05 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 133B061CA1 for ; Mon, 28 Jun 2021 19:49:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 133B061CA1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9C4B82E1E; Mon, 28 Jun 2021 21:48:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="iz1TyT/w"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6A24082E13; Mon, 28 Jun 2021 21:39:30 +0200 (CEST) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 502ED82E0B for ; Mon, 28 Jun 2021 21:39:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=francis.laniel@amarulasolutions.com Received: by mail-wr1-x42e.google.com with SMTP id u11so22620316wrw.11 for ; Mon, 28 Jun 2021 12:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L+UTEKG6/+K42M64yOuG8cmHwmU0rQgH9N019RW2WXQ=; b=iz1TyT/wAuh5ntlQdq9rYQ4JOQPeStt9zItv5ACQJDfycFvYy2zc15bxuTcroznCB9 s2CzdsVF6H5tarKOtspNMk5OKgQGgxAEs6aEevidB/gY73gk4o2i7Uy5m41KuHpLEw+t To284ktpPrGgM/dTfL/GNhcz9US4v7jDXQDTQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L+UTEKG6/+K42M64yOuG8cmHwmU0rQgH9N019RW2WXQ=; b=jF3yEQfD9by5zW3yLdTERWwXZT7yi+D7evLK9D0JX7u+C+lbcNAivLBCzCF62NAkef fP5qHhswTdKq3qDuKpWUH5r/MzY7fO0S47/m6cVNSq2+0Hal+IVlb+1vMWcTOKU3pVtn vj+eD2eohxuhf8+pOizG+b9Yj+e+OAvFLBDW66GdXvSLsNE/OJovamdt6IPRnsvbQtHW ivUuJNTquQgbauvTz9hG6gKEmSmGjQ07eA1h1g81T8OPCjKzn9+ZcwuiGNvAZvgRZ5sI t16FtOttjYqEtVIlH0jjOwSrpwsE2tRAt5Rq1oocUvou2eYMk/M2YpMJLsUlF4IPWqpQ gw2g== X-Gm-Message-State: AOAM5309b7Enu/SQ8H2d4sQX2kSpZTrfXwVlGO/DLn21lDxRaHlr1+x2 aBgepfKS/THNm44egXrrGK5vFxEfA/6+rRsL X-Google-Smtp-Source: ABdhPJz0MKB8onvITCrwSktGhG1TLnAVuN5DtrYEcT84Q8Kurs4jE6zUQz/3JZzxcx3CLysJ4sdWSA== X-Received: by 2002:a5d:51ce:: with SMTP id n14mr11840504wrv.209.1624909166977; Mon, 28 Jun 2021 12:39:26 -0700 (PDT) Received: from pwmachine.home ([2a01:cb14:983:1f00:73d:36ac:5ef7:7feb]) by smtp.gmail.com with ESMTPSA id o17sm400660wmh.19.2021.06.28.12.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 12:39:26 -0700 (PDT) From: Francis Laniel To: u-boot@lists.denx.de, joe.hershberger@ni.com, wd@denx.de Cc: michael@amarulasolutions.com, ondrej@amarulasolutions.com, Francis Laniel Subject: [RFC PATCH 0/1] cmd: nvedit: Forbid environment key to be empty. Date: Mon, 28 Jun 2021 21:39:14 +0200 Message-Id: <20210628193915.797459-1-francis.laniel@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 28 Jun 2021 21:48:54 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi. First of all, I hope you are fine and the same for your relatives. In this patch, I modified the setenv command to decline empty variable name. Indeed, it was strangely possible to give the following to this command: setenv '' foo Which results in the following belonging to environment: =foo And which in turns leads to problem while rebooting: Loading Environment from Flash... Cannot import environment: errno = 22 *** Warning - import failed, using default environment This error message is due to varname being empty and was added in [1]. With this patch, executing the above command will lead to the following being printed: ## Error: variable name cannot be empty And the environment will not be changed. Here is the diffstat for this patch: Francis Laniel (1): cmd: nvedit: Forbid key to be empty. cmd/nvedit.c | 5 +++++ 1 file changed, 5 insertions(+) If you see any way to improve the patch, feel free to share it. Best regards. --- [1] https://u-boot.denx.narkive.com/P4aKxVFu/patch-env-don-t-add-an-empty-key-to-the-env-hashtable -- 2.25.1