Skip to content
  • Matthieu Herrb's avatar
    Avoid chmod() calls on directories · 7058a177
    Matthieu Herrb authored
    
    
    There are several reasons for that:
    - the reason that triggered this patch is that the pledge() sandboxing
    system on OpenBSD forbids chmod() by default in many pledged
    applications. When one of these needs to rebuild the font cache it
    will fail because of these unneeded chmod() calls.
    - trying to change existing directories access rights isn't a good idea
    - and lastly doing mkdir() && chmod() is racy. Use umask() to make shure
    the directory is created with the proper access rights from start.
    
    Signed-off-by: default avatarMatthieu Herrb <matthieu@herrb.eu>
    7058a177