da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/***********************************************************************
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* This software is part of the ast package *
3e14f97f673e8a630f076077de35afdd43dc1587Roger A. Faulkner* Copyright (c) 1985-2010 AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* and is licensed under the *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Common Public License, Version 1.0 *
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin* by AT&T Intellectual Property *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* A copy of the License is available at *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Information and Software Systems Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* AT&T Research *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Florham Park NJ *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Glenn Fowler <gsf@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* David Korn <dgk@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin* Phong Vo <kpv@research.att.com> *
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin***********************************************************************/
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * check if package+tool is ok to run
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * a no-op here except for PARANOID packages
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * this allows PARANOID_COMPANY to post PARANOID binaries to the www
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * warn that the user should pay up if
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * (1) the tool matches PARANOID
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * (2) $_ is more than 90 days old
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * (3) running on an PARANOID_PAY machine
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * (4) (1)-(3) have not been defeated
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * hows that
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinpathcheck(const char* package, const char* tool, Pathcheck_t* pc)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin register char* s;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (strmatch(tool, PARANOID) && environ && (s = *environ) && *s++ == '_' && *s++ == '=' && !stat(s, &st))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin unsigned long n;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin unsigned long o;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (n > o && (n - o) > (unsigned long)(60 * 60 * 24 * 90) && (sp = sfopen(NiL, "/etc/hosts", "r")))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * this part is infallible
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin error(1, "licensed for external use -- %s employees should contact %s for the internal license", PARANOID_COMPANY, PARANOID_MAIL);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else if (*s != '#' && !isspace(*s) && !strneq(s, "127.", 4) && !strmatch(s, PARANOID_FREE) && o++ > 4)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return(0);