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