WizardsToolkit  1.0.7
sanitize.c
Go to the documentation of this file.
00001 /*
00002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00003 %                                                                             %
00004 %                                                                             %
00005 %                                                                             %
00006 %          SSSSS   AAA   N   N  IIIII  TTTTT  IIIII  ZZZZZ  EEEEE             %
00007 %          SS     A   A  NN  N    I      T      I       ZZ  E                 %
00008 %           SSS   AAAAA  N N N    I      T      I     ZZZ   EEE               %
00009 %             SS  A   A  N  NN    I      T      I    ZZ     E                 %
00010 %          SSSSS  A   A  N   N  IIIII    T    IIIII  ZZZZZ  EEEEE             %
00011 %                                                                             %
00012 %                                                                             %
00013 %              Wizard's Toolkit Environment Sanitazion Methods                %
00014 %                                                                             %
00015 %                             Software Design                                 %
00016 %                               John Cristy                                   %
00017 %                               March 2003                                    %
00018 %                                                                             %
00019 %                                                                             %
00020 %  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
00021 %  dedicated to making software imaging solutions freely available.           %
00022 %                                                                             %
00023 %  You may not use this file except in compliance with the License.  You may  %
00024 %  obtain a copy of the License at                                            %
00025 %                                                                             %
00026 %    http://www.wizards-toolkit.org/script/license.php                        %
00027 %                                                                             %
00028 %  Unless required by applicable law or agreed to in writing, software        %
00029 %  distributed under the License is distributed on an "AS IS" BASIS,          %
00030 %  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   %
00031 %  Wizard the License for the specific language governing permissions and        %
00032 %  limitations under the License.                                             %
00033 %                                                                             %
00034 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00035 %
00036 %
00037 */
00038 
00039 /*
00040   Include declarations.
00041 */
00042 #include "wizard/studio.h"
00043 #include "wizard/sanitize.h"
00044 
00045 /*
00046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00047 %                                                                             %
00048 %                                                                             %
00049 %                                                                             %
00050 %   S a n i t i z e E n v i r o n m e n t                                     %
00051 %                                                                             %
00052 %                                                                             %
00053 %                                                                             %
00054 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00055 %
00056 %  SanitizeEnvironment sanitizes the environment to help ensure the Wizard's
00057 %  Toolkit operates in a secure manner.
00058 %
00059 %  The format of the SanitizeEnvironment method is:
00060 %
00061 %      void SanitizeEnvironment(void)
00062 %
00063 */
00064 WizardExport void SanitizeEnvironment(void)
00065 {
00066 #if defined(SANS)
00067   {
00068     struct rlimit
00069       limit;
00070 
00071     /*
00072       Prevent core dumps.
00073     */
00074     limit.rlim_cur=0;
00075     limit.rlim_max=0;
00076     setrlimit(RLIMIT_CORE,&limit);
00077   }
00078 #endif
00079 }