News for hackers. Stuff that matters.
Re:Why did Windows 7 log on slower for months if you had a s... by snackbroken on Tuesday April 29, 2025 @04:50AM (#43830103)
This is a nice example of why one should parse, not validate. If every function that requires some kind of permission takes that permission as an argument, say (pseudocode)

  void doFoo(PermissionToDoFoo permission, ...){...}
and then, the only way to call it is through something like

  from request import getAuth, respond
  \\  Maybe<AuthenticationData> getAuth(Request request)
  \\  void respond(String response)
  from permissions import askForPermissionToDoFoo
  \\  Maybe<PermissionToDoFoo> askForPermissionToDoFoo(AuthenticationData auth)

  response =
    try
      auth <- getAuth(request)
      permission <- askForPermissionToDoFoo(auth)
      doFoo(permission)
      "Success!"
    fail
      "Oopsie!"

  respond(response)
It becomes impossible to represent the invalid state of doing Foo without permission.
Re:Why did Windows 7 log on slower for months if you had a s... by trympet on Tuesday April 29, 2025 @02:40PM (#43836414)
This is also known as capability-based access control. It was implemented in Project Midori [1] — Microsoft’s flopped managed microkernel OS

[1] - https://en.wikipedia.org/wiki/Midori_(operating_system)