From: Stephen Smalley <sds@tycho.nsa.gov>
To: Sebastien Buisson <sbuisson.ddn@gmail.com>
Cc: linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, selinux@tycho.nsa.gov,
serge@hallyn.com, james.l.morris@oracle.com,
Eric Paris <eparis@parisplace.org>,
Paul Moore <paul@paul-moore.com>,
Sebastien Buisson <sbuisson@ddn.com>
Subject: Re: [PATCH v5 1/2] selinux: add brief info to policydb
Date: Wed, 17 May 2017 11:38:11 -0400 [thread overview]
Message-ID: <1495035491.32535.6.camel@tycho.nsa.gov> (raw)
In-Reply-To: <CAPkE-bWykonYBssXGphktM7jANY_nbtQi7EVc4uLwjm-fdM8Kg@mail.gmail.com>
On Wed, 2017-05-17 at 16:59 +0200, Sebastien Buisson wrote:
> 2017-05-16 22:40 GMT+02:00 Stephen Smalley <sds@tycho.nsa.gov>:
> > > + strcpy(*brief, policydb.policybrief);
> > > + /* *len is the length of the output string */
> > > + *len = policybrief_len - 1;
> >
> > Is there a particular reason to not just return policybrief_len
> > here as
> > well, for consistency in the interface? How do you intend to use
> > this
> > value in the caller?
>
> As called in the other patch to expose policy brief via selinuxfs
> (sel_read_policybrief), the intent is to provide the caller with the
> length of the string returned.
> Or should I set *len to policy brief_len here, and just make the
> caller aware that the returned length is in fact the length of the
> buffer (i.e. including terminating NUL byte)?
Looking at the caller usage in the other patch, I guess it makes sense
in its current form.
prev parent reply other threads:[~2017-05-17 15:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-16 9:51 Sebastien Buisson
2017-05-16 9:51 ` [PATCH v5 2/2] selinux: expose policy brief via selinuxfs Sebastien Buisson
2017-05-16 20:40 ` [PATCH v5 1/2] selinux: add brief info to policydb Stephen Smalley
2017-05-17 14:59 ` Sebastien Buisson
2017-05-17 15:09 ` William Roberts
2017-05-17 15:24 ` Sebastien Buisson
2017-05-17 15:34 ` William Roberts
2017-05-17 15:43 ` Sebastien Buisson
2017-05-17 16:04 ` William Roberts
2017-05-17 16:22 ` William Roberts
2017-05-17 17:00 ` Sebastien Buisson
2017-05-17 18:28 ` William Roberts
2017-05-17 15:38 ` Stephen Smalley [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=1495035491.32535.6.camel@tycho.nsa.gov \
--to=sds@tycho.nsa.gov \
--cc=eparis@parisplace.org \
--cc=james.l.morris@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=sbuisson.ddn@gmail.com \
--cc=sbuisson@ddn.com \
--cc=selinux@tycho.nsa.gov \
--cc=serge@hallyn.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome