summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:22 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 16:49:22 +0000
commitf29890c259861c45cfae71547d2683a198313836 (patch)
treec67a629fbd78068c16566d5bee921b945504d001
parent1dea1475a4beb620f350eda4ff0f902c9ec274a9 (diff)
-rw-r--r--io.c21
-rw-r--r--misc.c11
-rw-r--r--pm.c22
-rw-r--r--pm.h3
-rw-r--r--transport.c5
-rw-r--r--xfwp.h11
-rw-r--r--xfwp.man39
7 files changed, 70 insertions, 42 deletions
diff --git a/io.c b/io.c
index f0b2518..7660a0f 100644
--- a/io.c
+++ b/io.c
@@ -29,6 +29,7 @@ authorization from The Open Group.
X Window System is a trademark of The Open Group.
*/
+/* $XFree86: xc/programs/xfwp/io.c,v 1.11 2001/12/14 20:01:43 dawes Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -51,9 +52,6 @@ X Window System is a trademark of The Open Group.
#include "transport.h"
#include "io.h"
-#ifdef X_NOT_STDC_ENV
-extern int errno;
-#endif
/*
* Error messages returned to clients who are denied access
@@ -215,8 +213,9 @@ doProcessWritables(
* since we just wrote data to the conn_to fd, mark it as ready
* to check for reading when we go through select() the next time
*/
- if (client_conn_array[fd_counter]->conn_to != -1)
- FD_SET(client_conn_array[fd_counter]->conn_to, rinit);
+ if (client_conn_array[fd_counter] != NULL)
+ if (client_conn_array[fd_counter]->conn_to != -1)
+ FD_SET(client_conn_array[fd_counter]->conn_to, rinit);
} /* end else no errors on write */
} else
{
@@ -346,7 +345,7 @@ ProcessNewPMConnection (
*/
retval = getpeername(temp_sock_fd,
(struct sockaddr*)&temp_sockaddr_in,
- &addrlen);
+ (void *)&addrlen);
if (retval)
{
IceCloseConnection(new_ice_conn);
@@ -370,7 +369,7 @@ ProcessNewPMConnection (
* close the PM connection
*
*/
- (void) fprintf(stderr, "The Proxy Manager failed the configuration check\n");
+ (void) fprintf(stderr, "PM failed config check\n");
IceCloseConnection(new_ice_conn);
return;
}
@@ -460,7 +459,7 @@ ProcessPMInput (
break;
case IceProcessMessagesIOError:
- IceProcessMessagesConnectionClosed:
+ case IceProcessMessagesConnectionClosed:
if (process_status == IceProcessMessagesIOError)
/*
@@ -550,7 +549,7 @@ ProcessNewClientConnection (
if ((temp_sock_fd = accept(accept_fd,
(struct sockaddr *) &temp_sockaddr_in,
- &temp_sock_len)) < 0)
+ (void *)&temp_sock_len)) < 0)
{
(void) fprintf (stderr, "accept call for a client failed\n");
return;
@@ -1216,9 +1215,9 @@ doProcessReadables(
if (!client_conn_array[fd_counter])
{
/*
- * This can happen if the client was marked as closed by
- * doProcessWritables.
+ * Impossible - right?
*/
+ (void) fprintf (stderr, "input processing error\n");
return;
}
diff --git a/misc.c b/misc.c
index 93dab82..91496bf 100644
--- a/misc.c
+++ b/misc.c
@@ -28,6 +28,7 @@ authorization from The Open Group.
X Window System is a trademark of The Open Group.
*/
+/* $XFree86: xc/programs/xfwp/misc.c,v 1.7 2001/12/14 20:01:43 dawes Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -60,7 +61,7 @@ BadSyntax(
}
static void
-Usage()
+Usage(void)
{
(void) fprintf (stderr, "Usage: xfwp [-pdt <#secs>] [-clt <#secs>] \\\n");
(void) fprintf (stderr,
@@ -71,7 +72,7 @@ Usage()
}
static void
-MallocFailed()
+MallocFailed(void)
{
(void) fprintf(stderr, "Memory allocation failed, exiting\n");
exit(1);
@@ -874,7 +875,7 @@ doCheckTimeouts(
* but it really doesn't matter either way given the logic of the
* process readables and writables code
*/
- *nfds_ready--;
+ (*nfds_ready)--; /* XXX was *nfds_ready-- found spurious by gcc */
/*
* if you just shut this connection object down, you don't want
* to reset its creation date to now, so go to the next one
@@ -945,7 +946,7 @@ doCheckTimeouts(
close(server_array[client_listen_counter]->client_listen_fd);
free(server_array[client_listen_counter]);
server_array[client_listen_counter] = NULL;
- *nfds_ready--;
+ (*nfds_ready)--; /* XXX */
/*
* if you just shut this connection object down, you don't want
* to reset its creation date to now, so go to the next one
@@ -998,7 +999,7 @@ doCheckTimeouts(
close(pm_conn_array[pm_conn_counter]->fd);
free(pm_conn_array[pm_conn_counter]);
pm_conn_array[pm_conn_counter] = NULL;
- *nfds_ready--;
+ (*nfds_ready)--; /* XXX */
/*
* if you just shut this connection object down, you don't want
* to reset its creation date to now, so go to the next one
diff --git a/pm.c b/pm.c
index 4df1634..180cd3a 100644
--- a/pm.c
+++ b/pm.c
@@ -29,14 +29,30 @@ authorization from The Open Group.
X Window System is a trademark of The Open Group.
*/
+/* $XFree86: xc/programs/xfwp/pm.c,v 1.8 2002/09/18 17:11:56 tsi Exp $ */
#include <stdio.h>
#include <stdlib.h>
+#include <string.h> /* strdup */
#include <X11/Xos.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+
+#ifdef X_POSIX_C_SOURCE
+#define _POSIX_C_SOURCE X_POSIX_C_SOURCE
+#include <signal.h>
+#undef _POSIX_C_SOURCE
+#else
+#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE)
+#include <signal.h>
+#else
+#define _POSIX_SOURCE
#include <signal.h>
+#undef _POSIX_SOURCE
+#endif
+#endif
+
#include <X11/Xproto.h>
#include <X11/ICE/ICElib.h>
@@ -335,8 +351,8 @@ void FWPprocessMessages(
(void) fprintf(stderr, "Proxy Manager reported ICE Error:\n");
(void) fprintf(stderr, "\tclass = 0x%x, offending minor opcode = %d\n",
pMsg->errorClass, pMsg->offendingMinorOpcode);
- (void) fprintf(stderr, "\tseverity = %d, sequence = %d\n",
- pMsg->severity, pMsg->offendingSequenceNum);
+ (void) fprintf(stderr, "\tseverity = %d, sequence = %ld\n",
+ pMsg->severity, (long)pMsg->offendingSequenceNum);
IceDisposeCompleteMessage (iceConn, pStart);
@@ -514,7 +530,7 @@ MyIoErrorHandler (
}
void
-doInstallIOErrorHandler ()
+doInstallIOErrorHandler (void)
{
IceIOErrorHandler default_handler;
diff --git a/pm.h b/pm.h
index ae110cd..a886625 100644
--- a/pm.h
+++ b/pm.h
@@ -29,6 +29,7 @@ authorization from The Open Group.
X Window System is a trademark of The Open Group.
*/
+/* $XFree86: xc/programs/xfwp/pm.h,v 1.5 2001/12/14 20:01:43 dawes Exp $ */
#ifndef _PM_H
#define _PM_H
@@ -64,6 +65,6 @@ doSetupPMListen(
fd_set * rinit);
extern void
-doInstallIOErrorHandler ();
+doInstallIOErrorHandler (void);
#endif /* _PM_H */
diff --git a/transport.c b/transport.c
index 864ab6e..6def508 100644
--- a/transport.c
+++ b/transport.c
@@ -29,6 +29,7 @@ authorization from The Open Group.
X Window System is a trademark of The Open Group.
*/
+/* $XFree86: xc/programs/xfwp/transport.c,v 1.7 2001/12/14 20:01:43 dawes Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -40,10 +41,6 @@ X Window System is a trademark of The Open Group.
#include <X11/Xfuncs.h> /* Need for bzero() */
-#ifdef X_NOT_STDC_ENV
-extern int errno;
-#endif
-
#include <X11/ICE/ICElib.h> /* Need typedef for Bool */
#include "xfwp.h"
diff --git a/xfwp.h b/xfwp.h
index c34fcc6..13ffe7b 100644
--- a/xfwp.h
+++ b/xfwp.h
@@ -25,15 +25,22 @@ not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
+/* $XFree86: xc/programs/xfwp/xfwp.h,v 1.10 2001/12/14 20:01:44 dawes Exp $ */
#ifndef _XFWP_H
#define _XFWP_H
+#include <X11/Xos.h> /* struct timeval */
+
#define FALSE 0
#define TRUE 1
+#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef max
#define max(a,b) ((a) > (b) ? (a) : (b))
+#endif
/*
* Default connection array sizes
@@ -84,8 +91,10 @@ enum LOG_EVENTS {
CLIENT_REJECT_SERVER /* event 2: client conn rejected by server query */
};
+#ifdef notyet
typedef void fp1();
typedef Bool fp2();
+#endif
struct ICE_setup_info
{
@@ -93,8 +102,10 @@ struct ICE_setup_info
int opcode;
int versionCount;
IcePaVersionRec PMVersions[1];
+#ifdef notyet
void (*fp1) ();
Bool (*fp2) ();
+#endif
};
struct client_conn_buf
diff --git a/xfwp.man b/xfwp.man
index b830d08..3bf2c94 100644
--- a/xfwp.man
+++ b/xfwp.man
@@ -23,8 +23,11 @@
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.\"
+.\"
+.\" $XFree86: xc/programs/xfwp/xfwp.man,v 1.8 2001/12/14 20:01:44 dawes Exp $
+.\"
.nh
-.TH XFWP 1 "Release 6.4" "X Version 11"
+.TH XFWP 1 __xorgversion__
.SH NAME
xfwp - X firewall proxy
.SH SYNOPSIS
@@ -348,27 +351,27 @@ EXAMPLES
.sp
\fC
.nf
-# if and only if server supports one of these policies then authorize
-# connections, but still subject to applicable rule matches
-#
+\&# if and only if server supports one of these policies then authorize
+\&# connections, but still subject to applicable rule matches
+\&#
require sitepolicy policy1
require sitepolicy policy2
-#
-# deny pm connections originating on 8.7.6.5 [NOTE: If pm service
-# is explicitly qualified, line must include destination fields as
-# shown.]
-#
+\&#
+\&# deny pm connections originating on 8.7.6.5 [NOTE: If pm service
+\&# is explicitly qualified, line must include destination fields as
+\&# shown.]
+\&#
deny 8.7.6.5 0.0.0.0 0.0.0.0 255.255.255.255 eq pm
-#
-# permit xfindproxy X server connects to anywhere [NOTE: If
-# fp service is explicitly qualified, line must include source fields
-# as shown.]
-#
+\&#
+\&# permit xfindproxy X server connects to anywhere [NOTE: If
+\&# fp service is explicitly qualified, line must include source fields
+\&# as shown.]
+\&#
permit 0.0.0.0 255.255.255.255 0.0.0.0 255.255.255.255 eq fp
-#
-# permit all connection types originating from the 192.0.0.0
-# IP domain only
-#
+\&#
+\&# permit all connection types originating from the 192.0.0.0
+\&# IP domain only
+\&#
permit 192.0.0.0 0.255.255.255
.fi
\fP