From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 23 01:23:04 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CAE6E16A513 for ; Sat, 23 Apr 2005 01:23:04 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5800A43D4C for ; Sat, 23 Apr 2005 01:23:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3N1N4ir001999 for ; Sat, 23 Apr 2005 01:23:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3N1N4EG001996; Sat, 23 Apr 2005 01:23:04 GMT (envelope-from gnats) Resent-Date: Sat, 23 Apr 2005 01:23:04 GMT Resent-Message-Id: <200504230123.j3N1N4EG001996@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ed Maste Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 923D116A4E1 for ; Sat, 23 Apr 2005 00:35:15 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A94C43D1D for ; Sat, 23 Apr 2005 00:35:15 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j3N0ZFWf015733 for ; Sat, 23 Apr 2005 00:35:15 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j3N0ZFmn015732; Sat, 23 Apr 2005 00:35:15 GMT (envelope-from nobody) Message-Id: <200504230035.j3N0ZFmn015732@www.freebsd.org> Date: Sat, 23 Apr 2005 00:35:15 GMT From: Ed Maste To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: misc/80269: [PATCH] libtacplus tac_get_av_value will not return empty attribute value X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2005 01:23:05 -0000 >Number: 80269 >Category: misc >Synopsis: [PATCH] libtacplus tac_get_av_value will not return empty attribute value >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 Apr 23 01:23:03 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Ed Maste >Release: 5.3-RELEASE-p2 >Organization: Sandvine Inc. >Environment: FreeBSD bsd10.phaedrus.sandvine.com 5.3-RELEASE-p2 FreeBSD 5.3-RELEASE-p2 #2: Fri Dec 3 13:30:36 EST 2004 root@bsd10.phaedrus.sandvine.com:/usr/obj/usr/src/sys/WORKFARM i386 >Description: We have an application that uses libtacplus(3). During the authorization phase the tacplus server returns a list of attribute/value pairs. If an attribute has an empty value, tac_get_av_value() returns NULL and not a zero-length string. This makes it impossible to distinguish between a set but empty attribute and an unset attribute. >How-To-Repeat: Call tac_get_av_value() on a tac_handle containing an attribute with an empty value. >Fix: --- src/lib/libtacplus/taclib.c.orig 2005-04-22 20:25:41.000000000 -0400 +++ src/lib/libtacplus/taclib.c 2005-04-22 20:26:19.000000000 -0400 @@ -1264,8 +1264,11 @@ * h->srvr_avs[0] = "foobie=var1" * h->srvr_avs[1] = "foo=var2" * is handled. + * Return 0-length string for empty attribute value, + * to distinguish between empty and unset. Note that + * dup_str does the right thing if srvr.len = 0. */ - if (found_seperator == 1 && ch != end) { + if (found_seperator == 1) { srvr.len = end - ch; srvr.data = ch; return dup_str(h, &srvr, NULL); >Release-Note: >Audit-Trail: >Unformatted: