Fly Home

Server Licensed SwiftView®
Technical Reference Manual
Version 3.01
UNIX and NT Server


Table of Contents

CHAPTER 1 INTRODUCTION
CHAPTER 2 UNIX SERVER SETUP AND OPERATION
CHAPTER 3 WINDOWS NT SERVER SETUP AND OPERATION
CHAPTER 4 CLIENT SETUP
CHAPTER 5 USING SERVER LICENSED SWIFTVIEW WITH SWIFTSERVE
CHAPTER 6 OPERATION WITH WWW TOOLS
APPENDIX A UNIX SERVER SETUP DETAILS

The information in this document is subject to change without notice.

Copyright 1990-2003 SwiftView, Inc. All rights reserved.

SwiftView®, SwiftServe, SwiftScan, SwiftCam and SwiftWare are trademarks of SwiftView, Inc.

DISCLAIMER

SwiftView scales images and other information files to arbitrary, user defined window sizes. This scaling process inherently modifies the original information in manners that may not be acceptable for critical applications such as the display of medical diagnostic photos. The purchaser / integrator (not SwiftView, Inc.) is solely responsible for determining whether SwiftView is acceptable for any given purpose.


CHAPTER 1 INTRODUCTION

Server licensed SwiftView® Ver 3+ and SwiftServe Ver 3+ work in a cooperative, client/server manner to provide the core of a high performance TCP/IP based document access and distribution system. Actual document control - which documents to view - is left under complete control of customer information systems or WWW tools. Numerous features enable interactive, high performance document viewing and printing on LAN and WAN intranets as well as the Internet itself.

First download server licensed SwiftView® from SwiftView, Inc.'s web site (http://www.swiftview.com) and install it on any number of user Windows and UNIX client systems. Then download SwiftServe with a one concurrent user license from our web site install it on your UNIX or NT server for a full "pre-buy" trial. Once you try it, simply call, fax or e-mail SwiftView, Inc., purchase a password for a specific number of concurrent server licenses on a specific server system and use it. There is no need to download or install more software. This architecture has many advantages:

In order to properly manage concurrent licenses, SwiftView® Ver 3+ and SwiftServe Ver 3+ must be used together. Neither work with earlier versions of the other.

This manual describes how to install and operate SwiftView® and SwiftServe and describes the file naming conventions that allow SwiftView® access to the server. It is intended for system managers, system integrators and developers.

The SwiftView® Technical Reference Manual should be consulted for all details of SwiftView® operation and setup not related to server licensed SwiftView® client/server setup and operation.


CHAPTER 2 UNIX SERVER SETUP AND OPERATION

This section gives all information normally needed to obtain, install and use the UNIX server. Appendix A contains additional UNIX details. See Chapter 3 for Windows NT server information.

How to get UNIX SwiftServe evaluation copy

SwiftView, Inc. software is normally downloaded via our web site: http://www.swiftview.com/product/current/srv_*.tar.Z

where * must be one be one of the following:

solar         Sparc Solaris 2.3+ systems
hpux         HP-UX 8/10+ systems
r6k           RS/6000 AIX 5.2+
linux         Linux Intel systems
sun           Sparc SunOS 4.1.2+ systems
sco3         SCO ODT3 systems

This version of SwiftServe comes with a limited use password (1 concurrent user, installed on any node). Contact SwiftView, Inc. at tech@swiftview.com for evaluation copies which support more users.

Extracting files

Move the downloaded file to an empty directory and type (using a Solaris example):

uncompress srv_solar.tar
tar xvf srv_solar.tar

This creates all necessary directories and files.

Overview of SwiftServe Operation

SwiftServe consists of two UNIX programs: "svsrvd" (the daemon) and "sviserv3" (the server) which must be located in the same directory. The UNIX daemon svsrvd listens on a TCP "well known port" (6100 by default) for a connect request from SwiftView®, using no significant system CPU resources. When svsrvd receives a connect from SwiftView®, it spawns a copy of sviserv3 which takes over the client/server link. sviserv3 frees the TCP port and returns to listening for a connect request. Each copy of SwiftView® is connected to its own copy of the server program. sviserv3 is also a small program, so few server system CPU or memory resources are used.

