Skip to content
  • Tyler Hicks's avatar
    libapparmor: Clarify that mode strings are not to be freed · ebabb30a
    Tyler Hicks authored
    
    
    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: default avatarTyler Hicks <tyhicks@canonical.com>
    Acked-by: default avatarSeth Arnold <seth.arnold@canonical.com>
    ebabb30a