/********************************************************************
* wilkinson
* 3.18VMS
* 1995/09/25 14:40
* gopher_root1:[gopher.g2.vms2_13.gopherd]special.c,v
* Exp
*
* Paul Lindner, University of Minnesota CIS.
*
* Copyright 1991, 1992 by the Regents of the University of Minnesota
* see the file "Copyright" in the distribution for conditions of use.
*********************************************************************
* MODULE: special.c
* routines to deal with special types of files, compressed, scripts, etc.
*********************************************************************
* Revision History:
* special.c,v
* Revision 3.18VMS 1995/09/25 14:40 wilkinson
* Consolodate VMS/Unix source code for server as well as client
*
* Revision 3.18 1994/07/21 04:08:29 lindner
* Bulletproofing for shell scripts
*
* Revision 3.17 1994/04/25 20:49:11 lindner
* Fix for debug code
*
* Revision 3.16 1994/04/14 15:48:54 lindner
* Fix for files with single quotes
*
* Revision 3.15 1993/11/03 03:32:52 lindner
* Test shell scripts for exec bit
*
* Revision 3.14 1993/08/19 20:52:30 lindner
* Mitra comments
*
* Revision 3.13 1993/08/11 22:47:11 lindner
* Don't let the security stuff trap ask blocks
*
* Revision 3.12 1993/08/06 14:30:49 lindner
* Fixes for better security logging
*
* Revision 3.11 1993/08/04 22:14:54 lindner
* Mods to use Gpopen
*
* Revision 3.10 1993/08/04 22:12:51 lindner
* Mods to use Gpopen
*
* Revision 3.9 1993/07/27 05:27:59 lindner
* Mondo Debug overhaul from Mitra
*
* Revision 3.8 1993/07/25 02:56:51 lindner
* Fixed iscompressed() to return NULL
*
* Revision 3.7 1993/07/23 03:18:13 lindner
* Mods for using decoder:'s
*
* Revision 3.6 1993/07/07 19:35:36 lindner
* removed extra args to popen()
*
* Revision 3.5 1993/06/22 06:58:53 lindner
* Added a little debug code..
*
* Revision 3.4 1993/06/11 16:46:50 lindner
* Support for gzipped files
*
* Revision 3.3 1993/04/09 15:00:19 lindner
* Fixes for ask shell scripts, ensure that they're run in the current
* directory of the script.
*
* Revision 3.2 1993/03/24 20:24:23 lindner
* Addition for compressed file support rfopenz()
*
* Revision 3.1.1.1 1993/02/11 18:02:53 lindner
* Gopher+1.2beta release
*
* Revision 1.3 1993/02/09 22:15:36 lindner
* additions for askfile
*
* Revision 1.2 1993/01/30 23:57:44 lindner
* Additions for ASK block support.
*
* Revision 1.1 1992/12/10 23:13:27 lindner
* gopher 1.1 release
*
*
*********************************************************************/
#ifdef VMS_SERVER
#define GSGOPHEROBJ_C
/* Right now, DEC C v5.0 seems to ignore the angle brackets and
pull in [-.object]string.h instead of the system
version of string.h, which we need here. But all we
need it for is a prototype of strchr(), so we'll put
that in by hand to get around this for now */
#include <string.h> /* */
/* char *strchr (const char *__s, int __c); /* */
#endif
/* Check to see if this file needs special treatment before heading
* back to the client... We will check for:
* Encoded files execute decoder...
* Shellscript if so, "do it"
* (add ask block params if exists..)
* Note: it would be somewhat non-portable to check of a binary
* (we'd need to check for so many different magic numbers; the
* shell script designation should be sufficient, since the script
* can call an executable anyway
* Recognized elsewhere:
* .snd needs special processing on client
* uuencoded needs special processing on client
* Other filetypes we could check for:
* GIF -> Bring up GIF previewer
* Postscript -> Bring up Postscript previewer
*/
int
Specialclose(fp)
FILE *fp;
{
if (ASKfile != NULL) /* Ick this is a global*/
unlink(ASKfile);
if (ispipe)
return(pclose(fp));
else
return(fclose(fp));
}