Date: Wed, 25 Nov 2009 14:59:28 +0000 (UTC) From: Attilio Rao <attilio@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r199802 - head/lib/libtacplus Message-ID: <200911251459.nAPExS7C053742@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: attilio Date: Wed Nov 25 14:59:28 2009 New Revision: 199802 URL: http://svn.freebsd.org/changeset/base/199802 Log: In tac_get_av_value() empty attributes should be handled like 0-length strings rather than unset strings. Fix the present wrong behaviour. Obtained from: Sandvine Incorporated Reviewed by: emaste Sponsored by: Sandvine Incorporated MFC: 1 week Modified: head/lib/libtacplus/taclib.c Modified: head/lib/libtacplus/taclib.c ============================================================================== --- head/lib/libtacplus/taclib.c Wed Nov 25 14:57:07 2009 (r199801) +++ head/lib/libtacplus/taclib.c Wed Nov 25 14:59:28 2009 (r199802) @@ -1263,8 +1263,13 @@ tac_get_av_value(struct tac_handle *h, c * h->srvr_avs[0] = "foobie=var1" * h->srvr_avs[1] = "foo=var2" * is handled. + * + * Note that for empty string attribute values a + * 0-length string is returned in order to distinguish + * against unset values. + * dump_str() will handle srvr.len == 0 correctly. */ - if (found_seperator == 1 && ch != end) { + if (found_seperator == 1) { srvr.len = end - ch; srvr.data = ch; return dup_str(h, &srvr, NULL);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911251459.nAPExS7C053742>