6c869ad selinux: accept the fact that getxyzcon() can return success and NULL

2 files Authored by Lennart Poettering a year ago, Committed by zbyszek a year ago,
    selinux: accept the fact that getxyzcon() can return success and NULL
    
    Inspired by #25664: let's check explicitly for NULL everywhere we do one
    of those getXYZcon() calls.
    
    We usually turn this into EOPNOTSUPP, as when selinux is off (which is
    supposed to be the only case this can happen according to selinux docs)
    we otherwise return EOPNOTSUPP in that case.
    
    Note that in most cases we have an explicit mac_selinux_use() call
    beforehand, hence this should mostly not be triggerable codepaths.
    
    (cherry picked from commit af614e45c3efb49e37c4b1507ccc4e450119c089)
    
        
file modified
+7 -3
file modified
+24 -6