file-chmod.lisp 574 B

123456789101112131415161718192021
  1. (in-package :hurd-translator)
  2. (def-fs-interface :file-chmod ((file port)
  3. (mode mode-t))
  4. (with-lookup protid file
  5. ; We only want permission bits
  6. ; Disable those bits that don't make much sense here
  7. (set-spare mode nil)
  8. (set-types mode nil)
  9. (set-trans mode nil)
  10. (let ((err (chmod-file *translator*
  11. (get-node protid)
  12. (get-user protid)
  13. mode)))
  14. (cond
  15. ((eq err t) t)
  16. ((eq err nil) :not-permitted)
  17. (t err)))))