From 68fbc7c7e9a4a0b32ce2da3ac5475a5dfb5aa7d5 Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Thu, 29 Oct 2020 16:39:28 -0400 Subject: bsd-auth: work on auth_verify, auth_getitem --- content/posts/WIP-how-bsd-authentication-works/index.org | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/content/posts/WIP-how-bsd-authentication-works/index.org b/content/posts/WIP-how-bsd-authentication-works/index.org index b1343c1..ffe58cb 100644 --- a/content/posts/WIP-how-bsd-authentication-works/index.org +++ b/content/posts/WIP-how-bsd-authentication-works/index.org @@ -216,7 +216,7 @@ =next= field on the last =authdata= struct in =*as= to its location. It returns =0= on success. -** auth_setitem +** auth_setitem / auth_getitem #+begin_src c int auth_setitem(auth_session_t *as, auth_item_t item, char *value) #+end_src @@ -228,6 +228,12 @@ =AUTHV_ALL= and =*value= is =NULL=, all fields are cleared. It returns =0= on success. + #+begin_src c + char *auth_getitem(auth_session_t *as, auth_item_t item) + #+end_src + + =auth_getitem= is used to return the value of the fields listed above. + *** auth_item_t =auth_item_t= is an enum defined in =/include/bsd_auth.h=. @@ -334,7 +340,11 @@ #+END_SRC =auth_verify= creates an auth session using =auth_open= if =as= is - =NULL=. It then sets the user name and style of the session, if the + =NULL=. + + The =state= of the session is set to 0. + + It then sets the =name= and =style= of the session, if the respective arguments are non-=NULL=. It then copies its variable arguments to the auth session's =va_list ap=, which is used inside of =auth_call=. -- cgit v1.2.3