From nobody Wed Dec 21 02:08:06 2022 X-Original-To: standards@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NcH0R2KFhz1GFjT for ; Wed, 21 Dec 2022 02:08:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NcH0Q5ypwz42vr for ; Wed, 21 Dec 2022 02:08:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671588486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pHG3cFOGbOInz8APVw0uxG30m5Il7pzh7iIo/k7t6EE=; b=hpKZ4HRsCIgVmBd8+4iROkhNYm3Fa2OafReGCGlmjHJJVYPZPbujMrv/dKztI9nIZUUmCy /1e1m7WCrIeaNlMukNGBD2kWVshJ8NvHHYAUOdFAta6Z4a8oZO1aMpMH4d4KcAW+LPDEjO 9j1ZxbdIF4vkV+Theg3AM8/bSwyBljZwC3Oya7e1FaGvLGWqks+x5z5uq25E0kUGbZ4DLO aX4pgyS5+CnF2PujsABkoP6px11TDXteDqw0vetTtUMq6Dh7MGSDGYHOkAYlkUBxgKUBfZ zy47Qm6ViCEJuQcKKgtceJt2QhKt2qsmuXevncJqXqwqbkUtaMs+QFXVEVTTgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671588486; a=rsa-sha256; cv=none; b=VJTyHRtq8F/DPdRqdQksQw9/7sLgYmsIA6MdaqWhKON7AXkSPhT1VLE4L/162nj5VyLcLL nTDiozYDqXfXx7GHlF8CMOQQzIhLpfan+kV6/YHdxsmqVHtcRfi/Qk7zhCC+ydsYNGg1/T ghyFOrterFVoqbDLSf8PeuC4uncYfvbSJZZmZ/dvRQwXNtbjzbbwKztHHxT2yVEthXB5O+ Xswi5bM289myTPGSTY6LEkp+/j/N7M/47CKufKFquDga3LQwRsaN+IpM8ONxlvnI8sTdQf DoIkLkEfbWn3/v5rn0tKzTYanisfrn0H75f/84FdeSkl7yRj1bxi7SUktGep3w== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NcH0Q4vkczy4V for ; Wed, 21 Dec 2022 02:08:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 2BL286S0091761 for ; Wed, 21 Dec 2022 02:08:06 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2BL286Q0091758 for standards@FreeBSD.org; Wed, 21 Dec 2022 02:08:06 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: standards@FreeBSD.org Subject: [Bug 268479] lib/libc/stdlib/getenv.c may have a problem with putenv() Date: Wed, 21 Dec 2022 02:08:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: standards X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: dclarke@blastwave.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: standards@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Standards compliance List-Archive: https://lists.freebsd.org/archives/freebsd-standards List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268479 --- Comment #1 from Dennis Clarke --- As a follow up I have been carefully reading :=20 https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#ta= g_08 Section 8.1 Environment Variable Definition which does not seem to care if the value of an env var is the empty string '\0'; Therefore UNAME_s can be just an empty string and then of course we see the uname struct member for system get set to the empty string. Section 8.1 Environment Variable Definition states :=20 These strings have the form name=3Dvalue; names shall not contain the character '=3D'. For values to be portable across systems conforming to POSIX.1-2017, the value shall be composed of characters from the portable character set (except NUL and as indicated below).=20 I see there "except NUL" for the value. However putenv and setenv both allow the value to be just a NUL byte '\0'; That then results in the name=3Dvalue being name=3DNUL.=20 Is it reasonable to allow this behavior given the POSIX spec ?=20 Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional --=20 You are receiving this mail because: You are the assignee for the bug.=