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 * G. S. Fowler
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * D. G. Korn
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * AT&T Bell Laboratories
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * shell library support
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * return pointer to the full path name of the shell
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * SHELL is read from the environment and must start with /
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * if set-uid or set-gid then the executable and its containing
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * directory must not be owned by the real user/group
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * root/administrator has its own test
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * astconf("SH",NiL,NiL) is returned by default
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * NOTE: csh is rejected because the bsh/csh differentiation is
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * not done for `csh script arg ...'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((sh = getenv("SHELL")) && *sh == '/' && strmatch(sh, "*/(sh|*[!cC]sh)*([[:digit:]])?(-+([.[:alnum:]]))?(.exe)"))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if (ru != st.st_uid && !strmatch(sh, "?(/usr)?(/local)/?([ls])bin/?([[:lower:]])sh?(.exe)"))