ldap/servers
by Noriko Hosoi
ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in | 69 +++++++++++++------
1 file changed, 50 insertions(+), 19 deletions(-)
New commits:
commit 8bb10ab2c2a1283aac4540a023acb0361f56f003
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Jun 27 16:13:00 2013 -0700
Ticket #47374 - flush.pl is not included in perl5
Fix description: replaced obsolete flush.pl and getopts.pl with
perl5 equivalents.
https://fedorahosted.org/389/ticket/47374
Reviewed by Rich (Thank you!!)
diff --git a/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in b/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in
index ce18f7c..51af0db 100755
--- a/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in
+++ b/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in
@@ -55,6 +55,7 @@
## Now, dc style namingcontext can be used.
#------------------------------------------------------------------------
+use Getopt::Long;
sub PrintUsage {
print STDERR
@@ -68,8 +69,7 @@ sub PrintUsage {
"\t -m naming attribute for RDN\n",
"\t -n number of entries to generate\n",
"\t -b beginning number for RDN (default 1 - ending number is -n value)\n",
- "\t -O for organizationalPersons, default is inetOrgPerson\n",
- "\t -p for piranha style aci's, default is barracuda\n",
+ "\t -p for organizationalPersons, default is inetOrgPerson\n",
"\t -r seed---seed number for random number generator\n",
"\t -g print extra entries for orgchart\n",
"\t -x suppress printing pre amble\n",
@@ -533,30 +533,61 @@ my $mycert =
);
@managers = (\%m0, \%m1, \%m2, \%m3, \%m4, \%m5, \%m6, \%m7, \%m8, \%m9, \%m10, \%m11, \%m12, \%m13, \%m14, \%m15, \%m16, \%m17);
-require "flush.pl";
-require "getopts.pl";
-&Getopts('n:o:s:r:cOvpqgxyl:z:m:b:j:');
-
-$Number_To_Generate = $opt_n;
-$Verbose = $opt_v;
-$Quiet = $opt_q;
-$Output_File_Name = $opt_o;
-$Random_Seed = $opt_r || 0xdbdbdbdb;
-$TargetServer = $opt_t;
-$debug = $opt_d;
-$Suffix = $opt_s || 'dc=example,dc=com';
+sub flush {
+ local($old) = select(shift);
+ $| = 1;
+ print "";
+ $| = 0;
+ select($old);
+}
+
+my $Number_To_Generate = 1;
+$Output_File_Name = "output.ldif";
+$Random_Seed = 1;
+$Suffix = 'dc=example,dc=com';
+$NamingType = "uid";
+$inetOrgPerson = "objectClass: inetOrgPerson\n";
+$PrintOrgChartDat = 0;
+$DataDir = "/usr/share/dirsrv/data";
+$BeginNum = 0;
+
+$Verbose = 0;
+$debug = 0;
+$Quiet = 0;
+
+$opt_x = 0;
+$opt_y = 0;
+$opt_z = "";
+
+GetOptions('number=i' => \$Number_To_Generate,
+ 'output=s' => \$Output_File_Name,
+ 'random=i' => \$Random_Seed,
+ 'suffix=s' => \$Suffix,
+ 'cnInDn' => \$opt_c,
+ 'moreChoices=s' => \$opt_m,
+ 'person' => \$opt_p,
+ 'graph' => \$PrintOrgChartDat,
+ 'location=s' => \$DataDir,
+ 'beginNum=i' => \$BeginNum,
+ 'x' => \$opt_x,
+ 'y' => \$opt_y,
+ 'z' => \$opt_z,
+ 'j' => \$opt_j,
+ 'verbose' => \$Verbose,
+ 'debug' => \$debug,
+ 'quiet' => \$Quiet,
+ );
+
+$Random_Seed = $Random_Seed || 0xdbdbdbdb;
$NamingType = "cn" if ($opt_c);
-$NamingType = "uid" if (!$opt_c);
$NamingType = $opt_m if ($opt_m);
-$inetOrgPerson = "objectClass: inetOrgPerson\n" if (!$opt_O);
-$PrintOrgChartDat = $opt_g;
-$DataDir = $opt_l || "@templatedir@";
+$inetOrgPerson = "" if ($opt_p);
+
$ExtraObjClasses = "";
if ($opt_z) {
$ExtraObjClasses = join "\n", map { "objectClass: $_" } split(/ /, $opt_z);
$ExtraObjClasses .= "\n";
}
-$BeginNum = $opt_b || 0;
$printpreamble = 1;
if ("" != $opt_x)
{
10 years, 10 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/dynalib.c | 47 ++++-------------------------------
ldap/servers/slapd/fedse.c | 50 ++++++++++++++++++++++++++++++++++++++
ldap/servers/slapd/slapi-plugin.h | 10 +++++++
ldap/servers/slapd/util.c | 39 +++++++++++++++++++++++++++++
4 files changed, 105 insertions(+), 41 deletions(-)
New commits:
commit a4b81c0ae59a4246d2d44790efea093a62fc972c
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Jun 27 15:48:30 2013 -0700
Ticket #47384 - Plugin library path validation
Bug description: ldapmodify could replace the plugin path with
an invalid path.
Fix description: This patch adds the validation code to dse
callback. If modify operation is requested for a plugin entry,
the registered callback check_plugin_path is called and check
the given plugin path.
This patch also has made get_plugin_name public as slapi_get_
plugin_name. Now, the following plugin paths are allowed:
/path/to/lib<plugin>.so, /path/to/lib<plugin>,
lib<plugin>.so, lib<plugin>
https://fedorahosted.org/389/ticket/47384
Reviewed by Rich (Thanks!!)
diff --git a/ldap/servers/slapd/dynalib.c b/ldap/servers/slapd/dynalib.c
index 58481a8..0448537 100644
--- a/ldap/servers/slapd/dynalib.c
+++ b/ldap/servers/slapd/dynalib.c
@@ -58,13 +58,6 @@ static struct dynalib {
static void symload_report_error( const char *libpath, char *symbol, char *plugin,
int libopen );
-/* construct a full path and name of a plugin
- very similar to PR_GetLibraryName except that function inserts
- the string "lib" at the beginning of name, making that function
- unsuitable for constructing plugin names
-*/
-static char *get_plugin_name(const char *dir, const char *name);
-
static void free_plugin_name(char *name)
{
PR_smprintf_free(name);
@@ -114,7 +107,11 @@ sym_load_with_flags( char *libpath, char *symbol, char *plugin, int report_error
}
if (PR_SUCCESS != PR_Access(libpath, PR_ACCESS_READ_OK)) {
- libSpec.value.pathname = get_plugin_name(PLUGINDIR, libpath);
+ if (strncmp(libpath, PLUGINDIR, strlen(PLUGINDIR))) {
+ libSpec.value.pathname = slapi_get_plugin_name(PLUGINDIR, libpath);
+ } else {
+ libSpec.value.pathname = slapi_get_plugin_name(NULL, libpath);
+ }
/* then just handle that failure case with symload_report_error below */
}
@@ -123,7 +120,7 @@ sym_load_with_flags( char *libpath, char *symbol, char *plugin, int report_error
symload_report_error( libSpec.value.pathname, symbol, plugin, 0 /* lib not open */ );
}
if (libSpec.value.pathname != libpath) {
- free_plugin_name((char *)libSpec.value.pathname); /* cast ok - allocated by get_plugin_name */
+ free_plugin_name((char *)libSpec.value.pathname); /* cast ok - allocated by slapi_get_plugin_name */
}
return( NULL );
}
@@ -171,35 +168,3 @@ symload_report_error( const char *libpath, char *symbol, char *plugin, int libop
libpath, plugin, 0 );
}
}
-
-/* PR_GetLibraryName does almost everything we need, and unfortunately
- a little bit more - it adds "lib" to be beginning of the library
- name if the library name does not end with the current platform
- DLL suffix - so
- foo.so -> /path/foo.so
- libfoo.so -> /path/libfoo.so
- BUT
- foo -> /path/libfoo.so
- libfoo -> /path/liblibfoo.so
-*/
-static char *
-get_plugin_name(const char *path, const char *lib)
-{
- const char *libstr = "/lib";
- size_t libstrlen = 4;
- char *fullname = PR_GetLibraryName(path, lib);
- char *ptr = PL_strrstr(fullname, lib);
-
- /* see if /lib was added */
- if (ptr && ((ptr - fullname) >= libstrlen)) {
- /* ptr is at the libname in fullname, and there is something before it */
- ptr -= libstrlen; /* ptr now points at the "/" in "/lib" if it is there */
- if (0 == PL_strncmp(ptr, libstr, libstrlen)) {
- /* just copy the remainder of the string on top of here */
- ptr++; /* ptr now points at the "l" in "/lib" - keep the "/" */
- memmove(ptr, ptr+3, strlen(ptr+3)+1);
- }
- }
-
- return fullname;
-}
diff --git a/ldap/servers/slapd/fedse.c b/ldap/servers/slapd/fedse.c
index 5434c75..ab6ee62 100644
--- a/ldap/servers/slapd/fedse.c
+++ b/ldap/servers/slapd/fedse.c
@@ -1551,6 +1551,8 @@ static const char *easter_egg_photos[NUM_EASTER_EGG_PHOTOS + 1];
static struct dse *pfedse= NULL;
+static int check_plugin_path(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg);
+
static void
internal_add_helper(Slapi_Entry *e, int dont_write_file)
{
@@ -1786,6 +1788,7 @@ setup_internal_backends(char *configdir)
Slapi_Backend *be;
Slapi_DN encryption;
Slapi_DN saslmapping;
+ Slapi_DN plugins;
slapi_sdn_init_ndn_byref(&monitor,"cn=monitor");
slapi_sdn_init_ndn_byref(&counters,"cn=counters,cn=monitor");
@@ -1794,6 +1797,7 @@ setup_internal_backends(char *configdir)
slapi_sdn_init_ndn_byref(&encryption,"cn=encryption,cn=config");
slapi_sdn_init_ndn_byref(&saslmapping,"cn=mapping,cn=sasl,cn=config");
+ slapi_sdn_init_ndn_byref(&plugins,"cn=plugins,cn=config");
/* Search */
dse_register_callback(pfedse,SLAPI_OPERATION_SEARCH,DSE_FLAG_PREOP,&config,LDAP_SCOPE_BASE,"(objectclass=*)",read_config_dse,NULL);
@@ -1809,6 +1813,7 @@ setup_internal_backends(char *configdir)
dse_register_callback(pfedse,SLAPI_OPERATION_MODIFY,DSE_FLAG_POSTOP,&config,LDAP_SCOPE_BASE,"(objectclass=*)",postop_modify_config_dse,NULL);
dse_register_callback(pfedse,SLAPI_OPERATION_MODIFY,DSE_FLAG_PREOP,&root,LDAP_SCOPE_BASE,"(objectclass=*)",modify_root_dse,NULL);
dse_register_callback(pfedse,SLAPI_OPERATION_MODIFY,DSE_FLAG_PREOP,&saslmapping,LDAP_SCOPE_SUBTREE,"(objectclass=nsSaslMapping)",sasl_map_config_modify,NULL);
+ dse_register_callback(pfedse,SLAPI_OPERATION_MODIFY,DSE_FLAG_PREOP,&plugins,LDAP_SCOPE_SUBTREE,"(objectclass=nsSlapdPlugin)",check_plugin_path,NULL);
/* Delete */
dse_register_callback(pfedse,SLAPI_OPERATION_DELETE,DSE_FLAG_PREOP,&config,LDAP_SCOPE_BASE,"(objectclass=*)",dont_allow_that,NULL);
@@ -1839,6 +1844,7 @@ setup_internal_backends(char *configdir)
slapi_sdn_done(&snmp);
slapi_sdn_done(&root);
slapi_sdn_done(&saslmapping);
+ slapi_sdn_done(&plugins);
} else {
slapi_log_error( SLAPI_LOG_FATAL, "dse",
"Please edit the file to correct the reported problems"
@@ -1903,3 +1909,47 @@ int fedse_create_startOK(char *filename, char *startokfilename, const char *con
return rc;
}
+
+static int
+check_plugin_path(Slapi_PBlock *pb,
+ Slapi_Entry* entryBefore,
+ Slapi_Entry* e,
+ int *returncode,
+ char *returntext,
+ void *arg)
+{
+ /* check for invalid nsslapd-pluginPath */
+ char **vals = slapi_entry_attr_get_charray (e, ATTR_PLUGIN_PATH);
+ int plugindir_len = sizeof(PLUGINDIR)-1;
+ int j = 0;
+ int rc = SLAPI_DSE_CALLBACK_OK;
+ for (j = 0; vals && vals[j]; j++) {
+ char *full_path = NULL;
+ char *resolved_path = NULL;
+ char *res = NULL;
+
+ if ( *vals[j] == '/' ) { /* absolute path */
+ full_path = slapi_get_plugin_name(NULL, vals[j]);
+ } else { /* relative path */
+ full_path = slapi_get_plugin_name(PLUGINDIR, vals[j]);
+ }
+ resolved_path = slapi_ch_malloc(strlen(full_path) + 1);
+ res = realpath( full_path, resolved_path );
+ if (res) {
+ if (strncmp(PLUGINDIR, resolved_path, plugindir_len) != 0) {
+ *returncode = LDAP_UNWILLING_TO_PERFORM;
+ returntext = "Invalid plugin path";
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ }
+ } else {
+ *returncode = LDAP_UNWILLING_TO_PERFORM;
+ returntext = "Invalid plugin path";
+ rc = SLAPI_DSE_CALLBACK_ERROR;
+ }
+ slapi_ch_free_string(&full_path);
+ slapi_ch_free_string(&resolved_path);
+ }
+ slapi_ch_array_free(vals);
+
+ return rc;
+}
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index d1e90de..9a66f2a 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -7495,6 +7495,16 @@ int slapi_eq_cancel(Slapi_Eq_Context ctx);
*/
void *slapi_eq_get_arg (Slapi_Eq_Context ctx);
+/**
+ * Construct a full path and name of a plugin.
+ *
+ * \param dir The Directory where the plugin is located.
+ * \param name The name of the plugin.
+ *
+ * \return absolute path of the plugin. Caller is responsible to free it.
+ */
+char *slapi_get_plugin_name(const char *dir, const char *name);
+
#ifdef __cplusplus
}
#endif
diff --git a/ldap/servers/slapd/util.c b/ldap/servers/slapd/util.c
index 653914b..fb92867 100644
--- a/ldap/servers/slapd/util.c
+++ b/ldap/servers/slapd/util.c
@@ -1395,3 +1395,42 @@ slapi_str_to_u64(const char *s)
(v6 << 36) | (v7 << 32) | (v8 << 28) | (v9 << 24) | (v10 << 20) | (v11 << 16) |
(v12 << 12) | (v13 << 8) | (v14 << 4) | v15;
}
+
+/* PR_GetLibraryName does almost everything we need, and unfortunately
+ a little bit more - it adds "lib" to be beginning of the library
+ name if the library name does not end with the current platform
+ DLL suffix - so
+ foo.so -> /path/foo.so
+ libfoo.so -> /path/libfoo.so
+ BUT
+ foo -> /path/libfoo.so
+ libfoo -> /path/liblibfoo.so
+ /path/libfoo -> lib/path/libfoo.so
+*/
+char *
+slapi_get_plugin_name(const char *path, const char *lib)
+{
+ const char *libstr = "/lib";
+ size_t libstrlen = 4;
+ char *fullname = PR_GetLibraryName(path, lib);
+ char *ptr = PL_strrstr(fullname, lib);
+
+ /* see if /lib was added */
+ if (ptr && ((ptr - fullname) >= libstrlen)) {
+ /* ptr is at the libname in fullname, and there is something before it */
+ ptr -= libstrlen; /* ptr now points at the "/" in "/lib" if it is there */
+ if (0 == PL_strncmp(ptr, libstr, libstrlen)) {
+ /* just copy the remainder of the string on top of here */
+ ptr++; /* ptr now points at the "l" in "/lib" - keep the "/" */
+ memmove(ptr, ptr+3, strlen(ptr+3)+1);
+ }
+ } else if ((NULL == path) && (0 == strncmp(fullname, "lib", 3))) {
+ /*
+ * case: /path/libfoo -> lib/path/libfoo.so
+ * remove "lib".
+ */
+ memmove(fullname, fullname+3, strlen(fullname)-2);
+ }
+
+ return fullname;
+}
10 years, 10 months
rpm/389-ds-base.spec.in
by Nathan Kinder
rpm/389-ds-base.spec.in | 108 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 103 insertions(+), 5 deletions(-)
New commits:
commit a77d3d1f3afcfd1761d9f62acd7b84b3d0d6751a
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Wed Jun 26 11:10:55 2013 -0700
Add hardened build option and correct changelog dates
This adds the hardened build option to our spec file used for
developer RPM builds. This makes the build use PIE flags and
full relro during compilation.
In addition, this corrects some of the dates in changelog entries.
More specifically, the day of week did not line up with the date.
These changes bring our spec file in-line with the Fedora 19+ spec
file.
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index 0aad60d..3b00556 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -19,6 +19,9 @@
# systemd support
%global groupname %{pkgname}.target
+# set PIE flag
+%global _hardened_build 1
+
Summary: 389 Directory Server (base)
Name: 389-ds-base
Version: __VERSION__
@@ -312,6 +315,101 @@ fi
%{_libdir}/%{pkgname}/libslapd.so.*
%changelog
+* Sat Jun 15 2013 Noriko Hosoi <nhosoi(a)redhat.com> - 1.3.1.2-1
+- bump version to 1.3.1.2
+- Ticket 47391 - deleting and adding userpassword fails to update the password
+- Coverity Fixes (Part 7)
+
+* Fri Jun 14 2013 Noriko Hosoi <nhosoi(a)redhat.com> - 1.3.1.1-1
+- bump version to 1.3.1.1
+- Ticket 402 - nhashed#user#password in entry extension
+- Ticket 511 - Revision - allow turning off vattr lookup in search entry return
+- Ticket 580 - Wrong error code return when using EXTERNAL SASL and no client certificate
+- Ticket 47327 - error syncing group if group member user is not synced
+- Ticket 47355 - dse.ldif doesn't replicate update to nsslapd-sasl-mapping-fallback
+- Ticket 47359 - new ldap connections can block ldaps and ldapi connections
+- Ticket 47362 - ipa upgrade selinuxusermap data not replicating
+- Ticket 47375 - flush_ber error sending back start_tls response will deadlock
+- Ticket 47376 - DESC should not be empty as per RFC 2252 (ldapv3)
+- Ticket 47377 - make listen backlog size configurable
+- Ticket 47378 - fix recent compiler warnings
+- Ticket 47383 - connections attribute in cn=snmp,cn=monitor is counted twice
+- Ticket 47385 - DS not shutting down when disk monitoring threshold is reached
+- Coverity Fixes (part 1)
+- Coverity Fixes (Part 2)
+- Coverity Fixes (Part 3)
+- Coverity Fixes (Part 4)
+- Coverity Fixes (Part 5)
+
+* Thu May 02 2013 Noriko Hosoi <nhosoi(a)redhat.com> - 1.3.1.0-1
+- bump version to 1.3.1.0
+- Ticket 332 - Command line perl scripts should attempt most secure connection type first
+- Ticket 342 - better error message when cache overflows
+- Ticket 417 - RFE - forcing passwordmustchange attribute by non-cn=directory manager
+- Ticket 419 - logconv.pl - improve memory management
+- Ticket 422 - 389-ds-base - Can't call method "getText"
+- Ticket 433 - multiple bugs in start-dirsrv, stop-dirsrv, restart-dirsrv scripts
+- Ticket 458 - RFE - Make it possible for privileges to be provided to an admin user to import an LDIF file containing hashed passwords
+- Ticket 471 - logconv.pl tool removes the access logs contents if "-M" is not correctly used
+- Ticket 487 - Possible to add invalid attribute values to PAM PTA plugin configuration
+- Ticket 502 - setup-ds.pl script should wait if "semanage.trans.LOCK" presen
+- Ticket 505 - use lock-free access name2asi and oid2asi tables (additional)
+- Ticket 508 - lock-free access to FrontendConfig structure
+- Ticket 511 - allow turning off vattr lookup in search entry return
+- Ticket 525 - Introducing a user visible configuration variable for controlling replication retry time
+- Ticket 528 - RFE - get rid of instance specific scripts
+- Ticket 529 - dn normalization must handle multiple space characters in attributes
+- Ticket 532 - RUV is not getting updated for both Master and consumer
+- Ticket 533 - only scan for attributes to decrypt if there are encrypted attrs configured
+- Ticket 534 - RFE: Add SASL mappings fallback
+- Ticket 537 - Improvement of range search
+- Ticket 539 - logconv.pl should handle microsecond timing
+- Ticket 543 - Sorting with attributes in ldapsearch gives incorrect result
+- Ticket 545 - Segfault during initial LDIF import: str2entry_dupcheck()
+- Ticket 547 - Incorrect assumption in ndn cache
+- Ticket 550 - posix winsync will not create memberuid values if group entry become posix group in the same sync interval
+- Ticket 551 - Multivalued rootdn-days-allowed in RootDN Access Control plugin always results in access control violation
+- Ticket 552 - Adding rootdn-open-time without rootdn-close-time to RootDN Acess Control results in inconsistent configuration
+- Ticket 558 - Replication - make timeout for protocol shutdown configurable
+- Ticket 561 - disable writing unhashed#user#password to changelog
+- Ticket 563 - DSCreate.pm: Error messages cannot be used in the if expression since they could be localized.
+- Ticket 565 - turbo mode and replication - allow disable of turbo mode
+- Ticket 571 - server does not accept 0 length LDAP Control sequence
+- Ticket 574 - problems with dbcachesize disk space calculation
+- Ticket 583 - dirsrv fails to start on reboot due to /var/run/dirsrv permissions
+- Ticket 585 - Behaviours of "db2ldif -a <filename>" and "db2ldif.pl -a <filename>" are inconsistent
+- Ticket 587 - Replication error messages in the DS error logs
+- Ticket 588 - Create MAN pages for command line scripts
+- Ticket 600 - Server should return unavailableCriticalExtension when processing a badly formed critical control
+- Ticket 603 - A logic error in str2simple
+- Ticket 604 - Required attribute not checked during search operation
+- Ticket 608 - Posix Winsync plugin throws "posix_winsync_end_update_cb: failed to add task entry" error message
+- Ticket 611 - logconv.pl missing stats for StartTLS, LDAPI, and AUTOBIND
+- Ticket 612 - improve dbgen rdn generation, output
+- Ticket 613 - ldclt: add timestamp, interval, nozeropad, other improvements
+- Ticket 616 - High contention on computed attribute lock
+- Ticket 618 - Crash at shutdown while stopping replica agreements
+- Ticket 620 - Better logging of error messages for 389-ds-base
+- Ticket 621 - modify operations without values need to be written to the changelog
+- Ticket 622 - DS logging errors "libdb: BDB0171 seek: 2147483648: (262144 * 8192) + 0: No such file or directory
+- Ticket 631 - Replication: "Incremental update started" status message without consumer initialized
+- Ticket 633 - allow nsslapd-nagle to be disabled, and also tcp cork
+- Ticket 47299 - allow cmdline scripts to work with non-root user
+- Ticket 47302 - get rid of sbindir start/stop/restart slapd scripts
+- Ticket 47303 - start/stop/restart dirsrv scripts should report and error if no instances
+- Ticket 47304 - reinitialization of a master with a disabled agreement hangs
+- Ticket 47311 - segfault in db2ldif(trigger by a cleanallruv task)
+- Ticket 47312 - replace PR_GetFileInfo with PR_GetFileInfo64
+- Ticket 47315 - filter option in fixup-memberof requires more clarification
+- Ticket 47325 - Crash at shutdown on a replica aggrement
+- Ticket 47330 - changelog db extension / upgrade is obsolete
+- Ticket 47336 - logconv.pl -m not working for all stats
+- Ticket 47341 - logconv.pl -m time calculation is wrong
+- Ticket 47343 - 389-ds-base: Does not support aarch64 in f19 and rawhide
+- Ticket 47347 - Simple paged results should support async search
+- Ticket 47348 - add etimes to per second/minute stats
+- Ticket 47349 - DS instance crashes under a high load
+
* Thu Mar 28 2013 Noriko Hosoi <nhosoi(a)redhat.com> - 1.3.0.5-1
- bump version to 1.3.0.5
- Ticket 47308 - unintended information exposure when anonymous access is set to rootdse
@@ -493,7 +591,7 @@ Ticket 429 - added nsslapd-readonly to DS schema
Ticket 403 - fix CLEANALLRUV regression from last commit
Trac Ticket #346 - Slow ldapmodify operation time for large quantities of multi-valued attribute values
-* Tue Aug 15 2012 Mark Reynolds <mareynol(a)redhat.com> - 1.2.11.10-1
+* Wed Aug 15 2012 Mark Reynolds <mareynol(a)redhat.com> - 1.2.11.10-1
db6b354 bumped version to 1.2.11.10
Ticket 403 - CLEANALLRUV revisions
@@ -1175,7 +1273,7 @@ ions
* Wed May 26 2010 Rich Megginson <rmeggins(a)redhat.com> - 1.2.6-0.4.a4
- 1.2.6.a4 release
-* Tue Apr 7 2010 Nathan Kinder <nkinder(a)redhat.com> - 1.2.6-0.4.a3
+* Wed Apr 7 2010 Nathan Kinder <nkinder(a)redhat.com> - 1.2.6-0.4.a3
- 1.2.6.a3 release
- add managed entries plug-in
- many bug fixes
@@ -1184,7 +1282,7 @@ ions
* Fri Apr 2 2010 Caolán McNamara <caolanm(a)redhat.com> - 1.2.6-0.3.a2
- rebuild for icu 4.4
-* Mon Mar 2 2010 Rich Megginson <rmeggins(a)redhat.com> - 1.2.6-0.2.a2
+* Tue Mar 2 2010 Rich Megginson <rmeggins(a)redhat.com> - 1.2.6-0.2.a2
- 1.2.6.a2 release
- add support for matching rules
- many bug fixes
@@ -1199,7 +1297,7 @@ ions
* Mon Jan 4 2010 Rich Megginson <rmeggins(a)redhat.com> - 1.2.5-0.5.rc4
- 1.2.5.rc4 release
-* Mon Dec 17 2009 Rich Megginson <rmeggins(a)redhat.com> - 1.2.5-0.4.rc3
+* Thu Dec 17 2009 Rich Megginson <rmeggins(a)redhat.com> - 1.2.5-0.4.rc3
- 1.2.5.rc3 release
* Mon Dec 7 2009 Rich Megginson <rmeggins(a)redhat.com> - 1.2.5-0.3.rc2
@@ -1271,7 +1369,7 @@ ions
- only create run dir if it does not exist
- CVS tag: FedoraDirSvr_1_2_0_RC1 FedoraDirSvr_1_2_0_RC1_20090330
-* Mon Oct 30 2008 Noriko Hosoi <nhosoi(a)redhat.com> - 1.1.3-7
+* Thu Oct 30 2008 Noriko Hosoi <nhosoi(a)redhat.com> - 1.1.3-7
- added db4-utils to Requires for verify-db.pl
* Mon Oct 13 2008 Noriko Hosoi <nhosoi(a)redhat.com> - 1.1.3-6
10 years, 10 months
ldap/servers
by Mark Reynolds
ldap/servers/slapd/back-ldbm/dblayer.c | 257 ++++++++++++++++++++-------------
1 file changed, 158 insertions(+), 99 deletions(-)
New commits:
commit 690f177e1dbac7337c8d508606f562b8efd35fa2
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Jun 26 13:38:36 2013 -0400
Ticket 47381 - nsslapd-db-transaction-batch-val turns to -1
Bug Description: If you set nsslapd-db-transaction-batch-val to zero, assuming
it was set to a number greater than zero, it gets changed to "-1".
Also, once it is set to zero, it is impossible to change the value
unless you edit dse.ldif manually.
Fix Description: First, do not transform a zero value to "-1". Second, allow the
changing of the value regardless what the current value is. If
batch transactions are disabled, log a mesage if we try to "enable"
it, stating that you need to restart the server.
Also needed to improve the synchronization if disabling batch txns,
as its possible to disable it while flushing is occurring.
Finally did a little code cleanup.
https://fedorahosted.org/389/ticket/47381
Reviewed by: Noriko(Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c
index daf1794..dbe1886 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -318,9 +318,9 @@ int dblayer_db_uses_logging(DB_ENV *db_env) {
return db_uses_feature(db_env, DB_INIT_LOG);
}
-/* this flag use if user remotely turned batching off */
+/* this flag is used if user remotely turned batching off */
+#define FLUSH_REMOTEOFF 0
-#define FLUSH_REMOTEOFF -1
/* routine that allows batch value to be changed remotely:
1. value = 0 turns batching off
@@ -337,51 +337,90 @@ dblayer_set_batch_transactions(void *arg, void *value, char *errorbuf, int phase
if (apply) {
if(phase == CONFIG_PHASE_STARTUP) {
- trans_batch_limit=val;
- } else if(trans_batch_limit != FLUSH_REMOTEOFF ) {
- if((val == 0) && (log_flush_thread)) {
- log_flush_thread=PR_FALSE;
+ trans_batch_limit = val;
+ } else {
+ if(val == 0){
+ if(log_flush_thread){
+ PR_Lock(sync_txn_log_flush);
+ }
trans_batch_limit = FLUSH_REMOTEOFF;
- } else if(val > 0) {
+ if(log_flush_thread){
+ log_flush_thread = PR_FALSE;
+ PR_Unlock(sync_txn_log_flush);
+ }
+ } else if(val > 0) {
+ if(trans_batch_limit == FLUSH_REMOTEOFF){
+ /* this requires a server restart to take effect */
+ LDAPDebug(LDAP_DEBUG_ANY,"dblayer_set_batch_transactions: enabling batch transactions "
+ "requires a server restart.\n",0,0,0);
+ } else if (!log_flush_thread){
+ /* we are already disabled, log a reminder of that fact. */
+ LDAPDebug(LDAP_DEBUG_ANY,"dblayer_set_batch_transactions: batch transactions was "
+ "previously disabled, this update requires a server restart.\n",0,0,0);
+ }
trans_batch_limit=val;
}
}
}
return retval;
}
+
int
dblayer_set_batch_txn_min_sleep(void *arg, void *value, char *errorbuf, int phase, int apply) {
int val = (int)((uintptr_t)value);
int retval = LDAP_SUCCESS;
if (apply) {
- if(phase == CONFIG_PHASE_STARTUP) {
- trans_batch_txn_min_sleep=val;
- } else if(trans_batch_txn_min_sleep != FLUSH_REMOTEOFF ) {
- if((val == 0) && (log_flush_thread)) {
- log_flush_thread=PR_FALSE;
+ if(phase == CONFIG_PHASE_STARTUP || phase == CONFIG_PHASE_INITIALIZATION) {
+ trans_batch_txn_min_sleep = val;
+ } else {
+ if(val == 0){
+ if(log_flush_thread){
+ PR_Lock(sync_txn_log_flush);
+ }
trans_batch_txn_min_sleep = FLUSH_REMOTEOFF;
- } else if(val > 0) {
- trans_batch_txn_min_sleep=val;
+ if(log_flush_thread){
+ log_flush_thread = PR_FALSE;
+ PR_Unlock(sync_txn_log_flush);
+ }
+ } else if(val > 0) {
+ if(trans_batch_txn_min_sleep == FLUSH_REMOTEOFF || !log_flush_thread){
+ /* this really has no effect until batch transactions are enabled */
+ LDAPDebug(LDAP_DEBUG_ANY,"dblayer_set_batch_txn_min_sleep: Warning batch transactions "
+ "is not enabled.\n",0,0,0);
+ }
+ trans_batch_txn_min_sleep = val;
}
}
}
return retval;
}
+
int
dblayer_set_batch_txn_max_sleep(void *arg, void *value, char *errorbuf, int phase, int apply) {
int val = (int)((uintptr_t)value);
int retval = LDAP_SUCCESS;
if (apply) {
- if(phase == CONFIG_PHASE_STARTUP) {
- trans_batch_txn_max_sleep=val;
- } else if(trans_batch_txn_max_sleep != FLUSH_REMOTEOFF ) {
- if((val == 0) && (log_flush_thread)) {
- log_flush_thread=PR_FALSE;
+ if(phase == CONFIG_PHASE_STARTUP || phase == CONFIG_PHASE_INITIALIZATION) {
+ trans_batch_txn_max_sleep = val;
+ } else {
+ if(val == 0){
+ if(log_flush_thread){
+ PR_Lock(sync_txn_log_flush);
+ }
trans_batch_txn_max_sleep = FLUSH_REMOTEOFF;
- } else if(val > 0) {
- trans_batch_txn_max_sleep=val;
+ if(log_flush_thread){
+ log_flush_thread = PR_FALSE;
+ PR_Unlock(sync_txn_log_flush);
+ }
+ } else if(val > 0) {
+ if(trans_batch_txn_max_sleep == FLUSH_REMOTEOFF || !log_flush_thread){
+ /* this really has no effect until batch transactions are enabled */
+ LDAPDebug(LDAP_DEBUG_ANY,"dblayer_set_batch_txn_max_sleep: Warning batch transactions "
+ "is not enabled.\n",0,0,0);
+ }
+ trans_batch_txn_max_sleep = val;
}
}
}
@@ -3663,7 +3702,7 @@ int dblayer_txn_commit_ext(struct ldbminfo *li, back_txn *txn, PRBool use_lock)
priv->dblayer_env &&
priv->dblayer_enable_transactions)
{
- txn_id = db_txn->id(db_txn);
+ txn_id = db_txn->id(db_txn);
return_value = TXN_COMMIT(db_txn, 0);
/* if we were given a transaction, and it is the same as the
current transaction in progress, pop it off the stack
@@ -3677,36 +3716,45 @@ int dblayer_txn_commit_ext(struct ldbminfo *li, back_txn *txn, PRBool use_lock)
txn->back_txn_txn = NULL;
}
if ((priv->dblayer_durable_transactions) && use_lock ) {
- if(trans_batch_limit > 0) {
- /* let log_flush thread do the flushing */
- PR_Lock(sync_txn_log_flush);
- txn_batch_slot = trans_batch_count++;
- txn_log_flush_pending[txn_batch_slot] = txn_id;
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "txn_commit (befor notify): batchcount: %d, txn_in_progress: %d, curr_txn: %x\n", trans_batch_count, txn_in_progress_count, txn_id);
- /* the log flush thread will periodically flush the txn log,
- * but in two cases it should be notified to do it immediately:
- * - the batch limit is passed
- * - there is no other outstanding txn
- */
- if (trans_batch_count > trans_batch_limit ||
- trans_batch_count == txn_in_progress_count)
- PR_NotifyCondVar(sync_txn_log_do_flush);
- /* we need to wait until the txn has been flushed before continuing
- * and returning success to the client, nit to vialate durability
- * PR_WaitCondvar releases and reaquires the lock
- */
- while (txn_log_flush_pending[txn_batch_slot] == txn_id)
- PR_WaitCondVar(sync_txn_log_flush_done, PR_INTERVAL_NO_TIMEOUT);
- txn_in_progress_count--;
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "txn_commit (before unlock): batchcount: %d, txn_in_progress: %d, curr_txn %x\n", trans_batch_count, txn_in_progress_count, txn_id);
- PR_Unlock(sync_txn_log_flush);
+ if(trans_batch_limit > 0 && log_flush_thread) {
+ /* let log_flush thread do the flushing */
+ PR_Lock(sync_txn_log_flush);
+ txn_batch_slot = trans_batch_count++;
+ txn_log_flush_pending[txn_batch_slot] = txn_id;
+ LDAPDebug(LDAP_DEBUG_BACKLDBM, "txn_commit (before notify): batchcount: %d, "
+ "txn_in_progress: %d, curr_txn: %x\n", trans_batch_count,
+ txn_in_progress_count, txn_id);
+ /*
+ * The log flush thread will periodically flush the txn log,
+ * but in two cases it should be notified to do it immediately:
+ * - the batch limit is passed
+ * - there is no other outstanding txn
+ */
+ if (trans_batch_count > trans_batch_limit ||
+ trans_batch_count == txn_in_progress_count)
+ {
+ PR_NotifyCondVar(sync_txn_log_do_flush);
+ }
+ /*
+ * We need to wait until the txn has been flushed before continuing
+ * and returning success to the client, nit to vialate durability
+ * PR_WaitCondvar releases and reaquires the lock
+ */
+ while (txn_log_flush_pending[txn_batch_slot] == txn_id){
+ PR_WaitCondVar(sync_txn_log_flush_done, PR_INTERVAL_NO_TIMEOUT);
+ }
+ txn_in_progress_count--;
+ LDAPDebug(LDAP_DEBUG_BACKLDBM, "txn_commit (before unlock): batchcount: %d, "
+ "txn_in_progress: %d, curr_txn %x\n", trans_batch_count,
+ txn_in_progress_count, txn_id);
+ PR_Unlock(sync_txn_log_flush);
} else if(trans_batch_limit == FLUSH_REMOTEOFF) { /* user remotely turned batching off */
LOG_FLUSH(priv->dblayer_env->dblayer_DB_ENV,0);
- }
- }
- if(use_lock) slapi_rwlock_unlock(priv->dblayer_env->dblayer_env_lock);
- } else
- {
+ }
+ }
+ if(use_lock)
+ slapi_rwlock_unlock(priv->dblayer_env->dblayer_env_lock);
+ } else {
return_value = 0;
}
@@ -4466,14 +4514,14 @@ dblayer_start_log_flush_thread(dblayer_private *priv)
int max_threads = config_get_threadnumber();
if ((priv->dblayer_durable_transactions) &&
- (priv->dblayer_enable_transactions) && (trans_batch_limit > 0)) {
- log_flush_thread=PR_TRUE;
- /* initialize the synchronization objects for the log_flush and worker threads */
- sync_txn_log_flush = PR_NewLock();
- sync_txn_log_flush_done = PR_NewCondVar (sync_txn_log_flush);
- sync_txn_log_do_flush = PR_NewCondVar (sync_txn_log_flush);
- txn_log_flush_pending = (int*)slapi_ch_malloc(max_threads*sizeof(int));
-
+ (priv->dblayer_enable_transactions) && (trans_batch_limit > 0))
+ {
+ /* initialize the synchronization objects for the log_flush and worker threads */
+ sync_txn_log_flush = PR_NewLock();
+ sync_txn_log_flush_done = PR_NewCondVar (sync_txn_log_flush);
+ sync_txn_log_do_flush = PR_NewCondVar (sync_txn_log_flush);
+ txn_log_flush_pending = (int*)slapi_ch_malloc(max_threads*sizeof(int));
+ log_flush_thread = PR_TRUE;
if (NULL == PR_CreateThread (PR_USER_THREAD,
(VFP) (void *) log_flush_threadmain, priv,
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,
@@ -4515,49 +4563,60 @@ static int log_flush_threadmain(void *param)
/* LK this is only needed if online change of
* of txn config is supported ???
*/
- while ((!priv->dblayer_stop_threads) && (log_flush_thread))
- {
- if (priv->dblayer_enable_transactions)
- {
- if (trans_batch_limit > 0) {
- /* synchronize flushing thread with workers */
- PR_Lock(sync_txn_log_flush);
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (in loop): batchcount: %d, txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
- /* if here, do flush the txn logs if any of the following conditions are met
- * - batch limit exceeded
- * - no more active transaction, no need to wait
- * - do_flush indicate that the max waiting interval is exceeded
- */
- if(trans_batch_count >= trans_batch_limit || trans_batch_count >= txn_in_progress_count || do_flush) {
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (working): batchcount: %d, txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
- LOG_FLUSH(priv->dblayer_env->dblayer_DB_ENV,0);
- for (i=0;i<trans_batch_count;i++)
- txn_log_flush_pending[i] = 0;
- trans_batch_count = 0;
- last_flush = PR_IntervalNow();
- do_flush = 0;
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (before notify): batchcount: %d, txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
- PR_NotifyAllCondVar(sync_txn_log_flush_done);
- }
- /* wait until flushing conditions are met */
- while ( trans_batch_count == 0 ||
- ( trans_batch_count < trans_batch_limit &&
- trans_batch_count < txn_in_progress_count)) {
- if (priv->dblayer_stop_threads) break;
- if (PR_IntervalNow() - last_flush > interval_flush) {
- do_flush = 1;
- break;
- }
- PR_WaitCondVar(sync_txn_log_do_flush, interval_wait);
- }
- PR_Unlock(sync_txn_log_flush);
- LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (wakeup): batchcount: %d, txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
+ while ((!priv->dblayer_stop_threads) && (log_flush_thread)){
+ if (priv->dblayer_enable_transactions){
+ if (trans_batch_limit > 0) {
+ /* synchronize flushing thread with workers */
+ PR_Lock(sync_txn_log_flush);
+ if(!log_flush_thread){
+ /* batch transactions was disabled while waiting for the lock */
+ PR_Unlock(sync_txn_log_flush);
+ break;
+ }
+ LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (in loop): batchcount: %d, "
+ "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
+ /*
+ * if here, do flush the txn logs if any of the following conditions are met
+ * - batch limit exceeded
+ * - no more active transaction, no need to wait
+ * - do_flush indicate that the max waiting interval is exceeded
+ */
+ if(trans_batch_count >= trans_batch_limit || trans_batch_count >= txn_in_progress_count || do_flush) {
+ LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (working): batchcount: %d, "
+ "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
+ LOG_FLUSH(priv->dblayer_env->dblayer_DB_ENV,0);
+ for (i=0;i<trans_batch_count;i++){
+ txn_log_flush_pending[i] = 0;
+ }
+ trans_batch_count = 0;
+ last_flush = PR_IntervalNow();
+ do_flush = 0;
+ LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (before notify): batchcount: %d, "
+ "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
+ PR_NotifyAllCondVar(sync_txn_log_flush_done);
+ }
+ /* wait until flushing conditions are met */
+ while ( trans_batch_count == 0 ||
+ ( trans_batch_count < trans_batch_limit &&
+ trans_batch_count < txn_in_progress_count))
+ {
+ if (priv->dblayer_stop_threads)
+ break;
+ if (PR_IntervalNow() - last_flush > interval_flush) {
+ do_flush = 1;
+ break;
+ }
+ PR_WaitCondVar(sync_txn_log_do_flush, interval_wait);
+ }
+ PR_Unlock(sync_txn_log_flush);
+ LDAPDebug(LDAP_DEBUG_BACKLDBM, "log_flush_threadmain (wakeup): batchcount: %d, "
+ "txn_in_progress: %d\n", trans_batch_count, txn_in_progress_count, 0);
} else {
- DS_Sleep(interval_def);
- }
+ DS_Sleep(interval_def);
+ }
} else {
- DS_Sleep(interval_def);
- }
+ DS_Sleep(interval_def);
+ }
}
DECR_THREAD_COUNT(priv);
10 years, 10 months
ldap/servers lib/libaccess
by Mark Reynolds
ldap/servers/plugins/replication/repl5_ruv.c | 3
ldap/servers/slapd/backend.c | 1
lib/libaccess/oneeval.cpp | 249 +++++++++++++--------------
3 files changed, 125 insertions(+), 128 deletions(-)
New commits:
commit 6e07f4df6c1963f40368d0ae17e0775aa33362af
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Jun 25 10:38:26 2013 -0400
Coverity Fixes
13177 - Unreachable code (backend.c)
13175 - Resource leak (repl5_ruv.c)
Did code cleanup in libaccess/oneval.cpp before I do the fix for 13176(resource leak).
This is will be a separate commit.
https://bugzilla.redhat.com/show_bug.cgi?id=970221
Reviewed by: richm(Thanks!)
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index bc2a270..d882326 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -2262,7 +2262,6 @@ ruv_is_newer (Object *sruvobj, Object *cruvobj)
void
ruv_force_csn_update_from_ruv(RUV *src_ruv, RUV *tgt_ruv, char *msg, int logLevel) {
RUVElement *replica = NULL;
- char csnStr [CSN_STRSIZE];
int cookie;
slapi_rwlock_rdlock(src_ruv->lock);
@@ -2275,6 +2274,8 @@ ruv_force_csn_update_from_ruv(RUV *src_ruv, RUV *tgt_ruv, char *msg, int logLeve
* updates the DB RUV.
*/
if (!ruv_covers_csn(tgt_ruv, replica->csn)) {
+ char csnStr[CSN_STRSIZE];
+
ruv_force_csn_update(tgt_ruv, replica->csn);
csn_as_string(replica->csn, PR_FALSE, csnStr);
slapi_log_error(logLevel, repl_plugin_name, "%s %s\n",
diff --git a/ldap/servers/slapd/backend.c b/ldap/servers/slapd/backend.c
index ead251e..8a72b13 100644
--- a/ldap/servers/slapd/backend.c
+++ b/ldap/servers/slapd/backend.c
@@ -669,7 +669,6 @@ slapi_back_transaction_commit(Slapi_PBlock *pb)
} else {
return txn_commit(pb);
}
- return txn_commit(pb);
}
/* API to expose DB transaction abort */
diff --git a/lib/libaccess/oneeval.cpp b/lib/libaccess/oneeval.cpp
index a6d3bbd..8e31940 100644
--- a/lib/libaccess/oneeval.cpp
+++ b/lib/libaccess/oneeval.cpp
@@ -358,8 +358,8 @@ ACLEvalBuildContext(
/* Allocate the cache context and link it into the ACLListHandle */
cache = (ACLListCache_t *)PERM_CALLOC(sizeof(ACLListCache_t));
if (cache == NULL) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4010, ACL_Program, 0);
- goto error;
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4010, ACL_Program, 0);
+ goto error;
}
/* Allocate the access rights hash table */
@@ -371,9 +371,9 @@ ACLEvalBuildContext(
NULL);
if (cache->Table == NULL) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4000, ACL_Program, 1,
- XP_GetAdminStr(DBT_EvalBuildContextUnableToCreateHash));
- goto error;
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4000, ACL_Program, 1,
+ XP_GetAdminStr(DBT_EvalBuildContextUnableToCreateHash));
+ goto error;
}
wrapper = acleval->acllist->acl_list_head;
@@ -395,162 +395,159 @@ ACLEvalBuildContext(
XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAceEntry));
goto error;
}
- new_ace->acep = ace;
+ new_ace->acep = ace;
ace_cnt++;
if (cache->acelist == NULL)
- cache->acelist = acelast = new_ace;
+ cache->acelist = acelast = new_ace;
else {
if(acelast)
- acelast->next = new_ace;
- acelast = new_ace;
- new_ace->acep = ace;
+ acelast->next = new_ace;
+ acelast = new_ace;
+ new_ace->acep = ace;
}
- new_ace->next = NULL;
+ new_ace->next = NULL;
- argp = ace->expr_argv;
+ argp = ace->expr_argv;
- switch (ace->expr_type)
- {
- case ACL_EXPR_TYPE_ALLOW:
- case ACL_EXPR_TYPE_DENY:
-
- /* Add this ACE to the appropriate entries in the access rights
- * hash table
- */
- while (*argp)
- {
- entry =
- (ACLAceNumEntry_t *)PERM_CALLOC(sizeof(ACLAceNumEntry_t));
- if (entry == (ACLAceNumEntry_t *)NULL) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4030, ACL_Program, 1,
- XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAceEntry));
- goto error;
- }
- if (cache->chain_head == NULL)
- cache->chain_head = cache->chain_tail = entry;
- else {
- cache->chain_tail->chain = entry;
- cache->chain_tail = entry;
+ switch (ace->expr_type)
+ {
+ case ACL_EXPR_TYPE_ALLOW:
+ case ACL_EXPR_TYPE_DENY:
+
+ /* Add this ACE to the appropriate entries in the access rights
+ * hash table
+ */
+ while (*argp)
+ {
+ entry = (ACLAceNumEntry_t *)PERM_CALLOC(sizeof(ACLAceNumEntry_t));
+ if (entry == (ACLAceNumEntry_t *)NULL) {
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4030, ACL_Program, 1,
+ XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAceEntry));
+ goto error;
+ }
+ if (cache->chain_head == NULL)
+ cache->chain_head = cache->chain_tail = entry;
+ else {
+ cache->chain_tail->chain = entry;
+ cache->chain_tail = entry;
+ }
+ entry->acenum = ace_cnt;
+
+ /*
+ * OK to call PL_HasTableLookup() even though it mods
+ * the Table as this routine is called in critical section.
+ */
+ temp_entry = (ACLAceNumEntry_t *)PL_HashTableLookup(cache->Table, *argp);
+ /* the first ACE for this right? */
+ if (temp_entry) {
+ /* Link it in at the end */
+ while (temp_entry->next) {
+ temp_entry = temp_entry->next;
+ }
+ temp_entry->next = entry;
+ } else /* just link it in */
+ PR_HashTableAdd(cache->Table, *argp, entry);
+ argp++;
}
- entry->acenum = ace_cnt;
-
- /*
- * OK to call PL_HasTableLookup() even though it mods
- * the Table as this routine is called in critical section.
- */
- temp_entry = (ACLAceNumEntry_t *)PL_HashTableLookup(cache->Table, *argp);
- /* the first ACE for this right? */
- if (temp_entry) {
- /* Link it in at the end */
- while (temp_entry->next) {
- temp_entry = temp_entry->next;
- }
- temp_entry->next = entry;
- } else /* just link it in */
- PR_HashTableAdd(cache->Table, *argp, entry);
-
- argp++;
- }
-
- /* See if any of the clauses require authentication. */
- if (curauthplist) {
- for (i = 0; i < ace->expr_term_index; i++) {
- expr = &ace->expr_arry[i];
- rv = PListFindValue(curauthplist, expr->attr_name,
- NULL, &authplist);
- if (rv > 0) {
- /* First one for this ACE? */
- if (!new_ace->autharray) {
- new_ace->autharray = (PList_t *)PERM_CALLOC(sizeof(PList_t) * ace->expr_term_index);
+ /* See if any of the clauses require authentication. */
+ if (curauthplist) {
+ for (i = 0; i < ace->expr_term_index; i++) {
+ expr = &ace->expr_arry[i];
+ rv = PListFindValue(curauthplist, expr->attr_name,
+ NULL, &authplist);
+ if (rv > 0) {
+ /* First one for this ACE? */
if (!new_ace->autharray) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4040, ACL_Program, 1, XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPointerArray));
- goto error;
- }
- }
- new_ace->autharray[i] = authplist;
- }
- }
- }
- break;
-
- case ACL_EXPR_TYPE_AUTH:
+ new_ace->autharray = (PList_t *)PERM_CALLOC(sizeof(PList_t) * ace->expr_term_index);
+ if (!new_ace->autharray) {
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4040, ACL_Program, 1,
+ XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPointerArray));
+ goto error;
+ }
+ }
+ new_ace->autharray[i] = authplist;
+ }
+ }
+ }
+ break;
- /* Allocate the running auth tables if none yet */
- if (!curauthplist) {
- curauthplist = PListNew(NULL);
- if (!curauthplist) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4050, ACL_Program, 1, XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPlist));
- goto error;
- }
- absauthplist = PListNew(NULL);
- if (!absauthplist) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4050, ACL_Program, 1, XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPlist));
- goto error;
- }
- } else { /* duplicate the existing auth table */
- curauthplist = PListDuplicate(curauthplist, NULL, 0);
- if (!curauthplist) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4050, ACL_Program, 1, XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPlist));
- goto error;
- }
- }
+ case ACL_EXPR_TYPE_AUTH:
+
+ /* Allocate the running auth tables if none yet */
+ if (!curauthplist) {
+ curauthplist = PListNew(NULL);
+ if (!curauthplist) {
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4050, ACL_Program, 1,
+ XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPlist));
+ goto error;
+ }
+ absauthplist = PListNew(NULL);
+ if (!absauthplist) {
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4050, ACL_Program, 1,
+ XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPlist));
+ goto error;
+ }
+ } else { /* duplicate the existing auth table */
+ curauthplist = PListDuplicate(curauthplist, NULL, 0);
+ if (!curauthplist) {
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4050, ACL_Program, 1,
+ XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAuthPlist));
+ goto error;
+ }
+ }
- /* For each listed attribute */
- while (*argp)
- {
- /* skip any attributes that were absoluted */
- if (PListFindValue(absauthplist, *argp, NULL, NULL) < 0)
- {
- /* Save pointer to the property list */
- PListInitProp(curauthplist, 0, *argp, ace->expr_auth,
- ace->expr_auth);
- if (IS_ABSOLUTE(ace->expr_flags))
- PListInitProp(absauthplist, 0, *argp, NULL,
- NULL);
- }
+ /* For each listed attribute */
+ while (*argp) {
+ /* skip any attributes that were absoluted */
+ if (PListFindValue(absauthplist, *argp, NULL, NULL) < 0){
+ /* Save pointer to the property list */
+ PListInitProp(curauthplist, 0, *argp, ace->expr_auth, ace->expr_auth);
+ if (IS_ABSOLUTE(ace->expr_flags))
+ PListInitProp(absauthplist, 0, *argp, NULL, NULL);
+ }
+ argp++;
+ }
- argp++;
- }
+ break;
- break;
+ case ACL_EXPR_TYPE_RESPONSE:
+ (void) ACL_ExprGetDenyWith(NULL, ace, &cache->deny_type,
+ &cache->deny_response);
+ break;
- case ACL_EXPR_TYPE_RESPONSE:
- (void) ACL_ExprGetDenyWith(NULL, ace, &cache->deny_type,
- &cache->deny_response);
- break;
+ default:
+ PR_ASSERT(0);
- default:
- PR_ASSERT(0);
-
- } /* switch expr_type */
+ } /* switch expr_type */
- new_ace->global_auth = curauthplist;
- ace = ace->expr_next;
- }
+ new_ace->global_auth = curauthplist;
+ ace = ace->expr_next;
+ } /* while (ace) */
- /* Next ACL please */
+ /* Next ACL please */
wrapper = wrapper->wrap_next;
}
if (absauthplist)
- PListDestroy(absauthplist);
+ PListDestroy(absauthplist);
/* This must be done last to avoid a race in initialization */
- acleval->acllist->cache = (void *)cache;
+ acleval->acllist->cache = (void *)cache;
return 0;
error:
if (curauthplist)
- PListDestroy(curauthplist);
+ PListDestroy(curauthplist);
if (absauthplist)
- PListDestroy(absauthplist);
+ PListDestroy(absauthplist);
if (cache) {
ACL_EvalDestroyContext(cache);
}
acleval->acllist->cache = NULL;
+
return ACL_RES_ERROR;
}
10 years, 10 months
ldap/servers
by Ludwig Krispenz
ldap/servers/plugins/acctpolicy/acct_util.c | 4 ++++
ldap/servers/plugins/acctpolicy/acctpolicy.h | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 00c4544c39f32a9f9fa51d06ee43daedef57bbf4
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Tue Jun 25 09:36:43 2013 +0200
fix compiler warnings, caused by fix for 47395,47397
diff --git a/ldap/servers/plugins/acctpolicy/acct_util.c b/ldap/servers/plugins/acctpolicy/acct_util.c
index a02382f..2e24da2 100644
--- a/ldap/servers/plugins/acctpolicy/acct_util.c
+++ b/ldap/servers/plugins/acctpolicy/acct_util.c
@@ -28,6 +28,10 @@ Hewlett-Packard Development Company, L.P.
/* Globals */
static void* plugin_id = NULL;
+/* attributes that no clients are allowed to add or modify */
+static char *protected_attrs_login_recording [] = { "createTimestamp",
+ NULL };
+
/*
Checks whether an entry has a particular attribute type, and optionally
diff --git a/ldap/servers/plugins/acctpolicy/acctpolicy.h b/ldap/servers/plugins/acctpolicy/acctpolicy.h
index 78412cd..5c202d3 100644
--- a/ldap/servers/plugins/acctpolicy/acctpolicy.h
+++ b/ldap/servers/plugins/acctpolicy/acctpolicy.h
@@ -35,10 +35,6 @@ Hewlett-Packard Development Company, L.P.
#define DEFAULT_INACT_LIMIT_ATTR "accountInactivityLimit"
#define DEFAULT_RECORD_LOGIN 1
-/* attributes that no clients are allowed to add or modify */
-static char *protected_attrs_login_recording [] = { "createTimestamp",
- NULL };
-
#define PLUGIN_VENDOR "Hewlett-Packard Company"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_CONFIG_DN "cn=config,cn=Account Policy Plugin,cn=plugins,cn=config"
10 years, 10 months
ldap/servers
by Noriko Hosoi
ldap/servers/plugins/whoami/whoami.c | 1 -
1 file changed, 1 deletion(-)
New commits:
commit 465fa850af4658d18235f26f6e05c5a386e70e3d
Author: Anupam Jain <anjain(a)localhost.localdomain>
Date: Mon Jun 24 16:36:24 2013 -0700
Ticket 123 - Enhancement request:"whoami" extended operation
Description:
Fixed compiler warning
diff --git a/ldap/servers/plugins/whoami/whoami.c b/ldap/servers/plugins/whoami/whoami.c
index f6f46bf..42df8c1 100644
--- a/ldap/servers/plugins/whoami/whoami.c
+++ b/ldap/servers/plugins/whoami/whoami.c
@@ -65,7 +65,6 @@ int whoami_exop( Slapi_PBlock *pb )
struct berval *bval;
struct berval retbval;
- Slapi_DN *dn = NULL;
char *client_dn = NULL;
char *fdn = NULL;
char *oid = NULL;
10 years, 10 months
2 commits - ldap/ldif ldap/servers Makefile.am Makefile.in
by Noriko Hosoi
Makefile.am | 12 ++
Makefile.in | 70 +++++++++++++---
ldap/ldif/template-dse.ldif.in | 11 ++
ldap/servers/plugins/whoami/whoami.c | 146 +++++++++++++++++++++++++++++++++++
4 files changed, 224 insertions(+), 15 deletions(-)
New commits:
commit beaad2ce018235fa5bf4ae135d36e7b8bba8b909
Author: Anupam Jain <anjain(a)localhost.localdomain>
Date: Thu Jun 13 13:09:55 2013 -0700
Ticket 123 - Enhancement request:"whoami" extended operation
Description:
Makefile and template-dse.ldif.in containing whoami plugin
configuration
Reviewed by: nhosoi
https://fedorahosted.org/389/ticket/123
diff --git a/Makefile.am b/Makefile.am
index 7f00b07..37647b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -228,7 +228,8 @@ serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la \
libreferint-plugin.la libreplication-plugin.la libretrocl-plugin.la \
libroles-plugin.la libstatechange-plugin.la libsyntax-plugin.la \
libviews-plugin.la libschemareload-plugin.la libusn-plugin.la \
- libacctusability-plugin.la librootdn-access-plugin.la $(LIBACCTPOLICY_PLUGIN) \
+ libacctusability-plugin.la librootdn-access-plugin.la \
+ libwhoami-plugin.la $(LIBACCTPOLICY_PLUGIN) \
$(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) \
$(LIBBITWISE_PLUGIN) $(LIBPRESENCE_PLUGIN) $(LIBPOSIX_WINSYNC_PLUGIN)
@@ -1297,7 +1298,16 @@ libviews_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
libviews_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
libviews_plugin_la_LDFLAGS = -avoid-version
+#------------------------
+# libwhoami-plugin
+#------------------------
+libwhoami_plugin_la_SOURCES = ldap/servers/plugins/whoami/whoami.c
+libwhoami_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+libwhoami_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
+libwhoami_plugin_la_LDFLAGS = -avoid-version
+
+#------------------------
#////////////////////////////////////////////////////////////////
#
# Programs
diff --git a/Makefile.in b/Makefile.in
index e858d77..e8bea15 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -847,6 +847,14 @@ libviews_plugin_la_OBJECTS = $(am_libviews_plugin_la_OBJECTS)
libviews_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libviews_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
+libwhoami_plugin_la_DEPENDENCIES = libslapd.la $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_libwhoami_plugin_la_OBJECTS = \
+ ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo
+libwhoami_plugin_la_OBJECTS = $(am_libwhoami_plugin_la_OBJECTS)
+libwhoami_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libwhoami_plugin_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am_dbscan_bin_OBJECTS = \
ldap/servers/slapd/tools/dbscan_bin-dbscan.$(OBJEXT)
@@ -1051,10 +1059,10 @@ SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \
$(libschemareload_plugin_la_SOURCES) $(libslapd_la_SOURCES) \
$(libstatechange_plugin_la_SOURCES) \
$(libsyntax_plugin_la_SOURCES) $(libusn_plugin_la_SOURCES) \
- $(libviews_plugin_la_SOURCES) $(dbscan_bin_SOURCES) \
- $(dsktune_bin_SOURCES) $(infadd_bin_SOURCES) \
- $(ldap_agent_bin_SOURCES) $(ldclt_bin_SOURCES) \
- $(ldif_bin_SOURCES) $(makstrdb_SOURCES) \
+ $(libviews_plugin_la_SOURCES) $(libwhoami_plugin_la_SOURCES) \
+ $(dbscan_bin_SOURCES) $(dsktune_bin_SOURCES) \
+ $(infadd_bin_SOURCES) $(ldap_agent_bin_SOURCES) \
+ $(ldclt_bin_SOURCES) $(ldif_bin_SOURCES) $(makstrdb_SOURCES) \
$(migratecred_bin_SOURCES) $(mmldif_bin_SOURCES) \
$(ns_slapd_SOURCES) $(pwdhash_bin_SOURCES) \
$(rsearch_bin_SOURCES)
@@ -1086,13 +1094,13 @@ DIST_SOURCES = $(libavl_a_SOURCES) $(libldaputil_a_SOURCES) \
$(am__libslapd_la_SOURCES_DIST) \
$(libstatechange_plugin_la_SOURCES) \
$(libsyntax_plugin_la_SOURCES) $(libusn_plugin_la_SOURCES) \
- $(libviews_plugin_la_SOURCES) $(dbscan_bin_SOURCES) \
- $(dsktune_bin_SOURCES) $(infadd_bin_SOURCES) \
- $(ldap_agent_bin_SOURCES) $(am__ldclt_bin_SOURCES_DIST) \
- $(ldif_bin_SOURCES) $(makstrdb_SOURCES) \
- $(migratecred_bin_SOURCES) $(mmldif_bin_SOURCES) \
- $(am__ns_slapd_SOURCES_DIST) $(pwdhash_bin_SOURCES) \
- $(rsearch_bin_SOURCES)
+ $(libviews_plugin_la_SOURCES) $(libwhoami_plugin_la_SOURCES) \
+ $(dbscan_bin_SOURCES) $(dsktune_bin_SOURCES) \
+ $(infadd_bin_SOURCES) $(ldap_agent_bin_SOURCES) \
+ $(am__ldclt_bin_SOURCES_DIST) $(ldif_bin_SOURCES) \
+ $(makstrdb_SOURCES) $(migratecred_bin_SOURCES) \
+ $(mmldif_bin_SOURCES) $(am__ns_slapd_SOURCES_DIST) \
+ $(pwdhash_bin_SOURCES) $(rsearch_bin_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -1497,7 +1505,8 @@ serverplugin_LTLIBRARIES = libacl-plugin.la libattr-unique-plugin.la \
libreferint-plugin.la libreplication-plugin.la libretrocl-plugin.la \
libroles-plugin.la libstatechange-plugin.la libsyntax-plugin.la \
libviews-plugin.la libschemareload-plugin.la libusn-plugin.la \
- libacctusability-plugin.la librootdn-access-plugin.la $(LIBACCTPOLICY_PLUGIN) \
+ libacctusability-plugin.la librootdn-access-plugin.la \
+ libwhoami-plugin.la $(LIBACCTPOLICY_PLUGIN) \
$(LIBPAM_PASSTHRU_PLUGIN) $(LIBDNA_PLUGIN) \
$(LIBBITWISE_PLUGIN) $(LIBPRESENCE_PLUGIN) $(LIBPOSIX_WINSYNC_PLUGIN)
@@ -2494,6 +2503,15 @@ libviews_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
libviews_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
libviews_plugin_la_LDFLAGS = -avoid-version
+#------------------------
+# libwhoami-plugin
+#------------------------
+libwhoami_plugin_la_SOURCES = ldap/servers/plugins/whoami/whoami.c
+libwhoami_plugin_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+libwhoami_plugin_la_LIBADD = libslapd.la $(LDAPSDK_LINK) $(NSPR_LINK)
+libwhoami_plugin_la_LDFLAGS = -avoid-version
+
+#------------------------
#////////////////////////////////////////////////////////////////
#
# Programs
@@ -4397,6 +4415,17 @@ ldap/servers/plugins/views/libviews_plugin_la-views.lo: \
ldap/servers/plugins/views/$(DEPDIR)/$(am__dirstamp)
libviews-plugin.la: $(libviews_plugin_la_OBJECTS) $(libviews_plugin_la_DEPENDENCIES) $(EXTRA_libviews_plugin_la_DEPENDENCIES)
$(libviews_plugin_la_LINK) -rpath $(serverplugindir) $(libviews_plugin_la_OBJECTS) $(libviews_plugin_la_LIBADD) $(LIBS)
+ldap/servers/plugins/whoami/$(am__dirstamp):
+ @$(MKDIR_P) ldap/servers/plugins/whoami
+ @: > ldap/servers/plugins/whoami/$(am__dirstamp)
+ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ldap/servers/plugins/whoami/$(DEPDIR)
+ @: > ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp)
+ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo: \
+ ldap/servers/plugins/whoami/$(am__dirstamp) \
+ ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp)
+libwhoami-plugin.la: $(libwhoami_plugin_la_OBJECTS) $(libwhoami_plugin_la_DEPENDENCIES) $(EXTRA_libwhoami_plugin_la_DEPENDENCIES)
+ $(libwhoami_plugin_la_LINK) -rpath $(serverplugindir) $(libwhoami_plugin_la_OBJECTS) $(libwhoami_plugin_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
@@ -4995,6 +5024,8 @@ mostlyclean-compile:
-rm -f ldap/servers/plugins/usn/*.lo
-rm -f ldap/servers/plugins/views/*.$(OBJEXT)
-rm -f ldap/servers/plugins/views/*.lo
+ -rm -f ldap/servers/plugins/whoami/*.$(OBJEXT)
+ -rm -f ldap/servers/plugins/whoami/*.lo
-rm -f ldap/servers/slapd/*.$(OBJEXT)
-rm -f ldap/servers/slapd/*.lo
-rm -f ldap/servers/slapd/back-ldbm/*.$(OBJEXT)
@@ -5201,6 +5232,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/usn/$(DEPDIR)/libusn_plugin_la-usn.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/usn/$(DEPDIR)/libusn_plugin_la-usn_cleanup.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/views/$(DEPDIR)/libviews_plugin_la-views.Plo(a)am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/ldap_agent_bin-agtmmap.Po(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-add.Plo(a)am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ldap/servers/slapd/$(DEPDIR)/libslapd_la-agtmmap.Plo(a)am__quote@
@@ -8104,6 +8136,13 @@ ldap/servers/plugins/views/libviews_plugin_la-views.lo: ldap/servers/plugins/vie
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libviews_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/views/libviews_plugin_la-views.lo `test -f 'ldap/servers/plugins/views/views.c' || echo '$(srcdir)/'`ldap/servers/plugins/views/views.c
+ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo: ldap/servers/plugins/whoami/whoami.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwhoami_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo -MD -MP -MF ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Tpo -c -o ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo `test -f 'ldap/servers/plugins/whoami/whoami.c' || echo '$(srcdir)/'`ldap/servers/plugins/whoami/whoami.c
+@am__fastdepCC_TRUE@ $(am__mv) ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Tpo ldap/servers/plugins/whoami/$(DEPDIR)/libwhoami_plugin_la-whoami.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ldap/servers/plugins/whoami/whoami.c' object='ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libwhoami_plugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ldap/servers/plugins/whoami/libwhoami_plugin_la-whoami.lo `test -f 'ldap/servers/plugins/whoami/whoami.c' || echo '$(srcdir)/'`ldap/servers/plugins/whoami/whoami.c
+
ldap/servers/slapd/tools/dbscan_bin-dbscan.o: ldap/servers/slapd/tools/dbscan.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dbscan_bin_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ldap/servers/slapd/tools/dbscan_bin-dbscan.o -MD -MP -MF ldap/servers/slapd/tools/$(DEPDIR)/dbscan_bin-dbscan.Tpo -c -o ldap/servers/slapd/tools/dbscan_bin-dbscan.o `test -f 'ldap/servers/slapd/tools/dbscan.c' || echo '$(srcdir)/'`ldap/servers/slapd/tools/dbscan.c
@am__fastdepCC_TRUE@ $(am__mv) ldap/servers/slapd/tools/$(DEPDIR)/dbscan_bin-dbscan.Tpo ldap/servers/slapd/tools/$(DEPDIR)/dbscan_bin-dbscan.Po
@@ -9279,6 +9318,7 @@ clean-libtool:
-rm -rf ldap/servers/plugins/uiduniq/.libs ldap/servers/plugins/uiduniq/_libs
-rm -rf ldap/servers/plugins/usn/.libs ldap/servers/plugins/usn/_libs
-rm -rf ldap/servers/plugins/views/.libs ldap/servers/plugins/views/_libs
+ -rm -rf ldap/servers/plugins/whoami/.libs ldap/servers/plugins/whoami/_libs
-rm -rf ldap/servers/slapd/.libs ldap/servers/slapd/_libs
-rm -rf ldap/servers/slapd/back-ldbm/.libs ldap/servers/slapd/back-ldbm/_libs
-rm -rf lib/base/.libs lib/base/_libs
@@ -9996,6 +10036,8 @@ distclean-generic:
-rm -f ldap/servers/plugins/usn/$(am__dirstamp)
-rm -f ldap/servers/plugins/views/$(DEPDIR)/$(am__dirstamp)
-rm -f ldap/servers/plugins/views/$(am__dirstamp)
+ -rm -f ldap/servers/plugins/whoami/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ldap/servers/plugins/whoami/$(am__dirstamp)
-rm -f ldap/servers/slapd/$(DEPDIR)/$(am__dirstamp)
-rm -f ldap/servers/slapd/$(am__dirstamp)
-rm -f ldap/servers/slapd/back-ldbm/$(DEPDIR)/$(am__dirstamp)
@@ -10034,7 +10076,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR)
+ -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
@@ -10090,7 +10132,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR)
+ -rm -rf ldap/libraries/libavl/$(DEPDIR) ldap/servers/plugins/acct_usability/$(DEPDIR) ldap/servers/plugins/acctpolicy/$(DEPDIR) ldap/servers/plugins/acl/$(DEPDIR) ldap/servers/plugins/automember/$(DEPDIR) ldap/servers/plugins/bitwise/$(DEPDIR) ldap/servers/plugins/chainingdb/$(DEPDIR) ldap/servers/plugins/collation/$(DEPDIR) ldap/servers/plugins/cos/$(DEPDIR) ldap/servers/plugins/deref/$(DEPDIR) ldap/servers/plugins/distrib/$(DEPDIR) ldap/servers/plugins/dna/$(DEPDIR) ldap/servers/plugins/http/$(DEPDIR) ldap/servers/plugins/linkedattrs/$(DEPDIR) ldap/servers/plugins/memberof/$(DEPDIR) ldap/servers/plugins/mep/$(DEPDIR) ldap/servers/plugins/pam_passthru/$(DEPDIR) ldap/servers/plugins/passthru/$(DEPDIR) ldap/servers/plugins/posix-winsync/$(DEPDIR) ldap/servers/plugins/presence/$(DEPDIR) ldap/servers/plugins/pwdstorage/$(DEPDIR) ldap/servers/plugins/referint/$(DEPDIR) ldap/servers/plugins/replication/$(DEPDIR) ldap/servers/plugins/retrocl/$(DEPDIR) ldap/servers/plugins/rever/$
(DEPDIR) ldap/servers/plugins/roles/$(DEPDIR) ldap/servers/plugins/rootdn_access/$(DEPDIR) ldap/servers/plugins/schema_reload/$(DEPDIR) ldap/servers/plugins/statechange/$(DEPDIR) ldap/servers/plugins/syntaxes/$(DEPDIR) ldap/servers/plugins/uiduniq/$(DEPDIR) ldap/servers/plugins/usn/$(DEPDIR) ldap/servers/plugins/views/$(DEPDIR) ldap/servers/plugins/whoami/$(DEPDIR) ldap/servers/slapd/$(DEPDIR) ldap/servers/slapd/back-ldbm/$(DEPDIR) ldap/servers/slapd/tools/$(DEPDIR) ldap/servers/slapd/tools/ldclt/$(DEPDIR) ldap/servers/slapd/tools/rsearch/$(DEPDIR) ldap/servers/snmp/$(DEPDIR) ldap/systools/$(DEPDIR) lib/base/$(DEPDIR) lib/ldaputil/$(DEPDIR) lib/libaccess/$(DEPDIR) lib/libadmin/$(DEPDIR) lib/libsi18n/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in
index 95ed60c..11595aa 100644
--- a/ldap/ldif/template-dse.ldif.in
+++ b/ldap/ldif/template-dse.ldif.in
@@ -738,6 +738,17 @@ nsslapd-pluginenabled: off
nsslapd-pluginbetxn: on
nsslapd-plugin-depends-on-type: database
+dn: cn=whoami,cn=plugins,cn=config
+objectclass: top
+objectclass: nsSlapdPlugin
+objectclass: extensibleObject
+cn: whoami
+nsslapd-pluginpath: libwhoami-plugin
+nsslapd-plugininitfunc: whoami_init
+nsslapd-plugintype: extendedop
+nsslapd-pluginenabled: on
+nsslapd-plugin-depends-on-type: database
+
dn: cn=RootDN Access Control,cn=plugins,cn=config
objectclass: top
objectclass: nsSlapdPlugin
commit 35e2b3883dd15cf5f32a07de5ac6f570c4c9bbc6
Author: Anupam Jain <anjain(a)localhost.localdomain>
Date: Tue Jun 11 16:51:00 2013 -0700
Ticket 123 - Enhancement request:"whoami" extended operation
Description:
whoami extended operation plugin that fetches the client authzid
associated with the client.
Reviewed by: nhosoi
https://fedorahosted.org/389/ticket/123
diff --git a/ldap/servers/plugins/whoami/whoami.c b/ldap/servers/plugins/whoami/whoami.c
new file mode 100644
index 0000000..f6f46bf
--- /dev/null
+++ b/ldap/servers/plugins/whoami/whoami.c
@@ -0,0 +1,146 @@
+/** BEGIN COPYRIGHT BLOCK
+ * This Program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; version 2 of the License.
+ *
+ * This Program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * In addition, as a special exception, Red Hat, Inc. gives You the additional
+ * right to link the code of this Program with code not covered under the GNU
+ * General Public License ("Non-GPL Code") and to distribute linked combinations
+ * including the two, subject to the limitations in this paragraph. Non-GPL Code
+ * permitted under this exception must only link to the code of this Program
+ * through those well defined interfaces identified in the file named EXCEPTION
+ * found in the source code files (the "Approved Interfaces"). The files of
+ * Non-GPL Code may instantiate templates or use macros or inline functions from
+ * the Approved Interfaces without causing the resulting work to be covered by
+ * the GNU General Public License. Only Red Hat, Inc. may make changes or
+ * additions to the list of Approved Interfaces. You must obey the GNU General
+ * Public License in all respects for all of the Program code and other code used
+ * in conjunction with the Program except the Non-GPL Code covered by this
+ * exception. If you modify this file, you may extend this exception to your
+ * version of the file, but you are not obligated to do so. If you do not wish to
+ * provide this exception without modification, you must delete this exception
+ * statement from your version and license this file solely under the GPL without
+ * exception.
+ *
+ *
+ * Copyright (C) 2013 Red Hat, Inc.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK **/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/**
+ * LDAP whoami extended operation plug-in
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "slapi-plugin.h"
+
+#define PLUGIN_NAME "whoami-plugin"
+#define PLUGIN_DESC "whoami extended operation plugin"
+#define WHOAMI_EXOP_REQUEST_OID "1.3.6.1.4.1.4203.1.11.3"
+
+static Slapi_PluginDesc expdesc = { PLUGIN_NAME, VENDOR, DS_PACKAGE_VERSION, PLUGIN_DESC };
+
+static char *whoami_exop_oid_list[] = { WHOAMI_EXOP_REQUEST_OID, NULL };
+
+int whoami_init( Slapi_PBlock *pb );
+int whoami_exop( Slapi_PBlock *pb );
+
+/* Extended operation function */
+
+int whoami_exop( Slapi_PBlock *pb )
+{
+ struct berval *bval;
+ struct berval retbval;
+
+ Slapi_DN *dn = NULL;
+ char *client_dn = NULL;
+ char *fdn = NULL;
+ char *oid = NULL;
+ /* Get the OID and the value included in the request */
+
+ if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_OID, &oid ) != 0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not get OID from request\n" );
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get OID from request\n", 0, NULL );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_VALUE, &bval ) != 0 || bval->bv_val != NULL )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not get correct request value from request\n" );
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get correct request value from request\n", 0, NULL );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ /* Fetch the client dn */
+
+ if( slapi_pblock_get( pb, SLAPI_CONN_DN, &client_dn ) !=0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not get client_dn" );
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not get client_dn\n", 0, NULL );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ if( client_dn == NULL )
+ {
+ retbval.bv_val = NULL;
+ retbval.bv_len = 0;
+ }
+ else
+ {
+ fdn = slapi_ch_smprintf( "dn: %s", client_dn );
+ retbval.bv_val = fdn;
+ retbval.bv_len = strlen( retbval.bv_val );
+ }
+
+ /* Set the return value in pblock */
+
+ if ( slapi_pblock_set( pb, SLAPI_EXT_OP_RET_OID, NULL ) != 0 || slapi_pblock_set( pb, SLAPI_EXT_OP_RET_VALUE, &retbval ) != 0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "Could not set return values" );
+ slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, "Could not set return values", 0, NULL );
+ slapi_ch_free_string( &client_dn );
+ slapi_ch_free_string( &fdn );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+ }
+
+ /* Send the response back to client */
+
+ slapi_send_ldap_result( pb, LDAP_SUCCESS, NULL, NULL, 0, NULL );
+
+ /* Free any memory allocated by this plug-in. */
+
+ slapi_ch_free_string( &client_dn );
+ slapi_ch_free_string( &fdn );
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+}
+
+/* Initialization function */
+
+int whoami_init( Slapi_PBlock *pb )
+{
+
+ /* Register the plugin function as an extended operation plugin function */
+
+ if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03 ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, ( void * )&expdesc ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, ( void * )whoami_exop ) != 0 || slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, ( void * )whoami_exop_oid_list ) !=0 )
+ {
+ slapi_log_error( SLAPI_LOG_FATAL, PLUGIN_NAME, "whoami_init: Failed to register plug-in.\n" );
+ return( -1 );
+ }
+
+ return( 0 );
+}
+
10 years, 10 months
Branch '389-ds-base-1.3.1' - ldap/servers
by thierry bordaz
ldap/servers/slapd/back-ldbm/back-ldbm.h | 15 ++++++++-------
ldap/servers/slapd/back-ldbm/import-threads.c | 2 ++
ldap/servers/slapd/back-ldbm/ldbm_config.c | 21 +++++++++++++++++++++
ldap/servers/slapd/back-ldbm/ldbm_config.h | 1 +
4 files changed, 32 insertions(+), 7 deletions(-)
New commits:
commit 46ced87650f310b18bb9fbde3d20a1e9cb2e0d9f
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Mon Jun 17 14:42:34 2013 +0200
Ticket 47393 - Attribute are not encrypted on a consumer after a full initialization
Bug Description:
During online initialization of a replica encrypted attributes are not encrypted by the import.
This is because the import job flag job->encrypt is not set.
Fix Description:
The fix consist to add the config backend attribute "nsslapd-online-import-encrypt" that is by default set to "on".
During online 'ldbm_back_wire_import' the config attribute is set into the pblock and set into the job->encrypt
https://bugzilla.redhat.com/show_bug.cgi?id=893178
Reviewed by: Rich Meggison (thanks Rich)
Platforms tested: fedora 17
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
index 871d489..64b636f 100644
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
@@ -645,13 +645,14 @@ struct ldbminfo {
int li_fat_lock; /* 608146 -- make this configurable, first */
int li_legacy_errcode; /* 615428 -- in case legacy err code is expected */
Slapi_Counter *li_global_usn_counter; /* global USN counter */
- int li_reslimit_allids_handle; /* allids aka idlistscan */
- int li_pagedlookthroughlimit;
- int li_pagedallidsthreshold;
- int li_reslimit_pagedlookthrough_handle;
- int li_reslimit_pagedallids_handle; /* allids aka idlistscan */
- int li_rangelookthroughlimit;
- int li_reslimit_rangelookthrough_handle;
+ int li_reslimit_allids_handle; /* allids aka idlistscan */
+ int li_pagedlookthroughlimit;
+ int li_pagedallidsthreshold;
+ int li_reslimit_pagedlookthrough_handle;
+ int li_reslimit_pagedallids_handle; /* allids aka idlistscan */
+ int li_rangelookthroughlimit;
+ int li_reslimit_rangelookthrough_handle;
+ int li_online_import_encrypt; /* toggle attribute encryption during ldbm_back_wire_import */
};
/* li_flags could store these bits defined in ../slapi-plugin.h
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index d9ab51f..5cb5663 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -3080,6 +3080,7 @@ static int bulk_import_start(Slapi_PBlock *pb)
}
slapi_pblock_get(pb, SLAPI_BACKEND, &be);
+ slapi_pblock_get(pb, SLAPI_LDIF2DB_ENCRYPT, &job->encrypt);
PR_ASSERT(be != NULL);
li = (struct ldbminfo *)(be->be_database->plg_private);
job->inst = (ldbm_instance *)be->be_instance_info;
@@ -3411,6 +3412,7 @@ int ldbm_back_wire_import(Slapi_PBlock *pb)
PR_ASSERT(be != NULL);
li = (struct ldbminfo *)(be->be_database->plg_private);
slapi_pblock_get(pb, SLAPI_BULK_IMPORT_STATE, &state);
+ slapi_pblock_set(pb, SLAPI_LDIF2DB_ENCRYPT, &li->li_online_import_encrypt);
if (state == SLAPI_BI_STATE_START) {
/* starting a new import */
int rc = bulk_import_start(pb);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 232af54..eeae22b 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -865,6 +865,26 @@ static int ldbm_config_db_private_mem_set(void *arg, void *value, char *errorbuf
return retval;
}
+static void *ldbm_config_db_online_import_encrypt_get(void *arg)
+{
+ struct ldbminfo *li = (struct ldbminfo *) arg;
+
+ return (void *) ((uintptr_t)li->li_online_import_encrypt);
+}
+
+static int ldbm_config_db_online_import_encrypt_set(void *arg, void *value, char *errorbuf, int phase, int apply)
+{
+ struct ldbminfo *li = (struct ldbminfo *) arg;
+ int retval = LDAP_SUCCESS;
+ int val = (int) ((uintptr_t)value);
+
+ if (apply) {
+ li->li_online_import_encrypt = val;
+ }
+
+ return retval;
+}
+
static void *ldbm_config_db_private_import_mem_get(void *arg)
{
struct ldbminfo *li = (struct ldbminfo *) arg;
@@ -1339,6 +1359,7 @@ static config_info ldbm_config[] = {
{CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, 0},
{CONFIG_DB_PRIVATE_MEM, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_private_mem_get, &ldbm_config_db_private_mem_set, 0},
{CONFIG_DB_PRIVATE_IMPORT_MEM, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_private_import_mem_get, &ldbm_config_db_private_import_mem_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
+ {CONDIF_DB_ONLINE_IMPORT_ENCRYPT, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_online_import_encrypt_get, &ldbm_config_db_online_import_encrypt_set, 0},
{CONFIG_DB_SHM_KEY, CONFIG_TYPE_LONG, "389389", &ldbm_config_db_shm_key_get, &ldbm_config_db_shm_key_set, 0},
{CONFIG_DB_CACHE, CONFIG_TYPE_INT, "0", &ldbm_config_db_cache_get, &ldbm_config_db_cache_set, 0},
{CONFIG_DB_DEBUG_CHECKPOINTING, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_debug_checkpointing_get, &ldbm_config_db_debug_checkpointing_set, 0},
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.h b/ldap/servers/slapd/back-ldbm/ldbm_config.h
index a5830e3..33eb078 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.h
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.h
@@ -136,6 +136,7 @@ struct config_info {
#define CONFIG_DB_HOME_DIRECTORY "nsslapd-db-home-directory"
#define CONFIG_DB_LOCKDOWN "nsslapd-db-lockdown"
#define CONFIG_DB_TX_MAX "nsslapd-db-tx-max"
+#define CONDIF_DB_ONLINE_IMPORT_ENCRYPT "nsslapd-online-import-encrypt"
#define CONFIG_IDL_SWITCH "nsslapd-idl-switch"
#define CONFIG_BYPASS_FILTER_TEST "nsslapd-search-bypass-filter-test"
10 years, 10 months
Branch '389-ds-base-1.3.0' - ldap/servers
by thierry bordaz
ldap/servers/slapd/back-ldbm/back-ldbm.h | 15 ++++++++-------
ldap/servers/slapd/back-ldbm/import-threads.c | 2 ++
ldap/servers/slapd/back-ldbm/ldbm_config.c | 21 +++++++++++++++++++++
ldap/servers/slapd/back-ldbm/ldbm_config.h | 1 +
4 files changed, 32 insertions(+), 7 deletions(-)
New commits:
commit 693b9f359fc42b248c548b8832c8130f3526c0b8
Author: Thierry bordaz (tbordaz) <tbordaz(a)redhat.com>
Date: Mon Jun 17 14:42:34 2013 +0200
Ticket 47393 - Attribute are not encrypted on a consumer after a full initialization
Bug Description:
During online initialization of a replica encrypted attributes are not encrypted by the import.
This is because the import job flag job->encrypt is not set.
Fix Description:
The fix consist to add the config backend attribute "nsslapd-online-import-encrypt" that is by default set to "on".
During online 'ldbm_back_wire_import' the config attribute is set into the pblock and set into the job->encrypt
https://bugzilla.redhat.com/show_bug.cgi?id=893178
Reviewed by: Rich Meggison (thanks Rich)
Platforms tested: fedora 17
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/back-ldbm.h b/ldap/servers/slapd/back-ldbm/back-ldbm.h
index 6536664..108d7e1 100644
--- a/ldap/servers/slapd/back-ldbm/back-ldbm.h
+++ b/ldap/servers/slapd/back-ldbm/back-ldbm.h
@@ -644,13 +644,14 @@ struct ldbminfo {
int li_fat_lock; /* 608146 -- make this configurable, first */
int li_legacy_errcode; /* 615428 -- in case legacy err code is expected */
Slapi_Counter *li_global_usn_counter; /* global USN counter */
- int li_reslimit_allids_handle; /* allids aka idlistscan */
- int li_pagedlookthroughlimit;
- int li_pagedallidsthreshold;
- int li_reslimit_pagedlookthrough_handle;
- int li_reslimit_pagedallids_handle; /* allids aka idlistscan */
- int li_rangelookthroughlimit;
- int li_reslimit_rangelookthrough_handle;
+ int li_reslimit_allids_handle; /* allids aka idlistscan */
+ int li_pagedlookthroughlimit;
+ int li_pagedallidsthreshold;
+ int li_reslimit_pagedlookthrough_handle;
+ int li_reslimit_pagedallids_handle; /* allids aka idlistscan */
+ int li_rangelookthroughlimit;
+ int li_reslimit_rangelookthrough_handle;
+ int li_online_import_encrypt; /* toggle attribute encryption during ldbm_back_wire_import */
};
/* li_flags could store these bits defined in ../slapi-plugin.h
diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c
index 78db060..5667acb 100644
--- a/ldap/servers/slapd/back-ldbm/import-threads.c
+++ b/ldap/servers/slapd/back-ldbm/import-threads.c
@@ -2715,6 +2715,7 @@ static int bulk_import_start(Slapi_PBlock *pb)
}
slapi_pblock_get(pb, SLAPI_BACKEND, &be);
+ slapi_pblock_get(pb, SLAPI_LDIF2DB_ENCRYPT, &job->encrypt);
PR_ASSERT(be != NULL);
li = (struct ldbminfo *)(be->be_database->plg_private);
job->inst = (ldbm_instance *)be->be_instance_info;
@@ -3046,6 +3047,7 @@ int ldbm_back_wire_import(Slapi_PBlock *pb)
PR_ASSERT(be != NULL);
li = (struct ldbminfo *)(be->be_database->plg_private);
slapi_pblock_get(pb, SLAPI_BULK_IMPORT_STATE, &state);
+ slapi_pblock_set(pb, SLAPI_LDIF2DB_ENCRYPT, &li->li_online_import_encrypt);
if (state == SLAPI_BI_STATE_START) {
/* starting a new import */
int rc = bulk_import_start(pb);
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 232af54..eeae22b 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -865,6 +865,26 @@ static int ldbm_config_db_private_mem_set(void *arg, void *value, char *errorbuf
return retval;
}
+static void *ldbm_config_db_online_import_encrypt_get(void *arg)
+{
+ struct ldbminfo *li = (struct ldbminfo *) arg;
+
+ return (void *) ((uintptr_t)li->li_online_import_encrypt);
+}
+
+static int ldbm_config_db_online_import_encrypt_set(void *arg, void *value, char *errorbuf, int phase, int apply)
+{
+ struct ldbminfo *li = (struct ldbminfo *) arg;
+ int retval = LDAP_SUCCESS;
+ int val = (int) ((uintptr_t)value);
+
+ if (apply) {
+ li->li_online_import_encrypt = val;
+ }
+
+ return retval;
+}
+
static void *ldbm_config_db_private_import_mem_get(void *arg)
{
struct ldbminfo *li = (struct ldbminfo *) arg;
@@ -1339,6 +1359,7 @@ static config_info ldbm_config[] = {
{CONFIG_DB_LOCK, CONFIG_TYPE_INT, "10000", &ldbm_config_db_lock_get, &ldbm_config_db_lock_set, 0},
{CONFIG_DB_PRIVATE_MEM, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_private_mem_get, &ldbm_config_db_private_mem_set, 0},
{CONFIG_DB_PRIVATE_IMPORT_MEM, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_private_import_mem_get, &ldbm_config_db_private_import_mem_set, CONFIG_FLAG_ALWAYS_SHOW|CONFIG_FLAG_ALLOW_RUNNING_CHANGE},
+ {CONDIF_DB_ONLINE_IMPORT_ENCRYPT, CONFIG_TYPE_ONOFF, "on", &ldbm_config_db_online_import_encrypt_get, &ldbm_config_db_online_import_encrypt_set, 0},
{CONFIG_DB_SHM_KEY, CONFIG_TYPE_LONG, "389389", &ldbm_config_db_shm_key_get, &ldbm_config_db_shm_key_set, 0},
{CONFIG_DB_CACHE, CONFIG_TYPE_INT, "0", &ldbm_config_db_cache_get, &ldbm_config_db_cache_set, 0},
{CONFIG_DB_DEBUG_CHECKPOINTING, CONFIG_TYPE_ONOFF, "off", &ldbm_config_db_debug_checkpointing_get, &ldbm_config_db_debug_checkpointing_set, 0},
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.h b/ldap/servers/slapd/back-ldbm/ldbm_config.h
index a5830e3..33eb078 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.h
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.h
@@ -136,6 +136,7 @@ struct config_info {
#define CONFIG_DB_HOME_DIRECTORY "nsslapd-db-home-directory"
#define CONFIG_DB_LOCKDOWN "nsslapd-db-lockdown"
#define CONFIG_DB_TX_MAX "nsslapd-db-tx-max"
+#define CONDIF_DB_ONLINE_IMPORT_ENCRYPT "nsslapd-online-import-encrypt"
#define CONFIG_IDL_SWITCH "nsslapd-idl-switch"
#define CONFIG_BYPASS_FILTER_TEST "nsslapd-search-bypass-filter-test"
10 years, 10 months