io-restrict-auth.lisp 938 B

12345678910111213141516171819202122
  1. (in-package :hurd-translator)
  2. (def-io-interface :io-restrict-auth ((file port)
  3. (new-port port-pointer)
  4. (new-port-type :pointer)
  5. (uids :pointer)
  6. (nuids msg-type-number)
  7. (gids :pointer)
  8. (ngids msg-type-number))
  9. (with-lookup protid file
  10. (let* ((new-user (make-iouser-mem uids nuids gids ngids))
  11. (restricted-user (restrict-iouser (get-user protid)
  12. new-user))
  13. (new-protid (new-protid *translator*
  14. restricted-user
  15. (open-node protid))))
  16. (setf (mem-ref new-port 'port) (get-right new-protid)
  17. (mem-ref new-port-type 'msg-type-name) :make-send)
  18. t)))