[PATCH] Fix python/ldb errors, possibly including debian bug #808769

Andrew Bartlett abartlet at samba.org
Mon Jan 4 19:56:15 UTC 2016


On Mon, 2016-01-04 at 11:11 +0000, Jelmer Vernooń≥ wrote:
> > From c3272299318d2b0faa752dfc2d2b6a8c982347c3 Mon Sep 17 00:00:00
> > 2001
> > From: Andrew Bartlett <abartlet at samba.org>
> > Date: Mon, 4 Jan 2016 12:12:37 +1300
> > Subject: [PATCH 01/15] ldb: Be strict about talloc_memdup() and
> > passed in
> >  buffers in ldb_dn_set_component()
> > 
> > This ensures we do not over-read the source buffer, but still NUL
> > terminate.
> > 
> > This may be related to debuain bug: 
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808769
> 
> s/debuain/debian/ :)
> 
> Reviewed-By: me
> 
> > From b317d3e456d9de67e374b13c4504c4f8c620231b Mon Sep 17 00:00:00
> > 2001
> > From: Andrew Bartlett <abartlet at samba.org>
> > Date: Mon, 4 Jan 2016 12:13:04 +1300
> > Subject: [PATCH 02/15] ldb: Explain why this use of talloc_memdup()
> > is safe
> 
> Reviewed-By: me
> 
> > From ba3cf3de3c16bb2c43d791a94a424cf4302b4468 Mon Sep 17 00:00:00
> > 2001
> > From: Andrew Bartlett <abartlet at samba.org>
> > Date: Mon, 4 Jan 2016 12:13:40 +1300
> > Subject: [PATCH 03/15] ldb: validate ldb_dn_set_component input
> > parameters
> >  even more strictly
> 
> Reviewed-By: me
> 
> > From 9ac6801fd7b62d69c66126b1e0948252780e1cf6 Mon Sep 17 00:00:00
> > 2001
> > From: Andrew Bartlett <abartlet at samba.org>
> > Date: Mon, 4 Jan 2016 12:40:54 +1300
> > Subject: [PATCH 04/15] Add common python.h replacement header
> > 
> > This allows us to define how we will use python project-wide, such
> > as setting PY_SSIZE_T_CLEAN
> 
> I don't think this is the right place for such a header. lib/replace
> is meant to
> provide "standard" functionality that the system doesn't provide for
> some reason. Python is not a part of that.
> 
> This change also doesn't move the python checks into
> lib/replace/wscript.

I can do that if you want.

> Do we need a separate header to set PY_SSIZE_T_CLEAN? I'd rather see
> it done as a config.h-level setting. Could we stick it in
> wafsamba/samba_python.py ?

My concern with that approach is that it would be even more hidden.  

I also can't just use a header elsewhere, as only lib/replace is
available across all the sub-projects, but I need the pattern to be
consistent across all of Samba as we have such a strong tradition of
copy-and-paste of python stuff. 

> > From 6c63f734118104a1cfd106e9d2400e39f25d9917 Mon Sep 17 00:00:00
> > 2001
> > From: Andrew Bartlett <abartlet at samba.org>
> > Date: Mon, 4 Jan 2016 13:03:39 +1300
> > Subject: [PATCH 07/15] pidl: Use system/python.h
> > 
> > This changes the type used for # arguments to
> > PyArg_ParseTupleAndKeywords
> 
> We can't use system/ headers in pidl-generated output, as system/*
> headers are (rightly) not installed.

I guess we have to just use <Python.h> and set the define in each
generated file then.  We can't use the config.h approach you suggest
above for PIDL output (is our python PIDL output useful outside samba?)

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba






More information about the samba-technical mailing list