1. /*
  2. * @(#)SerializablePermission.java 1.13 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.io;
  11. import java.security.*;
  12. import java.util.Enumeration;
  13. import java.util.Hashtable;
  14. import java.util.StringTokenizer;
  15. /**
  16. * This class is for Serializable permissions. A SerializablePermission
  17. * contains a name (also referred to as a "target name") but
  18. * no actions list; you either have the named permission
  19. * or you don't.
  20. *
  21. * <P>
  22. * The target name is the name of the Serializable permission (see below).
  23. *
  24. * <P>
  25. * The following table lists all the possible SerializablePermission target names,
  26. * and for each provides a description of what the permission allows
  27. * and a discussion of the risks of granting code the permission.
  28. * <P>
  29. *
  30. * <table border=1 cellpadding=5>
  31. * <tr>
  32. * <th>Permission Target Name</th>
  33. * <th>What the Permission Allows</th>
  34. * <th>Risks of Allowing this Permission</th>
  35. * </tr>
  36. *
  37. * <tr>
  38. * <td>enableSubclassImplementation</td>
  39. * <td>Subclass implementation of ObjectOutputStream or ObjectInputStream
  40. * to override the default serialization or deserialization, respectively,
  41. * of objects</td>
  42. * <td>Code can use this to serialize or
  43. * deserialize classes in a purposefully malfeasant manner. For example,
  44. * during serialization, malicious code can use this to
  45. * purposefully store confidential private field data in a way easily accessible
  46. * to attackers. Or, during deserializaiton it could, for example, deserialize
  47. * a class with all its private fields zeroed out.</td>
  48. * </tr>
  49. *
  50. * <tr>
  51. * <td>enableSubstitution</td>
  52. * <td>Substitution of one object for another during
  53. * serialization or deserialization</td>
  54. * <td>This is dangerous because malicious code
  55. * can replace the actual object with one which has incorrect or
  56. * malignant data.</td>
  57. * </tr>
  58. *
  59. * </table>
  60. *
  61. * @see java.security.BasicPermission
  62. * @see java.security.Permission
  63. * @see java.security.Permissions
  64. * @see java.security.PermissionCollection
  65. * @see java.lang.SecurityManager
  66. *
  67. * @version 1.13, 02/02/00
  68. *
  69. * @author Joe Fialli
  70. * @since 1.2
  71. */
  72. /* code was borrowed originally from java.lang.RuntimePermission. */
  73. public final class SerializablePermission extends BasicPermission {
  74. /**
  75. * @serial
  76. */
  77. private String actions;
  78. /**
  79. * Creates a new SerializablePermission with the specified name.
  80. * The name is the symbolic name of the SerializablePermission, such as
  81. * "enableSubstitution", etc.
  82. *
  83. * @param name the name of the SerializablePermission.
  84. */
  85. public SerializablePermission(String name)
  86. {
  87. super(name);
  88. }
  89. /**
  90. * Creates a new SerializablePermission object with the specified name.
  91. * The name is the symbolic name of the SerializablePermission, and the
  92. * actions String is currently unused and should be null. This
  93. * constructor exists for use by the <code>Policy</code> object
  94. * to instantiate new Permission objects.
  95. *
  96. * @param name the name of the SerializablePermission.
  97. * @param actions currently unused and must be set to null
  98. */
  99. public SerializablePermission(String name, String actions)
  100. {
  101. super(name, actions);
  102. }
  103. }