/*
- * cache.c Offers ability to cache /etc/group, /etc/passwd,
+ * cache.c Offers ability to cache /etc/group, /etc/passwd,
* /etc/shadow,
*
* All users in the passwd/shadow files are stored in a hash table.
/*
* In order to put passwd in correct structure, we have
- * to skip any struct that has a passwd already for that user
+ * to skip any struct that has a passwd already for that
+ * user
*/
cur = new;
while(new && (strcmp(new->pw_name, username)<=0)
- && (new->pw_passwd == NULL)) {
+ && (new->pw_passwd == NULL)) {
cur = new;
new = new->next;
}
new = cur;
/*
- * When we get here, we should be at the last duplicate user structure
- * in this hash bucket
+ * When we get here, we should be at the last duplicate
+ * user structure in this hash bucket
*/
/* Put passwords into struct from shadow file */
/* Hashes the username sent to it and returns index into hashtable */
static int hashUserName(const char *s) {
- unsigned long hash = 0;
+ unsigned long hash = 0;
- while (*s != '\0') {
- hash = hash * 7907 + (unsigned char)*s++;
- }
+ while (*s != '\0') {
+ hash = hash * 7907 + (unsigned char)*s++;
+ }
- return (hash % HASHTABLESIZE);
+ return (hash % HASHTABLESIZE);
}
/*
/*
* We might have a passwordless account.
*/
- if (encrypted_pass == NULL) return 0;
+ if(encrypted_pass == NULL) return 0;
if(mainconfig.do_usercollide) {
while(pwd) {
/*
- * Make sure same user still. If not, return as if wrong pass given
+ * Make sure same user still. If not, return as if
+ * wrong pass given
*/
if(strcmp(name, pwd->pw_name))
return -1;
*/
if(strcmp(encpw, encrypted_pass) == 0) {
/*
- * Add 'Class' pair here with value of full name from passwd
+ * Add 'Class' pair here with value of full
+ * name from passwd
*/
if(strlen(pwd->pw_gecos))
pairadd(reply_items, pairmake("Class", pwd->pw_gecos, T_OP_EQ));