unprot.ps 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. % Copyright (C) 1991, 1992, 1998 Aladdin Enterprises. All rights reserved.
  2. %
  3. % This file is part of AFPL Ghostscript.
  4. %
  5. % AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  6. % distributor accepts any responsibility for the consequences of using it, or
  7. % for whether it serves any particular purpose or works at all, unless he or
  8. % she says so in writing. Refer to the Aladdin Free Public License (the
  9. % "License") for full details.
  10. %
  11. % Every copy of AFPL Ghostscript must include a copy of the License, normally
  12. % in a plain ASCII text file named PUBLIC. The License grants you the right
  13. % to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14. % conditions described in the License. Among other things, the License
  15. % requires that the copyright notice and this notice be preserved on all
  16. % copies.
  17. % $Id: unprot.ps,v 1.2 2000/09/19 18:29:11 lpd Exp $
  18. % Disable all access checks. This is useful for printing out
  19. % eexec-encrypted Type 1 fonts, and similar purposes.
  20. systemdict wcheck
  21. { /protdict systemdict def
  22. }
  23. { (Please restart Ghostscript with the -dWRITESYSTEMDICT switch.\n) print
  24. (Some access checks will remain active if you do not do this.\n) print
  25. flush
  26. /protdict userdict def
  27. }
  28. ifelse
  29. % The procedures we're about to define will go in systemdict,
  30. % so they must be allocated in global VM.
  31. .currentglobal true .setglobal
  32. protdict begin
  33. /readonly. /readonly load def
  34. /executeonly. /executeonly load def
  35. /noaccess. /noaccess load def
  36. /readonly { } odef
  37. /readonly.. /readonly load def
  38. /executeonly { } odef
  39. /executeonly.. /executeonly load def
  40. /noaccess { } odef
  41. /noaccess.. /noaccess load def
  42. end
  43. % Disable the access checks.
  44. /unprot
  45. { protdict begin
  46. /readonly /readonly.. load def
  47. /executeonly /executeonly.. load def
  48. /noaccess /noaccess.. load def
  49. end
  50. } bind def
  51. % Re-enable the access checks.
  52. /reprot
  53. { protdict begin
  54. /readonly /readonly. load def
  55. /executeonly /executeonly. load def
  56. /noaccess /noaccess. load def
  57. end
  58. } bind def
  59. .setglobal