summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-09-19 07:25:55 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-09-19 07:25:55 -0400
commit97c150b61bbe436453b05d3c07cd2173870aac40 (patch)
tree5335d0df93703e7ca8617cfae57315709d032a29 /os
parent57907e0943da0c3fd3bf6c128d210b544629ce72 (diff)
parent547ad2125ece93bbe01f6d09a3baf176ebd16bb3 (diff)
Merge branch 'master' into XACE-SELINUX
Conflicts: afb/afbpntwin.c afb/afbscrinit.c afb/afbwindow.c cfb/cfb.h cfb/cfballpriv.c cfb/cfbscrinit.c cfb/cfbwindow.c configure.ac fb/wfbrename.h hw/xfree86/xf4bpp/ppcIO.c hw/xfree86/xf4bpp/ppcPntWin.c hw/xfree86/xf4bpp/ppcWindow.c hw/xfree86/xf8_32bpp/cfbscrinit.c mfb/mfb.h mfb/mfbpntwin.c mfb/mfbscrinit.c mfb/mfbwindow.c mi/miexpose.c Note: conflicts caused by devPrivates rework vs. paintwindow changes.
Diffstat (limited to 'os')
-rw-r--r--os/connection.c15
-rw-r--r--os/io.c4
-rw-r--r--os/osdep.h3
-rw-r--r--os/utils.c8
4 files changed, 26 insertions, 4 deletions
diff --git a/os/connection.c b/os/connection.c
index afe392c66..3d9d2e919 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -74,6 +74,9 @@ SOFTWARE.
#define TRANS_SERVER
#define TRANS_REOPEN
#include <X11/Xtrans/Xtrans.h>
+#ifdef HAVE_LAUNCHD
+#include <X11/Xtrans/Xtransint.h>
+#endif
#include <errno.h>
#include <signal.h>
#include <stdio.h>
@@ -657,10 +660,21 @@ ClientAuthorized(ClientPtr client,
XID auth_id;
char *reason = NULL;
XtransConnInfo trans_conn;
+#ifdef HAVE_LAUNCHD
+ struct sockaddr *saddr;
+#endif
priv = (OsCommPtr)client->osPrivate;
trans_conn = priv->trans_conn;
+#ifdef HAVE_LAUNCHD
+ saddr = (struct sockaddr *) (trans_conn->addr);
+ /* Allow any client to connect without authorization on a launchd socket,
+ because it is securely created -- this prevents a race condition on launch */
+ if (saddr->sa_len > 11 && saddr->sa_family == AF_UNIX &&
+ !strncmp(saddr->sa_data, "/tmp/launch", 11)) goto done;
+#endif
+
auth_id = CheckAuthorization (proto_n, auth_proto,
string_n, auth_string, client, &reason);
@@ -710,6 +724,7 @@ ClientAuthorized(ClientPtr client,
}
}
priv->auth_id = auth_id;
+ done:
priv->conn_time = 0;
#ifdef XDMCP
diff --git a/os/io.c b/os/io.c
index 835af54d9..9de75eeaa 100644
--- a/os/io.c
+++ b/os/io.c
@@ -304,12 +304,14 @@ ReadRequestFromClient(ClientPtr client)
*/
oci->lenLastReq = 0;
- if (needed > MAXBUFSIZE)
+#ifdef BIGREQS
+ if (needed > maxBigRequestSize << 2)
{
/* request is too big for us to handle */
YieldControlDeath();
return -1;
}
+#endif
if ((gotnow == 0) ||
((oci->bufptr - oci->buffer + needed) > oci->size))
{
diff --git a/os/osdep.h b/os/osdep.h
index 0c07a9004..b6894c146 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -55,9 +55,6 @@ SOFTWARE.
#define BOTIMEOUT 200 /* in milliseconds */
#define BUFSIZE 4096
#define BUFWATERMARK 8192
-#ifndef MAXBUFSIZE
-#define MAXBUFSIZE (1 << 22)
-#endif
#include <X11/Xdmcp.h>
diff --git a/os/utils.c b/os/utils.c
index 3bb7dbeba..144098b37 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1720,6 +1720,8 @@ static struct pid {
int pid;
} *pidlist;
+void (*old_alarm)(int) = NULL; /* XXX horrible awful hack */
+
pointer
Popen(char *command, char *type)
{
@@ -1741,11 +1743,15 @@ Popen(char *command, char *type)
return NULL;
}
+ /* Ignore the smart scheduler while this is going on */
+ old_alarm = signal(SIGALRM, SIG_IGN);
+
switch (pid = fork()) {
case -1: /* error */
close(pdes[0]);
close(pdes[1]);
xfree(cur);
+ signal(SIGALRM, old_alarm);
return NULL;
case 0: /* child */
if (setgid(getgid()) == -1)
@@ -1921,6 +1927,8 @@ Pclose(pointer iop)
/* allow EINTR again */
OsReleaseSignals ();
+ signal(SIGALRM, old_alarm);
+
return pid == -1 ? -1 : pstat;
}