|
|
@@ -576,17 +576,18 @@ static bool pass_set(struct userrec *u, struct user_entry *e, void *buf)
|
|
|
else {
|
|
|
unsigned char *p = (unsigned char *) pass;
|
|
|
|
|
|
- if (strlen(pass) > MAXPASSLEN)
|
|
|
- pass[MAXPASSLEN] = 0;
|
|
|
- while (*p) {
|
|
|
- if ((*p <= 32) || (*p == 127))
|
|
|
- *p = '?';
|
|
|
- p++;
|
|
|
- }
|
|
|
if (u->bot || (pass[0] == '+'))
|
|
|
newpass = strdup(pass);
|
|
|
- else
|
|
|
+ else {
|
|
|
+ if (strlen(pass) > MAXPASSLEN)
|
|
|
+ pass[MAXPASSLEN] = 0;
|
|
|
+ while (*p) {
|
|
|
+ if ((*p <= 32) || (*p == 127))
|
|
|
+ *p = '?';
|
|
|
+ p++;
|
|
|
+ }
|
|
|
newpass = salted_sha1(pass);
|
|
|
+ }
|
|
|
e->u.extra = strdup(newpass);
|
|
|
}
|
|
|
if (!noshare)
|