From sacadmin Wed Jan 23 16:43:55 2008
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m0O0hth9025036;
	Wed, 23 Jan 2008 16:43:55 -0800 (PST)
Received: (from dchieu@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id m0O0htBl025032;
	Wed, 23 Jan 2008 16:43:55 -0800 (PST)
Date: Wed, 23 Jan 2008 16:43:55 -0800 (PST)
From: David Chieu <dchieu@sac.sfbay.sun.com>
Message-Id: <200801240043.m0O0htBl025032@sac.sfbay.sun.com>
To: PSARC-record@sac.sfbay.sun.com
Cc: Dana.Myers@sun.com, dan.mick@sun.com, seth.goldberg@sun.com
Subject: Adding strnlen() to implementation of PSARC/1998/399 [PSARC/2008/047 Self Review]
Status: RO
Content-Length: 1914

I'm sponsoring this case for Dana Myers and marking it closed approved
automatic. If any ARC member believes this needs to be promoted to a
fast track case, let me know and I'll start a timer.

The project team requests a patch binding. 

-- David Chieu

Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI
This information is Copyright 2008 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 Adding strnlen() to implementation of PSARC/1998/399
    1.2. Name of Document Author/Supplier:
	 Author:  Dana Myers
    1.3  Date of This Document:
	23 January, 2008


4. Technical Description

 vsnprintf() in usr/src/common/util/string.c requires implementation of
strnlen().

Background:
 PSARC/1998/399 improved system error messages; part of the implementation
involved creating stand-alone/kernel versions of standard libc string
functions (such as strcat, strchr, strcmp, strncmp, strcpy, strncpy,  etc.).
These functions are used internally in kmdb, boot and the kernel.  In
particular, vsnprintf(), which underpins formatted output in kmdb, boot
and the kernel, uses these string functions.

Problem:
 A specific use of vsnprintf() for strings results in the use of
strlen() on a non-terminated string; fixing this requires the use of
strnlen(), which is not implemented in string.c.  The specific case
is where a 'precision' is supplied to %s (example "%4s" or "%4.4s").

Proposal:
 In order to support the fix to vsnprintf(), strnlen() will be
implemented with the same function prototype as the standard libc
version.  This is intended for use by the same internal consumers
as existing string functions.  This implementation may be backported
to an S10 patch, so 'patch' binding is assumed.
    

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: Automatic
    6.6. ARC Exposure: open


From sacadmin Wed Jan 23 17:26:06 2008
Received: from dm-eng-02.sfbay.sun.com (dm-eng-02 [129.146.11.32])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m0O1Q5HG026272;
	Wed, 23 Jan 2008 17:26:05 -0800 (PST)
Received: from marduk.eng.sun.com (marduk.SFBay.Sun.COM [129.146.108.224])
	by dm-eng-02.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m0O1Q5jJ027767;
	Wed, 23 Jan 2008 17:26:05 -0800 (PST)
Received: from marduk.eng.sun.com (localhost [127.0.0.1])
	by marduk.eng.sun.com (8.13.6+Sun/8.12.11) with ESMTP id m0O1OpJ3021044;
	Wed, 23 Jan 2008 17:24:51 -0800 (PST)
Received: (from gww@localhost)
	by marduk.eng.sun.com (8.13.6+Sun/8.12.11/Submit) id m0O1OpoT021043;
	Wed, 23 Jan 2008 17:24:51 -0800 (PST)
Date: Wed, 23 Jan 2008 17:24:51 -0800 (PST)
From: Gary Winiger <gww@eng.sun.com>
Message-Id: <200801240124.m0O1OpoT021043@marduk.eng.sun.com>
To: PSARC-record@sac.sfbay.sun.com, dchieu@sac.sfbay.sun.com
Cc: Dana.Myers@sun.com, dan.mick@sun.com, seth.goldberg@sun.com
Subject: Re: Adding strnlen() to implementation of PSARC/1998/399 [PSARC/2008/047 Self Review]
Status: RO
Content-Length: 240

> 4. Technical Description
> 
>  vsnprintf() in usr/src/common/util/string.c requires implementation of
> strnlen().

	And the materials that describe strnlen() are found where?
	I.e., the case needs a man page to define strnlen();

Gary..

From sacadmin Wed Jan 23 19:35:01 2008
Received: from dm-sfbay-01.sfbay.sun.com (dm-sfbay-01 [129.145.155.118])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id m0O3Z1ZV028381;
	Wed, 23 Jan 2008 19:35:01 -0800 (PST)
Received: from sca-es-mail-2.sun.com (sca-es-mail-2.Sun.COM [192.18.43.133])
	by dm-sfbay-01.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2) with ESMTP id m0O3Z1QB014742;
	Wed, 23 Jan 2008 19:35:01 -0800 (PST)
Received: from fe-sfbay-09.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m0O3YuSs017893;
	Wed, 23 Jan 2008 19:34:56 -0800 (PST)
Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0JV400C01PWKJT00@fe-sfbay-09.sun.com>
 (original mail from David.Chieu@Sun.COM); Wed, 23 Jan 2008 19:34:56 -0800 (PST)
Received: from [10.1.48.114] by fe-sfbay-09.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTPSA id <0JV400DB4PY7Z090@fe-sfbay-09.sun.com>; Wed,
 23 Jan 2008 19:34:55 -0800 (PST)
Date: Wed, 23 Jan 2008 19:35:20 -0800
From: David Chieu <David.Chieu@sun.com>
Subject: Re: Adding strnlen() to implementation of PSARC/1998/399
 [PSARC/2008/047 Self Review]
In-reply-to: <200801240124.m0O1OpoT021043@marduk.eng.sun.com>
Sender: David.Chieu@sun.com
To: Gary Winiger <gww@eng.sun.com>
Cc: PSARC-record@sac.sfbay.sun.com, dchieu@sac.sfbay.sun.com,
        Dana.Myers@sun.com, Dan.Mick@sun.com, Seth.Goldberg@sun.com
Message-id: <47980778.1000409@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
References: <200801240124.m0O1OpoT021043@marduk.eng.sun.com>
User-Agent: Thunderbird 2.0.0.6 (X11/20071203)
Status: RO
Content-Length: 362

Gary Winiger wrote:
>> 4. Technical Description
>>
>>  vsnprintf() in usr/src/common/util/string.c requires implementation of
>> strnlen().
>>     
>
> 	And the materials that describe strnlen() are found where?
> 	I.e., the case needs a man page to define strnlen();
>
> Gary..
>   
The man page is now uploaded at the case materials directory.

-- David Chieu

