UID-Notes 3.3 KB

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