summaryrefslogtreecommitdiffstats
path: root/ldap/servers/plugins/replication
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2005-11-22 03:40:14 +0000
committerRich Megginson <rmeggins@redhat.com>2005-11-22 03:40:14 +0000
commitf8dda515699b63542c9cd9cf62dff1c8e5feda1e (patch)
treea093a18c9b3363a3f8645a4715d8b85fd7dfbf5f /ldap/servers/plugins/replication
parentd0b36a594c1cca43526b27fdfe2f22c1b62c0ce2 (diff)
Cannot pass const strings into slapi_str2filter, since it can modifyFedoraDirSvr_20051103_RTCFedoraDirSvr10
the contents. I'm not sure why we haven't caught this earlier, but I believe it has something to do with the patch to make ds build on Fedora Core 4 with gcc4. To do that, we turn off the -fwriteable-strings argument to gcc. I suppose with it on, it moves those strings to some sort of writeable memory location. With it off, constant strings are definitely in the data section. There was one place in views that used a constant string, and a couple of places in the windows sync code.
Diffstat (limited to 'ldap/servers/plugins/replication')
-rw-r--r--ldap/servers/plugins/replication/windows_protocol_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 76fa15e5..827f7ab8 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -1570,11 +1570,12 @@ is_tombstone(Slapi_Entry *e)
{
int retval = 0;
- char *string_deleted = "(isdeleted=*)";
+ char *string_deleted = slapi_ch_strdup("(isdeleted=*)");
/* DBDB: we should allocate these filters once and keep them around for better performance */
Slapi_Filter *filter_deleted = slapi_str2filter( string_deleted );
+ slapi_ch_free_string(&string_deleted);
/* DBDB: this should be one filter, the code originally tested separately and hasn't been fixed yet */
if ( (slapi_filter_test_simple( e, filter_deleted ) == 0) )
{
@@ -2251,9 +2252,10 @@ is_subject_of_agreemeent_local(const Slapi_Entry *local_entry, const Repl_Agmt *
/* Next test for the correct kind of entry */
if (local_entry) {
/* DBDB: we should allocate these filters once and keep them around for better performance */
- char *string_filter = "(&(|(objectclass=ntuser)(objectclass=ntgroup))(ntUserDomainId=*))";
+ char *string_filter = slapi_ch_strdup("(&(|(objectclass=ntuser)(objectclass=ntgroup))(ntUserDomainId=*))");
Slapi_Filter *filter = slapi_str2filter( string_filter );
+ slapi_ch_free_string(&string_filter);
if (slapi_filter_test_simple( (Slapi_Entry*)local_entry, filter ) == 0)
{
retval = 1;