X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=scheduler%2Fenv.c;h=d5c154fcde18331d67d10aa750526fa04a20b14c;hb=6e5a57e8af67faf6868aab7f69c695120ad77afb;hp=5fbe52c559d9f7c72309cecdf15fd236d1d17cf9;hpb=a29fd7ddb5d63688a4d44d08e4ab16428921c321;p=thirdparty%2Fcups.git diff --git a/scheduler/env.c b/scheduler/env.c index 5fbe52c55..d5c154fcd 100644 --- a/scheduler/env.c +++ b/scheduler/env.c @@ -1,27 +1,16 @@ /* - * "$Id: env.c 9459 2011-01-11 03:48:42Z mike $" + * "$Id$" * - * Environment management routines for the CUPS scheduler. + * Environment management routines for the CUPS scheduler. * - * Copyright 2007-2011 by Apple Inc. - * Copyright 1997-2006 by Easy Software Products, all rights reserved. + * Copyright 2007-2014 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 + * file is missing or damaged, see the license at "http://www.cups.org/". */ /* @@ -130,6 +119,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... */ @@ -269,5 +265,5 @@ find_env(const char *name) /* I - Variable name */ /* - * End of "$Id: env.c 9459 2011-01-11 03:48:42Z mike $". + * End of "$Id$". */