Daemon command line

SwiftView Image Server Daemon
Version 3.0
Copyright (c) 1989-2003 SwiftView, Inc
All Rights Reserved
Tel: (503)885-9392, Fax: (503)885-9352
usage: svsrvd -llicense[-dv][-pPORT_NUMBER][-u[logfile]][-gpar1...
-gpar15]
Where:
-llicense = license string (required)
-d = Debug flag, tells the daemon not to detach from terminal
process
-p = Well known port to listen on ex: -p6000, default 6100
-v = Verify licensing and exit
-u[logfile] = log clients/errors to logfile (default stderr, no
cli log)
-g = Generic parameters passed (without the -g) to svisrv3
-h = This help message.
Note: only runs sviserv3

The "-d" debug case is intended only for verifying proper operation. It should not be used under normal circumstances, because it prevents server and daemon processes from dying as they should.

Server command line

SwiftView Image ServerVersion 3.0
   Copyright (c) 1989-2003 SwiftView, Inc
All Rights Reserved
Tel: (503)885-9392, Fax: (503)885-9352
usage: sviserv3 -drDir [-srDir] [-srwy|n] [-tmin] [-dname] [-h]
where:
-drDir file access restricted to files under directory Dir
(required opt)
-srDir system commands restricted to programs under
directory Dir
-sy|n system commands, y = allowed, n = not allowed,
default -sn
-ry|n remove file, y = allowed, n = not allowed, default -rn
-wy|n file writes, y = allowed, n = not allowed, default -wn
-c Use chroot/chdir() for -drDir (no access outside Dir)
-tmin A time in minutes. If this period passes without
activity, the server will automatically terminate.
Default: time out in 1440 minutes (24 hours).

-dname The name of a debug file, -d with no name will send
messages to the screen. Default: no debug messages.
-uuser Change user/group id to that of user
-ggroup Change group id to that of group
-h This usage message
Example:  Files read-only from /usr/docs, terminate in 30 minutes,
system calls and file removal disallowed:

sviserv3 -dr/usr/docs -t30

Please note that the "-dr..." option is required and there is no default. This limits file access to the defined tree and makes all remote access relative to that tree in the same manner as WWW servers. No client programs will ever use this path in their URL's or know its value.

If termination on time-out occurs, SwiftView will automatically reconnect to the server as required. Time-out should not be set to small values like 1 minute. Rather it should be set to a value like 1 hour to clean up after users who turn PC's off without shutting down programs.

UNIX process privileges

There are two correct ways to start the daemon process:

The server process inherits the privileges of the daemon process. Do not start the daemon as root unless you use the "change user/group" options.

If security is a concern SwiftView, Inc. recommends using the "-c" (chroot) option.

Security disclaimer

SwiftServe has most security features common to WWW servers but SwiftView, Inc. makes no claims that it is impervious to sophisticated TCP/IP based attacks. Your primary security is in limiting server process privileges and SwiftView, Inc. strongly recommends that these be as narrow as possible, including using the "-c" option.

SwiftView, Inc. also recommends limiting access to the server itself by placing your intranet behind a firewall. If the purpose of the server is to provide documents to the Internet, you should place only those "public" documents and files on your server system.

Installation - starting the daemon

