All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Antill <jantill@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Karl MacMillan <kmacmillan@mentalrootkit.com>,
	SE Linux <selinux@tycho.nsa.gov>
Subject: Re: policyrep questions
Date: Wed, 09 May 2007 12:34:54 -0400	[thread overview]
Message-ID: <1178728494.12294.69.camel@code.and.org> (raw)
In-Reply-To: <1178724555.16433.19.camel@moss-spartans.epoch.ncsc.mil>

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

On Wed, 2007-05-09 at 11:29 -0400, Stephen Smalley wrote:

> > 4) We assume NULL-terminated strings all over the place - should we be
> > providing apis with length? Alternatively, should we provide a better
> > string object (since we are currently re-inventing the wheel, why not?).
> > We could pull in something like James Antills Vstr library -
> > http://www.and.org/vstr/ (read and be amazed at the diligence of James).
> > It just seems crazy that our apis are not the safest.
> 
> I'm not clear that tracking length separately is advantageous for these
> APIs.

 I assume you mean "tracking length separately is not advantageous"?

>   What specific advantages would accrue to libsepol from using
> vstr?  What is the cost (incl. dependencies)?

 I'm not sure you need all the power of Vstr, while it certainly
provides a lot of convenience functions that you could use the main
design focus was on IO strings that travel across the network ... not on
lots of small strings in hashtables etc.
 The Vstr lib. itself has no deps.

 However I am convinced that having just char* is not a suitable string
ADT, tracking the length/size separately never works out well from a
bugs POV.
 Also sepol seems to do a _lot_ of comparisons, being able to implement
"eq" as:

 (s1->len == s1->len && !memcmp(s1->ptr, s2->ptr, s1->len)

...is a major win.

-- 
James Antill <jantill@redhat.com>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      parent reply	other threads:[~2007-05-09 16:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 22:29 policyrep questions Karl MacMillan
2007-05-09 14:13 ` Karl MacMillan
2007-05-09 15:30   ` Stephen Smalley
2007-05-09 15:29 ` Stephen Smalley
2007-05-09 15:51   ` Karl MacMillan
2007-05-09 16:34   ` James Antill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1178728494.12294.69.camel@code.and.org \
    --to=jantill@redhat.com \
    --cc=kmacmillan@mentalrootkit.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.