diff options
author | joerg <joerg> | 2006-09-14 16:52:54 +0000 |
---|---|---|
committer | joerg <joerg> | 2006-09-14 16:52:54 +0000 |
commit | cdf46a75082d5558dc712201c84a6f8e33cfc59b (patch) | |
tree | 9c2a637142d32b8aa0e0fdb927333e72df34ab1f | |
parent | 60c286c0802c571a7e0d7a5f69cbfd29182d8db6 (diff) | |
download | pkgsrc-cdf46a75082d5558dc712201c84a6f8e33cfc59b.tar.gz |
Check set*uid for error, at least on Linux it can fail.
Bump revisions of xorg-clients, xorg-libs and xorg-server.
-rw-r--r-- | x11/xorg-libs/distinfo | 13 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cj | 33 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-ck | 16 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cl | 17 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cm | 17 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cn | 16 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-co | 43 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cp | 21 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cq | 16 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cr | 17 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-cs | 24 | ||||
-rw-r--r-- | x11/xorg-libs/patches/patch-ct | 31 |
12 files changed, 263 insertions, 1 deletions
diff --git a/x11/xorg-libs/distinfo b/x11/xorg-libs/distinfo index 993a9fd26b6..6a49b66e3e4 100644 --- a/x11/xorg-libs/distinfo +++ b/x11/xorg-libs/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.53 2006/09/13 12:27:26 joerg Exp $ +$NetBSD: distinfo,v 1.54 2006/09/14 16:52:54 joerg Exp $ SHA1 (X11R6.9.0-src1.tar.gz) = a6c077ed8fdeee5fe1956a427c4cb0bc266e1bef RMD160 (X11R6.9.0-src1.tar.gz) = d12270a4f41a3ceee4bfd5da22d387a3aa707df8 @@ -62,3 +62,14 @@ SHA1 (patch-cf) = ec178ce36dbcd9b65d49584aa80e080b6f11132a SHA1 (patch-cg) = 82b40c8e39305bd320a88498c7202dc6e1e11743 SHA1 (patch-ch) = e09e3fe3dd14caa70d2bcee1b58a72db0851632c SHA1 (patch-ci) = eaba43892d9968cf268ce1c0efe31a14c1a56ed5 +SHA1 (patch-cj) = 2eb6dd78ef66b25a7f821fe65e03a66dcb40d90f +SHA1 (patch-ck) = 672f0af1ed67ead19bd2edf3afdaefcaaefa73d2 +SHA1 (patch-cl) = 296d1dd7d7c4f64f4b9b7e878538ed5ceda2520d +SHA1 (patch-cm) = d687dc6a731715eefda76e9797ce40daa120d7fd +SHA1 (patch-cn) = 60949f6c04d93f4936594a8cc3edd753d8201b9e +SHA1 (patch-co) = 92832fb4a61dbff18ca15d8963e58420b29e7b22 +SHA1 (patch-cp) = 633ece071dd407721bb6de780df2f4255a958938 +SHA1 (patch-cq) = ea8659818ffec0db8a1d11a2a45c3cdcce8b85bc +SHA1 (patch-cr) = c613afdca92b36a1a34264a53f9eaf4a8276a5fa +SHA1 (patch-cs) = 686c444c42acbbae4030ff198bcd4fbd08e7a0e3 +SHA1 (patch-ct) = 96084456c2d7d4aaf05b2eebd13be2e575cead29 diff --git a/x11/xorg-libs/patches/patch-cj b/x11/xorg-libs/patches/patch-cj new file mode 100644 index 00000000000..c397f31c65e --- /dev/null +++ b/x11/xorg-libs/patches/patch-cj @@ -0,0 +1,33 @@ +$NetBSD: patch-cj,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/xload/xload.c.orig 2004-04-23 21:54:57.000000000 +0200 ++++ programs/xload/xload.c +@@ -34,7 +34,7 @@ from the X Consortium. + * xload - display system load average in a window + */ + +- ++#include <errno.h> + #include <stdio.h> + #include <stdlib.h> + #include <unistd.h> +@@ -162,8 +162,17 @@ main(int argc, char **argv) + /* For security reasons, we reset our uid/gid after doing the necessary + system initialization and before calling any X routines. */ + InitLoadPoint(); +- setgid(getgid()); /* reset gid first while still (maybe) root */ +- setuid(getuid()); ++ /* reset gid first while still (maybe) root */ ++ if (setgid(getgid()) == -1) { ++ fprintf(stderr, "%s: setgid failed: %s\n", ++ ProgramName, strerror(errno)); ++ exit(1); ++ } ++ if (setuid(getuid()) == -1) { ++ fprintf(stderr, "%s: setuid failed: %s\n", ++ ProgramName, strerror(errno)); ++ exit(1); ++ } + + XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); + diff --git a/x11/xorg-libs/patches/patch-ck b/x11/xorg-libs/patches/patch-ck new file mode 100644 index 00000000000..101de0181de --- /dev/null +++ b/x11/xorg-libs/patches/patch-ck @@ -0,0 +1,16 @@ +$NetBSD: patch-ck,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/xinit/xinit.c.orig 2005-10-04 03:27:34.000000000 +0200 ++++ programs/xinit/xinit.c +@@ -692,7 +692,10 @@ static int + startClient(char *client[]) + { + if ((clientpid = vfork()) == 0) { +- setuid(getuid()); ++ if (setuid(getuid()) == -1) { ++ Error("cannot change uid: %s\n", strerror(errno)); ++ _exit(ERR_EXIT); ++ } + setpgrp(0, getpid()); + environ = newenviron; + #ifdef __UNIXOS2__ diff --git a/x11/xorg-libs/patches/patch-cl b/x11/xorg-libs/patches/patch-cl new file mode 100644 index 00000000000..9173b454931 --- /dev/null +++ b/x11/xorg-libs/patches/patch-cl @@ -0,0 +1,17 @@ +$NetBSD: patch-cl,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/Xserver/hw/xfree86/common/xf86Init.c.orig 2006-09-13 14:25:27.000000000 +0200 ++++ programs/Xserver/hw/xfree86/common/xf86Init.c +@@ -1905,7 +1905,11 @@ xf86RunVtInit(void) + FatalError("xf86RunVtInit: fork failed (%s)\n", strerror(errno)); + break; + case 0: /* child */ +- setuid(getuid()); ++ if (setuid(getuid()) == -1) { ++ xf86Msg(X_ERROR, "xf86RunVtInit: setuid failed (%s)\n", ++ strerror(errno)); ++ exit(255); ++ } + /* set stdin, stdout to the consoleFd */ + for (i = 0; i < 2; i++) { + if (xf86Info.consoleFd != i) { diff --git a/x11/xorg-libs/patches/patch-cm b/x11/xorg-libs/patches/patch-cm new file mode 100644 index 00000000000..fc6ffa9bdff --- /dev/null +++ b/x11/xorg-libs/patches/patch-cm @@ -0,0 +1,17 @@ +$NetBSD: patch-cm,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/xdm/xdmshell.c.orig 2005-07-15 00:58:25.000000000 +0200 ++++ programs/xdm/xdmshell.c +@@ -183,7 +183,11 @@ main ( + #endif + + /* make xdm run in a non-setuid environment */ +- setuid (geteuid()); ++ if (setuid (geteuid()) == -1) { ++ fprintf(stderr, "%s: cannot setuid (error %d, %s)\r\n", ++ ProgramName, errno, strerror(errno)); ++ exit(1); ++ } + + /* + * exec /usr/bin/X11/xdm -nodaemon -udpPort 0 diff --git a/x11/xorg-libs/patches/patch-cn b/x11/xorg-libs/patches/patch-cn new file mode 100644 index 00000000000..68b4f8c6644 --- /dev/null +++ b/x11/xorg-libs/patches/patch-cn @@ -0,0 +1,16 @@ +$NetBSD: patch-cn,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/Xserver/hw/xfree86/parser/write.c.orig 2005-07-03 09:01:37.000000000 +0200 ++++ programs/Xserver/hw/xfree86/parser/write.c +@@ -170,7 +170,10 @@ xf86writeConfigFile (const char *filenam + strerror(errno)); + return 0; + case 0: /* child */ +- setuid(getuid()); ++ if (setuid(getuid() == -1) ++ FatalError("xf86writeConfigFile(): " ++ "setuid failed(%s)\n", ++ strerror(errno)); + ret = doWriteConfigFile(filename, cptr); + exit(ret); + break; diff --git a/x11/xorg-libs/patches/patch-co b/x11/xorg-libs/patches/patch-co new file mode 100644 index 00000000000..e922750181a --- /dev/null +++ b/x11/xorg-libs/patches/patch-co @@ -0,0 +1,43 @@ +$NetBSD: patch-co,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/Xserver/os/utils.c.orig 2005-11-08 07:33:30.000000000 +0100 ++++ programs/Xserver/os/utils.c +@@ -1718,8 +1718,10 @@ System(char *command) + case -1: /* error */ + p = -1; + case 0: /* child */ +- setgid(getgid()); +- setuid(getuid()); ++ if (setgid(getgid()) == -1) ++ _exit(127); ++ if (setuid(getuid()) == -1) ++ _exit(127); + execl("/bin/sh", "sh", "-c", command, (char *)NULL); + _exit(127); + default: /* parent */ +@@ -1770,8 +1772,10 @@ Popen(char *command, char *type) + xfree(cur); + return NULL; + case 0: /* child */ +- setgid(getgid()); +- setuid(getuid()); ++ if (setgid(getgid()) == -1) ++ _exit(127); ++ if (setuid(getuid()) == -1) ++ _exit(127); + if (*type == 'r') { + if (pdes[1] != 1) { + /* stdout */ +@@ -1845,8 +1849,10 @@ Fopen(char *file, char *type) + xfree(cur); + return NULL; + case 0: /* child */ +- setgid(getgid()); +- setuid(getuid()); ++ if (setgid(getgid()) == -1) ++ _exit(127); ++ if (setuid(getuid()) == -1) ++ _exit(127); + if (*type == 'r') { + if (pdes[1] != 1) { + /* stdout */ diff --git a/x11/xorg-libs/patches/patch-cp b/x11/xorg-libs/patches/patch-cp new file mode 100644 index 00000000000..e03f4ce8417 --- /dev/null +++ b/x11/xorg-libs/patches/patch-cp @@ -0,0 +1,21 @@ +$NetBSD: patch-cp,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/xdm/session.c.orig 2005-11-08 07:33:31.000000000 +0100 ++++ programs/xdm/session.c +@@ -488,8 +488,14 @@ SessionExit (struct display *d, int stat + else + ResetServer (d); + if (removeAuth) { +- setgid (verify.gid); +- setuid (verify.uid); ++ if (setgid (verify.gid) == -1) { ++ LogError( "SessionExit: setgid: %s\n", strerror(errno)); ++ exit(status); ++ } ++ if (setuid (verify.uid) == -1) { ++ LogError( "SessionExit: setuid: %s\n", strerror(errno)); ++ exit(status); ++ } + RemoveUserAuthorization (d, &verify); + #ifdef K5AUTH + /* do like "kdestroy" program */ diff --git a/x11/xorg-libs/patches/patch-cq b/x11/xorg-libs/patches/patch-cq new file mode 100644 index 00000000000..098cc67f46b --- /dev/null +++ b/x11/xorg-libs/patches/patch-cq @@ -0,0 +1,16 @@ +$NetBSD: patch-cq,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c.orig 2005-07-03 10:53:48.000000000 +0200 ++++ programs/Xserver/hw/xfree86/os-support/shared/libc_wrapper.c +@@ -1270,7 +1270,10 @@ xf86execl(const char *pathname, const ch + #ifndef SELF_CONTAINED_WRAPPER + xf86DisableIO(); + #endif +- setuid(getuid()); ++ if (setuid(getuid()) == -1) { ++ ErrorF("xf86Execl: setuid() failed: %s\n", strerror(errno)); ++ exit(255); ++ } + #if !defined(SELF_CONTAINED_WRAPPER) + /* set stdin, stdout to the consoleFD, and leave stderr alone */ + for (i = 0; i < 2; i++) diff --git a/x11/xorg-libs/patches/patch-cr b/x11/xorg-libs/patches/patch-cr new file mode 100644 index 00000000000..2dd19fb87e8 --- /dev/null +++ b/x11/xorg-libs/patches/patch-cr @@ -0,0 +1,17 @@ +$NetBSD: patch-cr,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- lib/X11/lcFile.c.orig 2005-05-14 00:53:44.000000000 +0200 ++++ lib/X11/lcFile.c +@@ -269,7 +269,11 @@ xlocaledir( + if (seteuid(0) != 0) { + priv = 0; + } else { +- seteuid(oldeuid); ++ if (seteuid(oldeuid) == -1) { ++ /* XXX ouch, coudn't get back to original uid ++ what can we do ??? */ ++ _exit(127); ++ } + priv = 1; + } + #endif diff --git a/x11/xorg-libs/patches/patch-cs b/x11/xorg-libs/patches/patch-cs new file mode 100644 index 00000000000..52e6ec2a15c --- /dev/null +++ b/x11/xorg-libs/patches/patch-cs @@ -0,0 +1,24 @@ +$NetBSD: patch-cs,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- programs/xf86dga/dga.c.orig 2004-04-23 21:54:47.000000000 +0200 ++++ programs/xf86dga/dga.c +@@ -16,6 +16,7 @@ + #include <X11/Xmd.h> + #include <X11/extensions/xf86dga.h> + #include <ctype.h> ++#include <errno.h> + #include <stdio.h> + #include <stdlib.h> + #include <signal.h> +@@ -141,7 +142,10 @@ main(int argc, char *argv[]) + + #ifndef __UNIXOS2__ + /* Give up root privs */ +- setuid(getuid()); ++ if (setuid(getuid()) == -1) { ++ fprintf(stderr, "Unable to change uid: %s\n", strerror(errno)); ++ exit(2); ++ } + #endif + + XF86DGASetViewPort(dis, DefaultScreen(dis), 0, 0); diff --git a/x11/xorg-libs/patches/patch-ct b/x11/xorg-libs/patches/patch-ct new file mode 100644 index 00000000000..07552134000 --- /dev/null +++ b/x11/xorg-libs/patches/patch-ct @@ -0,0 +1,31 @@ +$NetBSD: patch-ct,v 1.1 2006/09/14 16:52:54 joerg Exp $ + +--- lib/xtrans/Xtranslcl.c.orig 2005-11-08 07:33:26.000000000 +0100 ++++ lib/xtrans/Xtranslcl.c +@@ -360,7 +360,10 @@ TRANS(PTSOpenClient)(XtransConnInfo cipt + uid_t saved_euid; + + saved_euid = geteuid(); +- setuid( getuid() ); /** sets the euid to the actual/real uid **/ ++ /** sets the euid to the actual/real uid **/ ++ if (setuid( getuid() ) == -1) { ++ exit(1); ++ } + if( chown( slave, saved_euid, -1 ) < 0 ) { + exit( 1 ); + } +@@ -369,7 +372,13 @@ TRANS(PTSOpenClient)(XtransConnInfo cipt + } + + waitpid(saved_pid, &exitval, 0); +- ++ if (WIFEXITED(exitval) && WEXITSTATUS(exitval) != 0) { ++ close(fd); ++ close(server); ++ PRMSG(1, "PTSOpenClient: cannot set the owner of %s\n", ++ slave, 0, 0); ++ return(-1); ++ } + if (chmod(slave, 0666) < 0) { + close(fd); + close(server); |