• Constant Pain@lemmy.world
    link
    fedilink
    arrow-up
    6
    ·
    5 hours ago

    What I don’t get is why deny the execution of a command because the lack of sudo instead of just notice that it needs elevated privilege and ask for password

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      4
      ·
      edit-2
      5 hours ago

      It’s kind of bad for scripts, where it can be either annoying or genuinely problematic, when your script hangs on a password prompt. You typically do want it to just fail right away, because if you have monitoring, then you’ll be able to spot it failing.

      These days, it is (largely reliably) possible to detect whether a command is being run interactively or as part of an unattended script, so you do see some commands that trigger a sudo password prompt only for interactive use, for example systemctl does this. But this adds quite a bit of complexity to each individual program, so it isn’t really something that’s going to be implemented universally.

      I also have to say that systemctl kind of gets on my tits when it does that, because it throws up a GUI dialog for grabbing the password, which is quite jarring.