From owner-freebsd-doc Mon Oct 22 7:20:14 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B5D8937B405 for ; Mon, 22 Oct 2001 07:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f9MEK1501772; Mon, 22 Oct 2001 07:20:01 -0700 (PDT) (envelope-from gnats) Received: from ice.42.org (ice.42.org [194.246.250.222]) by hub.freebsd.org (Postfix) with ESMTP id 1778D37B407 for ; Mon, 22 Oct 2001 07:19:34 -0700 (PDT) Received: by ice.42.org (Postfix, from userid 1000) id 604F9383; Mon, 22 Oct 2001 16:19:28 +0200 (CEST) Message-Id: <20011022141928.604F9383@ice.42.org> Date: Mon, 22 Oct 2001 16:19:28 +0200 (CEST) From: Stefan `Sec` Zehl Reply-To: Stefan `Sec` Zehl To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/31431: grep manpage is incorrect regarding _GNU_nonoption_argv_flags_ Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 31431 >Category: docs >Synopsis: grep manpage is incorrect regarding _GNU_nonoption_argv_flags_ >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 22 07:20:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Stefan `Sec` Zehl >Release: FreeBSD 4.4-STABLE i386 >Organization: >Environment: System: FreeBSD ice 4.4-STABLE FreeBSD 4.4-STABLE #9: Sat Sep 29 19:25:00 CEST 2001 root@ice:/usr/export/obj/usr/export/src/sys/ICE i386 >Description: The grep manpage states under ENVIRONMENT VARIABLES: _N_GNU_nonoption_argv_flags_ (Here N is grep's numeric process ID.) If the ith character of this environment variable's value is 1, do not consider the ith operand of grep to be an option, even if it appears to be one. A shell can put this variable in the environment for each com­ mand it runs, specifying which operands are the results of file name wildcard expansion and there­ fore should not be treated as options. This behav­ ior is available only with the GNU C library, and only when POSIXLY_CORRECT is not set. As far as I can see, this is incorrect, since out getopt() does not fetch this environment variable. >How-To-Repeat: (echo "foobar";echo "-G")|\ perl -e ' $ENV{"_".$$."_GNU_nonoption_argv_flags_"}="1"; exec "/usr/bin/grep","-G"; ' which should grep for "-G" but doesn't. Further evidence is, that neither the source, nor the binary contains the string "_GNU_nonoption_argv_flags_" yoda:/usr/src/gnu/usr.bin/grep>grep _GNU_nonoption_argv_flags_ *.[ch] yoda:/usr/src/gnu/usr.bin/grep> and yoda:~>ldd /usr/bin/grep /usr/bin/grep: libgnuregex.so.2 => /usr/lib/libgnuregex.so.2 (0x28070000) libz.so.2 => /usr/lib/libz.so.2 (0x28078000) libc.so.4 => /usr/lib/libc.so.4 (0x28086000) yoda:~>strings -a /usr/bin/grep /usr/lib/libgnuregex.so.2 /usr/lib/libz.so.2 /usr/lib/libc.so.4|grep _GNU_nonoption_argv_flags_ yoda:~> >Fix: remove that section from the manpage? >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message