summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:47 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-17 19:03:47 +0000
commitea6ccddfd94db3669d66495590c413cf4627a562 (patch)
tree4d8d4dde0e4d131645db05ed29b1d7246d469372
parent2416645e0f054d5b400a1ab22065acbe3d7bffb6 (diff)
merge XFree86 4.3.0.1 to -CURRENT
-rw-r--r--auth.c26
-rw-r--r--rstart.man5
-rw-r--r--rstartd.man15
-rw-r--r--server.c121
-rw-r--r--server.cpp2
5 files changed, 103 insertions, 66 deletions
diff --git a/auth.c b/auth.c
index 7430b60..5a1e2fc 100644
--- a/auth.c
+++ b/auth.c
@@ -23,18 +23,28 @@
/* OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT */
/* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
/************************************************************************/
+/* $XFree86: xc/programs/rstart/auth.c,v 1.5 2001/07/25 15:05:15 dawes Exp $ */
#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>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+
+static char * Strupr ( char *s0 );
+struct auth_info * find_or_create_auth ( char *s );
+void key_auth ( int ac, char **av );
+void key_internal_auth_program ( int ac, char **av );
+void key_internal_auth_input ( int ac, char **av );
+void do_auth ( void );
+char * expand ( char *s, int ac, char **av );
+
+/* server.c */
+extern void nomem ( void );
-extern char *expand();
extern char myname[];
struct list_of_argv {
@@ -92,6 +102,7 @@ char *s;
return auth;
}
+void
key_auth(ac, av)
int ac;
char **av;
@@ -116,6 +127,7 @@ char **av;
auth->data = lav;
}
+void
key_internal_auth_program(ac, av)
int ac;
char **av;
@@ -132,6 +144,7 @@ char **av;
auth->program = av + 2;
}
+void
key_internal_auth_input(ac, av)
int ac;
char **av;
@@ -148,7 +161,8 @@ char **av;
auth->input = av + 2;
}
-do_auth()
+void
+do_auth(void)
{
struct auth_info *auth;
int p[2];
diff --git a/rstart.man b/rstart.man
index c820812..cd187c0 100644
--- a/rstart.man
+++ b/rstart.man
@@ -18,6 +18,9 @@
.\" 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.
+.\"
+.\" $XFree86: xc/programs/rstart/rstart.man,v 1.6 2001/01/27 18:21:05 dawes Exp $
+.\"
.hy 0 \" I hate hyphenation.
.de EX \"Begin example
.ne 5
@@ -33,7 +36,7 @@
.if t .sp .5
..
.ta .3i .6i .9i 1.2i 1.5i 1.8i
-.TH RSTART 1 "Release 6.4" "X Version 11"
+.TH RSTART 1 __xorgversion__
.SH NAME
rstart - a sample implementation of a Remote Start client
.SH SYNOPSIS
diff --git a/rstartd.man b/rstartd.man
index c3683fe..dd56e81 100644
--- a/rstartd.man
+++ b/rstartd.man
@@ -18,6 +18,9 @@
.\" 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.
+.\"
+.\" $XFree86: xc/programs/rstart/rstartd.man,v 1.7 2002/10/12 16:06:45 herrb Exp $
+.\"
.hy 0 \" I hate hyphenation.
.de EX \"Begin example
.ne 5
@@ -33,7 +36,7 @@
.if t .sp .5
..
.ta .3i .6i .9i 1.2i 1.5i 1.8i
-.TH RSTARTD 1 "Release 6.4" "X Version 11"
+.TH RSTARTD 1 __xorgversion__
.SH NAME
rstartd - a sample implementation of a Remote Start rsh helper
.SH SYNOPSIS
@@ -55,8 +58,8 @@ 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.
+without the -c option, it reads
+.IR __projectroot__/lib/X11/rstart/config .
.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"
@@ -97,7 +100,7 @@ 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.
+__projectroot__/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.
@@ -136,9 +139,9 @@ cat both the global and local copies of @List.
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>)
+global per-context directory (__projectroot__/lib/X11/rstart/commands/<context>)
per-user all-contexts directory ($HOME/.rstart.commands)
-global all-contexts directory (<XRoot>/lib/X11/rstart/commands)
+global all-contexts directory (__projectroot__/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.)
diff --git a/server.c b/server.c
index b7d652a..b404c55 100644
--- a/server.c
+++ b/server.c
@@ -23,19 +23,14 @@
/* OF WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT */
/* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
/************************************************************************/
+/* $XFree86: xc/programs/rstart/server.c,v 1.5 2001/07/25 15:05:15 dawes Exp $ */
/* 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
@@ -45,54 +40,68 @@ extern char *getenv();
#define TRUE 1
#define FALSE 0
+extern void squish_out_escapes ( char *s );
+extern char * Strdup ( char *s );
+extern int get_a_line ( FILE *f, int *pargc, char ***pargv );
+extern void nomem ( void );
+static char *Strlwr ( char *s0 );
+extern void do_it ( void );
+extern void process ( FILE *f, int is_the_real_thing );
+extern void detach ( void );
+extern void putenv_with_prefix ( char *prefix, char *name, char *value );
+
+/* auth.c */
+extern void do_auth ( void );
+
struct key {
char *name;
- void (*func)();
+ void (*func)(int ac, char **av);
};
-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();
+extern void key_cmd(int ac, char **av);
+extern void key_exec(int ac, char **av);
+extern void key_context(int ac, char **av);
+extern void key_misc(int ac, char **av);
+extern void key_generic_cmd(int ac, char **av);
+extern void key_dir(int ac, char **av);
+extern void key_detach(int ac, char **av);
+extern void key_nodetach(int ac, char **av);
+extern void key_posix_umask(int ac, char **av);
+extern void key_auth(int ac, char **av);
+extern void key_internal_registries(int ac, char **av);
+extern void key_internal_local_default(int ac, char **av);
+extern void key_internal_global_contexts(int ac, char **av);
+extern void key_internal_local_contexts(int ac, char **av);
+extern void key_internal_global_commands(int ac, char **av);
+extern void key_internal_local_commands(int ac, char **av);
+extern void key_internal_variable_prefix(int ac, char **av);
+extern void key_internal_print(int ac, char **av);
+extern void key_internal_auth_program(int ac, char **av);
+extern void key_internal_auth_input(int ac, char **av);
+
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,
+ { "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, NULL }
};
@@ -113,9 +122,8 @@ int parm_detach = FALSE;
char *parm_global_default = DEFAULT_CONFIG;
char myname[]=SERVERNAME;
-main(argc, argv)
-int argc;
-char **argv;
+int
+main(int argc, char *argv[])
{
FILE *f;
@@ -140,8 +148,10 @@ char **argv;
process(stdin, TRUE);
do_it();
+ exit(0);
}
+void
squish_out_escapes(s)
char *s;
{
@@ -250,6 +260,7 @@ char ***pargv;
return TRUE;
}
+void
nomem()
{
printf("%s: Failure: Out of memory\n",myname);
@@ -515,7 +526,8 @@ char **av;
parm_generic_cmd = av;
}
-do_it()
+void
+do_it(void)
{
if(parm_dir) {
if(chdir(parm_dir)) {
@@ -647,6 +659,7 @@ do_it()
exit(255);
}
+void
process(f, is_the_real_thing)
FILE *f;
int is_the_real_thing;
@@ -710,7 +723,8 @@ char **av;
parm_detach = FALSE;
}
-detach()
+void
+detach(void)
{
/* I'm not exactly sure how you're supposed to handle stdio here */
switch(fork()) {
@@ -730,6 +744,7 @@ detach()
}
}
+void
putenv_with_prefix(prefix, name, value)
char *prefix;
char *name;
diff --git a/server.cpp b/server.cpp
index 7e6d630..f8d0801 100644
--- a/server.cpp
+++ b/server.cpp
@@ -23,5 +23,7 @@ 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
+XCOMM $XFree86: xc/programs/rstart/server.cpp,v 3.2 2001/01/17 23:45:03 dawes Exp $
exec LIBDIR/SERVERNAME.real -c LIBDIR/config