[apparmor] libapparmor: Clarify that mode strings are not to be freed

Seth Arnold seth.arnold at canonical.com
Wed Sep 4 22:38:48 UTC 2013


On Wed, Sep 04, 2013 at 03:11:08PM -0700, Tyler Hicks wrote:
> The aa_getcon man page only implies that the *mode strings returned by
> aa_getprocattr(), aa_gettaskcon(), aa_getcon(), and aa_getpeercon()
> should not be freed. A developer using the man page to build against
> libapparmor may miss that subtlety and end up hitting double free issues.
> 
> This patch makes the man page more clear, makes the function comments
> more clear, and changes the aa_getprocattr() *buf param to *con. The use
> of *buf should reserved for the aa_get*_raw() functions that do not
> allocate a buffer for the confinement context and all documents now
> clearly mention that *con must be freed.
> 
> Additionally, this patch removes the line wrapping of the
> aa_getprocattr_raw() prototype in the aa_getcon man page source. The
> line wrapping caused incorrect formatting of the function prototype when
> viewing the man page.
> 
> Signed-off-by: Tyler Hicks <tyhicks at canonical.com>

Nice, thanks.

Acked-by: Seth Arnold <seth.arnold at canonical.com>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130904/4c42948d/attachment.pgp>


More information about the AppArmor mailing list