• Tim Beale's avatar
    CVE-2019-3870 tests: Extend smbd tests to check for umask being overwritten · 40af26fa
    Tim Beale authored
    The smbd changes the umask - if the code fails to restore the umask to
    what it was, then this is very bad. Add an extra check to every
    smbd-related test that the umask at the end of the test is the same as
    what it was at the beginning (i.e. if the smbd code changed the umask
    then it correctly restored the value afterwards).
    
    As the selftest sets the umask for all tests to zero, it makes it hard
    to detect this problem, so the test setUp() needs to set it to something
    else first.
    
    This extra checking is added to the setUp()/tearDown() so that it
    applies to all test-cases. However, any failure that occur with this
    approach will not be able to be known-failed.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13834Signed-off-by: 's avatarTim Beale <timbeale@catalyst.net.nz>
    Reviewed-by: 's avatarAndrew Bartlett <abartlet@samba.org>
    
    (This backport to Samba 4.9 by Andrew Bartlett was not a pure
    cherry-pick due to merge conflicts)
    40af26fa
umask-leak 295 Bytes