xserver: Branch 'master' - 6 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Sep 1 20:13:42 UTC 2024


 hw/xfree86/common/xf86Init.c |    5 -
 os/utils.c                   |  118 +++++--------------------------------------
 2 files changed, 16 insertions(+), 107 deletions(-)

New commits:
commit aef17edd92949e4fc246fdcc3d313f929f5c63c5
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Fri May 3 17:58:11 2024 +0200

    os: utils: drop obsolete REMOVE_ENV_LD conditional
    
    This always had been set since it's incarnation back two decades
    ago, on XFree86 4.3.0.1. Probably no need to keep that around anymore.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518>

diff --git a/os/utils.c b/os/utils.c
index 3143ad583..6db344403 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1416,11 +1416,6 @@ PrivsElevated(void)
  * external wrapper utility.
  */
 
-/* Consider LD* variables insecure? */
-#ifndef REMOVE_ENV_LD
-#define REMOVE_ENV_LD 1
-#endif
-
 /* Check args and env only if running setuid (euid == 0 && euid != uid) ? */
 #ifndef CHECK_EUID
 #ifndef WIN32
@@ -1490,13 +1485,11 @@ CheckUserParameters(int argc, char **argv, char **envp)
             for (i = 0; envp[i]; i++) {
 
                 /* Check for bad environment variables and values */
-#if REMOVE_ENV_LD
                 while (envp[i] && (strncmp(envp[i], "LD", 2) == 0)) {
                     for (j = i; envp[j]; j++) {
                         envp[j] = envp[j + 1];
                     }
                 }
-#endif
                 if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) {
                     for (j = i; envp[j]; j++) {
                         envp[j] = envp[j + 1];
commit 4b94e4fa0813e291c964441a80fbd21e417fe435
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Fri May 3 12:58:19 2024 +0200

    os: utils: drop unused USE_ISPRINT
    
    This always had been disabled since it's incarnation XFree86 4.3.0.1,
    back two decades ago, so there's likely no need for it.
    
    Fixes: d568221710959cf7d783e6ff0fb80fb43a231124
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518>

diff --git a/os/utils.c b/os/utils.c
index cbdae0182..3143ad583 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1430,24 +1430,11 @@ PrivsElevated(void)
 #endif
 #endif
 
-/*
- * Maybe the locale can be faked to make isprint(3) report that everything
- * is printable?  Avoid it by default.
- */
-#ifndef USE_ISPRINT
-#define USE_ISPRINT 0
-#endif
-
 #define MAX_ARG_LENGTH          128
 #define MAX_ENV_LENGTH          256
 #define MAX_ENV_PATH_LENGTH     2048    /* Limit for *PATH and TERMCAP */
 
-#if USE_ISPRINT
-#include <ctype.h>
-#define checkPrintable(c) isprint(c)
-#else
 #define checkPrintable(c) (((c) & 0x7f) >= 0x20 && ((c) & 0x7f) != 0x7f)
-#endif
 
 enum BadCode {
     NotBad = 0,
commit b5d897d126f8fafea14ac2032b8eea8815840ed8
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu May 2 20:14:40 2024 +0200

    os: utils: drop REMOVE_LONG_ENV conditional
    
    This always had been enabled since it's incarnation back two decades ago,
    so it doesn't seem to be necessary keeping that conditional any longer.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518>

diff --git a/os/utils.c b/os/utils.c
index 79fcb5f77..cbdae0182 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1421,11 +1421,6 @@ PrivsElevated(void)
 #define REMOVE_ENV_LD 1
 #endif
 
-/* Remove long environment variables? */
-#ifndef REMOVE_LONG_ENV
-#define REMOVE_LONG_ENV 1
-#endif
-
 /* Check args and env only if running setuid (euid == 0 && euid != uid) ? */
 #ifndef CHECK_EUID
 #ifndef WIN32
@@ -1459,7 +1454,6 @@ enum BadCode {
     UnsafeArg,
     ArgTooLong,
     UnprintableArg,
-    EnvTooLong,
     InternalError
 };
 
@@ -1474,7 +1468,7 @@ CheckUserParameters(int argc, char **argv, char **envp)
 {
     enum BadCode bad = NotBad;
     int i = 0, j;
-    char *a, *e = NULL;
+    char *a = NULL;
 
 #if CHECK_EUID
     if (PrivsElevated())
@@ -1517,40 +1511,10 @@ CheckUserParameters(int argc, char **argv, char **envp)
                 }
 #endif
                 if (envp[i] && (strlen(envp[i]) > MAX_ENV_LENGTH)) {
-#if REMOVE_LONG_ENV
                     for (j = i; envp[j]; j++) {
                         envp[j] = envp[j + 1];
                     }
                     i--;
-#else
-                    char *eq;
-                    int len;
-
-                    eq = strchr(envp[i], '=');
-                    if (!eq)
-                        continue;
-                    len = eq - envp[i];
-                    e = strndup(envp[i], len);
-                    if (!e) {
-                        bad = InternalError;
-                        break;
-                    }
-                    if (len >= 4 &&
-                        (strcmp(e + len - 4, "PATH") == 0 ||
-                         strcmp(e, "TERMCAP") == 0)) {
-                        if (strlen(envp[i]) > MAX_ENV_PATH_LENGTH) {
-                            bad = EnvTooLong;
-                            break;
-                        }
-                        else {
-                            free(e);
-                        }
-                    }
-                    else {
-                        bad = EnvTooLong;
-                        break;
-                    }
-#endif
                 }
             }
         }
@@ -1568,9 +1532,6 @@ CheckUserParameters(int argc, char **argv, char **envp)
         ErrorF("Command line argument number %d contains unprintable"
                " characters\n", i);
         break;
-    case EnvTooLong:
-        ErrorF("Environment variable `%s' is too long\n", e);
-        break;
     case InternalError:
         ErrorF("Internal Error\n");
         break;
commit 6c6944be14c6c2d80ca29e5c735487c8ce392f7d
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu May 2 20:07:03 2024 +0200

    os: utils: drop unused VENDORSUPPORT
    
    This doesn't seem to be used anymore for two decades now,
    so there's probably no need to keep it any longer.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518>

diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 1a4da4eb8..97c691975 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -856,13 +856,8 @@ ddxGiveUp(enum ExitCode error)
 void
 OsVendorFatalError(const char *f, va_list args)
 {
-#ifdef VENDORSUPPORT
-    ErrorFSigSafe("\nPlease refer to your Operating System Vendor support "
-                 "pages\nat %s for support on this crash.\n", VENDORSUPPORT);
-#else
     ErrorFSigSafe("\nPlease consult the " XVENDORNAME " support \n\t at "
                  __VENDORDWEBSUPPORT__ "\n for help. \n");
-#endif
     if (xf86LogFile && xf86LogFileWasOpened)
         ErrorFSigSafe("Please also check the log file at \"%s\" for additional "
                      "information.\n", xf86LogFile);
diff --git a/os/utils.c b/os/utils.c
index 78fe246fc..79fcb5f77 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1463,9 +1463,7 @@ enum BadCode {
     InternalError
 };
 
-#if defined(VENDORSUPPORT)
-#define BUGADDRESS VENDORSUPPORT
-#elif defined(BUILDERADDR)
+#if defined(BUILDERADDR)
 #define BUGADDRESS BUILDERADDR
 #else
 #define BUGADDRESS "xorg at freedesktop.org"
commit 69905a0a281f87f9bcae2fd61e9698114fa8a173
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu May 2 19:46:28 2024 +0200

    os: utils: drop unused NO_OUTPUT_PIPES
    
    This hasn't been used/enabled for over 20 years, so there's probably
    no reason for keeping it even longer.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518>

diff --git a/os/utils.c b/os/utils.c
index dba2f5dad..78fe246fc 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1426,16 +1426,6 @@ PrivsElevated(void)
 #define REMOVE_LONG_ENV 1
 #endif
 
-/*
- * Disallow stdout or stderr as pipes?  It's possible to block the X server
- * when piping stdout+stderr to a pipe.
- *
- * Don't enable this because it looks like it's going to cause problems.
- */
-#ifndef NO_OUTPUT_PIPES
-#define NO_OUTPUT_PIPES 0
-#endif
-
 /* Check args and env only if running setuid (euid == 0 && euid != uid) ? */
 #ifndef CHECK_EUID
 #ifndef WIN32
@@ -1470,7 +1460,6 @@ enum BadCode {
     ArgTooLong,
     UnprintableArg,
     EnvTooLong,
-    OutputIsPipe,
     InternalError
 };
 
@@ -1567,16 +1556,6 @@ CheckUserParameters(int argc, char **argv, char **envp)
                 }
             }
         }
