NetBSD Problem Report #41774

From www@NetBSD.org  Fri Jul 24 11:11:59 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id AA61263BBD1
	for <gnats-bugs@gnats.netbsd.org>; Fri, 24 Jul 2009 11:11:59 +0000 (UTC)
Message-Id: <20090724111159.7F88A63B913@www.NetBSD.org>
Date: Fri, 24 Jul 2009 11:11:59 +0000 (UTC)
From: ekamperi@gmail.com
Reply-To: ekamperi@gmail.com
To: gnats-bugs@NetBSD.org
Subject: printenv doesn't handle well input with '='
X-Send-Pr-Version: www-1.0

>Number:         41774
>Category:       bin
>Synopsis:       printenv doesn't handle well input with '='
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 24 11:15:00 +0000 2009
>Closed-Date:    Tue Aug 18 15:15:50 +0000 2009
>Last-Modified:  Tue Aug 18 15:15:50 +0000 2009
>Originator:     Stathis Kamperis
>Release:        NetBSD 5.0_STABLE
>Organization:
Aristotle University of Thessaloniki
>Environment:
NetBSD xxx 5.0_STABLE NetBSD 5.0_STABLE (xxx) #1: Thu Jul  9 21:38:56 CEST 2009  xxx:/usr/objdir/sys/arch/i386/compile/xxx i386

>Description:
$ env foo=bar=lala printenv foo
bar=lala
$ env foo=bar=lala printenv foo=bar         <---- there is no such variable
lala                                        <---- yet printenv reports one
$ 

And I'm saying that there is no such variable, because POSIX mandates that
environmental variables don't contain a '='. So 'foo=bar=lala' is a variable
named 'foo' that equals to 'bar=lala'.


>How-To-Repeat:

>Fix:
I have a fix for DragonFly, here
http://bugs.dragonflybsd.org/file526/printenv.diff

but not so sure how it applies to NetBSD (didn't check the code).


>Release-Note:

>Audit-Trail:
From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41774 CVS commit: src/usr.bin/printenv
Date: Sat, 25 Jul 2009 08:18:33 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Sat Jul 25 08:18:33 UTC 2009

 Modified Files:
 	src/usr.bin/printenv: printenv.c

 Log Message:
 (1) reject instead of ignore extra arguments;
 (2) reject requests for environment variables containing '='
     (PR 41774, but with different patch)
 (3) fix capitalization of usage message


 To generate a diff of this commit:
 cvs rdiff -u -r1.9 -r1.10 src/usr.bin/printenv/printenv.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 25 Jul 2009 18:10:14 +0000
State-Changed-Why:
pullup-5 #871, pullup-4 #1343


From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41774 CVS commit: [netbsd-5] src/usr.bin/printenv
Date: Tue, 4 Aug 2009 20:01:54 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Tue Aug  4 20:01:54 UTC 2009

 Modified Files:
 	src/usr.bin/printenv [netbsd-5]: printenv.c

 Log Message:
 Pull up following revision(s) (requested by dholland in ticket #871):
 	usr.bin/printenv/printenv.c: revision 1.10
 (1) reject instead of ignore extra arguments;
 (2) reject requests for environment variables containing '='
    (PR 41774, but with different patch)
 (3) fix capitalization of usage message


 To generate a diff of this commit:
 cvs rdiff -u -r1.9 -r1.9.4.1 src/usr.bin/printenv/printenv.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Manuel Bouyer <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41774 CVS commit: [netbsd-4] src/usr.bin/printenv
Date: Tue, 18 Aug 2009 10:15:45 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Tue Aug 18 10:15:45 UTC 2009

 Modified Files:
 	src/usr.bin/printenv [netbsd-4]: printenv.c

 Log Message:
 Pull up following revision(s) (requested by dholland in ticket #1343):
 	usr.bin/printenv/printenv.c: revision 1.10
 (1) reject instead of ignore extra arguments;
 (2) reject requests for environment variables containing '='
     (PR 41774, but with different patch)
 (3) fix capitalization of usage message


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.8.18.1 src/usr.bin/printenv/printenv.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 18 Aug 2009 15:15:50 +0000
State-Changed-Why:
Fixed and pulled up; thanks for bringing this to our attention.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.