Lines Matching refs:userdb
22 p_pwdentry userdb[MAX_USERS]; // Array of pointers
32 if (userdb[i] == NULL)
34 if (strcmp(username, userdb[i]->username) == 0) {
35 strcpy(salt, userdb[i]->pwdhash);
37 if (strcmp(userdb[i]->pwdhash, crypt(pwd, salt)) == 0)
63 if (strcmp(userdb[i]->username, username) == 0) // Found the user
65 if (userdb[i]->perms == NULL)
67 tmp = strstr(userdb[i]->perms, dperm); // Search for permission
88 userdb[i] = NULL;
133 userdb[numusers] = (p_pwdentry) malloc(sizeof(pwdentry));
134 strcpy(userdb[numusers]->username, user);
135 strcpy(userdb[numusers]->pwdhash, pwdhash);
137 userdb[numusers]->perms = NULL;
139 userdb[numusers]->perms = (char *)malloc(strlen(perms) + 3);
140 (userdb[numusers]->perms)[0] = ':';
141 strcpy(userdb[numusers]->perms + 1, perms);
142 (userdb[numusers]->perms)[strlen(perms) + 1] = ':';
143 (userdb[numusers]->perms)[strlen(perms) + 2] = 0;
156 if (userdb[i] != NULL)
157 free(userdb[i]);