ACL-Notes 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. Date What ?
  41. ===================================
  42. 10/15/98 - Created the ACL plugin
  43. - Created a new file aclplugin.c and split the old
  44. acl.c to acl.c & aclparse.c files.
  45. - Merged changes made upt 4.0B2
  46. 10/21/98 - Added USERATTR rule.
  47. 02/01/99 - Cleanup needed to be done in 5.0 to make it a real plugin
  48. =====================================================================================
  49. 1. Do not use slap.h but use slapi-plugin.h. This will require
  50. some work. Work involves
  51. 1) Making the ACLCB an extensible object of CONN struct
  52. 2) Remove reference of Connection & operation struct
  53. 3) Need slapi plugin apis to get the IP and DNS so that
  54. we can evaluate it in the LASes.
  55. 4) Need new option to get values of conn , op & pb stuct like
  56. cert, authtype,
  57. 2. Make ACLPB hang from the Operation struct instead of the PBlock.
  58. 3. Make ACLCB an extensible object of CONN struct and remove any reference
  59. about acl private info.
  60. 4. I implemented the Userattr rule before even deciding if we need in 5.0
  61. or not. I think it is useful. The documents those were based on are
  62. in http://jazz/users/prasanta/acl_manage_filter
  63. 5. Move acllas_dn_parent to the libslapd. This is duplicated code and is
  64. BAAAD.
  65. 6. Use the new normalized dn code so that we don't have to it over and over again.
  66. We have to very careful ins slapi_access_allowed() as we keep the dn around and
  67. free it later ( we can use dn by ref ).
  68. 7. Merge from DS4.1 ( proxy auth) to DS 5.0.
  69. 8. Miscs
  70. a) can we use the SDK URL parsing code ?
  71. b) Merge teh printing routines ( it's all over ).
  72. My estimate for doing the above cleanup will require anywhere between 5 to 8 days.
  73. Run the ACL tests after all the changes -- that is a MUST.
  74. ===============================
  75. 04/28/99
  76. -- All the work descibed above is done.
  77. -- Also
  78. a) Created a Pool pf ACLPB one of which is grabed at the init time.
  79. b) Created a global lockarary which takes care of the concurreny issue between
  80. aclpb & aclcb
  81. c) Fixed plugin init.
  82. I think the userattr rule should be made generic
  83. useAttr = "attrName#Type"
  84. <Type> :== DN | GROUP | ROLE | URL | <value>
  85. <value> :== < any printable String>
  86. Example:
  87. userAttr = "manager#DN" --- similar to userdnattr
  88. userAttr = "owner#GROUP" --- similar to groupdnattr
  89. userAttr = "attr#ROLE" --- The value of attr contains a role definition
  90. userAttr = "myattr#URL" --- The value contains a URL or filter
  91. userAttr = "OU#Directory Server"
  92. --- In this case the client's OU and the
  93. resource entry's OU must have
  94. "Directory Server" value.
  95. This way we can get rid of userdnattr and groupdnattr and accomplish a
  96. lot with a single rule.
  97. At this point, we are done with the changes and waiting for what needs to be
  98. done in 5.0.
  99. =================================
  100. 06/01/1999
  101. -- Split the code into smaller modules
  102. ( aclanom, aclgroup, aclinit, ...)
  103. --- The ACLs are read and kept in a AVL tree.
  104. --- Few bugs fixed in the acl_scan_match code.
  105. ================================================
  106. 07/02/99
  107. -- Added support for parameterized bind rules.
  108. -- Added support for caching of ATTR rules using recompute.S
  109. What's left for 5.0
  110. -------------------
  111. 1. Support for roles
  112. 2. Re-architect user/group cache
  113. 3. startup in multiple threads ( low priority)
  114. 4. look at add/delete/modrdn operations.
  115. 5. cleanup:
  116. - revist all the debug statements
  117. - new tests etc.
  118. 6. UI work
  119. ============
  120. commit:14/12/99 rbyrne
  121. . Added targattrfilters keyword for value based acls.
  122. Required also slapi_filter_apply(), slapi_get_attribute_type()
  123. and slapi_attr_syntax_normalize() in slapd (filter.c and attrsyntax.c).
  124. . Memory leak fix in acl.c for PListInit() call--see comments in code.
  125. . made access an int on it's own to give room for expansion
  126. (see aci_access and aclpb_access)
  127. . files: ACL-Notes, acl.c acl.h acl-ext.c aclanom.c acllas.c acllist.c aclparse.c aclutil.c slapd/attrsyntax.c slapd/slapi-plugin.h slapd/filter.c slapd/libslapd.def
  128. ===
  129. commit: Mon 20th Dec 199
  130. . aclparse.c: add proxy back to acl_access2str
  131. . filter.c: get_filter() does not recurse anymore--get_fitler_internal(), get_filter_list()
  132. do the recursion...this way testing for ldapsubentry works.
  133. . aclinit.c: now have filter (|(aci=*)(objectclass=ldapsubentry)) in
  134. aclinit_search_and_insert_aci(). This means that when slapi_search_internal_callback()
  135. stops returning subentries by default, we will still get them as we have the correct filter.
  136. ===
  137. commit: 12/01/2000:
  138. . aclplugin.c: fix for proxyauth bug in aclplugin_preop_search() and
  139. acl_plugin_preop_modify()--the proxy_dn and dn were swapped.
  140. . acl_ext.c: Also, when we PListAssignValue() on DS_ATTR_USERDN in acl_init_aclpb(),
  141. we should pass it a dn from aclpb_sdn, NOT the dn passed into acl_init_aclpb() which
  142. gets freed after the call to acl_init_acpb(). JAlso here need to be careful thatif dn contains NULL that we indicate this in aclpb_sdn by setting dn to a non-NULL empty string ("") which the code takes to be anon.
  143. . checked that none of the PList objects (DS_PROP_ACLPB, DS_ATTR_USERDN, DS_ATTR_ENTRY) have mem leak problems.
  144. . acl.c, acllas.c, aclproxy.c: removed some #ifdef 0 and comments--tidy up but
  145. no code changes.
  146. . acl_ext.c: in acl__done_aclpb() we need to PListDleteProp() on ACL_ATTR_IP
  147. and ACL_ATTR_DNS. This is because if LASIpEval/ACL_GetAttribute() and
  148. LASDnsEval/ACL_GetAttribute() see that these properties exist, they do
  149. not bother calling the respective Getter() function. So, everytime
  150. the aclpb is reused and ip or dns eval is required, the old value is used (
  151. or whatever hjappens to be in the memory.). Tested--works fine now with ip and dns keywords. ALso tested that when the same user tries an a non-allowed machine he is not allowed by accident (as he was before).
  152. . in schema.c/oc_find(): normalize the objectclass name before looking for it. Otherwise
  153. if there's a trailing space in the oc name, you won't dfind it.
  154. ===
  155. commit:
  156. . aclparse.c: fix for syntax.ksh tp6 test: if there is no "version" in an aci item, reject it.
  157. . acllas.c: in DS_UserDnEval() now call slapi_normalize_dn() when comparing param strings and
  158. ordinary dns.
  159. . acl_ext.c: when seeting DS_USER_DN_ATTR, get the ndn, the normalized form.
  160. ====
  161. commit: 7/02/2000
  162. anom profile and groupdn != don't work together! Bug 381830 in 4.X
  163. . acl.h: new bit in aci_type to mark as below.
  164. . aclparse.c: mark an aci if it's like deny() groupdn != blah
  165. . aclanom.c: if marked like that cancel anom profile (just like userdn !=)
  166. ==
  167. . removed these for the mo...
  168. commit:
  169. . acllas.c: now get the vattrs via slapi_vattr_merge_copy() when testing the client entry.
  170. . vattr.c: assign i the length of the list:i = type_context.list_length;
  171. . entry.c: slapi_entry_add_valueset()
  172. ==
  173. commit: 03/03/2000
  174. . support for roledn in acis.
  175. ===
  176. . acllist: in slapi_sdn_free(&aciListHead->acic_sdn); gbeelato's mem leak fix.
  177. commited
  178. =====
  179. committed: 17/008/00
  180. . support for $dn: aclutil.c, aclparse.c, acllist.c, acllas.c, acl.c, acl.h
  181. . acl_ext.c:Make sure aclpb_search_base is initialized to NULL in aclpb__malloc()
  182. . acl.c: set_result_status: wrong bit masks were being used in a_eval->attrEval_s_astatus etc.
  183. acl__attr_cached_result(): in the attr==NULL case, need to test for potential
  184. "recompute" case of attribute--this happens if it's a param or attr style aci.
  185. ========
  186. commited
  187. Support for dynamic backends:
  188. . acllist.c, aclinit.c, libslapd.def, control.c, slapi-plugin.h:
  189. acl_be_state_change_fnc(), slapi_build_control_from_berval() etc.
  190. . aclanom.c: logical error in aclanom_match_profile() was causing misctest4 to fail.
  191. . acl_ext.c:fix mem leak by calling acl_clean_aclEval_control() in acl_ext_conn_desctructor()
  192. .
  193. ===
  194. committed:24 Aug 2000
  195. now SLAPI_ACL_ALL (allow(all)) does NOT include proxy right
  196. ==
  197. committed: 30 Aug 2000
  198. . acl.c: new print_access_control_Summary() routine to display final acl status. Gets the proxy
  199. stuff right too.
  200. in acl__resource_match_aci() always test the TARGET_FILTER case, the old cod ethere was wrong.
  201. ==
  202. . add support for macros to userdn ldapurl keyword.
  203. ==
  204. Committed:
  205. . Sep 07 2000: Support for $attr in macros.
  206. . Sep 15 2000: Support for aci macros in targetfilter keyword.
  207. . Sep 18 2000: improve ret code handling in __aclinit_handler--stops spurious error message.
  208. --eof