summaryrefslogtreecommitdiffstats
path: root/content/posts/WIP-how-bsd-authentication-works
diff options
context:
space:
mode:
authorDante Catalfamo2020-10-30 00:39:35 -0400
committerDante Catalfamo2020-10-30 00:39:35 -0400
commit5bb7065c734d427cfc3f9156c930d08ddbf4b05a (patch)
tree74863dc0bc3358e12b3d53222e510127aa895914 /content/posts/WIP-how-bsd-authentication-works
parent06cff06e70fe8e99d4e92efc1312a6e943bf782c (diff)
downloadblog-5bb7065c734d427cfc3f9156c930d08ddbf4b05a.tar.gz
blog-5bb7065c734d427cfc3f9156c930d08ddbf4b05a.tar.bz2
blog-5bb7065c734d427cfc3f9156c930d08ddbf4b05a.zip
_auth_next_arg and more on auth_call
Diffstat (limited to 'content/posts/WIP-how-bsd-authentication-works')
-rw-r--r--content/posts/WIP-how-bsd-authentication-works/index.org34
1 files changed, 23 insertions, 11 deletions
diff --git a/content/posts/WIP-how-bsd-authentication-works/index.org b/content/posts/WIP-how-bsd-authentication-works/index.org
index 3e2d76f..c06596b 100644
--- a/content/posts/WIP-how-bsd-authentication-works/index.org
+++ b/content/posts/WIP-how-bsd-authentication-works/index.org
@@ -406,8 +406,6 @@
=auth_call= is responsible for setting up the environment,
calling the modules, and communicating with them.
- First, the variable arguments are placed in =as->ap0=.
-
An array of char pointers called =argv= is allocated to hold the arguments for the
auth module.
@@ -415,18 +413,19 @@
char *argv[64]; /* 64 args should be more than enough */
#+END_SRC
- - =auth_next_arg=
- #+BEGIN_SRC c
- static char * _auth_next_arg(auth_session_t *as)
- #+END_SRC
+ First, the variable arguments are placed in =as->ap0=.
- First goes through =as->ap0=, returning one argument at a time
- until it hits the =NULL= character pointer. At which point it
- calls =va_end(as->ap0)= and =explicit_bzero='s it.
+ =_auth_next_arg= is called once, with the result being set as the
+ first element in =argv=. If =as->fd= is set, add =-v= and =fd=4= to
+ =argv=.
- Moves on to do the same thing for =as->ap=.
+ Then it loops through the =optlist= and appends =-v= followed the
+ option for each of them.
- Finally when it's gone through both lists, returns =NULL=
+ After that the rest of the arguments are retrieved from
+ =_auth_next_arg= and added to the end of =argv=.
+
+ If there are any extra options left over
<<here>>
@@ -588,6 +587,19 @@
after reading both the man page and source.
---
+** _auth_next_arg
+ #+BEGIN_SRC c
+ static char * _auth_next_arg(auth_session_t *as)
+ #+END_SRC
+
+ First goes through =as->ap0=, returning one argument at a time
+ until it hits the =NULL= character pointer. At which point it
+ calls =va_end(as->ap0)= and =explicit_bzero='s it.
+
+ Moves on to do the same thing for =as->ap=.
+
+ Finally when it's gone through both lists, returns =NULL=
+
** _auth_spool
** _recv_fd