diff options
40 files changed, 2595 insertions, 0 deletions
@@ -0,0 +1,247 @@ +/* $Xorg: auth.c,v 1.4 2000/08/17 19:54:01 cpqbld Exp $ */ + +/************************************************************************/ +/* Copyright (c) 1993 Quarterdeck Office Systems */ +/* */ +/* Permission to use, copy, modify, distribute, and sell this software */ +/* and software and its documentation for any purpose is hereby granted */ +/* without fee, provided that the above copyright notice appear in all */ +/* copies and that both that copyright notice and this permission */ +/* notice appear in supporting documentation, and that the name */ +/* Quarterdeck Office Systems, Inc. not be used in advertising or */ +/* publicity pertaining to distribution of this software without */ +/* specific, written prior permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, */ +/* INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, */ +/* INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR */ +/* NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, */ +/* INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, */ +/* INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR */ +/* PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS */ +/* OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT */ +/* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/************************************************************************/ + +#include <stdio.h> +#include <X11/Xos.h> +#include <errno.h> +#ifndef X_NOT_STDC_ENV +#include <stdlib.h> +#else +extern int errno; +#endif +#include <ctype.h> + +extern char *expand(); +extern char myname[]; + +struct list_of_argv { + struct list_of_argv *next; + int argc; + char **argv; +}; + +struct auth_info { + struct auth_info *next; + char *name; + struct list_of_argv *data; + char **program; + char **input; +}; + +struct auth_info *auth_schemes = NULL; + +static char * +Strupr(s0) +char *s0; +{ + char *s; + + for(s = s0; *s; s++) { + if(islower(*s)) *s = toupper(*s); + } + return s0; +} + +/* Argument "s" is overwritten and the memory used, so it must not be */ +/* deallocated or subsequently used by the caller. */ +struct auth_info * +find_or_create_auth(s) +char *s; +{ + struct auth_info *auth; + + Strupr(s); + + for(auth = auth_schemes; auth; auth=auth->next) { + if(!strcmp(s, auth->name)) return auth; + } + + auth = (struct auth_info *)malloc(sizeof(*auth)); + if(!auth) nomem(); + + auth->next = auth_schemes; + auth->name = s; + auth->data = NULL; + auth->program = NULL; + auth->input = NULL; + auth_schemes = auth; + + return auth; +} + +key_auth(ac, av) +int ac; +char **av; +{ + struct list_of_argv *lav; + struct auth_info *auth; + + if(ac < 2) { + printf( + "%s: Failure: Malformed AUTH\n",myname); + exit(255); + } + + auth = find_or_create_auth(av[1]); + + lav = (struct list_of_argv *)malloc(sizeof(*lav)); + if(!lav) nomem(); + + lav->next = auth->data; + lav->argc = ac-2; + lav->argv = av+2; + auth->data = lav; +} + +key_internal_auth_program(ac, av) +int ac; +char **av; +{ + struct auth_info *auth; + + if(ac < 4) { + printf( + "%s: Failure: Malformed INTERNAL-AUTH-PROGRAM\n",myname); + exit(255); + } + + auth = find_or_create_auth(av[1]); + auth->program = av + 2; +} + +key_internal_auth_input(ac, av) +int ac; +char **av; +{ + struct auth_info *auth; + + if(ac < 2) { + printf( + "%s: Failure: Malformed INTERNAL-AUTH-INPUT\n",myname); + exit(255); + } + + auth = find_or_create_auth(av[1]); + auth->input = av + 2; +} + +do_auth() +{ + struct auth_info *auth; + int p[2]; + char **pp; + struct list_of_argv *lav; + char *s; + int pid; + int status; + + for(auth = auth_schemes; auth; auth = auth->next) { + if(!auth->data) continue; + if(!auth->program) { + printf( +"%s: Warning: no %s authorization program specified in this context\n",myname, + auth->name); + continue; + } + + if(pipe(p)) { + printf("%s: Error: pipe - %s\n",myname, strerror(errno)); + exit(255); + } + + fflush(stdout); /* Can't hurt. */ + + switch(pid = fork()) { + case -1: + printf("%s: Error: fork - %s\n",myname, strerror(errno)); + exit(255); + case 0: /* kid */ + close(0); + dup(p[0]); + close(p[0]); + close(p[1]); + execvp(auth->program[0], auth->program+1); + printf("%s: Error: %s - %s\n",myname, auth->program[0], + strerror(errno)); + exit(255); + break; + default: /* parent */ + close(p[0]); + for(lav = auth->data; lav; lav=lav->next) { + for(pp = auth->input; *pp; pp++) { + s = expand(*pp, lav->argc, lav->argv); + write(p[1], s, strlen(s)); + write(p[1], "\n", 1); + } + } + close(p[1]); + while(wait(&status) != pid) /* LOOP */; + if(status) { + printf( + "%s: Warning: %s authorization setup failed\n",myname, auth->name); + } + break; + } + } +} + +char * +expand(s, ac, av) +char *s; +int ac; +char **av; +{ + static char buf[BUFSIZ]; + char *p; + int i; + + p = buf; + while(*s) { + if(*s == '$') { + s++; + if(*s == '$') { + *p++ = *s++; + continue; + } + if(!isdigit(*s)) { + printf( + "%s: Failure: bad $ in configuration: non-digit after $\n",myname); + exit(255); + } + i = (int)strtol(s, &s, 10); + if(i > ac) { + printf( + "%s: Failure: not enough arguments to AUTH\n",myname); + exit(255); + } + strcpy(p, av[i-1]); + p += strlen(p); + } else *p++ = *s++; + } + *p = '\0'; + + return buf; +} diff --git a/client.cpp b/client.cpp new file mode 100644 index 0000000..8c5f58e --- /dev/null +++ b/client.cpp @@ -0,0 +1,124 @@ +XCOMM! /bin/sh +XCOMM $Xorg: client.cpp,v 1.4 2000/12/20 16:41:43 pookie Exp $ +XCOMM + +XCOMM Copyright (c) 1993 Quarterdeck Office Systems +XCOMM +XCOMM Permission to use, copy, modify, distribute, and sell this software +XCOMM and software and its documentation for any purpose is hereby granted +XCOMM without fee, provided that the above copyright notice appear in all +XCOMM copies and that both that copyright notice and this permission +XCOMM notice appear in supporting documentation, and that the name +XCOMM Quarterdeck Office Systems, Inc. not be used in advertising or +XCOMM publicity pertaining to distribution of this software without +XCOMM specific, written prior permission. +XCOMM +XCOMM THIS SOFTWARE IS PROVIDED "AS-IS". QUARTERDECK OFFICE SYSTEMS, +XCOMM INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +XCOMM INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +XCOMM MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +XCOMM NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +XCOMM INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +XCOMM INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +XCOMM PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +XCOMM OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +XCOMM OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +usage() { + if [ -n "$1" ] + then + echo "`basename $0`: $1" + fi + + echo "" + echo "Usage: `basename $0` [options] hostname command args ..." + echo "" + echo "where options include:" + echo " -c context run command in the specified context" + echo " -g interpret command as a generic command" + echo " -l username run command as the specified user" + echo " -v enable verbose output" + exit 1 +} + +if [ $# -eq 0 ] +then + usage +fi + +context=X +verbose=DETACH +name= +kind=CMD + +while : +do + case $1 in + -c) + if [ $# -lt 2 ] + then + usage "-c option requires an argument" + fi + + context=$2 + shift; shift + ;; + -g) + kind=GENERIC-CMD + shift + ;; + -l) + if [ $# -lt 2 ] + then + usage "-l option requires an argument" + fi + + name="-l $2" + shift; shift + ;; + -v) + verbose=NODETACH + shift + ;; + *) + if [ $# -eq 0 ] + then + usage "missing host name" + fi + + host=$1 + shift + break + ;; + esac +done + +if [ $# -eq 0 ] +then + usage "missing command" +fi + +case $verbose in +DETACH) + exec > /dev/null + ;; +esac + +case "$DISPLAY" in +:*) disp="`uname -n`$DISPLAY" + echo expanded $DISPLAY to $disp + ;; +*) disp="$DISPLAY" + ;; +esac + +( +cat << / +CONTEXT $context +MISC X DISPLAY=$disp +$kind $* +$verbose +/ +xauth list $disp | sed 's/^/AUTH X11 /' +echo "" +) | RSHCMD $host $name SERVERNAME diff --git a/commands/@List b/commands/@List new file mode 100644 index 0000000..9599a5c --- /dev/null +++ b/commands/@List @@ -0,0 +1,26 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ListContexts Shows available contexts +ListGenericCommands Shows available generic commands diff --git a/commands/ListContexts b/commands/ListContexts new file mode 100644 index 0000000..c495bde --- /dev/null +++ b/commands/ListContexts @@ -0,0 +1,36 @@ +#! /bin/sh +# $Xorg: ListContexts,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +list=@List + +for i in $ENVPREFIX_GLOBAL_CONTEXTS \ + $HOME/$ENVPREFIX_LOCAL_CONTEXTS +do + if test -f $i/$list + then + sed -e '/^$/d' -e '/^#/d' $i/$list + fi +done diff --git a/commands/ListGenericCommands b/commands/ListGenericCommands new file mode 100644 index 0000000..9289a39 --- /dev/null +++ b/commands/ListGenericCommands @@ -0,0 +1,38 @@ +#! /bin/sh +# $Xorg: ListGenericCommands,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +cmdlist=@List + +for i in $ENVPREFIX_GLOBAL_COMMANDS \ + $ENVPREFIX_GLOBAL_COMMANDS/$ENVPREFIX_CONTEXT \ + $HOME/$ENVPREFIX_LOCAL_COMMANDS \ + $HOME/$ENVPREFIX_LOCAL_COMMANDS/$ENVPREFIX_CONTEXT +do + if test -f $i/$cmdlist + then + sed -e '/^$/d' -e '/^#/d' $i/$cmdlist + fi +done diff --git a/commands/x11r6/@List b/commands/x11r6/@List new file mode 100644 index 0000000..5863fc7 --- /dev/null +++ b/commands/x11r6/@List @@ -0,0 +1,26 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +LoadMonitor Runs X11R6 xload to monitor system load +Terminal Runs X11R6 xterm terminal emulator diff --git a/commands/x11r6/LoadMonitor b/commands/x11r6/LoadMonitor new file mode 100644 index 0000000..d67e10b --- /dev/null +++ b/commands/x11r6/LoadMonitor @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: LoadMonitor,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec xload diff --git a/commands/x11r6/Terminal b/commands/x11r6/Terminal new file mode 100644 index 0000000..b1d3047 --- /dev/null +++ b/commands/x11r6/Terminal @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: Terminal,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec xterm diff --git a/config.cpp b/config.cpp new file mode 100644 index 0000000..623a696 --- /dev/null +++ b/config.cpp @@ -0,0 +1,34 @@ +XCOMM $Xorg: config.cpp,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +XCOMM +XCOMM Copyright (c) 1993 Quarterdeck Office Systems +XCOMM +XCOMM Permission to use, copy, modify, distribute, and sell this software +XCOMM and software and its documentation for any purpose is hereby granted +XCOMM without fee, provided that the above copyright notice appear in all +XCOMM copies and that both that copyright notice and this permission +XCOMM notice appear in supporting documentation, and that the name +XCOMM Quarterdeck Office Systems, Inc. not be used in advertising or +XCOMM publicity pertaining to distribution of this software without +XCOMM specific, written prior permission. +XCOMM +XCOMM THIS SOFTWARE IS PROVIDED "AS-IS". QUARTERDECK OFFICE SYSTEMS, +XCOMM INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +XCOMM INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +XCOMM MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +XCOMM NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +XCOMM INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +XCOMM INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +XCOMM PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +XCOMM OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +XCOMM OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +XCOMM First set up some important defaults. Can not find other config files +XCOMM without these, and can not read some of this one without them! + +internal-local-default .PACKAGEname +internal-global-contexts LIBDIR/contexts +internal-local-contexts .PACKAGEname.contexts +internal-local-commands .PACKAGEname.commands +internal-registries local posix x +internal-global-commands LIBDIR/commands +internal-variable-prefix ENVPREFIX diff --git a/contexts/@Aliases b/contexts/@Aliases new file mode 100644 index 0000000..76a8b68 --- /dev/null +++ b/contexts/@Aliases @@ -0,0 +1,25 @@ +# $Xorg: @Aliases,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +x11r6 x11 x diff --git a/contexts/@List b/contexts/@List new file mode 100644 index 0000000..6ba8111 --- /dev/null +++ b/contexts/@List @@ -0,0 +1,25 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +X11R6,X11,X X Window System Release 6 diff --git a/contexts/default b/contexts/default new file mode 100644 index 0000000..f4860da --- /dev/null +++ b/contexts/default @@ -0,0 +1,26 @@ +# $Xorg: default,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# +# Null context + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/contexts/x11r6 b/contexts/x11r6 new file mode 100644 index 0000000..0bf9ffe --- /dev/null +++ b/contexts/x11r6 @@ -0,0 +1,30 @@ +# $Xorg: x11r6,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +# +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +MISC X MANPATH=_MANPATH +MISC POSIX PATH=_PATH +INTERNAL-AUTH-PROGRAM X11 xauth xauth +INTERNAL-AUTH-INPUT X11 add\040$1\040$2\040$3 +INTERNAL-AUTH-PROGRAM ICE iceauth iceauth +INTERNAL-AUTH-INPUT ICE add\040$1\040$2\040$3\040$4\040$5 diff --git a/rstart.man b/rstart.man new file mode 100644 index 0000000..c820812 --- /dev/null +++ b/rstart.man @@ -0,0 +1,114 @@ +.\" $Xorg: rstart.man,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +.\" Copyright (c) 1993 Quarterdeck Office Systems +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation, and that the name Quarterdeck Office Systems, Inc. not +.\" be used in advertising or publicity pertaining to distribution of this +.\" software without specific, written prior permission. +.\" +.\" THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, INC., +.\" DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT +.\" LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +.\" PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK +.\" OFFICE SYSTEMS, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING +.\" SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, +.\" DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND +.\" REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING +.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.hy 0 \" I hate hyphenation. +.de EX \"Begin example +.ne 5 +.if n .sp 1 +.if t .sp .5 +.nf +.in +.5i +.. +.de EE +.fi +.in -.5i +.if n .sp 1 +.if t .sp .5 +.. +.ta .3i .6i .9i 1.2i 1.5i 1.8i +.TH RSTART 1 "Release 6.4" "X Version 11" +.SH NAME +rstart - a sample implementation of a Remote Start client +.SH SYNOPSIS +.B "rstart" +[\-c \fIcontext\fP] +[\-g] +[\-l \fIusername\fP] +[\-v] +\fIhostname\fP +\fIcommand args ...\fP +.SH DESCRIPTION +.PP +\fIRstart\fP is a simple implementation of a Remote Start client as +defined in "A Flexible Remote Execution Protocol Based on \fBrsh\fP". +It uses \fIrsh\fP as its underlying remote execution mechanism. +.SH OPTIONS +.TP 8 +.B \-c \fIcontext\fP +This option specifies the \fIcontext\fP in which the command is to be +run. A \fIcontext\fP specifies a general environment the program is to +be run in. The details of this environment are host-specific; the +intent is that the client need not know how the environment must be +configured. If omitted, the context defaults to \fBX\fP. This should +be suitable for running X programs from the host's "usual" X +installation. +.TP 8 +.B \-g +Interprets \fIcommand\fP as a \fIgeneric command\fP, as discussed +in the protocol document. This is intended to allow common applications +to be invoked without knowing what they are called on the remote system. +Currently, the only generic commands defined are \fBTerminal\fP, +\fBLoadMonitor\fP, \fBListContexts\fP, and \fBListGenericCommands\fP. +.TP 8 +.B \-l \fIusername\fP +This option is passed to the underlying \fIrsh\fP; it requests that +the command be run as the specified user. +.TP 8 +.B \-v +This option requests that \fIrstart\fP be verbose in its operation. +Without this option, \fIrstart\fP discards output from the remote's +\fIrstart\fP helper, and directs the \fIrstart\fP helper to detach +the program from the \fIrsh\fP connection used to start it. With +this option, responses from the helper are displayed and the resulting +program is not detached from the connection. +.SH NOTES +This is a trivial implementation. Far more sophisticated implementations +are possible and should be developed. +.PP +Error handling is nonexistant. Without \fB\-v\fP, error reports from +the remote are discarded silently. With \fB\-v\fP, error reports are +displayed. +.PP +The $DISPLAY environment variable is passed. If it starts with a colon, +the local hostname is prepended. The local domain name should be appended +to unqualified host names, but isn't. +.PP +The $SESSION_MANAGER environment variable should be passed, but isn't. +.PP +X11 authority information is passed for the current display. +.PP +ICE authority information should be passed, but isn't. It isn't +completely clear how \fIrstart\fP should select what ICE authority +information to pass. +.PP +Even without \fB\-v\fP, the sample \fIrstart\fP helper will leave a +shell waiting for the program to complete. This causes no real harm +and consumes relatively few resources, but if it is undesirable +it can be avoided by explicitly specifying the "exec" command to the +shell, eg +.EX 0 +rstart somehost exec xterm +.EE +This is obviously dependent on the command interpreter being used on +the remote system; the example given will work for the Bourne and C shells. +.SH "SEE ALSO" +rstartd(1), rsh(1), A Flexible Remote Execution Protocol Based on \fBrsh\fP +.SH AUTHOR +Jordan Brown, Quarterdeck Office Systems diff --git a/rstartd.man b/rstartd.man new file mode 100644 index 0000000..c3683fe --- /dev/null +++ b/rstartd.man @@ -0,0 +1,271 @@ +.\" $Xorg: rstartd.man,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +.\" Copyright (c) 1993 Quarterdeck Office Systems +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and +.\" its documentation for any purpose is hereby granted without fee, provided +.\" that the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation, and that the name Quarterdeck Office Systems, Inc. not +.\" be used in advertising or publicity pertaining to distribution of this +.\" software without specific, written prior permission. +.\" +.\" THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, INC., +.\" DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT +.\" LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +.\" PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK +.\" OFFICE SYSTEMS, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING +.\" SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, +.\" DATA, OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND +.\" REGARDLESS OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING +.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.hy 0 \" I hate hyphenation. +.de EX \"Begin example +.ne 5 +.if n .sp 1 +.if t .sp .5 +.nf +.in +.5i +.. +.de EE +.fi +.in -.5i +.if n .sp 1 +.if t .sp .5 +.. +.ta .3i .6i .9i 1.2i 1.5i 1.8i +.TH RSTARTD 1 "Release 6.4" "X Version 11" +.SH NAME +rstartd - a sample implementation of a Remote Start rsh helper +.SH SYNOPSIS +.B "rstartd" +.PP +.B "rstartd.real" +[\-c \fIconfigfilename\fP] +.SH DESCRIPTION +.PP +\fIRstartd\fP is an implementation of a Remote Start "helper" as defined in +"A Flexible Remote Execution Protocol Based on \fBrsh\fP". +.PP +This document describes the peculiarities of \fIrstartd\fP and how it is +configured. +.SH OPTIONS +.TP 8 +.B \-c \fIconfigfilename\fP +This option specifies the "global" configuration file that \fIrstartd\fP +is to read. Normally, \fIrstartd\fP is a shell script that invokes +\fIrstartd.real\fP with the \fB-c\fP switch, allowing local configuration +of the location of the configuration file. If \fIrstartd.real\fP is started +without the -c option, it reads <XRoot>/lib/X11/rstart/config, where +<XRoot> refers to the root of the X11 install tree. +.SH INSTALLATION +It is critical to successful interoperation of the Remote Start protocol +that \fIrstartd\fP be installed in a directory which is in the "default" +search path, so that default rsh requests and the ilk will be able to +find it. +.SH "CONFIGURATION AND OPERATION" +\fIRstartd\fP is by design highly configurable. One would like things like +configuration file locations to be fixed, so that users and administrators +can find them without searching, but reality is that no two vendors will +agree on where things should go, and nobody thinks the original location +is "right". Thus, \fIrstartd\fP allows one to relocate \fBall\fP of its files and +directories. +.PP +\fIRstartd\fP has a hierarchy of configuration files which are executed in +order when a request is made. They are: +.EX 0 +global config +per-user ("local") config +global per-context config +per-user ("local") per-context config +config from request +.EE +As you might guess from the presence of "config from request", all of the +config files are in the format of an \fIrstart\fP request. \fIRstartd\fP +defines a few additional keywords with the INTERNAL- prefix for specifying +its configuration. +.PP +\fIRstartd\fP starts by reading and executing the global config file. +This file will normally specify the locations of the other configuration +files and any systemwide defaults. +.PP +\fIRstartd\fP will then read the user's local config file, default name +$HOME/.rstart. +.PP +\fIRstartd\fP will then start interpreting the request. +.PP +Presumably one of the first lines in the request will be a CONTEXT line. +The context name is converted to lower case. +.PP +\fIRstartd\fP will read the global config file for that context, default name +<XRoot>/lib/X11/rstart/contexts/<name>, if any. +.PP +It will then read the user's config file for that context, default name +$HOME/.rstart.contexts/<name>, if any. +.PP +(If neither of these exists, \fIrstartd\fP aborts with a Failure message.) +.PP +\fIRstartd\fP will finish interpreting the request, and execute the program +specified. +.PP +This allows the system administrator and the user a large degree of control +over the operation of \fIrstartd\fP. The administrator has final say, because +the global config file doesn't need to specify a per-user config file. +If it does, however, the user can override anything from the global file, +and can even completely replace the global context config files. +.PP +The config files have a somewhat more flexible format than requests do; +they are allowed to contain blank lines and lines beginning with "#" +are comments and ignored. (#s in the middle of lines are data, not comment +markers.) +.PP +Any commands run are provided a few useful pieces of information in +environment variables. The exact names are configurable, but the supplied +defaults are: +.EX 0 +$RSTART_CONTEXT the name of the context +$RSTART_GLOBAL_CONTEXTS the global contexts directory +$RSTART_LOCAL_CONTEXTS the local contexts directory +$RSTART_GLOBAL_COMMANDS the global generic commands directory +$RSTART_LOCAL_COMMANDS the local generic commands directory +.EE +$RSTART_{GLOBAL,LOCAL}_CONTEXTS should contain one special file, @List, +which contains a list of the contexts in that directory in the format +specified for ListContexts. The supplied version of ListContexts will +cat both the global and local copies of @List. +.PP +Generic commands are searched for in several places: (defaults) +.EX 0 +per-user per-context directory ($HOME/.rstart.commands/<context>) +global per-context directory (<XRoot>/lib/X11/rstart/commands/<context>) +per-user all-contexts directory ($HOME/.rstart.commands) +global all-contexts directory (<XRoot>/lib/X11/rstart/commands) +.EE +(Yes, this means you can't have an all-contexts generic command with the +same name as a context. It didn't seem like a big deal.) +.PP +Each of these directories should have a file called @List that gives +the names and descriptions of the commands in that directory in the +format specified for ListGenericCommands. +.SH "CONFIGURATION KEYWORDS" +There are several "special" \fIrstart\fP keywords defined for \fIrstartd\fP +configuration. Unless otherwise specified, there are no defaults; related +features are disabled in this case. +.PP +.TP 8 +.B INTERNAL-REGISTRIES name ... +Gives a space-separated list of "MISC" registries that this system +understands. (Registries other than this are accepted but generate +a Warning.) +.TP 8 +.B INTERNAL-LOCAL-DEFAULT relative_filename +Gives the name ($HOME relative) of the per-user config file. +.TP 8 +.B INTERNAL-GLOBAL-CONTEXTS absolute_directory_name +Gives the name of the system-wide contexts directory. +.TP 8 +.B INTERNAL-LOCAL-CONTEXTS relative_directory_name +Gives the name ($HOME relative) of the per-user contexts directory. +.TP 8 +.B INTERNAL-GLOBAL-COMMANDS absolute_directory_name +Gives the name of the system-wide generic commands directory. +.TP 8 +.B INTERNAL-LOCAL-COMMANDS relative_directory_name +Gives the name ($HOME relative) of the per-user generic commands +directory. +.TP 8 +.B INTERNAL-VARIABLE-PREFIX prefix +Gives the prefix for the configuration environment variables \fIrstartd\fP +passes to its kids. +.TP 8 +.B INTERNAL-AUTH-PROGRAM authscheme program argv[0] argv[1] ... +Specifies the program to run to set up authentication for the +specified authentication scheme. "program argv[0] ..." gives +the program to run and its arguments, in the same form as the +EXEC keyword. +.TP 8 +.B INTERNAL-AUTH-INPUT authscheme +Specifies the data to be given to the authorization program as +its standard input. Each argument is passed as a single line. +$n, where n is a number, is replaced by the n'th argument to the +"AUTH authscheme arg1 arg2 ..." line. +.TP 8 +.B INTERNAL-PRINT arbitrary text +Prints its arguments as a Debug message. Mostly for \fIrstartd\fP +debugging, but could be used to debug config files. +.SH NOTES +When using the C shell, or any other shell which runs a script every +time the shell is started, the script may get run several times. +In the worst case, the script may get run \fBthree\fP times: +.EX 0 +By rsh, to run \fIrstartd\fP +By \fIrstartd\fP, to run the specified command +By the command, eg \fIxterm\fP +.EE +\fIrstartd\fP currently limits lines, both from config files and requests, to +BUFSIZ bytes. +.PP +DETACH is implemented by redirecting file descriptors 0,1, and 2 to +/dev/null and forking before executing the program. +.PP +CMD is implemented by invoking $SHELL (default /bin/sh) with "-c" and +the specified command as arguments. +.PP +POSIX-UMASK is implemented in the obvious way. +.PP +The authorization programs are run in the same context as the target +program - same environment variables, path, etc. Long term this might +be a problem. +.PP +In the X context, GENERIC-CMD Terminal runs xterm. +In the OpenWindows context, GENERIC-CMD Terminal runs cmdtool. +.PP +In the X context, GENERIC-CMD LoadMonitor runs xload. +In the OpenWindows context, GENERIC-CMD LoadMonitor runs perfmeter. +.PP +\fBGENERIC-CMD ListContexts\fP lists the contents of @List in both the +system-wide and per-user contexts directories. It is available in +all contexts. +.PP +\fBGENERIC-CMD ListGenericCommands\fP lists the contents of @List in the +system-wide and per-user commands directories, including the +per-context subdirectories for the current context. It is available +in all contexts. +.PP +\fBCONTEXT None\fP is not implemented. +.PP +\fBCONTEXT Default\fP is really dull. +.PP +For installation ease, the "contexts" directory in the distribution contains +a file "@Aliases" which lists a context name and aliases for that context. +This file is used to make symlinks in the contexts and commands directories. +.PP +All \fBMISC\fP values are passed unmodified as environment variables. +.PP +One can mistreat \fIrstartd\fP in any number of ways, resulting in anything +from stupid behavior to core dumps. Other than by explicitly running +programs I don't think it can write or delete any files, but there's +no guarantee of that. The important thing is that (a) it probably won't +do anything REALLY stupid and (b) it runs with the user's permissions, +so it can't do anything catastrophic. +.PP +@List files need not be complete; contexts or commands which are dull +or which need not or should not be advertised need not be listed. +In particular, per-user @List files should not list things which are in +the system-wide @List files. In the future, perhaps ListContexts and +ListGenericCommands will automatically suppress lines from the +system-wide files when there are per-user replacements for those lines. +.PP +Error handling is OK to weak. In particular, no attempt is made to +properly report errors on the exec itself. (Perversely, exec errors +could be reliably reported when detaching, but not when passing the +stdin/out socket to the app.) +.PP +If compiled with -DODT1_DISPLAY_HACK, \fIrstartd\fP will work around a bug in +SCO ODT version 1. (1.1?) (The bug is that the X clients are all compiled +with a bad library that doesn't know how to look host names up using DNS. +The fix is to look up a host name in $DISPLAY and substitute an IP address.) +This is a trivial example of an incompatibility that \fIrstart\fP can hide. +.SH "SEE ALSO" +rstart(1), rsh(1), A Flexible Remote Execution Protocol Based on \fBrsh\fP +.SH AUTHOR +Jordan Brown, Quarterdeck Office Systems diff --git a/samples/commands/@List b/samples/commands/@List new file mode 100644 index 0000000..2f4f46b --- /dev/null +++ b/samples/commands/@List @@ -0,0 +1,26 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:02 cpqbld Exp $ +# +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ListContexts Shows available contexts +ListGenericCommands Shows available generic commands diff --git a/samples/commands/ListContexts b/samples/commands/ListContexts new file mode 100644 index 0000000..08998c6 --- /dev/null +++ b/samples/commands/ListContexts @@ -0,0 +1,36 @@ +#! /bin/sh +# $Xorg: ListContexts,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +list=@List + +for i in $RSTART_GLOBAL_CONTEXTS \ + $HOME/$RSTART_LOCAL_CONTEXTS +do + if test -f $i/$list + then + sed -e '/^$/d' -e '/^#/d' $i/$list + fi +done diff --git a/samples/commands/ListGenericCommands b/samples/commands/ListGenericCommands new file mode 100644 index 0000000..279f416 --- /dev/null +++ b/samples/commands/ListGenericCommands @@ -0,0 +1,38 @@ +#! /bin/sh +# $Xorg: ListGenericCommands,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +cmdlist=@List + +for i in $RSTART_GLOBAL_COMMANDS \ + $RSTART_GLOBAL_COMMANDS/$RSTART_CONTEXT \ + $HOME/$RSTART_LOCAL_COMMANDS \ + $HOME/$RSTART_LOCAL_COMMANDS/$RSTART_CONTEXT +do + if test -f $i/$cmdlist + then + sed -e '/^$/d' -e '/^#/d' $i/$cmdlist + fi +done diff --git a/samples/commands/odt1/@List b/samples/commands/odt1/@List new file mode 100644 index 0000000..2e77b27 --- /dev/null +++ b/samples/commands/odt1/@List @@ -0,0 +1,26 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +LoadMonitor Runs ODT xload to monitor system load +Terminal Runs ODT xterm terminal emulator diff --git a/samples/commands/odt1/LoadMonitor b/samples/commands/odt1/LoadMonitor new file mode 100644 index 0000000..dbece57 --- /dev/null +++ b/samples/commands/odt1/LoadMonitor @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: LoadMonitor,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec xload diff --git a/samples/commands/odt1/Terminal b/samples/commands/odt1/Terminal new file mode 100644 index 0000000..018dde8 --- /dev/null +++ b/samples/commands/odt1/Terminal @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: Terminal,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec xterm diff --git a/samples/commands/openwindows2/@List b/samples/commands/openwindows2/@List new file mode 100644 index 0000000..f3b960a --- /dev/null +++ b/samples/commands/openwindows2/@List @@ -0,0 +1,27 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +LoadMonitor Runs OpenWindows PerfMeter to monitor system load +Terminal Runs OpenWindows xterm terminal emulator diff --git a/samples/commands/openwindows2/LoadMonitor b/samples/commands/openwindows2/LoadMonitor new file mode 100644 index 0000000..b5fe45e --- /dev/null +++ b/samples/commands/openwindows2/LoadMonitor @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: LoadMonitor,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec perfmeter diff --git a/samples/commands/openwindows2/Terminal b/samples/commands/openwindows2/Terminal new file mode 100644 index 0000000..331d09b --- /dev/null +++ b/samples/commands/openwindows2/Terminal @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: Terminal,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec cmdtool diff --git a/samples/commands/openwindows3/@List b/samples/commands/openwindows3/@List new file mode 100644 index 0000000..f3b960a --- /dev/null +++ b/samples/commands/openwindows3/@List @@ -0,0 +1,27 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +LoadMonitor Runs OpenWindows PerfMeter to monitor system load +Terminal Runs OpenWindows xterm terminal emulator diff --git a/samples/commands/openwindows3/LoadMonitor b/samples/commands/openwindows3/LoadMonitor new file mode 100644 index 0000000..b5fe45e --- /dev/null +++ b/samples/commands/openwindows3/LoadMonitor @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: LoadMonitor,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec perfmeter diff --git a/samples/commands/openwindows3/Terminal b/samples/commands/openwindows3/Terminal new file mode 100644 index 0000000..331d09b --- /dev/null +++ b/samples/commands/openwindows3/Terminal @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: Terminal,v 1.3 2000/08/17 19:54:03 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec cmdtool diff --git a/samples/commands/x11r5/@List b/samples/commands/x11r5/@List new file mode 100644 index 0000000..8ed7209 --- /dev/null +++ b/samples/commands/x11r5/@List @@ -0,0 +1,27 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +LoadMonitor Runs X11R5 xload to monitor system load +Terminal Runs X11R5 xterm terminal emulator diff --git a/samples/commands/x11r5/LoadMonitor b/samples/commands/x11r5/LoadMonitor new file mode 100644 index 0000000..b3580d2 --- /dev/null +++ b/samples/commands/x11r5/LoadMonitor @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: LoadMonitor,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec xload diff --git a/samples/commands/x11r5/Terminal b/samples/commands/x11r5/Terminal new file mode 100644 index 0000000..5afd96b --- /dev/null +++ b/samples/commands/x11r5/Terminal @@ -0,0 +1,27 @@ +#! /bin/sh +# $Xorg: Terminal,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec xterm diff --git a/samples/contexts.odt1/@Aliases b/samples/contexts.odt1/@Aliases new file mode 100644 index 0000000..d9df7e2 --- /dev/null +++ b/samples/contexts.odt1/@Aliases @@ -0,0 +1,26 @@ +# $Xorg: @Aliases,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +odt1 odt x11r3 x11 x diff --git a/samples/contexts.odt1/@List b/samples/contexts.odt1/@List new file mode 100644 index 0000000..f69a723 --- /dev/null +++ b/samples/contexts.odt1/@List @@ -0,0 +1,26 @@ +# $Xorg: @List,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +ODT,ODT1,X11R3,X11,X SCO Open Desktop v1.x (X11R3) diff --git a/samples/contexts.odt1/default b/samples/contexts.odt1/default new file mode 100644 index 0000000..62e4c60 --- /dev/null +++ b/samples/contexts.odt1/default @@ -0,0 +1,26 @@ +# $Xorg: default,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# +# Null context + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/samples/contexts.odt1/odt1 b/samples/contexts.odt1/odt1 new file mode 100644 index 0000000..e6a5efa --- /dev/null +++ b/samples/contexts.odt1/odt1 @@ -0,0 +1,26 @@ +# $Xorg: odt1,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +MISC X PATH=:/usr/bin/X11:/usr/bin:/bin diff --git a/samples/contexts.odt1/openwindows2 b/samples/contexts.odt1/openwindows2 new file mode 100644 index 0000000..1c41857 --- /dev/null +++ b/samples/contexts.odt1/openwindows2 @@ -0,0 +1,35 @@ +# $Xorg: openwindows2,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +MISC SUN OPENWINHOME=/usr/openwin.2 +MISC SUN LD_LIBRARY_PATH=/usr/openwin.2/lib +MISC SUN FONTPATH=/usr/openwin.2/lib/fonts +MISC SUN HELPPATH=/usr/openwin.2/lib/help +MISC SUN MANPATH=/usr/openwin.2/share/man:/usr/man +# But note that OW2 appears to come with an empty app-defaults! +MISC SUN XAPPLRESDIR=/usr/openwin.2/lib/app-defaults +MISC POSIX PATH=:/usr/openwin.2/bin:/usr/openwin.2/demo:/usr/openwin.2/bin/xview:/usr/ucb:/usr/bin +INTERNAL-AUTH-PROGRAM X11 xauth xauth +INTERNAL-AUTH-INPUT X11 add\040$1\040$2\040$3 diff --git a/samples/contexts.odt1/openwindows3 b/samples/contexts.odt1/openwindows3 new file mode 100644 index 0000000..d30be63 --- /dev/null +++ b/samples/contexts.odt1/openwindows3 @@ -0,0 +1,33 @@ +# $Xorg: openwindows3,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +MISC SUN OPENWINHOME=/usr/openwin +MISC SUN FONTPATH=/usr/openwin/lib/fonts +MISC SUN HELPPATH=/usr/openwin/lib/help +MISC SUN MANPATH=/usr/openwin/share/man:/usr/man +MISC SUN XAPPLRESDIR=/usr/openwin/lib/app-defaults +MISC POSIX PATH=:/usr/openwin/bin:/usr/openwin/demo:/usr/openwin/bin/xview:/usr/ucb:/usr/bin +INTERNAL-AUTH-PROGRAM X11 xauth xauth +INTERNAL-AUTH-INPUT X11 add\040$1\040$2\040$3 diff --git a/samples/contexts.odt1/x11r5 b/samples/contexts.odt1/x11r5 new file mode 100644 index 0000000..915f815 --- /dev/null +++ b/samples/contexts.odt1/x11r5 @@ -0,0 +1,29 @@ +# $Xorg: x11r5,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +MISC X PATH=/usr/X11R5/bin:/usr/ucb:/usr/bin +MISC SUN MANPATH=/usr/X11R5/man:/usr/man +INTERNAL-AUTH-PROGRAM X11 xauth xauth +INTERNAL-AUTH-INPUT X11 add\040$1\040$2\040$3 diff --git a/samples/contexts.odt1/x11r6 b/samples/contexts.odt1/x11r6 new file mode 100644 index 0000000..35e7811 --- /dev/null +++ b/samples/contexts.odt1/x11r6 @@ -0,0 +1,29 @@ +# $Xorg: x11r6,v 1.3 2000/08/17 19:54:04 cpqbld Exp $ +# + +# Copyright (c) 1993 Quarterdeck Office Systems +# +# Permission to use, copy, modify, distribute, and sell this software +# and software and its documentation for any purpose is hereby granted +# without fee, provided that the above copyright notice appear in all +# copies and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name +# Quarterdeck Office Systems, Inc. not be used in advertising or +# publicity pertaining to distribution of this software without +# specific, written prior permission. +# +# THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, +# INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +# NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +# INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +# INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +# PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +# OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +MISC SUN MANPATH=/usr/X11R6/man:/usr/share/man +MISC X PATH=/usr/X11R6/bin:/usr/ucb:/usr/bin +INTERNAL-AUTH-PROGRAM X11 xauth xauth +INTERNAL-AUTH-INPUT X11 add\040$1\040$2\040$3 diff --git a/server.c b/server.c new file mode 100644 index 0000000..b7d652a --- /dev/null +++ b/server.c @@ -0,0 +1,839 @@ +/* $Xorg: server.c,v 1.5 2000/08/17 19:54:01 cpqbld Exp $ */ + +/************************************************************************/ +/* Copyright (c) 1993 Quarterdeck Office Systems */ +/* */ +/* Permission to use, copy, modify, distribute, and sell this software */ +/* and software and its documentation for any purpose is hereby granted */ +/* without fee, provided that the above copyright notice appear in all */ +/* copies and that both that copyright notice and this permission */ +/* notice appear in supporting documentation, and that the name */ +/* Quarterdeck Office Systems, Inc. not be used in advertising or */ +/* publicity pertaining to distribution of this software without */ +/* specific, written prior permission. */ +/* */ +/* THIS SOFTWARE IS PROVIDED `AS-IS'. QUARTERDECK OFFICE SYSTEMS, */ +/* INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, */ +/* INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR */ +/* NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, */ +/* INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, */ +/* INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR */ +/* PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS */ +/* OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT */ +/* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/************************************************************************/ + +/* Extended rsh "helper" program */ +#include <stdio.h> +#include <ctype.h> +#include <X11/Xos.h> +#include <errno.h> +#ifndef X_NOT_STDC_ENV +#include <stdlib.h> +#else +extern int errno; +extern void *malloc(); +extern char *getenv(); +#endif +#include <sys/stat.h> + +#ifdef ODT1_DISPLAY_HACK +#include <netdb.h> +#endif /* ODT1_DISPLAY_HACK */ + +#define TRUE 1 +#define FALSE 0 + +struct key { + char *name; + void (*func)(); +}; + +extern void key_cmd(); +extern void key_exec(); +extern void key_context(); +extern void key_misc(); +extern void key_generic_cmd(); +extern void key_dir(); +extern void key_detach(); +extern void key_nodetach(); +extern void key_posix_umask(); +extern void key_auth(); +extern void key_internal_registries(); +extern void key_internal_local_default(); +extern void key_internal_global_contexts(); +extern void key_internal_local_contexts(); +extern void key_internal_global_commands(); +extern void key_internal_local_commands(); +extern void key_internal_variable_prefix(); +extern void key_internal_print(); +extern void key_internal_auth_program(); +extern void key_internal_auth_input(); + +struct key keys[] = { + "cmd", key_cmd, + "exec", key_exec, + "context", key_context, + "misc", key_misc, + "generic-cmd", key_generic_cmd, + "dir", key_dir, + "detach", key_detach, + "nodetach", key_nodetach, + "posix-umask", key_posix_umask, + "auth", key_auth, + "internal-registries", key_internal_registries, + "internal-local-default", key_internal_local_default, + "internal-global-contexts", key_internal_global_contexts, + "internal-local-contexts", key_internal_local_contexts, + "internal-global-commands", key_internal_global_commands, + "internal-local-commands", key_internal_local_commands, + "internal-variable-prefix", key_internal_variable_prefix, + "internal-print", key_internal_print, + "internal-auth-program", key_internal_auth_program, + "internal-auth-input", key_internal_auth_input, + NULL, +}; + + +char **parm_cmd = NULL; +char **parm_exec = NULL; +char **parm_generic_cmd = NULL; +char *parm_dir = NULL; +char *parm_context = NULL; +char **parm_internal_registries = NULL; +char *parm_internal_local_default = NULL; +char *parm_internal_global_contexts = NULL; +char *parm_internal_local_contexts = NULL; +char *parm_internal_global_commands = NULL; +char *parm_internal_local_commands = NULL; +char *parm_internal_variable_prefix = NULL; +int parm_detach = FALSE; + +char *parm_global_default = DEFAULT_CONFIG; +char myname[]=SERVERNAME; + +main(argc, argv) +int argc; +char **argv; +{ + FILE *f; + + if(argc == 3 && !strcmp(argv[1], "-c")) parm_global_default = argv[2]; + + setbuf(stdin, NULL); + + printf( + "%s: Ready: version 1.0, May 02 1994 X11R6.3\n", + myname); + fflush(stdout); + + f = fopen(parm_global_default, "r"); + if(f) process(f, FALSE); + + if(parm_internal_local_default) { + /* We start in $HOME */ + f = fopen(parm_internal_local_default, "r"); + if(f) process(f, FALSE); + } + + process(stdin, TRUE); + + do_it(); +} + +squish_out_escapes(s) +char *s; +{ + char *p; + char *o; + + o = s; + for(p = s; *p; p++) { + if(*p == '\\') { + if(p[1] >= '0' && p[1] <= '3' + && p[2] >= '0' && p[2] <= '7' + && p[3] >= '0' && p[3] <= '7') { + *o++ = ((p[1]-'0') << 6) + + ((p[2]-'0') << 3) + + (p[3]-'0'); + p += 3; + } else { + printf( + "%s: Failure: Improper \\ escape\n",myname); + exit(255); + } + } else *o++ = *p; + } + *o = '\0'; +} + +char * +Strdup(s) + char *s; +{ + char *cs; + + if (!s) + return s; + cs = malloc(strlen(s)+1); + strcpy(cs, s); + return cs; +} + +int +get_a_line(f, pargc, pargv) +FILE *f; +int *pargc; +char ***pargv; +{ + char buf[2048]; + char *p; + int c; + char **pa; + int was_space; + char *saved; + + while(1) { + p = buf; + while((c = getc(f)) != '\n') { + switch(c) { + case '\0': + case '\r': + /* Ignored, per spec */ + break; + case EOF: + return FALSE; + default: + *p++ = c; + break; + } + } + *p = '\0'; + + saved = Strdup(buf); + if(!saved) nomem(); + + *pargc = 0; + was_space = TRUE; + for(p = saved; *p; p++) { + if(was_space && !isspace(*p)) (*pargc)++; + was_space = isspace(*p); + } + + *pargv = (char **)malloc((*pargc+1)*sizeof(char *)); + if(!*pargv) nomem(); + + pa = *pargv; + was_space = TRUE; + for(p = saved; *p; p++) { + if(was_space && !isspace(*p)) *pa++ = p; + was_space = isspace(*p); + if(isspace(*p)) *p = '\0'; + } + *pa = NULL; + + if(*pargc > 0 && (*pargv)[0][0] == '#') { + /* How embarrassing. All that work for a comment. */ + free(saved); + free(*pargv); + continue; + } + + break; + } + + for(pa = *pargv; *pa; pa++) { + squish_out_escapes(*pa); + } + + return TRUE; +} + +nomem() +{ + printf("%s: Failure: Out of memory\n",myname); + exit(255); +} + +void +key_internal_registries(ac, av) +int ac; +char **av; +{ + parm_internal_registries = av+1; +} + +void +key_internal_variable_prefix(ac, av) +int ac; +char **av; +{ + if(ac != 2) { + printf( + "%s: Failure: Malformed INTERNAL-VARIABLE-PREFIX\n",myname); + exit(255); + } + parm_internal_variable_prefix = av[1]; +} + +void +key_internal_local_default(ac, av) +int ac; +char **av; +{ + if(ac != 2) { + printf("%s: Failure: Malformed INTERNAL-LOCAL-DEFAULT\n",myname); + exit(255); + } + parm_internal_local_default = av[1]; +} + +void +key_internal_global_commands(ac, av) +int ac; +char **av; +{ + if(ac != 2) { + printf("%s: Failure: Malformed INTERNAL-GLOBAL-COMMANDS\n",myname); + exit(255); + } + parm_internal_global_commands = av[1]; +} + +void +key_internal_local_commands(ac, av) +int ac; +char **av; +{ + if(ac != 2) { + printf("%s: Failure: Malformed INTERNAL-LOCAL-COMMANDS\n",myname); + exit(255); + } + parm_internal_local_commands = av[1]; +} + +void +key_internal_global_contexts(ac, av) +int ac; +char **av; +{ + if(ac != 2) { + printf("%s: Failure: Malformed INTERNAL-GLOBAL-CONTEXTS\n",myname); + exit(255); + } + parm_internal_global_contexts = av[1]; +} + +void +key_internal_local_contexts(ac, av) +int ac; +char **av; +{ + if(ac != 2) { + printf("%s: Failure: Malformed INTERNAL-LOCAL-CONTEXTS\n",myname); + exit(255); + } + parm_internal_local_contexts = av[1]; +} + +void +key_cmd(ac, av) +int ac; +char **av; +{ + if(parm_cmd || parm_exec || parm_generic_cmd) { + printf( + "%s: Failure: more than one of CMD, EXEC, GENERIC-CMD\n",myname); + exit(255); + } + parm_cmd = av; +} + +void +key_exec(ac, av) +int ac; +char **av; +{ + if(parm_cmd || parm_exec || parm_generic_cmd) { + printf( + "%s: Failure: more than one of CMD, EXEC, GENERIC-CMD\n",myname); + exit(255); + } + parm_exec = av; +} + +static char * +Strlwr(s0) +char *s0; +{ + char *s; + + for(s = s0; *s; s++) { + if(isupper(*s)) *s = tolower(*s); + } + return s0; +} + + +void +key_context(ac, av) +int ac; +char **av; +{ + char buf[1024]; + int ok; + FILE *f; + + if(ac != 2) { + printf("%s: Failure: Malformed CONTEXT\n",myname); + exit(255); + } + Strlwr(av[1]); + parm_context = av[1]; + + ok = FALSE; + + if(parm_internal_global_contexts) { + strcpy(buf, parm_internal_global_contexts); + strcat(buf, "/"); + strcat(buf, parm_context); + if((f = fopen(buf, "r"))) { + process(f, FALSE); + ok = TRUE; + } + } + + if(parm_internal_local_contexts) { + strcpy(buf, parm_internal_local_contexts); + strcat(buf, "/"); + strcat(buf, parm_context); + if((f = fopen(buf, "r"))) { + process(f, FALSE); + ok = TRUE; + } + } + + if(!ok) { + printf("%s: Error: Unknown context '%s'\n",myname, parm_context); + exit(255); + } +} + +void +key_dir(ac, av) +int ac; +char **av; +{ + if(ac != 2) { + printf("%s: Failure: malformed DIR line\n",myname); + exit(255); + } + parm_dir = av[1]; +} + +void +key_misc(ac, av) +int ac; +char **av; +{ + char **pp; + + if(ac != 3) { + printf("%s: Failure: malformed MISC line\n",myname); + exit(255); + } + + Strlwr(av[1]); + + if(parm_internal_registries) { + for(pp = parm_internal_registries; *pp; pp++) { + if(!strcmp(av[1], *pp)) goto ok; + } + } + printf("%s: Warning: registry %s not recognized\n",myname, av[1]); + fflush(stdout); + +ok: + ; + +#ifdef ODT1_DISPLAY_HACK + /* The X apps in ODT version 1 don't know how to look up */ + /* host names using DNS. Do it for them. */ + if(!strcmp(av[1], "x") + && !strncmp(av[2], "DISPLAY=", 8) + && odt1_display_hack(av[2]+8)) return; +#endif /* ODT1_DISPLAY_HACK */ + + putenv(av[2]); +} + +#ifdef ODT1_DISPLAY_HACK +odt1_display_hack(s) +char *s; +{ + char buf[80]; + struct hostent *he; + char *p; + int ok; + + ok = FALSE; + for(p = s; *p; p++) { + if(*p == ':') { + if(!ok) break; + *p = '\0'; + he = gethostbyname(s); + *p = ':'; + if(!he) break; + sprintf(buf, "DISPLAY=%u.%u.%u.%u%s", + he->h_addr_list[0][0] & 0xff, + he->h_addr_list[0][1] & 0xff, + he->h_addr_list[0][2] & 0xff, + he->h_addr_list[0][3] & 0xff, + p); + s = Strdup(buf); + if(!s) nomem(); + putenv(s); + return TRUE; + } + if(!isdigit(*p) && *p != '.') ok = TRUE; + } + return FALSE; +} +#endif /* ODT1_DISPLAY_HACK */ + +void +key_generic_cmd(ac, av) +int ac; +char **av; +{ + if(parm_cmd || parm_exec || parm_generic_cmd) { + printf( + "%s: Failure: more than one of CMD, EXEC, GENERIC-CMD\n",myname); + exit(255); + } + parm_generic_cmd = av; +} + +do_it() +{ + if(parm_dir) { + if(chdir(parm_dir)) { + printf("%s: Error: %s - %s\n",myname, + parm_dir, strerror(errno)); + exit(255); + } + } + + if(parm_internal_variable_prefix) { + putenv_with_prefix(parm_internal_variable_prefix, + "CONTEXT", parm_context); + putenv_with_prefix(parm_internal_variable_prefix, + "LOCAL_COMMANDS", parm_internal_local_commands); + putenv_with_prefix(parm_internal_variable_prefix, + "GLOBAL_COMMANDS", parm_internal_global_commands); + putenv_with_prefix(parm_internal_variable_prefix, + "LOCAL_CONTEXTS", parm_internal_local_contexts); + putenv_with_prefix(parm_internal_variable_prefix, + "GLOBAL_CONTEXTS", parm_internal_global_contexts); + } + + do_auth(); + + if(parm_cmd) { + char *shell; + char *buf; + int len; + char **pa; + + if(!(shell = getenv("SHELL"))) shell = "/bin/sh"; + + len = 0; + for(pa = parm_cmd+1; *pa; pa++) { + len += strlen(*pa) + 1; + } + + buf = malloc(len+1); + if(!buf) nomem(); + + buf[0] = '\0'; + for(pa = parm_cmd+1; *pa; pa++) { + strcat(buf, " "); + strcat(buf, *pa); + } + + printf("%s: Success: about to exec %s -c %s\n",myname, + shell, buf+1); + fflush(stdout); + + if(parm_detach) detach(); + + execl(shell, shell, "-c", buf+1, (char *)NULL); + printf("%s: Error: %s - %s\n",myname, + shell, strerror(errno)); + exit(255); + } + + if(parm_exec) { + printf("%s: Success: about to exec %s with args\n",myname, + parm_exec[1]); + fflush(stdout); + + if(parm_detach) detach(); + + execvp(parm_exec[1], parm_exec+2); + printf("%s: Error: %s - %s\n",myname, + parm_exec[0], strerror(errno)); + exit(255); + } + + if(parm_generic_cmd) { + char buf[1024]; + + if(!parm_internal_local_commands + && !parm_internal_global_commands) { + printf( + "%s: Failure: No generic command directory!\n",myname); + exit(255); + } + + printf("%s: Success: about to exec generic command\n",myname); + fflush(stdout); + + if(parm_detach) detach(); + + /* Try context-specific generic commands first */ + if(parm_context) { + if(parm_internal_local_commands) { + strcpy(buf, parm_internal_local_commands); + strcat(buf, "/"); + strcat(buf, parm_context); + strcat(buf, "/"); + strcat(buf, parm_generic_cmd[1]); + execv(buf, parm_generic_cmd+1); + } + + if(parm_internal_global_commands) { + strcpy(buf, parm_internal_global_commands); + strcat(buf, "/"); + strcat(buf, parm_context); + strcat(buf, "/"); + strcat(buf, parm_generic_cmd[1]); + execv(buf, parm_generic_cmd+1); + } + } + + /* Failing that, try non-context-specific */ + if(parm_internal_local_commands) { + strcpy(buf, parm_internal_local_commands); + strcat(buf, "/"); + strcat(buf, parm_generic_cmd[1]); + execv(buf, parm_generic_cmd+1); + } + + if(parm_internal_global_commands) { + strcpy(buf, parm_internal_global_commands); + strcat(buf, "/"); + strcat(buf, parm_generic_cmd[1]); + execv(buf, parm_generic_cmd+1); + } + + printf("%s: Error: %s - %s\n",myname, + buf, strerror(errno)); + exit(255); + } + + printf("%s: Failure: No CMD, EXEC, or GENERIC-CMD.\n",myname); + exit(255); +} + +process(f, is_the_real_thing) +FILE *f; +int is_the_real_thing; +{ + int line_argc; + char **line_argv; + struct key *pk; + + while(1) { + if(!get_a_line(f, &line_argc, &line_argv)) { + if(is_the_real_thing) { + printf( + "%s: Failure: No blank line after request\n",myname); + exit(255); + } + return; + } + + if(line_argc == 0) { + if(is_the_real_thing) return; + continue; + } + + Strlwr(line_argv[0]); + for(pk = keys; pk->name; pk++) { + if(!strcmp(line_argv[0], pk->name)) { + (*pk->func)(line_argc, line_argv); + goto ok; + } + } + printf("%s: Failure: %s not recognized\n",myname, line_argv[0]); + exit(255); +ok: + ; + } +} + +void +key_internal_print(ac, av) +int ac; +char **av; +{ + printf("%s: Debug:",myname); + while(*++av) printf(" %s", *av); + printf("\n"); +} + +void +key_detach(ac,av) +int ac; +char **av; +{ + parm_detach = TRUE; +} + +void +key_nodetach(ac,av) +int ac; +char **av; +{ + parm_detach = FALSE; +} + +detach() +{ + /* I'm not exactly sure how you're supposed to handle stdio here */ + switch(fork()) { + case -1: + printf("%s: Error: fork - %s\n",myname, strerror(errno)); + exit(255); + case 0: + /* Child */ + close(0); + close(1); + close(2); + dup(dup(open("/dev/null", O_RDWR))); + return; + default: + /* Parent */ + _exit(0); + } +} + +putenv_with_prefix(prefix, name, value) +char *prefix; +char *name; +char *value; +{ + char *s; + + if(!value) return; + + s = malloc(strlen(prefix) + strlen(name) + strlen(value) + 3); + + if(!s) nomem(); + + sprintf(s, "%s_%s=%s", prefix, name, value); + + putenv(s); +} + +void +key_posix_umask(ac, av) +int ac; +char **av; +{ + unsigned i; + char *s; + + if(ac != 2) { + printf( + "%s: Failure: Malformed POSIX-UMASK - wrong number of args\n",myname); + exit(255); + } + + i = strtol(av[1], &s, 8); + + if(*s || i < 0 || i > 0777) { + printf( + "%s: Failure: Malformed POSIX-UMASK - bad arg\n",myname); + exit(255); + } + + umask(i); +} + +#ifdef NOPUTENV +/* + * define our own putenv() if the system doesn't have one. + * putenv(s): place s (a string of the form "NAME=value") in + * the environment; replacing any existing NAME. s is placed in + * environment, so if you change s, the environment changes (like + * putenv on a sun). Binding removed if you putenv something else + * called NAME. + */ +int +putenv(s) + char *s; +{ + char *v; + int varlen, idx; + extern char **environ; + char **newenv; + static int virgin = 1; /* true while "environ" is a virgin */ + + v = index(s, '='); + if(v == 0) + return 0; /* punt if it's not of the right form */ + varlen = (v + 1) - s; + + for (idx = 0; environ[idx] != 0; idx++) { + if (strncmp(environ[idx], s, varlen) == 0) { + if(v[1] != 0) { /* true if there's a value */ + environ[idx] = s; + return 0; + } else { + do { + environ[idx] = environ[idx+1]; + } while(environ[++idx] != 0); + return 0; + } + } + } + + /* add to environment (unless no value; then just return) */ + if(v[1] == 0) + return 0; + if(virgin) { + register i; + + newenv = (char **) malloc((unsigned) ((idx + 2) * sizeof(char*))); + if(newenv == 0) + return -1; + for(i = idx-1; i >= 0; --i) + newenv[i] = environ[i]; + virgin = 0; /* you're not a virgin anymore, sweety */ + } else { + newenv = (char **) realloc((char *) environ, + (unsigned) ((idx + 2) * sizeof(char*))); + if (newenv == 0) + return -1; + } + + environ = newenv; + environ[idx] = s; + environ[idx+1] = 0; + + return 0; +} +#endif /* NOPUTENV */ diff --git a/server.cpp b/server.cpp new file mode 100644 index 0000000..7e6d630 --- /dev/null +++ b/server.cpp @@ -0,0 +1,27 @@ +XCOMM! /bin/sh +XCOMM $Xorg: server.cpp,v 1.3 2000/08/17 19:54:01 cpqbld Exp $ +XCOMM + +XCOMM Copyright (c) 1993 Quarterdeck Office Systems +XCOMM +XCOMM Permission to use, copy, modify, distribute, and sell this software +XCOMM and software and its documentation for any purpose is hereby granted +XCOMM without fee, provided that the above copyright notice appear in all +XCOMM copies and that both that copyright notice and this permission +XCOMM notice appear in supporting documentation, and that the name +XCOMM Quarterdeck Office Systems, Inc. not be used in advertising or +XCOMM publicity pertaining to distribution of this software without +XCOMM specific, written prior permission. +XCOMM +XCOMM THIS SOFTWARE IS PROVIDED "AS-IS". QUARTERDECK OFFICE SYSTEMS, +XCOMM INC., DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +XCOMM INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF +XCOMM MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +XCOMM NONINFRINGEMENT. IN NO EVENT SHALL QUARTERDECK OFFICE SYSTEMS, +XCOMM INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL, +XCOMM INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR +XCOMM PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS +XCOMM OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT +XCOMM OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +exec LIBDIR/SERVERNAME.real -c LIBDIR/config |