while ((t = token(tokval)) && t != MACH && t != DEFAULT) {
switch(t) {
case LOGIN:
- if (token(tokval) && *aname == 0) {
- *aname = mh_xmalloc((size_t) strlen(tokval) + 1);
- strcpy(*aname, tokval);
- }
+ if (token(tokval) && *aname == 0)
+ *aname = mh_xstrdup(tokval);
break;
case PASSWD:
- if (fstat(fileno(cfile), &stb) >= 0 &&
+ if (!credentials_no_perm_check &&
+ fstat(fileno(cfile), &stb) >= 0 &&
(stb.st_mode & 077) != 0) {
/* We make this a fatal error to force the
user to correct it. */
adios(NULL, "Remove password or correct file "
"permissions.");
}
- if (token(tokval) && *apass == 0) {
- *apass = mh_xmalloc((size_t) strlen(tokval) + 1);
- strcpy(*apass, tokval);
- }
+ if (token(tokval) && *apass == 0)
+ *apass = mh_xstrdup(tokval);
break;
case ACCOUNT:
myname = tmp;
}
- *aname = mh_xmalloc((size_t) strlen(myname) + 1);
- strcpy (*aname, myname);
+ *aname = mh_xstrdup(myname);
}
if (!*apass) {
mypass = *aname;
}
- *apass = mh_xmalloc((size_t) strlen(mypass) + 1);
- strcpy (*apass, mypass);
+ *aname = mh_xstrdup(mypass);
}
}