Skip to content
Snippets Groups Projects
  1. Jul 22, 2019
  2. 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
  3. Feb 14, 2019
  4. Feb 08, 2019
  5. Oct 17, 2018
    • Birte Kristina Friesel's avatar
      Use random() instead of rand() to increase portability · 9803fc41
      Birte Kristina Friesel authored
      Quoting glibc rand(3):
      
      The  versions  of rand() and srand() in the Linux C Library use the same random
      number generator as random(3) and srandom(3), so the lower-order bits should be
      as  random  as  the  higher-order bits.   However,  on  older  rand()
      implementations, and on current implementations on different systems, the
      lower-order bits are much less random than the higher-order bits.  Do not use
      this function in applications intended to be portable when good randomness is
      needed.  (Use random(3) instead.)
      9803fc41
  6. Jun 10, 2018
  7. May 16, 2018
  8. May 11, 2018
  9. May 10, 2018
  10. Apr 18, 2018
  11. Feb 28, 2018
  12. Feb 27, 2018
  13. Jan 29, 2018
  14. Jan 17, 2018
  15. Nov 07, 2017
  16. Nov 01, 2017
  17. Oct 03, 2017
  18. Sep 15, 2017
  19. Aug 21, 2017
  20. Aug 19, 2017
  21. Mar 23, 2017
    • Tobias Stoeckmann's avatar
      Fix double-free/OOB-write while receiving IPC data · f7a547b7
      Tobias Stoeckmann authored
      
      If a malicious client pretends to be the E17 window manager, it is
      possible to trigger an out of boundary heap write while receiving an
      IPC message.
      
      The length of the already received message is stored in an unsigned
      short, which overflows after receiving 64 KB of data. It's comparably
      small amount of data and therefore achievable for an attacker.
      
      When len overflows, realloc() will either be called with a small value
      and therefore chars will be appended out of bounds, or len + 1 will be
      exactly 0, in which case realloc() behaves like free(). This could be
      abused for a later double-free attack as it's even possible to overwrite
      the free information -- but this depends on the malloc implementation.
      
      Signed-off-by: default avatarTobias Stoeckmann <tobias@stoeckmann.org>
      f7a547b7
  22. May 02, 2016
  23. May 01, 2016
  24. Jun 26, 2015
  25. Jun 22, 2015
  26. Aug 21, 2014
  27. May 22, 2014
  28. May 11, 2014
  29. Feb 27, 2014
  30. Sep 26, 2013
    • Joel Bradshaw's avatar
      Support geometry in --bg-max and --bg-center · bae543b2
      Joel Bradshaw authored
      Overloads the --geometry option for wallpaper setting
      Currently only supports the two options that result in
      black borders, --bg-max and --bg-center.
      
      For both, if a geometry offset is specified (w/h is ignored),
      the image will be offset the specified pixels from the screen edge
      Left side for + numbers, right side for -.
      +/-0 will align at the edge of the screen.
      bae543b2
  31. Dec 04, 2012
  32. Oct 17, 2012
    • Rob Cornish's avatar
      Add --image-bg option for wallpaper border · 16654adf
      Rob Cornish authored
      Previously feh would set a black background around wallpaper images,
      with no option to change.
      
      This commit extends the functionality offered by the --image-bg option,
      which is available for regular image viewing, to centered and max'ed feh
      backgrounds. Essentially, this means a white border can now be chosen
      in addition to a black one.
      16654adf
  33. Nov 03, 2011
  34. Oct 10, 2011
  35. Sep 28, 2011
Loading