]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/env.c
Fix source file header text duplication text duplication.
[thirdparty/cups.git] / scheduler / env.c
index ec12d155f021719ca27cbf6b6bb73857a225c850..01676c317b714a6ebd072c294b13cd4134c6ebe9 100644 (file)
@@ -1,27 +1,14 @@
 /*
- * "$Id: env.c 9459 2011-01-11 03:48:42Z mike $"
+ * Environment management routines for the CUPS scheduler.
  *
- *   Environment management routines for the CUPS scheduler.
+ * Copyright 2007-2016 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
- *   Copyright 2007-2011 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
- *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   which should have been included with this file.  If this file is
- *   file is missing or damaged, see the license at "http://www.cups.org/".
- *
- * Contents:
- *
- *   cupsdInitEnv()   - Initialize the current environment with standard
- *                      variables.
- *   cupsdLoadEnv()   - Copy common environment variables into an array.
- *   cupsdSetEnv()    - Set a common environment variable.
- *   cupsdSetEnvf()   - Set a formatted common environment variable.
- *   cupsdUpdateEnv() - Update the environment for the configured directories.
- *   clear_env()      - Clear common environment variables.
- *   find_env()       - Find a common environment variable.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file.  If this file is
+ * missing or damaged, see the license at "http://www.cups.org/".
  */
 
 /*
@@ -62,7 +49,7 @@ cupsdInitEnv(void)
 
 #if defined(__APPLE__)
  /*
-  * Add special voodoo magic for MacOS X - this allows MacOS X 
+  * Add special voodoo magic for macOS - this allows macOS
   * programs to access their bundle resources properly...
   *
   * This string is replaced in cupsdStartProcess()...
@@ -130,6 +117,13 @@ cupsdSetEnv(const char *name,              /* I - Name of variable */
   if (!value)
     return;
 
+ /*
+  * Do not allow dynamic linker variables when running as root...
+  */
+
+  if (!RunUser && (!strncmp(name, "DYLD_", 5) || !strncmp(name, "LD_", 3)))
+    return;
+
  /*
   * See if this variable has already been defined...
   */
@@ -227,6 +221,8 @@ cupsdUpdateEnv(void)
   set_if_undefined("TZ", NULL);
   set_if_undefined("USER", "root");
   set_if_undefined("VG_ARGS", NULL);
+
+  cupsdSetEnvf("CUPS_MAX_MESSAGE", "%d", CUPSD_SB_BUFFER_SIZE - 1);
 }
 
 
@@ -264,8 +260,3 @@ find_env(const char *name)          /* I - Variable name */
 
   return (-1);
 }
-
-
-/*
- * End of "$Id: env.c 9459 2011-01-11 03:48:42Z mike $".
- */