Skip to content
Snippets Groups Projects
  1. Jun 29, 2024
  2. Oct 06, 2023
  3. Oct 04, 2022
  4. Mar 25, 2017
    • Tobias Stoeckmann's avatar
      Properly clear the last entered character · 35633d45
      Tobias Stoeckmann authored
      
      When enter is pressed, passwd[len] will be set to '\0'. Pressing
      backspace is supposed to remove the last entered character.
      
      But currently, the clearing has an off-by-one, as in setting
      passwd[len] to '\0' just like enter would do.
      
      You can also verify it by imagining len=1 and that it's impossible to
      clear passwd[0] by pressing backspace with the current code.
      
      Signed-off-by: default avatarTobias Stoeckmann <tobias@stoeckmann.org>
      35633d45
  5. Nov 22, 2016
  6. Nov 20, 2016
  7. Nov 19, 2016
  8. Oct 17, 2016
  9. Oct 10, 2016
  10. Sep 28, 2016
    • FRIGN's avatar
      Add a section on security considerations · bd069b08
      FRIGN authored
      The section on security considerations sheds some light on the problems that we
      can't solve within slock but which the user has to solve in his X configuration.
      bd069b08
  11. Sep 26, 2016
    • Markus Teich's avatar
      remove confusing DPMS comment · 2d85c5ba
      Markus Teich authored
      FRIGN on hackers@suckless.org:
      What has been bugging me for quite a while is this DPMS comment that was added
      there for no reason. Every sane mind would agree that fiddling with DPMS makes
      no sense whatsoever. When I slock, my screen turns off after 10 minutes. So, if
      I don't like that, I disable DPMS. If I do, I just fiddle around with my mouse a
      bit and get the slock promt.
      2d85c5ba
  12. Sep 23, 2016
    • Markus Teich's avatar
      error out early on crypt() fail · a98fba89
      Markus Teich authored
      a98fba89
    • FRIGN's avatar
      Stop using $USER for shadow entries · dc2e8e83
      FRIGN authored
      This was extremely bad practice, effectively making the program behave
      different depending on which architecture you are running it on.
      
      OpenBSD offers getpwuid_shadow, but there is no getspuid for getspnam,
      so we resort to using the pw_name entry in the struct passwd we filled
      earlier.
      
      This prevents slock from crashing when $USER is empty (easy to do). If
      you want to run slock as a different user, don't use
      
      	$ USER="tom" slock
      
      but doas or sudo which were designed for this purpose.
      dc2e8e83
    • FRIGN's avatar
      Rename getpw() and pws to gethash() and hash · 9a617db7
      FRIGN authored
      9a617db7
    • FRIGN's avatar
      Remove cleanup and deglobalize and rework data structures · b00f444a
      FRIGN authored
      The cleanup removal is a joint-venture with Markus. We assume the X server does
      the cleanup, so we don't need it. The idea is that the fds are closed at exit
      and thus already indicate to the X server that the client has quit. Analogously
      the same applies to freeing memory sections previously allocated for the X
      server.
      
      We love XXXXXL burgers and therefore removed
      XUngrabPointer
      XUngrabKeyboard
      XFreeColors
      XFreePixmap
      XDestroyWindow
      Lines of Code.
      
      For a project like slock there is no need to carry around global state. By
      moving the three structures to main() it is now clear which functions modify
      which state, greatly improving the readability of the code, especially given
      slock is a suid program.
      b00f444a
  13. Sep 08, 2016
  14. Sep 07, 2016
    • FRIGN's avatar
      Ensure Polyphemus-Mitigation and properly drop privileges · 22eba05f
      FRIGN authored
      Don't hide privilege drops inside readpw() and actually make it
      configurable what you are dropping to in config.h.
      
      The privilege drop comes after opening the Display because the
      user "nobody" with "nogroup" can't do that.
      
      So why do I call this strategy the Polyphemus-Mitigation?
      
      """
      After the giant returns in the evening and eats two more of the men,
      Odysseus offers Polyphemus some strong and undiluted wine given to him
      earlier on his journey. Drunk and unwary, the giant asks Odysseus his
      name, promising him a guest-gift if he answers. Odysseus tells him
      "Οὖτις", which means "nobody" and Polyphemus promises to eat this
      "Nobody" last of all. With that, he falls into a drunken sleep. Odysseus
      had meanwhile hardened a wooden stake in the fire and now drives it into
      Polyphemus' eye. When Polyphemus shouts for help from his fellow giants,
      saying that "Nobody" has hurt him, they think Polyphemus is being
      afflicted by divine power and recommend prayer as the answer.
      """
      
      (source: https://en.wikipedia.org/wiki/Polyphemus)
      22eba05f
    • Quentin Rameau's avatar
      04143fd6
    • Markus Teich's avatar
      make error message prefix consistent · 96982240
      Markus Teich authored
      96982240
  15. Sep 02, 2016
  16. Aug 30, 2016
    • FRIGN's avatar
      Refactor dontkillme() · 137f0076
      FRIGN authored
      - Use file pointers instead of raw I/O, inspired by Kernel code.
      - Use OOM_SCORE_ADJ_MIN from linux/oom.h instead of working with
        magic values.
      - Stricter error checking and descriptive error messages.
      
      The reasoning for using the constant rather than magic values lies
      in the fact that this ensures people get the message.
      With "-1000", a code reviewer would question if that is really the
      lowest possible number or just an arbitrary value.
      The kernel ABI probably won't change, but even in the case, we wouldn't
      have to modify the code. The OOM killer only is guaranteed to not
      kill you if you have OOM_SCORE_ADJ_MIN.
      137f0076
    • FRIGN's avatar
      Convert manpage to mandoc and fix usage · a9eddbd9
      FRIGN authored
      In all honor, the previous usage was formally more correct, but for the
      sake of consistency across all the tools having the v-flag, I separated
      it from the command-string.
      
      Also, make use of the mandoc macros for the manpage. This makes it
      easier to maintain, extend and change in the future.
      a9eddbd9
Loading