diff options
Diffstat (limited to 'content/posts/WIP-how-bsd-authentication-works')
-rw-r--r-- | content/posts/WIP-how-bsd-authentication-works/index.org | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/content/posts/WIP-how-bsd-authentication-works/index.org b/content/posts/WIP-how-bsd-authentication-works/index.org index fdf2e99..15497f1 100644 --- a/content/posts/WIP-how-bsd-authentication-works/index.org +++ b/content/posts/WIP-how-bsd-authentication-works/index.org @@ -204,15 +204,42 @@ =auth_setdata= allocates and initializes a new =authdata= struct, storing a copy of the data from =*ptr= and =len=. It then point the =next= field on the last =authdata= struct in =*as= to its - location. + location. It returns =0= on success. ** auth_setitem #+begin_src c int auth_setitem(auth_session_t *as, auth_item_t item, char *value) #+end_src + =auth_setitem= is used to set =challenge=, =class=, =name=, + =service=, =style=, and =interactive= of =*as=. If =*value= is + =NULL=, it clears that item. If =item= is =AUTHV_ALL= and =*value= + is =NULL=, all fields are cleared. It returns =0= on success. + +*** auth_item_t + =auth_item_t= is an enum defined in =/include/bsd_auth.h=. + + #+begin_src c + typedef enum { + AUTHV_ALL, + AUTHV_CHALLENGE, + AUTHV_CLASS, + AUTHV_NAME, + AUTHV_SERVICE, + AUTHV_STYLE, + AUTHV_INTERACTIVE + } auth_item_t; + #+end_src + ** auth_setoption + #+begin_src c + int auth_setoption(auth_session_t *as, char *n, char *v) + #+end_src + =auth_setoption= initializes a new =authopts= struct, and sets the + =*opt= field to a string formatted as =sprintf(%s=%s, n, v)=. It + then point the =next= field on the last =authopts= struct in =*as= + to its location. It returns =0= on success. ** auth_setstate * auth_open |