Merge branch 'master' into develop

Conflicts:
	src/modules/autoseed.c
This commit is contained in:
Enno Rehling 2017-08-09 19:42:24 +02:00
commit c984e876af
1 changed files with 17 additions and 14 deletions

View File

@ -163,28 +163,31 @@ newfaction *read_newfactions(const char *filename)
if (email[0] == '#') { if (email[0] == '#') {
continue; continue;
} }
if (email[0] == '\0') if (email[0] == '\0') {
break;
if (email[0] == '#')
break; break;
}
if (password[0] == '\0') { if (password[0] == '\0') {
size_t sz; size_t sz;
sz = strlcpy(password, itoa36(rng_int()), sizeof(password)); sz = strlcpy(password, itoa36(rng_int()), sizeof(password));
sz += strlcat(password, itoa36(rng_int()), sizeof(password)); sz += strlcat(password, itoa36(rng_int()), sizeof(password));
} }
for (f = factions; f; f = f->next) { for (f = factions; f; f = f->next) {
if (strcmp(f->email, email) == 0 && f->subscription if (strcmp(f->email, email) == 0 && f->age < MINAGE_MULTI) {
&& f->age < MINAGE_MULTI) log_warning("email %s already in use by %s", email, factionname(f));
break; break;
} }
}
if (f && f->units) if (f && f->units)
continue; /* skip the ones we've already got */ continue; /* skip the ones we've already got */
for (nf = newfactions; nf; nf = nf->next) { for (nf = newfactions; nf; nf = nf->next) {
if (strcmp(nf->email, email) == 0) if (strcmp(nf->email, email) == 0) {
log_warning("duplicate new faction %s", email);
break; break;
} }
if (nf) }
if (nf) {
continue; continue;
}
nf = calloc(sizeof(newfaction), 1); nf = calloc(sizeof(newfaction), 1);
if (set_email(&nf->email, email) != 0) { if (set_email(&nf->email, email) != 0) {
log_error("Invalid email address for subscription %s: %s\n", itoa36(subscription), email); log_error("Invalid email address for subscription %s: %s\n", itoa36(subscription), email);