From 1576df8aa182a2536d21a186edc401847ae43250 Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Sat, 31 Oct 2020 14:01:46 -0400 Subject: Add auth_setenv --- .../WIP-how-bsd-authentication-works/index.org | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'content/posts/WIP-how-bsd-authentication-works/index.org') diff --git a/content/posts/WIP-how-bsd-authentication-works/index.org b/content/posts/WIP-how-bsd-authentication-works/index.org index 1a92943..f24693d 100644 --- a/content/posts/WIP-how-bsd-authentication-works/index.org +++ b/content/posts/WIP-how-bsd-authentication-works/index.org @@ -295,6 +295,14 @@ =auth_clrenv= removes all lines containing =BI_SETENV= and =BI_UNSETENV= from =as->spool=. This is explained under the =auth_call= section. + +** auth_setenv + #+begin_src c + void auth_setenv(auth_session_t *as) + #+end_src + + =auth_setenv= scans through =as->spool=, modifying the environment + according to =BI_SETENV= and =BI_UNSETENV= instructions. * auth_open #+begin_src c @@ -717,8 +725,17 @@ =as->rmlist= linked list. * auth_close - =auth_close= is the function responsible for cleaning up the session - and taking care of the values returned though the back channel. + #+begin_src c + int auth_close(auth_session_t *as) + #+end_src + + =auth_close= is responsible for setting the environment variables, + removing any files requested by the authentication module, and + freeing =as=. + + First it saves the state in a variable =s= + +<> It first sets the environment variables returned through the back channel by passing the auth session to =auth_setenv=. It then goes -- cgit v1.2.3