summaryrefslogtreecommitdiff
path: root/auth.h
diff options
context:
space:
mode:
Diffstat (limited to 'auth.h')
-rw-r--r--auth.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/auth.h b/auth.h
new file mode 100644
index 0000000..0e5c0ea
--- /dev/null
+++ b/auth.h
@@ -0,0 +1,10 @@
+#define AUTH_SUCCESS 0
+#define AUTH_FAILED -1
+
+int check_password( char *pw, char *correct_pw ){
+ if ( pw == NULL || (uint64_t)strlen(pw) <= 0 )
+ return AUTH_FAILED;
+ if ( strcmp((const char*)pw, (const char*)correct_pw) != 0 )
+ return AUTH_FAILED;
+ return AUTH_SUCCESS;
+}