--- /dev/null
+// makeuserkey() - convert a username into the format used as a database key
+//
+// Copyright (c) 1987-2023 by the citadel.org team
+//
+// This program is open source software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License, version 3.
+
+#include <stdlib.h>
+#include <unistd.h>
+#include "sysdep.h"
+#include <stdio.h>
+#include <sys/stat.h>
+#include <libcitadel.h>
+#include "config.h"
+#include "user_ops.h"
+
+
+// makeuserkey() - convert a username into the format used as a database key
+// "key" must be a buffer of at least USERNAME_SIZE
+// (Key format is the username with all non-alphanumeric characters removed, and converted to lower case.)
+void makeuserkey(char *key, const char *username) {
+ int i;
+ int keylen = 0;
+
+ if (IsEmptyStr(username)) {
+ key[0] = 0;
+ return;
+ }
+
+ int len = strlen(username);
+ for (i=0; ((i<=len) && (i<USERNAME_SIZE-1)); ++i) {
+ if (isalnum((username[i]))) {
+ key[keylen++] = tolower(username[i]);
+ }
+ }
+ key[keylen++] = 0;
+}
+
+
int chkpwd_read_pipe[2];
-// makeuserkey() - convert a username into the format used as a database key
-// "key" must be a buffer of at least USERNAME_SIZE
-// (Key format is the username with all non-alphanumeric characters removed, and converted to lower case.)
-void makeuserkey(char *key, const char *username) {
- int i;
- int keylen = 0;
-
- if (IsEmptyStr(username)) {
- key[0] = 0;
- return;
- }
-
- int len = strlen(username);
- for (i=0; ((i<=len) && (i<USERNAME_SIZE-1)); ++i) {
- if (isalnum((username[i]))) {
- key[keylen++] = tolower(username[i]);
- }
- }
- key[keylen++] = 0;
-}
-
-
// Compare two usernames to see if they are the same user after being keyed for the database
// Usage is identical to strcmp()
int CtdlUserCmp(char *s1, char *s2) {