Subject: toolchain/16139: crunchgen needs popen(..., "r+"), which glibc 2.1.3 can't do
To: None <gnats-bugs@gnats.netbsd.org>
From: Ben Harris <bjh21@netbsd.org>
List: netbsd-bugs
Date: 03/31/2002 00:15:40
>Number:         16139
>Category:       toolchain
>Synopsis:       crunchgen needs popen(..., "r+"), which glibc 2.1.3 can't do
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 30 16:16:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Ben Harris
>Release:        2002-03-30
>Organization:
>Environment:
Debian GNU/Linux 2.2
libc6-dev	2.1.3-20
gcc		2.95.2-13

>Description:
crunchgen is built as a host tool for building boot disks.  At line 626 of
crunchgen/crunchgen.c, though, we see:

    if((f = popen(line, "r+")) == NULL) {

According to the glibc documentation, it only supports "r" and "w".
Similarly, the popen(3) manual page on NetBSD points out that this usage
isn't portable.

>How-To-Repeat:
Try to use nbcrunchgen built on a Linux system.  Get this error message:
submake pipe: Invalid argument

>Fix:
Maybe change that to "r".  I don't think f is ever written to.



>Release-Note:
>Audit-Trail:
>Unformatted: