From d1746995e5aa1497d46ad95726918233713a7b6d Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Wed, 17 Jul 2019 21:26:52 -0400 Subject: move authentication to separate file --- Makefile | 2 +- auth.c | 11 +++++++++++ blog.c | 6 ------ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 auth.c 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 +#include +#include +#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) { -- cgit v1.2.1