UID-Notes 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #
  2. # BEGIN COPYRIGHT BLOCK
  3. # Copyright 2001 Sun Microsystems, Inc.
  4. # Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
  5. # All rights reserved.
  6. # END COPYRIGHT BLOCK
  7. #
  8. Unique UID Checking Plugin
  9. --------------------------
  10. Terry Hayes, April 16, 1998
  11. GOALS
  12. The Unique UID Checking Plugin supports the management of user entries in the
  13. directory by enforcing the constraints on the value of an attribute within a
  14. portion of the directory. This provides a central point for enforcing this
  15. constraint, which allows changes from any source to be checked (DSGW, Kingpin,
  16. LDAP utilities, or user application).
  17. CONFIGURATION
  18. The software operates as a preoperation plugin to the directory server. An
  19. entry must be added to the slapd.conf file for the server that declares the
  20. plugin and provides arguments required for its operation.
  21. The plugin is declared as follows (line split for clarity):
  22. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  23. uidunique_init <attribute_name> <subtree_dn> ...
  24. The first 5 values are the standard plugin declaration. The uidunique_init
  25. function registers preoperation callbacks for the add, modify and modRDN
  26. directory operations.
  27. The next argument ("attribute_name") specifies the name of the entry attribute
  28. to check for uniqueness. This attribute must be unique within each of the
  29. subtrees listed in the remainder of the arguments.
  30. For example:
  31. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  32. uidunique_init uid o=mcom.com
  33. This line specifies "uid" as the unique attribute, and lists a single subtree
  34. to be checked. This line is typical of an initial installation (see below).
  35. A more complex case:
  36. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  37. uidunique_init uid o=Coke o=Pepsi
  38. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  39. uidunique_init mail "o=Dr. Pepper"
  40. This configuration specifies a total of three subtrees to check. Two use the
  41. (standard) "uid" attribute as a unique value. The other specifies "mail"
  42. as the unique attribute.
  43. INSTALLATION
  44. The standard installation of the directory server will configure this plugin
  45. to check the "uid" attribute on the default suffix.
  46. OPERATION
  47. The plugin responds to the following LDAP operations:
  48. + add
  49. + modify
  50. + modRDN
  51. For all operations, the plugin forces the LDAP operation to return
  52. CONSTRAINT_VIOLATION if the operation would result in two entries with
  53. the same unique attribute value.
  54. For an "add" operation that includes the unique attribute, the plugin checks
  55. that no other entry has the same value.
  56. For a "modify" operation, the operation will fail if the new value of the
  57. attribute exists in any entry OTHER than the target of the modify. If the
  58. value already exists, but is in the node being changed, the operation
  59. succeeds. For example, if a modify operation replaces a 'uid' attribute
  60. with the same set of values, the plugin will find the "new" values already
  61. exist. However since it is in the entry being modified, the operation is
  62. allowed to complete.
  63. For modRDN, the same checking as for "modify" is performed.
  64. ModRDN is coded to handle reparenting, but since the LDAP protocol to support
  65. this operation is not present, it cannot be exercised and has not been
  66. tested.