patch: add cups encryption support

Björn JACKE bj at SerNet.DE
Fri Mar 27 13:21:37 GMT 2009


On 2009-03-27 at 13:34 +0100 Volker Lendecke sent off:
> 
> A quick search for httpConnectEncrypt found
> 
> http://webui.sourcelabs.com/cups/mail/dev/threads/How_to_get_printer_status_via_CUPS_API%253F.meta
> 
> This contains
> 
> > > BTW. httpConnectEncrypt() calls httpInitialize() which
> > > calls gnutls_global_init() but httpClose() or any other
> > > function do not call gnutls_global_deinit() which would
> > > free the acquired resources. This is true for atleast CUPS
> > > 1.3.7. See: http://linux.die.net/man/3/gnutls_global_init
> > 
> > This is OK - we only want/need to initialize once, and then the
> > resources are freed automatically when the process exits.
> 
> Samba calls httpClose(). Is it certain that we don't end up
> with a memory leak here?

looking at the cups code it looks like the gnutls_global_init is called
unconditionally whether encryption is used or not. So if we would leak memory
here, I think we'd also do now - but I can't really say this. CUPS'
gnutls_init() inside the http_setup_ssl() has a matching gnutls_deinit() in
http_shutdown_ssl(). This is true even for the cups 1.1 release series. So I
think at least we don't regress here.

Cheers
Björn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20090327/f06a22fb/attachment.bin


More information about the samba-technical mailing list