diff options
-rw-r--r-- | content/posts/WIP-how-bsd-authentication-works/index.org | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/content/posts/WIP-how-bsd-authentication-works/index.org b/content/posts/WIP-how-bsd-authentication-works/index.org index b2e3da1..678ef6b 100644 --- a/content/posts/WIP-how-bsd-authentication-works/index.org +++ b/content/posts/WIP-how-bsd-authentication-works/index.org @@ -2106,6 +2106,23 @@ :CUSTOM_ID: _auth_validuser :END: + @@html: <details> <summary> @@ + #+begin_src c + int _auth_validuser(const char *name) + #+end_src + @@html: </summary> @@ + #+begin_src c + { + /* User name must be specified and may not start with a '-'. */ + if (*name == '\0' || *name == '-') { + syslog(LOG_ERR, "invalid user name %s", name); + return 0; + } + return 1; + } + #+end_src + @@html: </details> @@ + * COMMENT note :noexport: |