/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* check if package+tool is ok to run
* a no-op here except for PARANOID packages
* this allows PARANOID_COMPANY to post PARANOID binaries to the www
*
* warn that the user should pay up if
*
* (1) the tool matches PARANOID
* (2) $_ is more than 90 days old
* (3) running on an PARANOID_PAY machine
* (4) (1)-(3) have not been defeated
*
* hows that
*/
#include <ast.h>
#include <ls.h>
#include <error.h>
#include <times.h>
#include <ctype.h>
int
{
#ifdef PARANOID
register char* s;
if (strmatch(tool, PARANOID) && environ && (s = *environ) && *s++ == '_' && *s++ == '=' && !stat(s, &st))
{
unsigned long n;
unsigned long o;
{
/*
* this part is infallible
*/
n = 0;
o = 0;
if (strmatch(s, PARANOID_PAY))
{
error(1, "licensed for external use -- %s employees should contact %s for the internal license", PARANOID_COMPANY, PARANOID_MAIL);
break;
}
else if (*s != '#' && !isspace(*s) && !strneq(s, "127.", 4) && !strmatch(s, PARANOID_FREE) && o++ > 4)
break;
}
}
#else
#endif
return(0);
}