Skip to content
  • Tyler Hicks's avatar
    libapparmor: Use directory file descriptor in _aa_dirat_for_each() · 86de47d0
    Tyler Hicks authored
    
    
    The _aa_dirat_for_each() function used the DIR * type for its first
    parameter. It then switched back and forth between the directory file
    descriptors, retrieved with dirfd(), and directory streams, retrieved
    with fdopendir(), when making syscalls and calling the call back
    function.
    
    This patch greatly simplifies the function by simply using directory
    file descriptors. No functionality is lost since callers can still
    easily use the function after calling dirfd() to retrieve the underlying
    file descriptor.
    
    Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
    Acked-by: default avatarSeth Arnold <seth.arnold@canonical.com>
    86de47d0