summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-07-17 21:26:52 -0400
committerJakob Kaivo <jkk@ung.org>2019-07-17 21:26:52 -0400
commitd1746995e5aa1497d46ad95726918233713a7b6d (patch)
tree7678d2208d23cafc64827184ac03b272fef0c898
parent4de3158c80864aa130ac6f701f4c28a2aa7bbf20 (diff)
move authentication to separate file
-rw-r--r--Makefile2
-rw-r--r--auth.c11
-rw-r--r--blog.c6
3 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index d80c8f2..c9fcefa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
.POSIX:
CFLAGS=-static
-OBJECTS=blog.o post.o
+OBJECTS=blog.o post.o auth.o
all: blog
diff --git a/auth.c b/auth.c
new file mode 100644
index 0000000..fb6db13
--- /dev/null
+++ b/auth.c
@@ -0,0 +1,11 @@
+#define _XOPEN_SOURCE 700
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "blog.h"
+
+int verify_creds(const char *username, const char *password)
+{
+ printf("verifying '%s'/'%s'\n", username ? username : "", password ? password : "");
+ return 1;
+}
diff --git a/blog.c b/blog.c
index 4c7f3db..b0c6cc2 100644
--- a/blog.c
+++ b/blog.c
@@ -6,12 +6,6 @@
extern char **environ;
-int verify_creds(const char *username, const char *password)
-{
- printf("verifying '%s'/'%s'\n", username ? username : "", password ? password : "");
- return 1;
-}
-
int handle_post(void)
{