[PATCH] add generated NTSTATUS error module for python

Andrew Bartlett abartlet at samba.org
Mon Oct 10 02:12:02 UTC 2016

On Thu, 2016-10-06 at 15:19 -0700, Jeremy Allison wrote:
> On Fri, Sep 30, 2016 at 06:25:15AM +0200, Günther Deschner wrote:
> > Hi,
> > 
> > please review and push.
> > 
> > Thanks,
> > Guenther
> Hi Guenther, I'm still working on my python - but get:
> ../libcli/util/py_ntstatus.c:17:6: error: no previous prototype for
> ‘initntstatus’ [-Werror=missing-prototypes]
>  void initntstatus(void)
> when I try and build with this. Not sure where the
> missing proto should go...

Nowhere (or just above it, to shut up the warning).

Because this is essentially a plugin (to python), it is like our own
modules where the caller (python) works out the name and finds it with
dlopen/dlsym stuff, rather than via a header. 

The only thing I would ask for is some spaces in this:
+    print "writing new headerfile: %s"%pythonfile_name
+    out_file = open(pythonfile_name,"w")


+    print "writing new headerfile: %s" % pythonfile_name
+    out_file = open(pythonfile_name, "w")

Sorry for the nitpick, but otherwise, it looks good to me, and we can
work from here to make some python exceptions so we can raise something
sensible when we need to return an NTSTATUS error from C.

Reviewed-by: Andrew Bartlett <abartlet at samba.org>

Andrew Bartlett

Andrew Bartlett
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   

More information about the samba-technical mailing list