Assuming the programs are installed in /usr/ndg/bin and you are logged in as the user which owns the document tree /u/tiff/*, do the following:

/usr/ndg/bin/svsrvd -l0001xcz5fd1rcmk -g-dr/u/tiff -g-t100

Please note that there are no spaces in the parameters.

The password shown above is the actual password enabling one concurrent user on any system (i.e. not node locked). Use this password for all testing.

This starts the daemon listening on TCP port 6100, with file access limited to the /u/tiff/* tree and a server "no activity time-out" of 100 minutes. Ports in this range are rarely used by other services, so a conflict is unlikely. Ports below 1024 can be used only by root to prevent underprivileged programs from pretending to offer standard system services. Port 6100 is significant only in that it is assumed by SwiftView and other SwiftView, Inc. programs if no port number is specified in the URL of the document to be viewed. You can take advantage of the enhanced security provided by low ports using the sviserve -u and -g options, but all clients must then include the port number in their URL's. The daemon automatically detaches as a separate process (no '&' character required).

You can see the daemon executing using the "ps" command. For example, "ps -ef" on Solaris 2.x might give: you 26561 1 0 Jun 25 ? 0:01 /usr/ndg/bin/svsrvd -l0001xcz5fd1rcmk -g-dr/u/tiff -g-t100

Terminate the daemon process above by using "kill 26561" where 26561 is the process ID from the ps command. Killing and restarting this daemon has no effect on existing server processes.

The daemon startup command can be placed in the server system's startup files in the same manner as telnetd.

Server connection logging

If the "-u" option is used with svsrvd, daemon startup and connection rejections are logged as well as successful connections. If a logfile name is given, the messages are sent to the logfile identified by full path starting with '/' and filename. If a logfile is not given, messages go to stderr. In either case messages are also sent to syslog(), startup and rejection at the "notice" level, and successful connection at the "info" level.

This feature is valuable for maintaining system security. The SwiftServe distribution contains a sample /etc/init.d file for UNIX SVR3 system that maintains log files created with this option.

How to upgrade your UNIX SwiftServe evaluation copy to full function

Once you have tried out SwiftView® + SwiftServe, you may purchase a password that upgrades the evaluation copy to any number of users. No additional software downloads are required. Just give SwiftView, Inc. a purchase order or VISA/MC number for the number of concurrent users you want to support plus the server information defined below and we fax or e-mail a password. Please note that "one concurrent user" evaluation software is not free. That is, production use must be licensed, even for one concurrent user. Please contact SwiftView, Inc.

Your production password is "node locked" to a given server system, so you must supply SwiftView, Inc. the hostname and domainname OR the IP address of the server on which it will be installed. This is your choice but often it is best to use names so that IP addresses can be assigned at will. Find this information using SwiftServe by typing "svsrvd -lx".

SwiftServe checks this information when it runs and uses the first of these it finds:

  1. The hostname if it includes a '.' character. Type "hostname" on most systems.
  2. <hostname>.<DNS domainname> if <DNS domainname> exists and contains a '.' character. <DNS domain name> is obtained from the C-language DNS resolver library (res_init(), _res.defdname[0]), and can be obtained by typing: nslookup set all ^d
    which prints: Default Server: .... ... domain=<DNS domain name> ...
    We require a '.' in the domain name because some unconfigured domain services return "com", which is invalid.
  3. <hostname>.`domainname`, if `domainname` is non-null (when typed).
  4. The first IP address returned by gethostbyname() for the hostname other than the local loopback address 127.0.0.1.

The addition of DNS support was the primary change form Ver 3.0 to Ver 3.01.


CHAPTER 3 WINDOWS NT SERVER SETUP AND OPERATION

This section gives all information normally needed to obtain, install and use the NT server. This server supports Microsoft Windows NT Ver 4.0 (workstation or server) only. Contact SwiftView, Inc. if you require NT Ver 3.51 support.

Please note that SwiftView, Inc. has not limited the number of sockets used by the server. The customer is responsible for using the server in a manner consistent with their current Microsoft Windows NT Workstation license.

How to get Windows NT SwiftServe evaluation copy

SwiftView, Inc. software is normally downloaded via our web site: http://www.swiftview.com/product/current/srv_nt4.exe

This version of SwiftServe comes with a limited use password (1 concurrent user, installed on any node). Contact SwiftView, Inc. for evaluation copies which support more users. Please note that this is not the same one concurrent user password used for UNIX.

Extracting files

Move the downloaded file to an empty directory and type:

srv_nt4 -d

This creates all necessary directories and files.

Overview of NT SwiftServe Operation

SwiftServe for NT consists of 2 programs: SVTISERV.EXE is the actual server and PWSERV.EXE is the password server. These must both be installed the same directory but, PWSERV is otherwise invisible and requires no setup. PWSERV is automatically started by the first instance of SVTISERV.

SwiftServe for NT is multithreaded, serving up to 63 (NT limit) SwiftView® or other SwiftView, Inc. clients from a single NT process. If more are required, additional SVTISERV processes are spawned up to the maximum licensed limit provided by PWSERV. This approach makes the server very fast to start up, providing excellent performance. A single Pentium NT system can be expected to easily service much more than 100 concurrent users.

Command line

Must invoke with absolute path to svtiserv!
-drDir option required!
-llicense option required!
SwiftView Image Server
Version 3.01

Copyright (c) 1989-2003 SwiftView, Inc
All Rights Reserved
Tel: (503)885-9392, Fax: (503)885-9352
usage: c:\path\svtiserv -llicense 
[-o[lservhost][:port]] [-vch]
[-pport] [-a[logfile]] -drDir [-srDir]
[-sy|n] [-ry|n] [-wy|n] [-tmin] [-dname]
Required options:
-llicense license string
-drDir file access restricted to files under directory Dir
Optional options:
-o[host][:p] license server host and port, default local host, 6101
-v Verify licensing and installation and exit
-pport Well known port to listen on, e.g. -p901, default 6100
-a[logfile] log clients/errors to audit logfile (default stderr,
no log)
-srDir system commands restricted to programs under directory
Dir
-sy|n system commands, y = allowed, n = not allowed,
default -sn
-ry|n remove file, y = allowed, n = not allowed, default -rn
-wy|n file writes, y = allowed, n = not allowed, default -wn
-tmin A time in minutes. If this period passes without
activity, the server will automatically terminate.
Default: time out in 1440 minutes (24 hours).
-dname The name of a debug file, -d with no name will send
messages to the screen/system log. Default: no debug
messages.
-i Install as a boot-time NT service
(don't run, but record all parameters in the registry).
-e Eliminate (deinstall) as an NT service (don't run).
-h This usage message

Example: Files read-only from \usr\docs, terminate in 30 minutes, system calls and file removal disallowed:

c:\msdev\projects\tiserv\debug\svtiserv -drc:\ -t30

Installation

SwiftServe 3+ is designed to run as an NT service, automatically started at boot time and managed with the Service Manager ("Control Panel" "Services"). SwiftServe can also be started "by hand" from a command prompt window, as "<drive>:<path>\svtiserv". Note that it must be started using the full path to the executable file.

SwiftServe is installed as an NT service by executing it from a command window with the desired options, plus "-i". This registers it with the Service Manager and installs the necessary entries mainly the command options) in the registry. Once installed, "SwiftServe" appears in the Service Manager screen and will start automatically at boot time.

Assuming the programs are installed in C:\NDG and you are logged in as the user which owns the document tree D:\DOCROOT\*, do the following in a command line window:

C:\NDG\SVTISERV -l0001hpododfingo -drD:\DOCROOT -i

Please note that there are no spaces in the parameters. The password shown is the actual password enabling one concurrent user on any system (i.e. not node locked). Use this password for all testing.

This example starts the server listening on TCP port 6100, with file access limited to the D:\TIFF\* tree, installed as a system service. Ports in this range are rarely used by other services, so a conflict is unlikely. Port 6100 is significant only in that it is assumed by SwiftView and other SwiftView, Inc. programs if no port number is specified in the URL of the document to be viewed.

You should now see "SwiftServe" running in the "Control Panel" "Services" list. Once SwiftServe has been "installed" using "-i", use this menu to start and stop it at all times.

The SwiftServe options are stored as values in the registry under:

SYSTEM\CurrentControlSet\Services\SwiftServe\Parameters

and can be changed using the registry editor (REGEDT32.EXE).

Server connection logging

SwiftServe for NT sends all error messages and requested connection log and debug messages to the NT Application Event log, following the usual NT conventions. Debug messages are sent at the Information level, and connection log messages at Success or Failure Audit. "Start" "Administrative Tools (Common)" "Event Viewer" to see the "SwiftServe" messages.

Deinstall

SwiftServe is deinstalled as an NT service by executing it from a command window with the single option "-e". All registry values are deleted but program files are not. However, all program files exist in a single directory as described above, so deleting that directory finishes the deinstall.

Security

It is the system administrator's responsibility to consider what access rights SwiftServe should have, and run SwiftServe under an appropriately configured account. By default, SwiftServe, like most NT services, runs under the LocalSystem account. This account has some access restrictions, and does not allow logins. For example, SwiftServe cannot access remote shared file systems when running under LocalSystem.

The Service Manager screen "Startup" menu can be used to reconfigure the service to run under a different account. See "Known Bugs" below for more considerations.

Known Problems

IMPORTANT: If SVTISERV has already been installed as an NT service ("-i" command line option) and is executed from the command line with no options, it will start up the SwiftServe NT service, which then cannot be stopped or restarted from the Service Manager screen. A reboot is necessary to clear this condition. (Surprisingly, running the service under a login-capable account does not allow you to kill it, though it does allow you to kill the pwserv process it starts.). Use the "Control Panel" "Services" to start and stop it as discussed above.

When you stop the SwiftServe service from "Services", the service manager reports an error "Could not stop... Error 0109: The pipe has been ended." This does not cause any functional problems and can be safely ignored.

The service manager screen does not recover from service time-outs or failures on startup: the buttons are all grayed out. Closing and reopening the screen usually clears the problem.

If SwiftServe dies for some reason, it's listening port may become unusable until after internal NT time-outs. A new service can be started on that port in about 15 minutes.

If SwiftServe is licensed for more than 63 simultaneous clients and this limit is reached, a new SwiftServe process is spawned that cannot be stopped or killed without rebooting the server host or logging in as the account under which SwiftServe is running. However, logging in to kill it is impossible if SwiftServe is running under the "LocalSystem" account. Generally, therefore, a SwiftServe licensed for 64 or more clients must be run under a login-capable user account. This is preferable for security reasons because it limits access to the document directory tree.

Processes can be killed by the process owner using the Task Manager. Press control-alt-delete to access the Task Manager, select "svtiserv.exe", and click the "End Process" button.

Security disclaimer

SwiftServe has most security features common to WWW servers but SwiftView, Inc. makes no claims that it is impervious to sophisticated TCP/IP based attacks. Your primary security is in limiting server process privileges and SwiftView, Inc. strongly recommends that these be as narrow as possible.

SwiftView, Inc. also recommends limiting access to the server itself by placing your intranet behind a firewall. If the purpose of the server is to provide documents to the Internet, you should place only those "public" documents and files on your server system.


CHAPTER 4 CLIENT SETUP

How to get server licensed SwiftView®

SwiftView software is normally downloaded via our web site: Please contact licensing@swiftview.com for current link to software.


UNIX clients are in http://www.swiftview.com/product/current/sv_*.tar.Z:

where * can be any of the following:


dec DEC Alpha Unix
hpux HP-UX 8/10 systems
linux HP-Linux systems
r6k RS/6000 AIX 5.2+
sgi SGI IRIX 6.2+
solar Sparc Solaris 2.5+ systems
sunos Sparc SunOS 4.1.2+ systems

Other systems are supported. Just send email to tech@swiftview.com.

Overview of server licensed SwiftView® Operation

The server licensed SwiftView® can be placed on any number of supported UNIX and MS Windows workstations at no charge. It is fully functional except in that it views only documents provided via TCP/IP by SwiftServe 3.0+. These documents are defined by network URL's in the same manner as WWW based HTML documents.

SwiftView® provides all viewing and printing functions under full control of customer specific information systems or WWW tools. SwiftView® provides local document caching in memory whose size is configurable using an ICS command. The "download block" size is also configurable and can be tuned to optimize LAN or modem connections. These are both discussed in some detail in the SwiftView® Technical Reference Manual.

SwiftView® Installation - MS Windows

The Windows executables are self-extracting ZIP files. Move them to an empty directory and type:

svnl_nt -d

or

svnl_w31 -d

which extracts all files, creating any necessary directories. Then delete the original downloaded file.

No actual installation is required. That is, you just run the binary program SVIEW.EXE to use SwiftView®. You can place SVIEW.INI in the directory with SVIEW.EXE. If that is a network mount, the pair provide both the executable and the full configuration file for all network users.

SwiftView® Installation - UNIX

Move the downloaded file to an empty directory and type (using a Solaris example):

uncompress svnl_solar.tar
tar xvf svnl_solar.tar

This creates all necessary directories and files.

No actual installation is required. That is, you just run the binary program "sview" to use SwiftView®. However, printers must be defined in the file $NDGUTIL/svstart.ics as documented in the SwiftView® Technical Reference Manual.


CHAPTER 5 USING SERVER LICENSED SWIFTVIEW WITH SWIFTSERVE

Standard SwiftView operation is normal except that documents are available only via the server using Universal Resource Locators (URL's). The "file dialog" cannot display a list of documents that can be viewed and the URL syntax cannot be typed into a Windows file dialog.

SwiftView® supports URL's under all other circumstances, including:

URL syntax

Remote document files use standard WWW Universal Resource Locator (URL) syntax as follows:

x-idtp://yoursystem.you.com:6100/projectabc/doc23.tif

Where:


x-idtp The SwiftView, Inc. Interactive Document Transfer
Protocol
yoursystem.you.com A TCP/IP system name known to the client
system. A
numeric IP address of the form
nnn.nnn.nnn.nnn
can also be used.
:6100 Identifies the well-known port the server
is listening on
/projectabc/doc23.tif Path/file of the file to be accessed
RELATIVE to the server defined root
(/u/tiff in the example above).

This will typically be shortened to:

//yoursystem/projectabc/doc23.tif

because SwiftView assumes the "x-idtp" protocol, a local system typically does not require the complete TCP/IP domain name to be specified and port 6100 is used unless another port is defined.

Note that the leading characters "//" are required if the protocol is removed, because SwiftView needs them to distinguish between remote and local files. This is done to maintain existing SwiftView capabilities and use of "file:" is not supported.

SwiftView supports this syntax under all normal circumstances, including:

URL syntax cannot be typed into an MS Windows "file open" dialog.

Command line example

Consider the following SwiftView command line:

sview //yoursystem/invoices.tif

The user has started SwiftView with a request to display the relative file name invoices.tif via a remote image server defined by IP host name "yoursystem" and port=6100. If the server is installed as shown in the example above (with -g-dr/u/tiff) the complete UNIX file name being displayed is /u/tiff/invoices.tif.

SwiftView can also recognize multiple page documents by file name extension. For example, a three page document may be stored in the files:


/u/tiff/parts.001 Page 1
/u/tiff/parts.002 Page 2
/u/tiff/parts.003 Page 3

Continuing with the example from above, the command:

sview //yoursystem/parts

uses the image server to find the three files and treat them as a single 3-page document.

Imaging command set example

The file from the previous example can be displayed by sending the following ICS commands to SwiftView:

ldoc //yoursystem/invoices.tif
draw all

The inclusion of a second file name for markups is not currently supported via URL's.

Client Messages

Server based concurrent license management implementation requires that SwiftView® and SwiftServe Ver 3+ work only with each other. The following error messages may result from other combinations:

"3.x SwiftView may not access pre-3.0 SwiftServe" means that you are attempting to access an old SwiftServe (e.g. Ver 1.31) with the new SwiftView®.

"The communications link failed" means that you are attempting to use an old SwiftView® (e.g. Ver 2.61) to access the new SwiftServe 3.x.

"This program licensed only to read documents from SwiftServe Ver 3.x" means that you are attempting to use the server licensed SwiftView® Ver 3.x with local files. Local file access requires a licensed version of SwiftView®.

"The number of licensed SwiftServe clients has been exceeded; connection rejected" means that you have exceeded the number of concurrent clients (SwiftView®) currently licensed for your server.


CHAPTER 6 OPERATION WITH WWW TOOLS

This chapter describes how to configure SwiftView® and SwiftServe to function in conjunction with WWW tools. Netscape Navigator 2.0+ for Win32 systems is assumed as the client. Netscape Communications Server for UNIX is assumed as the server.

Configuring the Server

Using ICS commands is the most powerful technique for document enabling Netscape, because only a tiny ICS file is sent via the WWW server. SwiftServe then sends the actual document in a much more interactive manner.

What follows is a SwiftView, Inc. supplied CGI Perl script and two HTML fragments which show how to do this. This CGI and HTML is available on SwiftView, Inc.'s web site.

This HTML encodes a document URL and uses an SwiftView, Inc. supplied CGI script:

<P><A href="/cgi-bin/ndg_load_doc.cgi?name=//yoursystem/invoice123.tif">View invoices</A></P>

This HTML presents a form in which a user can enter the URL of any document support by SwiftView®:

<FORM METHOD="POST" ACTION="/cgi-bin/ndg_load_doc.cgi"><INPUT SIZE="60" NAME="name"></FORM>

The SwiftView, Inc. CGI Perl script supporting both of these techniques is as follows:


#!/usr/local/bin/perl
#
# This perl CGI script enables document distribution using
# SwiftView(R) and SwiftServe.
# SwiftView, Inc.
#
# flush stdout buffer
$| = 1;
#
# MIME type = any data stream "auto-recognized" by SwiftView(R)
print "Content-type: application/x-SwiftView\n\n";
#
# check for the POST method - used for forms
if ($ENV{'REQUEST_METHOD'} eq 'POST')
{
# How many bytes are we supposed to receive?
read(STDIN, $buffer,$ENV{'CONTENT_LENGTH'});
# make a list of keyword/value pairs
@pairs = split(/&/, $buffer);
# cycle through each pair and decipher the values
foreach $pair (@pairs)
{
# get the name/value pair strings
($name, $value) = split(/=/, $pair);
# translate "+" to a space
$value =~ tr/+/ /;
# decipher ASCII hexidecimal escaped characters, if any
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# add the pair to a list keyed on the name of the variable
$contents{$name} = $value;
}
}
#
# check for the GET method - used for links
if ($ENV{REQUEST_METHOD} eq 'GET' &&
$ENV{QUERY_STRING} ne '') {
# split the query string into an array of keywords
foreach $widget (split("&", $ENV{QUERY_STRING})) {
# get the keyword and value pair from the widget string
if ($widget =~ /(.*)=(.*)/) {
($key, $value) = ($1, $2);
$value =~ s/\+/ /g ; # replace "+" with " "
# unescape ASCII hexadecimal characters
$value =~ s/%(..)/pack('c',hex($1))/eg;
$contents{$key} = $value; # add keyword/value pair to a list
}
}
}
# The document URL is now in the name variable
# The \r's are here because our vb helper svwh currently requires them.
print <<"END";
ICS\r
ldoc $contents{'name'}\r
draw all\r
END

Using SwiftView® as a Netscape 2+ (Win32) Helper

It is very easy to configure SwiftView® as a Netscape helper. The first time the user browses a file of a MIME type (data type) not known (including application/x-SwiftView used above), Netscape Navigator will pop up the "Unknown File Type" dialog with the text:

You have started to download a file of type
application/x-SwiftView

Click on "Pick App…"

Click on "Browse" and select SVIEW.EXE from wherever it was placed.

For Navigator 2.x only, click on "options" "save options" to save that result.

If a given MIME type has already been configured for another application, select:

Options
General preferences
Helpers

Then select the type you want to change, "browse" to SVIEW.EXE and select it to change that type. Then click on "options" "save options" to change it.

Using the SwiftView® Web Helper (SVWH.EXE) as a Netscape 2.0 (Win32) Helper

Configuring SwiftView® as a helper is easy as described above but results in a new window each time something is viewed. The SwiftView® Web Helper is a small 32 bit Visual Basic 4 program which, when configured as a Netscsape helper, has the following advantages:

This program and its required support files are available at http://www.swiftview.com. See Appendix B for more details.


APPENDIX A - UNIX SERVER SETUP DETAILS

User/Group Control

The "-uuser" and "-ggroup" options on sviserv3 allow use of ports below 1024 (these ports are accessible only to root). svsrvd can be started by root, and the sviserv -uuser option changes the user and group of the sviserv process to "user", which should be the owner of the document structure.

Note that the user and group are changed before writing any messages to logfiles, but after opening the connection logfile (svsrvd -u option). Hence the connection logfile can be owned by root, and the sviserv error/debug file (-d option) must be writable by the -u user. Also, both svsrvd and sviserv3 must be executable by root.

Chroot Access Control - highest security

The sviserv3 "-c" option modifies the "-drDir" option to call chroot(2) with "Dir". This implements tighter restrictions to the document directory: no file can be opened by the server outside "Dir", even via symbolic links placed under the document directory. It is also impossible to gain access outside "Dir" by exploiting bugs in the server.

If -c is given, system commands, the -srDir option, and the debug log file are located relative to the -drDir document directory. A var/tmp directory must exist in the document directory.

Debug Tracing and Syslog

All messages after svsrvd or sviserv3 start up are sent to the system logging daemon, syslogd. Errors are sent at level "err", connection failure messages at level "notice", and connection acceptance messages at level "info", even if -d is not given. Debug trace is sent at level "debug" only if sviserv3 "-d" is given. All messages are sent as facility "daemon".

Syslogd is configured by /etc/syslog.conf. The default syslog.conf on Solaris 2.x writes messages to the console and /var/adm/messages if level is "err" or greater, or to /var/adm/messages if facility is "daemon" and level is "notice" or greater.

Note: the syslog.conf syntax has some undocumented restrictions. Each facility should appear only once in a selector field. Wild-carded facilities should appear first. Typically, you should not need to change syslog.conf to get errors and connection rejection notices in /var/adm/messages. On Solaris 2.x, to get connection acceptances, change

*.err;kern.debug;daemon.notice;mail.crit;user.none /var/adm/messages

to

*.err;kern.debug;daemon.info;mail.crit;user.none /var/adm/messages

Server Invocation

Here is a sample Solaris 2.x startup file to install in /etc/init.d that implements the above features, except for debug trace, and helps prevent the log file from growing unreasonably large. Adjust the paths, document service user, and port number for your installation. The server 'start' section can be adapted to other systems.

#!/bin/sh
#
killproc() {            # kill the named process(es)
pid=`/usr/bin/ps -e |
/usr/bin/grep $1 |
/usr/bin/sed -e 's/^ *//' -e 's/ .*//'`
[ "$pid" != "" ] && kill $pid
}
#
# Start/stop ndgtcpd's
#
NDGUTIL=/usr/local/swiftview
export NDGUTIL
DOCS=/usr/docs
SVLOG=/usr/adm/sviserv.log
# Special user nobody is just a bit more secure (implies nobody's
# group nobody).
DOCUSER=nobody
case "$1" in
'start')
# Keep the logfile from growing exponentially. Don't send
# successful connection logs to syslog.
if [ -f $SVLOG ]
then
if [ `wc -c $SVLOG | sed -e "s;$SVLOG;;"` -gt 100000 ]
then
if [ -f $SVLOG.1 ]
then
mv $SVLOG.1 $SVLOG.2
fi
mv $SVLOG $SVLOG.1
fi
fi
# This password is for one user, any host.
# For maximum security, use chroot() (-c).
# Root must have access to
/u/rel/cur,eng/hpux/bin/svsrvd,sviserv3.
$NDGUTIL/svsrvd -l0001xcz5fd1rcmk -p851 \
-u$SVLOG -g-dr$DOCS -g-c -g-u$DOCUSER -g-t60

# Else run as a regular user, which must be able to write
$SVLOG,
# and cannot access ports below 1024:
#echo $NDGUTIL/svsrvd -l0001xcz5fd1rcmk \
#-u$SVLOG -g-dr$DOCS -g-t60 | su $DOCUSER
;;

'stop')
killproc svsrvd # kill daemon
;;
*)
echo "Usage: /etc/init.d/ndg { start | stop }"
;;
esac

.