Skip to content
  1. Dec 03, 2019
  2. Dec 02, 2019
  3. Nov 07, 2019
  4. Oct 31, 2019
  5. Oct 30, 2019
  6. Oct 11, 2019
  7. Jul 22, 2019
  8. Jul 13, 2019
  9. Jul 12, 2019
    • Tobias Stoeckmann's avatar
      Check stat for error before setting permissions. · 2c38c9da
      Tobias Stoeckmann authored
      
      
      When setting wallpapers without --no-fehbg option, a ~/.fehbg file is
      created. This file is set to be an executable for later re-use.
      
      Calling stat() without checking the return value can lead to issues.
      If the call fails, then s.st_mode is undefined and excessive permissions
      could be set to .fehbg, at worst even setuid/setgid bits for a world
      writable file.
      
      While adjusting this, I changed the code to use fstat() and fchmod() to
      avoid a further -- but very unlikely -- issue: race condition in form of
      TOCTOU. If the file ~/.fehsetbg is replaced by a symlink right before
      the chmod call, then a different file would be set executable + the
      default mode of the (newly created) file. I don't expect this to be a
      real world issue but changed this part "while at it" anyway for more
      robust code and a good example on how to handle files.
      
      Signed-off-by: default avatarTobias Stoeckmann <tobias@stoeckmann.org>
      2c38c9da
  10. Jul 10, 2019
  11. Jul 08, 2019
  12. Apr 18, 2019
  13. Apr 12, 2019
  14. Apr 05, 2019
  15. Apr 01, 2019
  16. Mar 26, 2019
  17. Mar 15, 2019
  18. Mar 14, 2019
  19. Feb 17, 2019
  20. Feb 16, 2019
  21. Feb 14, 2019
  22. Feb 11, 2019
  23. Feb 08, 2019