UID-Notes 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #
  2. # BEGIN COPYRIGHT BLOCK
  3. # This Program is free software; you can redistribute it and/or modify it under
  4. # the terms of the GNU General Public License as published by the Free Software
  5. # Foundation; version 2 of the License.
  6. #
  7. # This Program is distributed in the hope that it will be useful, but WITHOUT
  8. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  9. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. #
  11. # You should have received a copy of the GNU General Public License along with
  12. # this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  13. # Place, Suite 330, Boston, MA 02111-1307 USA.
  14. #
  15. # In addition, as a special exception, Red Hat, Inc. gives You the additional
  16. # right to link the code of this Program with code not covered under the GNU
  17. # General Public License ("Non-GPL Code") and to distribute linked combinations
  18. # including the two, subject to the limitations in this paragraph. Non-GPL Code
  19. # permitted under this exception must only link to the code of this Program
  20. # through those well defined interfaces identified in the file named EXCEPTION
  21. # found in the source code files (the "Approved Interfaces"). The files of
  22. # Non-GPL Code may instantiate templates or use macros or inline functions from
  23. # the Approved Interfaces without causing the resulting work to be covered by
  24. # the GNU General Public License. Only Red Hat, Inc. may make changes or
  25. # additions to the list of Approved Interfaces. You must obey the GNU General
  26. # Public License in all respects for all of the Program code and other code used
  27. # in conjunction with the Program except the Non-GPL Code covered by this
  28. # exception. If you modify this file, you may extend this exception to your
  29. # version of the file, but you are not obligated to do so. If you do not wish to
  30. # provide this exception without modification, you must delete this exception
  31. # statement from your version and license this file solely under the GPL without
  32. # exception.
  33. #
  34. #
  35. # Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  36. # Copyright (C) 2005 Red Hat, Inc.
  37. # All rights reserved.
  38. # END COPYRIGHT BLOCK
  39. #
  40. Unique UID Checking Plugin
  41. --------------------------
  42. Terry Hayes, April 16, 1998
  43. GOALS
  44. The Unique UID Checking Plugin supports the management of user entries in the
  45. directory by enforcing the constraints on the value of an attribute within a
  46. portion of the directory. This provides a central point for enforcing this
  47. constraint, which allows changes from any source to be checked (DSGW, Kingpin,
  48. LDAP utilities, or user application).
  49. CONFIGURATION
  50. The software operates as a preoperation plugin to the directory server. An
  51. entry must be added to the slapd.conf file for the server that declares the
  52. plugin and provides arguments required for its operation.
  53. The plugin is declared as follows (line split for clarity):
  54. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  55. uidunique_init <attribute_name> <subtree_dn> ...
  56. The first 5 values are the standard plugin declaration. The uidunique_init
  57. function registers preoperation callbacks for the add, modify and modRDN
  58. directory operations.
  59. The next argument ("attribute_name") specifies the name of the entry attribute
  60. to check for uniqueness. This attribute must be unique within each of the
  61. subtrees listed in the remainder of the arguments.
  62. For example:
  63. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  64. uidunique_init uid o=mcom.com
  65. This line specifies "uid" as the unique attribute, and lists a single subtree
  66. to be checked. This line is typical of an initial installation (see below).
  67. A more complex case:
  68. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  69. uidunique_init uid o=Coke o=Pepsi
  70. plugin preoperation "uid uniqueness" /home/thayes/testdir/lib/uid-plugin.so
  71. uidunique_init mail "o=Dr. Pepper"
  72. This configuration specifies a total of three subtrees to check. Two use the
  73. (standard) "uid" attribute as a unique value. The other specifies "mail"
  74. as the unique attribute.
  75. INSTALLATION
  76. The standard installation of the directory server will configure this plugin
  77. to check the "uid" attribute on the default suffix.
  78. OPERATION
  79. The plugin responds to the following LDAP operations:
  80. + add
  81. + modify
  82. + modRDN
  83. For all operations, the plugin forces the LDAP operation to return
  84. CONSTRAINT_VIOLATION if the operation would result in two entries with
  85. the same unique attribute value.
  86. For an "add" operation that includes the unique attribute, the plugin checks
  87. that no other entry has the same value.
  88. For a "modify" operation, the operation will fail if the new value of the
  89. attribute exists in any entry OTHER than the target of the modify. If the
  90. value already exists, but is in the node being changed, the operation
  91. succeeds. For example, if a modify operation replaces a 'uid' attribute
  92. with the same set of values, the plugin will find the "new" values already
  93. exist. However since it is in the entry being modified, the operation is
  94. allowed to complete.
  95. For modRDN, the same checking as for "modify" is performed.
  96. ModRDN is coded to handle reparenting, but since the LDAP protocol to support
  97. this operation is not present, it cannot be exercised and has not been
  98. tested.