diff options
author | Dante Catalfamo | 2020-10-28 18:03:46 -0400 |
---|---|---|
committer | Dante Catalfamo | 2020-10-28 18:03:46 -0400 |
commit | 6ba2a727bbaaf149c628298274a24ff29ba601a5 (patch) | |
tree | b82b289efa2f365891c63c87b1bf55a88b621204 /content/posts/WIP-how-bsd-authentication-works/index.org | |
parent | f5d17175232744e6d20ee76333c4e6c2437398a4 (diff) | |
download | blog-6ba2a727bbaaf149c628298274a24ff29ba601a5.tar.gz blog-6ba2a727bbaaf149c628298274a24ff29ba601a5.tar.bz2 blog-6ba2a727bbaaf149c628298274a24ff29ba601a5.zip |
More auth_subr details
Diffstat (limited to 'content/posts/WIP-how-bsd-authentication-works/index.org')
-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 |