summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/acl
Commit message (Collapse)AuthorAgeFilesLines
...
* Use thread aware library for complex regex searchesNoriko Hosoi2009-05-281-17/+10
| | | | | | | | For more details, see the design doc at http://directory.fedoraproject.org/wiki/Thread_Aware_Regex Additional 2 unrelated changes are being made: 1) dbgen.pl.in: secretary and manager are having a dn format value "cn=...". 2) slapi_counter_sunos_sparcv9.S: adding "#define _ASM 1" to force to set an assembler code macro _ASM.
* Fix various compiler warningsRich Megginson2009-05-191-1/+1
| | | | | | | | | | | | | | | | | | 1) Make sure we use "const" consistently 2) Make sure we use "unsigned char" consistently for some reason (unsigned char)*p did not compare to '\xHH' literals unless the literal was also cast to (unsigned char) 3) added some missing function prototypes 4) removed some unused variables/functions, or commented out for use when debugging 5) various other compiler warnings With all of these, the code compiles cleanly on RHEL5 x86_64 using gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44) and CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic" The only warning now is the spurious message about %llu or %lld having the wrong format argument. Reviewed by: nhosoi (Thanks!)
* Resolves: #208076Noriko Hosoi2009-01-231-54/+305
| | | | | | Summary: userattr="parent[1].<attribute>#LDAPURL" does not work Description: It turned out userattr="parent[1].<attribute>#LDAPURL" was not implemented. The functionality has been implemented with this change.
* Resolves: bug 454030Rich Megginson2008-12-059-108/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug Description: Need to address 64-bit compiler warnings - again Reviewed by: nhosoi (Thanks!) Fix Description: This patch cleans up most of the other remaining compiler warnings. I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic I also enabled argument/format match checking for most of the commonly used varadic functions. Most of the problems I found fell into these categories: 1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments. If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic. 2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems. However, for regular system formatting functions, we have to use %ld or %lu. I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions. I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions. 3) use %lu for size_t and %ld for time_t I did find a few "real" errors, places that the code was doing something definitely not right: https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/aclinit.c_sec4 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/acllas.c_sec17 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/http/http_impl.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/memberof/memberof.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_api.c_sec5 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_clcache.c_sec2 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/replutil.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/libglobs.c_sec1 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c_sec2 https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c_sec3 This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors. Platforms tested: RHEL5 Flag Day: no Doc impact: no
* Resolves: 470918Nathan Kinder2008-11-131-3/+3
| | | | Summary: Made replica_set_updatedn detect value add modify operations properly.
* Resolves: bug 469243Rich Megginson2008-11-051-1/+1
| | | | | Description: ACL: support group filter Fix Description: unset value for lud_scope is -1, not NULL
* Resolves: #469243Noriko Hosoi2008-11-011-105/+93
| | | | | | | | | | | | Summary: ACL: support group filter Fix Description: . backoff the previous checkin . check the value of groupdn is the full ldapurl or not by ldap_url_parse. . if yes, run the search and get the search results. otherwise, evaluate the bind dn for the value as usual. . evaluate the bind dn against each group returned from the search. . additionally, added the code to trim the beginning and trailig spaces from the groupdn value, which is needed for ldap_url_parse.
* Resolves: #469243Noriko Hosoi2008-10-311-13/+83
| | | | | Summary: ACL: support group filter Description: extended userattr #GROUPDN value to support LDAPURL
* Related: 207457Nathan Kinder2008-10-174-10/+26
| | | | Summary: Add support for 64-bit counters (phase 1).
* Bug Description: Need to address 64-bit compiler warnings - part 1Rich Megginson2008-10-082-8/+9
| | | | | | | | | | | | | | | | | | | | | Reviewed by: nhosoi (Thanks!) Fix Description: The intptr_t and uintptr_t are types which are defined as integer types that are the same size as the pointer (void *) type. On the platforms we currently support, this is the same as long and unsigned long, respectively (ILP32 and LP64). However, intptr_t and uintptr_t are more portable. These can be used to assign a value passed as a void * to get an integer value, then "cast down" to an int or PRBool, and vice versa. This seems to be a common idiom in other applications where values must be passed as void *. For the printf/scanf formats, there is a standard header called inttypes.h which defines formats to use for various 64 bit quantities, so that you don't need to figure out if you have to use %lld or %ld for a 64-bit value - you just use PRId64 which is set to the correct value. I also assumed that size_t is defined as the same size as a pointer so I used the PRIuPTR format macro for size_t. I removed many unused variables and some unused functions. I put parentheses around assignments in conditional expressions to tell the compiler not to complain about them. I cleaned up some #defines that were defined more than once. I commented out some unused goto labels. Some of our header files shared among several source files define static variables. I made it so that those variables are not defined unless a macro is set in the source file. This avoids a lot of unused variable warnings. I added some return values to functions that were declared as returning a value but did not return a value. In all of these cases no one was checking the return value anyway. I put explicit parentheses around cases like this: expr || expr && expr - the && has greater precedence than the ||. The compiler complains because it wants you to make sure you mean expr || (expr && expr), not (expr || expr) && expr. I cleaned up several places where the compiler was complaining about possible use of uninitialized variables. There are still a lot of these cases remaining. There are a lot of warnings like this: lib/ldaputil/certmap.c:1279: warning: dereferencing type-punned pointer will break strict-aliasing rules These are due to our use of void ** to pass in addresses of addresses of structures. Many of these are calls to slapi_ch_free, but many are not - they are cases where we do not know what the type is going to be and may have to cast and modify the structure or pointer. I started replacing the calls to slapi_ch_free with slapi_ch_free_string, but there are many many more that need to be fixed. The dblayer code also contains a fix for https://bugzilla.redhat.com/show_bug.cgi?id=463991 - instead of checking for dbenv->foo_handle to see if a db "feature" is enabled, instead check the flags passed to open the dbenv. This works for bdb 4.2 through bdb 4.7 and probably other releases as well. Platforms tested: RHEL5 x86_64, Fedora 8 i386 Flag Day: no Doc impact: no
* Resolves: bug 457156Rich Megginson2008-08-111-2/+3
| | | | | | | | | Bug Description: GER: allow GER for non-existing entries (phase 2) Reviewed by: nhosoi (Thanks!) Fix Description: There are a couple of memory leaks in the code. acleffectiverights.c line 617 calls slapi_attr_get_valueset to get the list of objectclass values in objclassvals - this function allocates memory (returns a dup of the list) but this is not freed. The fix is to call slapi_valueset_free() to free it. The allattrs and opattrs arrays are not freed in all conditions. The fix is to make sure they are freed in all conditions. Platforms tested: RHEL5, Fedora 8 Flag Day: no Doc impact: no
* Resolves: #457156Noriko Hosoi2008-07-311-2/+10
| | | | | | | | Summary: GER: allow GER for non-existing entries (phase 2) (comment #6) Description: additional fix for the previous checkin. Not just checking if dn is NULL or not, but also checking the length of dn is greater than 0. If both conditions are satisfied, locate the template entry at the dn.
* Resolves: #457156Noriko Hosoi2008-07-311-5/+21
| | | | | | | | Summary: GER: allow GER for non-existing entries (phase 2) (comment #3) Description: get the target dn from the pblock and add it to the template entry dn if available. Plus a memory leak was found and fixed at the same time. Following the suggestion from Nathan, the "dummy" attributes are replaced with "(template_attribute)".
* Resolves: #456752Noriko Hosoi2008-07-281-33/+60
| | | | | | | | | Summary: GER: supporting "dn" and extensible object class is missing Description: 1. Extensible object class cannot use the schema info. Evaluate existing attributes with no schema check. 2. dn is not an attribute belonging to an entry, but treat is as it is if it's given as a part of the attribute list.
* Resolves: #456296Noriko Hosoi2008-07-231-0/+12
| | | | | | | Summary: GER: attribute types which do not belong to an entry should not be returned with effective rights Description: when an attribute was given to the search request and the attribute in the list does not belong to the entry, it was returning "*:none", which was not true. The star should be the attribute type.
* Resoves: #448831Noriko Hosoi2008-06-301-1/+1
| | | | | | | | Summary: attacker can tie up CPU in regex code Description: when substring search is requested, sets the time limit based upon the nsslapd-timelimit value. Pass the timelimit (time_up) to the regular expression function. When the time is up, it returns the "Timelimit exceeded" error. Note: timelimit is applied non-Directory Manager users.
* Resolves: #437525Noriko Hosoi2008-06-271-13/+261
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: GER: allow GER for non-existing entries Description: [slapd/charray.c] new: charray_merge_nodup -- merge 2 string arrays skipping the duplicates modified: charray_remove -- introduced "freeit" flag. If true, the removed string is freed. (The API is used only in chainingdb. The change is applied to the plugin.) [slapd/opshared.c] modified: check OP_FLAG_GET_EFFECTIVE_RIGHTS in the iterate to support "@<objectclass>". It's needed to do at the location since we have to call acl plugin even when no entries are returned from the search. If no entries are returned and "@<objectclass>" is found in the attribute list, acl effective rights code generates the corresponding template entry. [slapd/pblock.c] place to store gerattrs is added (SLAPI_SEARCH_GERATTRS), where gerattrs is an array of strings which store "...@<objectclass>". [slapd/result.c] moved OP_FLAG_GET_EFFECTIVE_RIGHTS checking to iterate (opshared.c) [slapd/schema.c] new: slapi_schema_list_objectclass_attributes -- return the required and/or allowed attributes belonging to the given objectclass. This is used to support "*" and "+" in the get effective rights. new: slapi_schema_get_superior_name -- return the superior objectclass name of the given objectclass. [slapd/search.c] if "<attr>@<objectclass>" is found in the attribute list, cut the <attr> part out and added to the attrs array (pblock SLAPI_SEARCH_ATTRS) and store the original string to the gerattrs (pblock SLAPI_SEARCH_GERATTRS). [plugin/acl/acleffectiverights.c] modified: _ger_g_permission_granted -- if the requester and the subject user are identical, give "g" permission modified: _ger_parse_control -- replaced strcpy with memmove since strcpy does not guarantee the result of the overlap copy. modified: _ger_get_attrs_rights -- support "*" (all attributes belonging to the object) and "+" (operational attributes). If repeated attributes are found in the given attribute list, they are reduced to one. new: _ger_generate_template_entry -- generate a template entry if "@<objectclass>" is passed. [pluginc/cb/*] adjusted to the updated charray_remove. Please see also this wiki page for the overview and test cases. http://directory.fedoraproject.org/wiki/Get_Effective_Rights_for_non-present_attributes
* Resolves: 440333Nathan Kinder2008-04-031-1/+1
| | | | Summary: Fixed valrgind errors about use of unitialized values.
* Resolves: #339791Noriko Hosoi2007-10-242-10/+31
| | | | | | | Summary: rhds71sp1 rhel3u6 - ns-slapd process dies with segmentation fault Description: ldap_utf8prev, LDAP_UTF8PREV, and LDAP_UTF8DEC were sometimes used without checking the returned pointer going back beyond the beginning of the string.
* Resolves: bug 232910Rich Megginson2007-10-191-9/+9
| | | | | Description: ACI targetattr list parser is whitespace sensitive Fix Description: In addition to the previous fixes, test for quote at end of string before incrementing s - otherwise test will always fail.
* Resolves: bug 232910Rich Megginson2007-10-191-8/+15
| | | | | Description: ACI targetattr list parser is whitespace sensitive Fix Description: I made it too sensitive. The parser should allow simple unquoted strings. However, if it begins with a quote, it must end with a quote.
* Resolves: bug 297221Rich Megginson2007-10-192-4/+14
| | | | | | Description: rhds71 Malformed Dynamic Authorization Group makes Directory Server Crash Reviewed by: supplemental Fix Description: In some cases, it is ok if the filter is NULL. So just allow NULL in those cases. slapi_str2filter must take either NULL or a writable string, so make sure we pass those in correctly.
* Resolves: bug 297221Rich Megginson2007-10-181-0/+8
| | | | | | | | | | Bug Description: rhds71 Malformed Dynamic Authorization Group makes Directory Server Crash Reviewed by: nhosoi (Thanks!) Fix Description: The problem was that we were not checking the return value of slapi_str2filter(). I added a check at the crash site, and it will not print out a helpful error message. I did a search through the code looking for other similar places and found a couple. I added similar code in those places. I added an initialization of a buffer to null, as suggested by nhosoi. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Resolves: bug 232910Rich Megginson2007-10-181-1/+10
| | | | | | | | | | | Bug Description: ACI targetattr list parser is whitespace sensitive Reviewed by: nkinder, nhosoi (Thanks!) Files: see diff Branch: HEAD Fix Description: Need to trim trailing whitespace from the targetattr clause. I noticed that targetattrfilters had the same problem, except it returned ACL_SYNTAX_ERR in that case, so I changed targetattr to do the same. Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no
* Resolves: #188320Noriko Hosoi2007-10-187-62/+45
| | | | Summary: HP-UX: warnings reported by the HP-UX compiler
* Resolves: 288321Nathan Kinder2007-10-041-15/+26
| | | | Summary: Handle poorly formatted DN's when normalizing. Also only check modify values against authenticated DN for DN syntax attributes.
* Resolves: #237040Noriko Hosoi2007-04-191-124/+0
| | | | Summary: Remove obsolete makefiles
* Resolves: #214533Noriko Hosoi2006-11-1014-0/+70
| | | | | | | | | | Summary: configure needs to support --with-fhs (Comment #6) Changes: Added the following include next to the end of the copyright block. + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif +
* Resolves: #214728Noriko Hosoi2006-11-101-1/+0
| | | | | Summary: Cleaning up obsolete macros in the build Changes: eliminated macro NSPR20 (Comment #9)
* Resolves: #210947Noriko Hosoi2006-10-251-1/+1
| | | | | Summary: parameterizing the hardcoded paths (phase 3. installed binaries, change log, setup) Comment #23
* Bug: 205456Rich Megginson2006-09-061-5/+3
| | | | | | Description: Enable DS Core build/install on HP-UX Fix Description: remove some bogus adminutil and nsdshttpd stuff from the plugin makefiles Reviewed by: nhosoi (Thanks!)
* Bug(s) fixed: 205456Rich Megginson2006-09-061-3/+0
| | | | | | | | | | | | | | | | | | | | | | | Bug Description: Enable core DS build Reviewed by: nkinder, nhosoi (Thanks!) Fix Description: I turned off all of the other components in the build, such as adminserver, setuputil, clients, etc. and enabled the packaging step when building just the core DS. Now, when you build just the core DS, you get a slapd.tar.gz which you unpack in the server root you create e.g. mkdir /opt/rhds ; cd /opt/rhds ; tar xfz slapd.tar.gz In order to create an instance, you have to use the ds_newinst.pl script as described here - http://directory.fedora.redhat.com/wiki/Install_Guide#Installing_just_the_core_directory_server I also got rid of several references to adminutil that are not needed anymore. Platforms tested: RHEL4 64 Flag Day: Yes. In order to build the full setuputil/adminserver package, you must specify USE_SETUPUTIL=1 USE_ADMINSERVER=1 etc. on the make/gmake command line. Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: I need to change the acceptance tests to be able to test just the core DS package.
* 204517 - Use new ber types throughout the server code.Nathan Kinder2006-08-311-1/+1
|
* [191832] changing password sometimes crashes the server [Admin Server ↵Noriko Hosoi2006-05-191-2/+2
| | | | | | password always remembers initial password on (part 2)] acl_access_allowed: changed to check the given entry address with the one in aclpb. If they don't match, even if the sdn's match, let acl re-evaluate.
* Bug(s) fixed: 186280Rich Megginson2006-04-112-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug Description: ldapserver: Close potential security vulnerabilities in CGI code Reviewed by: Nathan, Noriko, and Pete (Thanks!) Fix Description: Clean up usage of sprintf, strcpy, fgets instead of gets, fixed buffer usage, etc., mostly in the CGI code and other user facing code (i.e. setup). Also, Steve Grubb told me about a GCC trick to force it to check printf style varargs functions, to check the format string against the argument string, for type mismatches, missing arguments, and too many arguments. In the CGI form argument parsing code, we needed to be more careful about checking for bad input - good input is supposed to look like this: name=value&name=value&..... &name=value. I don't think the original code was checking properly for something like name&name=value. There was another place where we were not checking to see if a buffer had enough room before appending a string to it. I had to change a couple of functions to allow passing in the size of the buffer. Fixed some issues raised by Noriko and Nathan. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
* Bug(s) fixed: 172005Rich Megginson2005-10-291-1/+1
| | | | | | | | | | | | | Bug Description: Change ldapserver version to 1.0 Reviewed by: Noriko (Thanks!) Fix Description: This also fixes some lingering build issues involving perldap, which is no longer a separate setup package, but just gets included into DS in a similar manner to nspr, nss, etc. Platforms tested: RHEL4 Flag Day: no Doc impact: no QA impact: should be covered by regular nightly and manual testing New Tests integrated into TET: none
* Fixed licensing typoNathan Kinder2005-04-1917-17/+51
|
* 155068 - Added license to source filesNathan Kinder2005-04-1517-0/+510
|
* [Bug 146919] Directory Server rebrandingNoriko Hosoi2005-03-251-1/+1
| | | | | | | | | | 1) Brandx -> Fedora 2) Pick up new internal component set (Admin SDK, Setup SDK, Admin Server) 3) Use JRE from the Admin Server package 4) Docs a) Componentize Docs b) Rebrand Docs c) Drop packaging Administration Guide in the external version
* This one is mostly strcpy/strcat checking, checking for null strings before ↵Rich Megginson2005-03-112-7/+5
| | | | strlen, removing some dead code, other odds and ends.
* clean up sprintf usage and many other flawfinder issues; clean up compiler ↵Rich Megginson2005-03-058-196/+88
| | | | warnings on Linux; remove pam_passthru from DS 7.1
* 149951 - Updated source code copyrightsNathan Kinder2005-02-2817-33/+33
|
* get rid of adminutil dependency on core DSRich Megginson2005-02-241-3/+5
|
* [146919] De-brand the Directory Server as "brandx"Noriko Hosoi2005-02-021-1/+1
|
* remove references to ldapserver from makefiles; use BUILD_ROOT instead of ↵Rich Megginson2005-01-281-2/+2
| | | | MCOM_ROOT and NSROOT; BUILD_ROOT is now the ldapserver directory rather than its parent
* Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. ↵ldapserver7xcvsadm2005-01-2117-0/+17338
(foxworth)