|
@@ -606,7 +606,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
if (s[0] != '#' && s[0] != ';' && s[0]) {
|
|
if (s[0] != '#' && s[0] != ';' && s[0]) {
|
|
|
code = newsplit(&s);
|
|
code = newsplit(&s);
|
|
|
rmspace(s);
|
|
rmspace(s);
|
|
|
- if (!strcmp(code, "-")) {
|
|
|
|
|
|
|
+ if (!strcmp(code, "-")) { /* ignores/bans */
|
|
|
if (!lasthand[0])
|
|
if (!lasthand[0])
|
|
|
continue; /* Skip this entry. */
|
|
continue; /* Skip this entry. */
|
|
|
if (u) { /* only break it down if there a real users */
|
|
if (u) { /* only break it down if there a real users */
|
|
@@ -661,7 +661,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- } else if (!strcmp(code, "!")) {
|
|
|
|
|
|
|
+ } else if (!strcmp(code, "!")) { /* user channel record */
|
|
|
/* ! #chan laston flags [info] */
|
|
/* ! #chan laston flags [info] */
|
|
|
char *chname = NULL, *st = NULL, *fl = NULL;
|
|
char *chname = NULL, *st = NULL, *fl = NULL;
|
|
|
|
|
|
|
@@ -691,7 +691,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- } else if (!strcmp(code, "+")) {
|
|
|
|
|
|
|
+ } else if (!strcmp(code, "+")) { /* add channel record */
|
|
|
if (s[0] && lasthand[0] == '*' && lasthand[1] == CHANS_NAME[1]) {
|
|
if (s[0] && lasthand[0] == '*' && lasthand[1] == CHANS_NAME[1]) {
|
|
|
char *options = NULL, *chan = NULL, *my_ptr = NULL;
|
|
char *options = NULL, *chan = NULL, *my_ptr = NULL;
|
|
|
char resultbuf[2048] = "";
|
|
char resultbuf[2048] = "";
|
|
@@ -715,8 +715,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
}
|
|
}
|
|
|
free(my_ptr);
|
|
free(my_ptr);
|
|
|
}
|
|
}
|
|
|
- } else if (!strncmp(code, "::", 2)) {
|
|
|
|
|
- /* channel-specific bans */
|
|
|
|
|
|
|
+ } else if (!strncmp(code, "::", 2)) { /* channel-specific bans */
|
|
|
strcpy(lasthand, &code[2]);
|
|
strcpy(lasthand, &code[2]);
|
|
|
u = NULL;
|
|
u = NULL;
|
|
|
if (!findchan_by_dname(lasthand)) {
|
|
if (!findchan_by_dname(lasthand)) {
|
|
@@ -735,8 +734,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
clear_masks(cst->bans);
|
|
clear_masks(cst->bans);
|
|
|
cst->bans = NULL;
|
|
cst->bans = NULL;
|
|
|
}
|
|
}
|
|
|
- } else if (!strncmp(code, "&&", 2)) {
|
|
|
|
|
- /* channel-specific exempts */
|
|
|
|
|
|
|
+ } else if (!strncmp(code, "&&", 2)) { /* channel-specific exempts */
|
|
|
strcpy(lasthand, &code[2]);
|
|
strcpy(lasthand, &code[2]);
|
|
|
u = NULL;
|
|
u = NULL;
|
|
|
if (!findchan_by_dname(lasthand)) {
|
|
if (!findchan_by_dname(lasthand)) {
|
|
@@ -755,8 +753,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
clear_masks(cst->exempts);
|
|
clear_masks(cst->exempts);
|
|
|
cst->exempts = NULL;
|
|
cst->exempts = NULL;
|
|
|
}
|
|
}
|
|
|
- } else if (!strncmp(code, "$$", 2)) {
|
|
|
|
|
- /* channel-specific invites */
|
|
|
|
|
|
|
+ } else if (!strncmp(code, "$$", 2)) { /* channel-specific invites */
|
|
|
strcpy(lasthand, &code[2]);
|
|
strcpy(lasthand, &code[2]);
|
|
|
u = NULL;
|
|
u = NULL;
|
|
|
if (!findchan_by_dname(lasthand)) {
|
|
if (!findchan_by_dname(lasthand)) {
|
|
@@ -775,7 +772,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
clear_masks(cst->invites);
|
|
clear_masks(cst->invites);
|
|
|
cst->invites = NULL;
|
|
cst->invites = NULL;
|
|
|
}
|
|
}
|
|
|
- } else if (!strncmp(code, "--", 2)) {
|
|
|
|
|
|
|
+ } else if (!strncmp(code, "--", 2)) { /* user USERENTRY */
|
|
|
if (u) {
|
|
if (u) {
|
|
|
/* new format storage */
|
|
/* new format storage */
|
|
|
struct user_entry *ue = NULL;
|
|
struct user_entry *ue = NULL;
|
|
@@ -832,7 +829,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
lasthand[0] = 0;
|
|
lasthand[0] = 0;
|
|
|
u = NULL;
|
|
u = NULL;
|
|
|
} else { /* its a user ! */
|
|
} else { /* its a user ! */
|
|
|
- pass = newsplit(&s);
|
|
|
|
|
|
|
+ pass = newsplit(&s); /* old style passwords */
|
|
|
attr = newsplit(&s);
|
|
attr = newsplit(&s);
|
|
|
rmspace(s);
|
|
rmspace(s);
|
|
|
if (!attr[0] || !pass[0]) {
|
|
if (!attr[0] || !pass[0]) {
|
|
@@ -862,7 +859,7 @@ int readuserfile(const char *file, struct userrec **ret)
|
|
|
|
|
|
|
|
if (strlen(code) > HANDLEN)
|
|
if (strlen(code) > HANDLEN)
|
|
|
code[HANDLEN] = 0;
|
|
code[HANDLEN] = 0;
|
|
|
- if (strlen(pass) > 20) {
|
|
|
|
|
|
|
+ if (strlen(pass) > 20) { /* old style passwords */
|
|
|
putlog(LOG_MISC, "*", "* Corrupted password reset for '%s'", code);
|
|
putlog(LOG_MISC, "*", "* Corrupted password reset for '%s'", code);
|
|
|
strcpy(pass, "-");
|
|
strcpy(pass, "-");
|
|
|
}
|
|
}
|