pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/x11/xorg-libs Check set*uid for error, at least on Lin...
details: https://anonhg.NetBSD.org/pkgsrc/rev/3c3791ee2a4e
branches: trunk
changeset: 518610:3c3791ee2a4e
user: joerg <joerg%pkgsrc.org@localhost>
date: Thu Sep 14 16:52:54 2006 +0000
description:
Check set*uid for error, at least on Linux it can fail.
Bump revisions of xorg-clients, xorg-libs and xorg-server.
diffstat:
x11/xorg-libs/distinfo | 13 +++++++++++-
x11/xorg-libs/patches/patch-cj | 33 ++++++++++++++++++++++++++++++++
x11/xorg-libs/patches/patch-ck | 16 +++++++++++++++
x11/xorg-libs/patches/patch-cl | 17 ++++++++++++++++
x11/xorg-libs/patches/patch-cm | 17 ++++++++++++++++
x11/xorg-libs/patches/patch-cn | 16 +++++++++++++++
x11/xorg-libs/patches/patch-co | 43 ++++++++++++++++++++++++++++++++++++++++++
x11/xorg-libs/patches/patch-cp | 21 ++++++++++++++++++++
x11/xorg-libs/patches/patch-cq | 16 +++++++++++++++
x11/xorg-libs/patches/patch-cr | 17 ++++++++++++++++
x11/xorg-libs/patches/patch-cs | 24 +++++++++++++++++++++++
x11/xorg-libs/patches/patch-ct | 31 ++++++++++++++++++++++++++++++
12 files changed, 263 insertions(+), 1 deletions(-)
diffs (truncated from 319 to 300 lines):
diff -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/distinfo
--- a/x11/xorg-libs/distinfo Thu Sep 14 16:17:43 2006 +0000
+++ b/x11/xorg-libs/distinfo Thu Sep 14 16:52:54 2006 +0000
@@ -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-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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cj Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-ck
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-ck Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cl Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cm Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cn
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cn Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-co
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-co Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cp Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cq
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cq Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cr
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cr Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-cs Thu Sep 14 16:52:54 2006 +0000
@@ -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 -r 2d77c6a4c2d1 -r 3c3791ee2a4e x11/xorg-libs/patches/patch-ct
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/xorg-libs/patches/patch-ct Thu Sep 14 16:52:54 2006 +0000
@@ -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);
Home |
Main Index |
Thread Index |
Old Index