From beyssac@bofh.enst.fr  Tue Oct  5 14:57:42 2004
Return-Path: <beyssac@bofh.enst.fr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 68AC716A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Oct 2004 14:57:42 +0000 (GMT)
Received: from smtp2.enst.fr (enst.enst.fr [137.194.2.16])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 085E043D2F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Oct 2004 14:57:42 +0000 (GMT)
	(envelope-from beyssac@bofh.enst.fr)
Received: from bofh.enst.fr (bofh.enst.fr [137.194.32.191])
	(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
	(Client CN "bofh.enst.fr", Issuer "ENST CA" (not verified))
	by smtp2.enst.fr (Postfix) with ESMTP id A425D53A92
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Oct 2004 16:57:38 +0200 (CEST)
Received: from bofh.enst.fr (localhost [127.0.0.1])
	by bofh.enst.fr (8.13.1/8.13.1) with ESMTP id i95Evc3R076369
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 5 Oct 2004 16:57:38 +0200 (CEST)
	(envelope-from beyssac@bofh.enst.fr)
Received: (from beyssac@localhost)
	by bofh.enst.fr (8.13.1/8.13.1/Submit) id i95Evc43076368;
	Tue, 5 Oct 2004 16:57:38 +0200 (CEST)
	(envelope-from beyssac)
Message-Id: <200410051457.i95Evc43076368@bofh.enst.fr>
Date: Tue, 5 Oct 2004 16:57:38 +0200 (CEST)
From: Pierre Beyssac <beyssac@bofh.enst.fr>
Reply-To: Pierre Beyssac <beyssac@bofh.enst.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Can't run "strings" on a (disk) device, even if you want to
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72355
>Category:       bin
>Synopsis:       Can't run strings(1) on a (disk) device, even if you want to
>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:   Tue Oct 05 15:00:39 GMT 2004
>Closed-Date:    
>Last-Modified:  Sat May 24 21:20:51 UTC 2008
>Originator:     Pierre Beyssac
>Release:        FreeBSD 5.3-BETA5 i386 and 6.0-current
>Organization:
ENST
>Environment:
System: FreeBSD bofh.enst.fr 5.3-BETA5 FreeBSD 5.3-BETA5 #2: Mon Sep 27 19:38:14 CEST 2004 beyssac@bofh.enst.fr:/usr/src/sys/i386/compile/BOFH i386

>Description:

Cannot "strings" a disk device even if you want to:

	# strings /dev/da2s1
	strings: Warning: '/dev/da2s1' is not an ordinary file
	#

Two misfeatures in one:
1. the warning is bogus, it is actually treated as an error: strings
   exits instead of going on with its job as would seem logical.
2. there is no documented way to override this behaviour.

>How-To-Repeat:
>Fix:

	Unknown.
>Release-Note:
>Audit-Trail:

From: David Schultz <das@FreeBSD.ORG>
To: Pierre Beyssac <beyssac@bofh.enst.fr>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/72355: Can't run "strings" on a (disk) device, even if you want to
Date: Wed, 6 Oct 2004 17:08:12 -0400

 > 	# strings /dev/da2s1
 > 	strings: Warning: '/dev/da2s1' is not an ordinary file
 
 I can't speak for why strings does this or whether it should be
 considered a bug or not, but a way to override it is
 'cat /dev/da2s1 | strings'.

From: Pierre Beyssac <beyssac@enst.fr>
To: David Schultz <das@FreeBSD.ORG>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/72355: Can't run "strings" on a (disk) device, even if you want to
Date: Thu, 7 Oct 2004 00:31:18 +0200

 On Wed, Oct 06, 2004 at 05:08:12PM -0400, David Schultz wrote:
 > I can't speak for why strings does this or whether it should be
 > considered a bug or not, but a way to override it is
 > 'cat /dev/da2s1 | strings'.
 
 Thanks! Since I sent the PR I have also found "strings < /dev/da2s1"
 which saves a cat; but still...
 -- 
 Pierre Beyssac						pb@enst.fr

From: Ryan Sommers <ryans@gamersimpact.com>
To: freebsd-gnats-submit@FreeBSD.org, beyssac@bofh.enst.fr
Cc:  
Subject: Re: bin/72355: Can't run "strings" on a (disk) device, even if you
 want to
Date: Thu, 07 Oct 2004 23:28:56 -0500

 According to POSIX: "The /strings/ utility shall look for printable 
 strings in regular files and shall write those strings to standard output."
 
  From the looks of it strings isn't supposed to work on devices. Depends 
 on how literally you take "regular files" to mean.
 
 -- 
 Ryan Sommers
 ryans@gamersimpact.com
 

From: Pierre Beyssac <beyssac@enst.fr>
To: Ryan Sommers <ryans@gamersimpact.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/72355: Can't run "strings" on a (disk) device, even if you want to
Date: Fri, 8 Oct 2004 10:14:36 +0200

 On Thu, Oct 07, 2004 at 11:28:56PM -0500, Ryan Sommers wrote:
 > According to POSIX: "The /strings/ utility shall look for printable 
 > strings in regular files and shall write those strings to standard output."
 
 Well, sorry but I don't quite see in what respect this precludes a
 POSIX-compliant strings from working on devices too (just as FreeBSD
 4.10 strings does).
 -- 
 Pierre Beyssac						pb@enst.fr
>Unformatted:
