Date: Sat, 12 Aug 2000 14:51:55 -0400 (EDT) From: David Holland <dholland@eecs.harvard.edu> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/20567: /bin/sh `type' builtin bug Message-ID: <200008121851.OAA17736@sake.eecs.harvard.edu>
next in thread | raw e-mail | index | archive | help
>Number: 20567
>Category: bin
>Synopsis: /bin/sh `type' builtin bug
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Aug 12 12:00:03 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: David A. Holland
>Release: FreeBSD 4.0-RELEASE i386
>Organization:
eecs.harvard.edu
>Environment:
4.0-RELEASE, appears to also affect -current.
>Description:
The `type' builtin of sh, if given an absolute pathname,
prints it concatenated with the first entry in $PATH.
>How-To-Repeat:
sh -c 'PATH=/bin:/sbin; type /bin/ls'
prints "/bin/ls is /bin//bin/ls"
>Fix:
Patch:
--- exec.c.dist Sat Aug 12 14:42:28 2000
+++ exec.c Sat Aug 12 14:44:06 2000
@@ -884,7 +884,11 @@
entry.cmdtype = cmdp->cmdtype;
entry.u = cmdp->param;
}
- else {
+ else if (argv[i][0]=='/') {
+ /* Absolute path. */
+ out1fmt(" is %s\n", argv[i]);
+ continue;
+ } else {
/* Finally use brute force */
find_command(argv[i], &entry, 0, pathval());
}
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008121851.OAA17736>
