fauth 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .TH FAUTH 2
  2. .SH NAME
  3. fauth \- set up authentication on a file descriptor to a file server
  4. .SH SYNOPSIS
  5. .nf
  6. .PP
  7. .ft L
  8. #include <u.h>
  9. #include <libc.h>
  10. .PP
  11. .ft P
  12. .B
  13. int fauth(int fd, char *aname)
  14. .SH DESCRIPTION
  15. .PP
  16. .I Fauth
  17. is used to establish authentication for the current user to access
  18. the resources available through the 9P connection represented by
  19. .IR fd .
  20. The return value is a file descriptor, conventionally called
  21. .BR afd ,
  22. that is subsequently used to negotiate the authentication protocol
  23. for the server, typically using
  24. .IR auth_proxy
  25. or
  26. .IR fauth_proxy
  27. (see
  28. .IR auth (2)).
  29. After successful authentication,
  30. .B afd
  31. may be passed as the second argument to a subsequent
  32. .B mount
  33. call (see
  34. .IR bind (2)),
  35. with the same
  36. .IR aname,
  37. as a ticket-of-entry for the user.
  38. .PP
  39. If
  40. .I fauth
  41. returns -1, the error case, that means the file server does not require
  42. authentication for the connection, and
  43. .B afd
  44. should be set to -1
  45. in the call to
  46. .BR mount.
  47. .PP
  48. It is rare to use
  49. .IR fauth
  50. directly; more commonly
  51. .I amount
  52. (see
  53. .IR auth (2))
  54. is used.
  55. .SH SOURCE
  56. .B /sys/src/libc/9syscall
  57. .SH SEE ALSO
  58. .IR attach (5),
  59. .IR auth (2)
  60. (particularly
  61. .BR amount ),
  62. .IR authsrv (6),
  63. .IR auth (8)
  64. .SH DIAGNOSTICS
  65. Sets
  66. .IR errstr .