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) {