-#if NO_OUTPUT_PIPES
-        if (!bad) {
-            struct stat buf;
-
-            if (fstat(fileno(stdout), &buf) == 0 && S_ISFIFO(buf.st_mode))
-                bad = OutputIsPipe;
-            if (fstat(fileno(stderr), &buf) == 0 && S_ISFIFO(buf.st_mode))
-                bad = OutputIsPipe;
-        }
-#endif
     }
     switch (bad) {
     case NotBad:
@@ -1594,9 +1573,6 @@ CheckUserParameters(int argc, char **argv, char **envp)
     case EnvTooLong:
         ErrorF("Environment variable `%s' is too long\n", e);
         break;
-    case OutputIsPipe:
-        ErrorF("Stdout and/or stderr is a pipe\n");
-        break;
     case InternalError:
         ErrorF("Internal Error\n");
         break;
commit 6153b89d19904be8939214d54fc239e904b870e8
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Thu May 2 19:42:33 2024 +0200

    os: utils: minor code formatting cleanup
    
    Just correcting some small indention issues, no actual change.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1518>

diff --git a/os/utils.c b/os/utils.c
index 4fb7de469..dba2f5dad 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -397,8 +397,7 @@ UseMsg(void)
     ErrorF("+xinerama              Enable XINERAMA extension\n");
     ErrorF("-xinerama              Disable XINERAMA extension\n");
 #endif
-    ErrorF
-        ("-dumbSched             Disable smart scheduling and threaded input, enable old behavior\n");
+    ErrorF("-dumbSched             Disable smart scheduling and threaded input, enable old behavior\n");
     ErrorF("-schedInterval int     Set scheduler interval in msec\n");
     ErrorF("-sigstop               Enable SIGSTOP based startup\n");
     ErrorF("+extension name        Enable extension\n");
@@ -675,21 +674,21 @@ ProcessCommandLine(int argc, char *argv[])
                 DisableServerLock();
         }
 #endif
-	else if ( strcmp( argv[i], "-maxclients") == 0)
-	{
-	    if (++i < argc) {
-		LimitClients = atoi(argv[i]);
-		if (LimitClients != 64 &&
-		    LimitClients != 128 &&
-		    LimitClients != 256 &&
-		    LimitClients != 512 &&
+        else if ( strcmp( argv[i], "-maxclients") == 0)
+        {
+            if (++i < argc) {
+                LimitClients = atoi(argv[i]);
+                if (LimitClients != 64 &&
+                    LimitClients != 128 &&
+                    LimitClients != 256 &&
+                    LimitClients != 512 &&
                     LimitClients != 1024 &&
                     LimitClients != 2048) {
-		    FatalError("maxclients must be one of 64, 128, 256, 512, 1024 or 2048\n");
-		}
-	    } else
-		UseMsg();
-	}
+                    FatalError("maxclients must be one of 64, 128, 256, 512, 1024 or 2048\n");
+                }
+            } else
+                UseMsg();
+        }
         else if (strcmp(argv[i], "-nolisten") == 0) {
             if (++i < argc) {
                 if (_XSERVTransNoListen(argv[i]))


More information about the xorg-commit mailing list