Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1643470
| From | Stephen Smalley <sds@tycho.nsa.gov> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v5 1/2] selinux: add brief info to policydb |
| Date | 2017-05-17 17:40 +0200 |
| Message-ID | <tI9dn-4QL-3@gated-at.bofh.it> (permalink) |
| References | <tHHqO-3Wv-17@gated-at.bofh.it> <tHRqa-1So-15@gated-at.bofh.it> <tI8Km-4GH-7@gated-at.bofh.it> |
| Organization | National Security Agency |
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.
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-16 12:00 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb Stephen Smalley <sds@tycho.nsa.gov> - 2017-05-16 22:40 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 17:10 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 17:10 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 17:30 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 17:40 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 17:50 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 18:10 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 18:30 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb Sebastien Buisson <sbuisson.ddn@gmail.com> - 2017-05-17 19:10 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb William Roberts <bill.c.roberts@gmail.com> - 2017-05-17 20:30 +0200
Re: [PATCH v5 1/2] selinux: add brief info to policydb Stephen Smalley <sds@tycho.nsa.gov> - 2017-05-17 17:40 +0200
csiph-web