[petsc-dev] Checking hostnames
Barry Smith
bsmith at mcs.anl.gov
Thu Jun 6 14:56:22 CDT 2013
It definitely was put in originally to solve a particular problem. I only remember vaguely that some sites/systems would intentionally? put invalid values in and this was a crude way to detect those and not use them.
I am fine with the code being taken out (we can always put something back if problems develop).
Barry
On Jun 6, 2013, at 1:46 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> Barry, you added this logic in 2002. Is it solving a particular
> problem? This is by no means a complete list of valid TLDs, and local
> networks could use arbitrary hostnames. Delete it?
>
>
> /* check if domain name is not a dnsdomainname and nuke it */
> ierr = PetscStrlen(name,&ll);CHKERRQ(ierr);
> if (ll > 4) {
> const char *suffixes[] = {".edu",".com",".net",".org",".mil",0};
> PetscInt index;
> ierr = PetscStrendswithwhich(name,suffixes,&index);CHKERRQ(ierr);
> if (!suffixes[index]) {
> ierr = PetscInfo1(0,"Rejecting domainname, likely is NIS %s\n",name);CHKERRQ(ierr);
> name[l-1] = 0;
> }
> }
More information about the petsc-dev
mailing list