Project

General

Profile

Bug #5221

head shouldn't reuse stdin

Added by Robert Mustacchi about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
2014-10-08
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Because head freopen's stdin and it closes it, it fails to properly handle cases where we actually have data passed into us and /dev/stdin is an explicit file given to head. This is similar to the OpenBSD bug pointed out here: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/head/head.c#rev1.18.

History

#1

Updated by Electric Monk about 5 years ago

  • Status changed from New to Closed

git commit 4e6070e87069f63bef94d8e79c2fc3cab2c1ab6b

commit  4e6070e87069f63bef94d8e79c2fc3cab2c1ab6b
Author: Robert Mustacchi <rm@joyent.com>
Date:   2014-10-15T13:26:54.000Z

    5221 head shouldn't reuse stdin
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Reviewed by: Patrick Domack <patrickdk@patrickdk.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF