RemoteShell-Protector.doc INTRODUCTION As a sysop or networking-fan you are lucky if the following never happened to you: Some Cosys logs in, enters the shell to search a file and accidentially starts a GUI-driven program that's not self-detaching. POOF! Your BBS hangs! If you are at home - fine. If you aren't, your system will be down for a long time. Ever tried the same thing with X-Windows? If you start a GUI-driven program from a local shell - no problem. If you try it via a telnet link (and don't specify any "-display" parameters) it just says "Can't open display!" and exits. This is what RShell-Protector achieves on the Amiga. REQUIREMENTS RShell-Protector makes use of environment variables and therefore requires OS2.04. INSTALLATION/USAGE The "rshell-protector" executable is intended to be run as a background task in the user-startup script. The install-script included in this archive should perform all necessary changes for you. The program patches intuition.library and then hangs in the background, waiting for a Ctrl-C signal. If you ever want to remove the patches, just use "break c". No fancy (and illegal) patching routines are used so RShell-Protector will work fine with SaferPatches. To actually protect a shell, you have to set the local variable "RSHELL-PROTECTOR". E.g. in the shell-startup script use: set RSHELL-PROTECTOR 1 Programs started from this shell (and its childred which inherit local variables) will fail to open any window or screen. Using the "set" and "unset" commands you can switch between "protected" and "unprotected" while the shell is running. There might be programs which don't care if Intuition returns NULL on an OpenScreen()/OpenWindow() call. They will render into an invalid rastport and crash. The best place for such programs is your trashcan. CNET BBS INSTALLATION When running some network with remote-logins you will most likely have some kind of rlogin-startup script, which you don't have for the BBS shell in CNet. Let's change that: Load CNet's "bbstext" file into your favourite editor and move to line #632 where you will find a newshell-command and some options for the FIFO: handler. Just change the end of the line from "from S:shell-startup" to something like "from s:CNetShell-Startup" and save the file. Create a file called "CNetShell-Startup (or however you called it) in your s: directory. It sould contain at least: execute s:shell-startup set RSHELL-PROTECTOR 1 and maybe some other tools/patches that you want to use from the BBS shell only. Now select "text/menu reload" from CNet's menu and you're done. INSTALLATION ON OTHER BBS-PROGRAMS Sorry, can't tell you much about this - you have to find out yourself. Using SnoopDos will help! For DLG the installation should be similar to CNet, AFAIK the command to call when opening a shell is also configurable through a textfile. TECHNICAL INFO/COMPATIBILITY RShell-Protector patches the following intuition-functions: OpenScreen() OpenWindow() OpenScreenTagList() OpenWindowTagList() On every call to these functions it checks for the environment variable called "RSHELL-PROTECTOR". If there is no such variable the original function is called. Otherwise an error-message is printed on stdout and zero returned, which means "failure" to the calling program. As the ones with good RKM-knowledge will have noticed, this method is not 100% system friendly. If a TASK (not a PROCESS) calls one of the above functions, there will be trouble. Only processes are allowed to call dos.library, tasks aren't. But no need to ban this patch from your HD forever! We know of only ONE task that ever calls OpenWindow(), which is the Fastlane's "z3scsi.device" - and this is only to display errors on very early system startup. RShell-Protector has been tested on: A4000/040, OS3.0, 12MB RAM, Fastlane, Merlin A4000/030, OS3.0, 22MB RAM, GVP-II, Merlin, MFC-2, CNet/3 A2000, A2630, OS3.1, 7MB RAM, Mastercard, MFC-2, CNet/3 No 68030 or OS3.0+ specific features are used so it should also run on the 68000 and with OS2.04. BUGS Returncode is always 0, no matter if the patching succeeded or not. If this annoys you, fix it. COPYLEFT RShell-Protector is copylefted software. Do with it whatever you like. The sourcecode in asm is included so you can hack around with it - we used AsmOne V1.50 to write it. The only thing you must not do is redistribute hacked-up versions with our names in them - or thou shalt be marked a lamer forever! If you implement any improvements, please let us know. See below for addresses. AUTHORS If you can't find us on IRC, send comments, flames etc. to: Usenet: hg6202@sun0.mni.fh-giessen.de AmigaNet: Lunkwill@39:176/208.0 Skywalker@39:176/208.3 Call these BBSs: Sweet Dreams - +49-6404-61539 (Line 1, ZyXEL 19k2, 24h) +49-6404-65106 (Line 2, ZyXEL 16k8, 22-13h) Thunder Dome - +49-6408-3249 (Line 1, ZyXEL 19k2, 24h) +49-6408-3779 (Line 2, ZyXEL 19k2, 22-13h) HISTORY V37.1, 23-10-94, initial release FUTURE Maybe a WB emulation using RIP-term...? :^)