Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 182198

Summary: server writing to read-only string constants
Product: [Retired] 389 Reporter: Rich Megginson <rmeggins>
Component: Directory ServerAssignee: Rich Megginson <rmeggins>
Status: CLOSED NEXTRELEASE QA Contact: Orla Hegarty <ohegarty>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: ohegarty
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: 1.0.2
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-10 23:04:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 182201    
Bug Blocks: 183369    

Description Rich Megginson 2006-02-20 22:53:27 UTC
views.c and windows_protocol_util.c use slapi_str2filter() with a constant
string argument, but that function writes to its argument.

Comment 1 Rich Megginson 2006-02-20 22:59:35 UTC
Cannot pass const strings into slapi_str2filter, since it can modify
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.

/cvs/dirsec/ldapserver/ldap/servers/plugins/views/views.c,v
revision 1.7
+++ views.c	22 Nov 2005 03:40:14 -0000	1.7

/cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
revision 1.23
+++ windows_protocol_util.c	22 Nov 2005 03:40:08 -0000	1.23