smb_iconv modifies constant input strings

Andrew Bartlett abartlet at
Sat Sep 27 09:22:02 GMT 2003

On Sat, 2003-09-27 at 11:20, Jeremy Allison wrote:
> On Sat, Sep 27, 2003 at 11:17:16AM +1000, Andrew Bartlett wrote:
> > 
> > Neither of these options are very good.  Samba's use of iconv() really
> > does assume it behaves in the way descriped in the linux manpage - which
> > declares it as char ** input, but does not modify the input string.  
> I'm not so sure. Changing smb_iconv to take a char **, not const char **
> seems the easiest. If iconv does behave this way then we need to honour
> that interface.

Sure - and if it really did behave that way (it doesn't according to
Matt's other post), then we would be in much more trouble.  What does
your patch achieve except moving we get the warnings?  I think we would
need to strdup the inputs if we really wanted to honer this interface...

Andrew Bartlett

Andrew Bartlett                                 abartlet at
Manager, Authentication Subsystems, Samba Team  abartlet at
Student Network Administrator, Hawker College   abartlet at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url :

More information about the samba-technical mailing list