• Stephen Smalley's avatar
    Optimize restorecon_recursive tree walk. · 0e7340fb
    Stephen Smalley authored
    
    
    restorecon_recursive can prune the tree walk whenever it
    encounters a directory for which there is no possible match
    for any of its descendants in the file_contexts configuration.
    This will only presently benefit the restorecon_recursive("/sys") call
    by init since other restorecon_recursive calls always have
    top-level entries that will match anything underneath and this
    is required to fully label those partitions on upgrade. However,
    those other cases are already optimized to only run once per
    file_contexts change (upgrade) and thus do not need this optimization.
    
    Change-Id: I854bf1ccff6ded56e9da2c4184435f67d7069bc1
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
    0e7340fb
label_file.c 17.7 KB