[–] 1 point 6 months ago

Yeah I do wonder if we need an easier way to declare these things because programmers are lazy and even in Rust I wouldn't always bother.

You can kind of do it in Typescript with strings:

function create_user(role: "admin" | "normal")

But of course the downside is they are strings at runtime. I'm sure it's possible though.

  • source
  • parent
  • context
  • [–] 1 point 6 months ago

    Tbh while DST (or just "testing" as hardware people would call it) is very obviously a great idea, I'm not sure it would have helped here - in order to detect these TOCTOU bugs you would need stimulus that triggers it and some kind of checker/model that has the correct behaviour.

    That's totally possible but it's pretty hardcore testing for a software project and it's difficult to imagine doing that without realising that you have a TOCTOU issue just by inspection.

  • source
  • parent
  • context
  • view more: ‹ prev next ›