From cd9@buffalo.edu  Wed Aug 21 16:19:19 2002
Return-Path: <cd9@buffalo.edu>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E914037B400
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Aug 2002 16:19:19 -0700 (PDT)
Received: from mta02-srv.alltel.net (mta02.alltel.net [166.102.165.144])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E618743E84
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 21 Aug 2002 16:19:18 -0700 (PDT)
	(envelope-from cd9@buffalo.edu)
Received: from selvirjin.alltel.net ([166.102.201.65])
          by mta02-srv.alltel.net with ESMTP
          id <20020821231917.TGZB28341.mta02-srv.alltel.net@selvirjin.alltel.net>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Wed, 21 Aug 2002 18:19:17 -0500
Received: from dragon by selvirjin.alltel.net with local (Exim 3.36 #1)
	id 17hekR-000172-00; Wed, 21 Aug 2002 19:18:47 -0400
Message-Id: <20020821191847.A87558@selvirjin.alltel.net>
Date: Wed, 21 Aug 2002 19:18:47 -0400
From: cd9@buffalo.edu
Reply-To: cd9@buffalo.edu
To: FreeBSD-gnats-submit@freebsd.org
Cc: cd9@buffalo.edu
Subject: [PATCH] atacontrol reports SMART settings for "security"
X-Send-Pr-Version: 3.113

>Number:         41870
>Category:       bin
>Synopsis:       [PATCH] atacontrol reports SMART settings for "security"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    sos
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 21 16:20:06 PDT 2002
>Closed-Date:    Thu Sep 12 07:08:51 PDT 2002
>Last-Modified:  Thu Sep 12 07:08:51 PDT 2002
>Originator:     C. A. Daelhousen
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD selvirjin.alltel.net 4.6-STABLE FreeBSD 4.6-STABLE #2:
Wed Aug 21 13:21:57 EDT 2002
root@selvirjin.alltel.net:/usr/obj/usr/src/sys/V8 i386

>Description:
	In /usr/src/sbin/atacontrol/atacontrol.c v1.11.2.5, function
cap_print, line 161:
	For "security", the printf statement uses the values of
parm->support.smart and parm->enabled.smart rather than
parm->support.security and parm->enabled.security.

>How-To-Repeat:
        Unknown--the problem was spotted while reading source.
Presumably, running "atacontrol cap" on a device that has either SMART
or security (but not both) enabled or supported would show the bug.
>Fix:

	Caveat: I'm a novice at operating diff. Check the headers before
use. Times are UTC -0400.
	Patch against src/sbin/atacontrol/atacontrol.c,v 1.11.2.5:

--- src/sbin/atacontrol/atacontrol.c       Wed Aug 21 11:24:21 2002
+++ src/sbin/atacontrol/atacontrol-patched.c        Wed Aug 21 15:15:04 2002
@@ -158,8 +158,8 @@
                parm->enabled.microcode ? "yes" : "no");        
 
        printf("security                       %s       %s\n",
-               parm->support.smart ? "yes" : "no",
-               parm->enabled.smart ? "yes" : "no");    
+               parm->support.security ? "yes" : "no",
+               parm->enabled.security ? "yes" : "no"); 
 
        printf("power management               %s       %s\n",
                parm->support.power_mngt ? "yes" : "no",

>Release-Note:
>Audit-Trail:

From: "C. A. Daelhousen" <cd9@buffalo.edu>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/41870: [PATCH] atacontrol reports SMART settings for "security"
Date: Thu, 22 Aug 2002 22:20:40 -0400

 One should read the Contributing page BEFORE submitting the patch. Here
 it is with proper tabbing, and hopefully they won't get eaten.
 
 --- src/sbin/atacontrol/atacontrol.c	Wed Aug 21 11:24:21 2002
 +++ src/sbin/atacontrol/atacontrol-patched.c	Wed Aug 21 15:15:04 2002
 @@ -158,8 +158,8 @@
  		parm->enabled.microcode ? "yes" : "no");	
  
  	printf("security                       %s	%s\n",
 -		parm->support.smart ? "yes" : "no",
 -		parm->enabled.smart ? "yes" : "no");	
 +		parm->support.security ? "yes" : "no",
 +		parm->enabled.security ? "yes" : "no");	
  
  	printf("power management               %s	%s\n",
  		parm->support.power_mngt ? "yes" : "no",
 
 -- 
 ..: Chad Daelhousen == cd9@buffalo.edu :.........: sig v3.1 :...
 : Programming for 10 +/- 2 years (50 +/- 10% of a lifetime)    :
 :.............Perl will be the first to implement mind reading.:
 
Responsible-Changed-From-To: freebsd-bugs->sos 
Responsible-Changed-By: cjc 
Responsible-Changed-When: Sat Aug 24 13:59:12 PDT 2002 
Responsible-Changed-Why:  
Over to the ATA maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41870 
State-Changed-From-To: open->closed 
State-Changed-By: sos 
State-Changed-When: Thu Sep 12 07:06:31 PDT 2002 
State-Changed-Why:  
Thanks! committed to current mfc follows 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41870 
>Unformatted:
