From d71cd194393a9615674b1a7c2433cfd290f6d8f0 Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Fri, 28 May 2021 16:00:14 -0400 Subject: bsd-auth: add func def for last function mentioned so far --- .../posts/WIP-how-bsd-authentication-works/index.org | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'content/posts') 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:
@@ + #+begin_src c + int _auth_validuser(const char *name) + #+end_src + @@html: @@ + #+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:
@@ + * COMMENT note :noexport: -- cgit v1.2.3