Cleanup of header files for python extensions.
authorTim Potter <tpot@samba.org>
Tue, 18 Feb 2003 05:05:15 +0000 (05:05 +0000)
committerTim Potter <tpot@samba.org>
Tue, 18 Feb 2003 05:05:15 +0000 (05:05 +0000)
 - combine py_foo_proto.h and py_foo.h
 - move #include of Python.h into one place so we can get rid of that
   annoying compiler warning about HAVE_FSTAT being redefined
(This used to be commit 0659351b251aee438bb9e92682bc445f164923a5)

25 files changed:
source3/python/py_common.c
source3/python/py_common.h
source3/python/py_common_proto.h [deleted file]
source3/python/py_conv.c
source3/python/py_conv.h
source3/python/py_lsa.h
source3/python/py_lsa_proto.h [deleted file]
source3/python/py_ntsec.c
source3/python/py_samr.c
source3/python/py_samr.h
source3/python/py_smb.h
source3/python/py_spoolss.c
source3/python/py_spoolss.h
source3/python/py_spoolss_common.c [new file with mode: 0644]
source3/python/py_spoolss_printerdata.c
source3/python/py_spoolss_proto.h [deleted file]
source3/python/py_srvsvc.c
source3/python/py_srvsvc.h
source3/python/py_srvsvc_conv.c [new file with mode: 0644]
source3/python/py_tdb.h
source3/python/py_winbind.c
source3/python/py_winbind.h [new file with mode: 0644]
source3/python/py_winbind_conv.c
source3/python/py_winreg.h
source3/python/setup.py

index 6e299470bf831d4dafb90321eab5e683efe567c7..ea092d93703b48419e6b2f866c4b591e0a58676c 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 /* Return a tuple of (error code, error string) from a WERROR */
 
index 1f5188971db8714306404f8227f42e6018d0fb4b..2bbd148ff4ba5e840e7294d54f99aa140b6389ca 100644 (file)
@@ -1,7 +1,7 @@
 /* 
    Python wrappers for DCERPC/SMB client routines.
 
-   Copyright (C) Tim Potter, 2002
+   Copyright (C) Tim Potter, 2002-2003
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include "includes.h"
 
+/* This symbol is used in both includes.h and Python.h which causes an
+   annoying compiler warning. */
+
+#ifdef HAVE_FSTAT
+#undef HAVE_FSTAT
+#endif
+
+#include "Python.h"
+
 /* Return a cli_state struct opened on the specified pipe.  If credentials
    are passed use them. */
 
@@ -30,6 +39,29 @@ typedef struct cli_state *(cli_pipe_fn)(
        struct cli_state *cli, char *system_name,
        struct ntuser_creds *creds);
 
-#include "python/py_common_proto.h"
+/* The following definitions come from python/py_common.c  */
+
+PyObject *py_werror_tuple(WERROR werror);
+PyObject *py_ntstatus_tuple(NTSTATUS ntstatus);
+void py_samba_init(void);
+PyObject *get_debuglevel(PyObject *self, PyObject *args);
+PyObject *set_debuglevel(PyObject *self, PyObject *args);
+PyObject *py_setup_logging(PyObject *self, PyObject *args, PyObject *kw);
+BOOL py_parse_creds(PyObject *creds, char **username, char **domain, 
+                   char **password, char **errstr);
+struct cli_state *open_pipe_creds(char *server, PyObject *creds, 
+                                 int pipe_idx, char **errstr);
+BOOL get_level_value(PyObject *dict, uint32 *level);
+
+/* The following definitions come from python/py_ntsec.c  */
+
+BOOL py_from_SID(PyObject **obj, DOM_SID *sid);
+BOOL py_to_SID(DOM_SID *sid, PyObject *obj);
+BOOL py_from_ACE(PyObject **dict, SEC_ACE *ace);
+BOOL py_to_ACE(SEC_ACE *ace, PyObject *dict);
+BOOL py_from_ACL(PyObject **dict, SEC_ACL *acl);
+BOOL py_to_ACL(SEC_ACL *acl, PyObject *dict, TALLOC_CTX *mem_ctx);
+BOOL py_from_SECDESC(PyObject **dict, SEC_DESC *sd);
+BOOL py_to_SECDESC(SEC_DESC **sd, PyObject *dict, TALLOC_CTX *mem_ctx);
 
-#endif /* _PY_COMMON_H */
+#endif /*  _PY_COMMON_H  */
diff --git a/source3/python/py_common_proto.h b/source3/python/py_common_proto.h
deleted file mode 100644 (file)
index b012c17..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _PY_COMMON_PROTO_H
-#define _PY_COMMON_PROTO_H
-
-/* This file is automatically generated with "make proto". DO NOT EDIT */
-
-
-/* The following definitions come from python/py_common.c  */
-
-PyObject *py_werror_tuple(WERROR werror);
-PyObject *py_ntstatus_tuple(NTSTATUS ntstatus);
-void py_samba_init(void);
-PyObject *get_debuglevel(PyObject *self, PyObject *args);
-PyObject *set_debuglevel(PyObject *self, PyObject *args);
-PyObject *py_setup_logging(PyObject *self, PyObject *args, PyObject *kw);
-BOOL py_parse_creds(PyObject *creds, char **username, char **domain, 
-                   char **password, char **errstr);
-struct cli_state *open_pipe_creds(char *server, PyObject *creds, 
-                                 int pipe_idx, char **errstr);
-BOOL get_level_value(PyObject *dict, uint32 *level);
-
-/* The following definitions come from python/py_ntsec.c  */
-
-BOOL py_from_SID(PyObject **obj, DOM_SID *sid);
-BOOL py_to_SID(DOM_SID *sid, PyObject *obj);
-BOOL py_from_ACE(PyObject **dict, SEC_ACE *ace);
-BOOL py_to_ACE(SEC_ACE *ace, PyObject *dict);
-BOOL py_from_ACL(PyObject **dict, SEC_ACL *acl);
-BOOL py_to_ACL(SEC_ACL *acl, PyObject *dict, TALLOC_CTX *mem_ctx);
-BOOL py_from_SECDESC(PyObject **dict, SEC_DESC *sd);
-BOOL py_to_SECDESC(SEC_DESC **sd, PyObject *dict, TALLOC_CTX *mem_ctx);
-
-#endif /*  _PY_COMMON_PROTO_H  */
index e865daf7d9c0661b9191cd5b5de18468165dbdef..d0a2d78aabd48d15066608ead8dd6070e46fb6b9 100644 (file)
@@ -18,8 +18,6 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "includes.h"
-#include "Python.h"
 #include "py_conv.h"
 
 /* Helper for rpcstr_pull() function */
@@ -29,6 +27,11 @@ static void fstr_pull(fstring str, UNISTR *uni)
        rpcstr_pull(str, uni->buffer, sizeof(fstring), -1, STR_TERMINATE);
 }
 
+static void fstr_pull2(fstring str, UNISTR2 *uni)
+{
+       rpcstr_pull(str, uni->buffer, sizeof(fstring), -1, STR_TERMINATE);
+}
+
 /* Convert a structure to a Python dict */
 
 PyObject *from_struct(void *s, struct pyconv *conv)
@@ -52,6 +55,18 @@ PyObject *from_struct(void *s, struct pyconv *conv)
 
                        break;
                }
+               case PY_UNISTR2: {
+                       UNISTR2 *u = (UNISTR2 *)((char *)s + conv[i].offset);
+                       fstring str = "";
+
+                       if (u->buffer)
+                               fstr_pull2(str, u);
+
+                       item = PyString_FromString(str);
+                       PyDict_SetItemString(obj, conv[i].name, item);
+
+                       break;
+               }
                case PY_UINT32: {
                        uint32 *u = (uint32 *)((char *)s + conv[i].offset);
 
index b384f70fc2db9c808f0617a2849ca0a4a983cdf7..798661c3a0e6686881fa31777c63012058715c97 100644 (file)
 #ifndef _PY_CONV_H
 #define _PY_CONV_H
 
-enum pyconv_types { PY_UNISTR, PY_UINT32, PY_UINT16, PY_STRING, PY_UID, PY_GID };
+#include "python/py_common.h"
+
+enum pyconv_types { PY_UNISTR, PY_UNISTR2, PY_UINT32, PY_UINT16, PY_STRING, 
+                   PY_UID, PY_GID };
 
 struct pyconv {
        char *name;             /* Name of member */
index f9a30d2f7e7510557269b9f4be0d11fde5bfbea1..99f3de50b1ffb2529fff47cdea9ce27f6c3171fa 100644 (file)
 #ifndef _PY_LSA_H
 #define _PY_LSA_H
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 /* LSA policy handle object */
 
@@ -41,6 +38,4 @@ extern PyTypeObject lsa_policy_hnd_type;
 
 extern PyObject *lsa_error;
 
-#include "python/py_lsa_proto.h"
-
 #endif /* _PY_LSA_H */
diff --git a/source3/python/py_lsa_proto.h b/source3/python/py_lsa_proto.h
deleted file mode 100644 (file)
index 1c6f6ab..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _PY_LSA_PROTO_H
-#define _PY_LSA_PROTO_H
-
-/* This file is automatically generated with "make proto". DO NOT EDIT */
-
-
-/* The following definitions come from python/py_lsa.c  */
-
-PyObject *new_lsa_policy_hnd_object(struct cli_state *cli, TALLOC_CTX *mem_ctx,
-                                   POLICY_HND *pol);
-void initlsa(void);
-
-#endif /*  _PY_LSA_PROTO_H  */
index f216d96aa8ff84d46f0b54f3a42293f1445bc6ac..47524d8e19048cdfa21be4d9e06a5cc7718d1f0a 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 /* Convert a SID to a Python dict */
 
index 208274d9b5fb2b2132dfca08df710c60e211cb39..182671d04783c2ad62a3ce2d14da308628a5d364 100644 (file)
@@ -157,7 +157,7 @@ static PyObject *samr_enum_dom_groups(PyObject *self, PyObject *args,
        samr_domain_hnd_object *domain_hnd = (samr_domain_hnd_object *)self;
        static char *kwlist[] = { NULL };
        TALLOC_CTX *mem_ctx;
-       uint32 desired_access = MAXIMUM_ALLOWED_ACCESS;
+/*     uint32 desired_access = MAXIMUM_ALLOWED_ACCESS; */
        uint32 start_idx, size, num_dom_groups;
        struct acct_info *dom_groups;
        NTSTATUS result;
index 22c3660ef9894f75f92c241b53038cd748cb203c..3292eb97ec6afb1884464aa40e38ad5a02e5c183 100644 (file)
 #ifndef _PY_SAMR_H
 #define _PY_SAMR_H
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 /* SAMR connect policy handle object */
 
@@ -78,6 +75,7 @@ extern PyTypeObject samr_connect_hnd_type, samr_domain_hnd_type,
 
 extern PyObject *samr_error;
 
-/* #include "python/py_samr_proto.h" */
+/* The following definitions are from py_samr_conv.c */
 
+BOOL py_from_acct_info(PyObject **array, struct acct_info *info, int num_accts);
 #endif /* _PY_SAMR_H */
index 18677b49056f5532e4a6b26dc26ab53f5837e7f9..31bcf4aab2e37b9125a2c5d048a3e8645ba382a1 100644 (file)
 #ifndef _PY_SMB_H
 #define _PY_SMB_H
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 /* cli_state handle object */
 
index 957b4e9d9f114d18fd056f6ae6b1c48a2b791e28..7b0a102b3142fec1238519bfce6722c00ca262f7 100644 (file)
 
 PyObject *spoolss_error, *spoolss_werror;
 
-/*
- * Routines to convert from python hashes to Samba structures
- */
-
-PyObject *new_spoolss_policy_hnd_object(struct cli_state *cli, 
-                                       TALLOC_CTX *mem_ctx, POLICY_HND *pol)
-{
-       spoolss_policy_hnd_object *o;
-
-       o = PyObject_New(spoolss_policy_hnd_object, &spoolss_policy_hnd_type);
-
-       o->cli = cli;
-       o->mem_ctx = mem_ctx;
-       memcpy(&o->pol, pol, sizeof(POLICY_HND));
-
-       return (PyObject*)o;
-}
-     
 /* 
  * Method dispatch table
  */
index 40a6ae972e87bdce018c4b2176557026c6b54201..34b48190cd1d41d1048fb11c8d1b156f872e8345 100644 (file)
 #ifndef _PY_SPOOLSS_H
 #define _PY_SPOOLSS_H
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 /* Spoolss policy handle object */
 
@@ -41,6 +38,123 @@ extern PyTypeObject spoolss_policy_hnd_type;
 
 extern PyObject *spoolss_error, *spoolss_werror;
 
-#include "python/py_spoolss_proto.h"
+/* The following definitions come from python/py_spoolss_common.c */
+
+PyObject *new_spoolss_policy_hnd_object(struct cli_state *cli, 
+                                       TALLOC_CTX *mem_ctx, POLICY_HND *pol);
+
+/* The following definitions come from python/py_spoolss_drivers.c  */
+
+PyObject *spoolss_enumprinterdrivers(PyObject *self, PyObject *args,
+                                    PyObject *kw);
+PyObject *spoolss_hnd_getprinterdriver(PyObject *self, PyObject *args,
+                                  PyObject *kw);
+PyObject *spoolss_getprinterdriverdir(PyObject *self, PyObject *args, 
+                                     PyObject *kw);
+PyObject *spoolss_addprinterdriver(PyObject *self, PyObject *args,
+                                  PyObject *kw);
+PyObject *spoolss_addprinterdriverex(PyObject *self, PyObject *args,
+                                            PyObject *kw);
+PyObject *spoolss_deleteprinterdriver(PyObject *self, PyObject *args,
+                                     PyObject *kw);
+PyObject *spoolss_deleteprinterdriverex(PyObject *self, PyObject *args,
+                                       PyObject *kw);
+
+/* The following definitions come from python/py_spoolss_drivers_conv.c  */
+
+BOOL py_from_DRIVER_INFO_1(PyObject **dict, DRIVER_INFO_1 *info);
+BOOL py_to_DRIVER_INFO_1(DRIVER_INFO_1 *info, PyObject *dict);
+BOOL py_from_DRIVER_INFO_2(PyObject **dict, DRIVER_INFO_2 *info);
+BOOL py_to_DRIVER_INFO_2(DRIVER_INFO_2 *info, PyObject *dict);
+BOOL py_from_DRIVER_INFO_3(PyObject **dict, DRIVER_INFO_3 *info);
+BOOL py_to_DRIVER_INFO_3(DRIVER_INFO_3 *info, PyObject *dict);
+BOOL py_from_DRIVER_INFO_6(PyObject **dict, DRIVER_INFO_6 *info);
+BOOL py_to_DRIVER_INFO_6(DRIVER_INFO_6 *info, PyObject *dict);
+BOOL py_from_DRIVER_DIRECTORY_1(PyObject **dict, DRIVER_DIRECTORY_1 *info);
+BOOL py_to_DRIVER_DIRECTORY_1(DRIVER_DIRECTORY_1 *info, PyObject *dict);
+
+/* The following definitions come from python/py_spoolss_forms.c  */
+
+PyObject *spoolss_hnd_addform(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_getform(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_setform(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_deleteform(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_enumforms(PyObject *self, PyObject *args, PyObject *kw);
+
+/* The following definitions come from python/py_spoolss_forms_conv.c  */
+
+BOOL py_from_FORM_1(PyObject **dict, FORM_1 *form);
+BOOL py_to_FORM(FORM *form, PyObject *dict);
+
+/* The following definitions come from python/py_spoolss_jobs.c  */
+
+PyObject *spoolss_hnd_enumjobs(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_setjob(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_getjob(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_startpageprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_endpageprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_startdocprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_enddocprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_writeprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_addjob(PyObject *self, PyObject *args, PyObject *kw);
+
+/* The following definitions come from python/py_spoolss_jobs_conv.c  */
+
+BOOL py_from_JOB_INFO_1(PyObject **dict, JOB_INFO_1 *info);
+BOOL py_to_JOB_INFO_1(JOB_INFO_1 *info, PyObject *dict);
+BOOL py_from_JOB_INFO_2(PyObject **dict, JOB_INFO_2 *info);
+BOOL py_to_JOB_INFO_2(JOB_INFO_2 *info, PyObject *dict);
+BOOL py_from_DOC_INFO_1(PyObject **dict, DOC_INFO_1 *info);
+BOOL py_to_DOC_INFO_1(DOC_INFO_1 *info, PyObject *dict);
+
+/* The following definitions come from python/py_spoolss_ports.c  */
+
+PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw);
+
+/* The following definitions come from python/py_spoolss_ports_conv.c  */
+
+BOOL py_from_PORT_INFO_1(PyObject **dict, PORT_INFO_1 *info);
+BOOL py_to_PORT_INFO_1(PORT_INFO_1 *info, PyObject *dict);
+BOOL py_from_PORT_INFO_2(PyObject **dict, PORT_INFO_2 *info);
+BOOL py_to_PORT_INFO_2(PORT_INFO_2 *info, PyObject *dict);
+
+/* The following definitions come from python/py_spoolss_printerdata.c  */
+
+PyObject *spoolss_hnd_getprinterdata(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_setprinterdata(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_enumprinterdata(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_deleteprinterdata(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_getprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_setprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_enumprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_deleteprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_enumprinterkey(PyObject *self, PyObject *args,
+                                    PyObject *kw);
+PyObject *spoolss_hnd_deleteprinterkey(PyObject *self, PyObject *args,
+                                      PyObject *kw);
+
+/* The following definitions come from python/py_spoolss_printers.c  */
+
+PyObject *spoolss_openprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_closeprinter(PyObject *self, PyObject *args);
+PyObject *spoolss_hnd_getprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_hnd_setprinter(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_enumprinters(PyObject *self, PyObject *args, PyObject *kw);
+PyObject *spoolss_addprinterex(PyObject *self, PyObject *args, PyObject *kw);
+
+/* The following definitions come from python/py_spoolss_printers_conv.c  */
+
+BOOL py_from_DEVICEMODE(PyObject **dict, DEVICEMODE *devmode);
+BOOL py_to_DEVICEMODE(DEVICEMODE *devmode, PyObject *dict);
+BOOL py_from_PRINTER_INFO_0(PyObject **dict, PRINTER_INFO_0 *info);
+BOOL py_to_PRINTER_INFO_0(PRINTER_INFO_0 *info, PyObject *dict);
+BOOL py_from_PRINTER_INFO_1(PyObject **dict, PRINTER_INFO_1 *info);
+BOOL py_to_PRINTER_INFO_1(PRINTER_INFO_1 *info, PyObject *dict);
+BOOL py_from_PRINTER_INFO_2(PyObject **dict, PRINTER_INFO_2 *info);
+BOOL py_to_PRINTER_INFO_2(PRINTER_INFO_2 *info, PyObject *dict,
+                         TALLOC_CTX *mem_ctx);
+BOOL py_from_PRINTER_INFO_3(PyObject **dict, PRINTER_INFO_3 *info);
+BOOL py_to_PRINTER_INFO_3(PRINTER_INFO_3 *info, PyObject *dict,
+                         TALLOC_CTX *mem_ctx);
 
 #endif /* _PY_SPOOLSS_H */
diff --git a/source3/python/py_spoolss_common.c b/source3/python/py_spoolss_common.c
new file mode 100644 (file)
index 0000000..f34d2ac
--- /dev/null
@@ -0,0 +1,35 @@
+/* 
+   Python wrappers for DCERPC/SMB client routines.
+
+   Copyright (C) Tim Potter, 2003
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "python/py_spoolss.h"
+
+PyObject *new_spoolss_policy_hnd_object(struct cli_state *cli, 
+                                       TALLOC_CTX *mem_ctx, POLICY_HND *pol)
+{
+       spoolss_policy_hnd_object *o;
+
+       o = PyObject_New(spoolss_policy_hnd_object, &spoolss_policy_hnd_type);
+
+       o->cli = cli;
+       o->mem_ctx = mem_ctx;
+       memcpy(&o->pol, pol, sizeof(POLICY_HND));
+
+       return (PyObject*)o;
+}
index 583d097e845a372d1cd13e5129a66d71970341da..f165475b0802ec7265bd47eef0cb214028cb7418 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 #include "python/py_spoolss.h"
+#include "python/py_conv.h"
 
 static BOOL py_from_printerdata(PyObject **dict, char *key, char *value,
                                uint16 data_type, uint8 *data, 
diff --git a/source3/python/py_spoolss_proto.h b/source3/python/py_spoolss_proto.h
deleted file mode 100644 (file)
index 77feb1a..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef _PY_SPOOLSS_PROTO_H
-#define _PY_SPOOLSS_PROTO_H
-
-/* This file is automatically generated with "make proto". DO NOT EDIT */
-
-
-/* The following definitions come from python/py_spoolss.c  */
-
-PyObject *new_spoolss_policy_hnd_object(struct cli_state *cli, 
-                                       TALLOC_CTX *mem_ctx, POLICY_HND *pol);
-void initspoolss(void);
-
-/* The following definitions come from python/py_spoolss_drivers.c  */
-
-PyObject *spoolss_enumprinterdrivers(PyObject *self, PyObject *args,
-                                    PyObject *kw);
-PyObject *spoolss_hnd_getprinterdriver(PyObject *self, PyObject *args,
-                                  PyObject *kw);
-PyObject *spoolss_getprinterdriverdir(PyObject *self, PyObject *args, 
-                                     PyObject *kw);
-PyObject *spoolss_addprinterdriver(PyObject *self, PyObject *args,
-                                  PyObject *kw);
-PyObject *spoolss_addprinterdriverex(PyObject *self, PyObject *args,
-                                            PyObject *kw);
-PyObject *spoolss_deleteprinterdriver(PyObject *self, PyObject *args,
-                                     PyObject *kw);
-PyObject *spoolss_deleteprinterdriverex(PyObject *self, PyObject *args,
-                                       PyObject *kw);
-
-/* The following definitions come from python/py_spoolss_drivers_conv.c  */
-
-BOOL py_from_DRIVER_INFO_1(PyObject **dict, DRIVER_INFO_1 *info);
-BOOL py_to_DRIVER_INFO_1(DRIVER_INFO_1 *info, PyObject *dict);
-BOOL py_from_DRIVER_INFO_2(PyObject **dict, DRIVER_INFO_2 *info);
-BOOL py_to_DRIVER_INFO_2(DRIVER_INFO_2 *info, PyObject *dict);
-BOOL py_from_DRIVER_INFO_3(PyObject **dict, DRIVER_INFO_3 *info);
-BOOL py_to_DRIVER_INFO_3(DRIVER_INFO_3 *info, PyObject *dict);
-BOOL py_from_DRIVER_INFO_6(PyObject **dict, DRIVER_INFO_6 *info);
-BOOL py_to_DRIVER_INFO_6(DRIVER_INFO_6 *info, PyObject *dict);
-BOOL py_from_DRIVER_DIRECTORY_1(PyObject **dict, DRIVER_DIRECTORY_1 *info);
-BOOL py_to_DRIVER_DIRECTORY_1(DRIVER_DIRECTORY_1 *info, PyObject *dict);
-
-/* The following definitions come from python/py_spoolss_forms.c  */
-
-PyObject *spoolss_hnd_addform(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_getform(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_setform(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_deleteform(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_enumforms(PyObject *self, PyObject *args, PyObject *kw);
-
-/* The following definitions come from python/py_spoolss_forms_conv.c  */
-
-BOOL py_from_FORM_1(PyObject **dict, FORM_1 *form);
-BOOL py_to_FORM(FORM *form, PyObject *dict);
-
-/* The following definitions come from python/py_spoolss_jobs.c  */
-
-PyObject *spoolss_hnd_enumjobs(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_setjob(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_getjob(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_startpageprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_endpageprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_startdocprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_enddocprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_writeprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_addjob(PyObject *self, PyObject *args, PyObject *kw);
-
-/* The following definitions come from python/py_spoolss_jobs_conv.c  */
-
-BOOL py_from_JOB_INFO_1(PyObject **dict, JOB_INFO_1 *info);
-BOOL py_to_JOB_INFO_1(JOB_INFO_1 *info, PyObject *dict);
-BOOL py_from_JOB_INFO_2(PyObject **dict, JOB_INFO_2 *info);
-BOOL py_to_JOB_INFO_2(JOB_INFO_2 *info, PyObject *dict);
-BOOL py_from_DOC_INFO_1(PyObject **dict, DOC_INFO_1 *info);
-BOOL py_to_DOC_INFO_1(DOC_INFO_1 *info, PyObject *dict);
-
-/* The following definitions come from python/py_spoolss_ports.c  */
-
-PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw);
-
-/* The following definitions come from python/py_spoolss_ports_conv.c  */
-
-BOOL py_from_PORT_INFO_1(PyObject **dict, PORT_INFO_1 *info);
-BOOL py_to_PORT_INFO_1(PORT_INFO_1 *info, PyObject *dict);
-BOOL py_from_PORT_INFO_2(PyObject **dict, PORT_INFO_2 *info);
-BOOL py_to_PORT_INFO_2(PORT_INFO_2 *info, PyObject *dict);
-
-/* The following definitions come from python/py_spoolss_printerdata.c  */
-
-PyObject *spoolss_hnd_getprinterdata(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_setprinterdata(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_enumprinterdata(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_deleteprinterdata(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_getprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_setprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_enumprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_deleteprinterdataex(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_enumprinterkey(PyObject *self, PyObject *args,
-                                    PyObject *kw);
-PyObject *spoolss_hnd_deleteprinterkey(PyObject *self, PyObject *args,
-                                      PyObject *kw);
-
-/* The following definitions come from python/py_spoolss_printers.c  */
-
-PyObject *spoolss_openprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_closeprinter(PyObject *self, PyObject *args);
-PyObject *spoolss_hnd_getprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_hnd_setprinter(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_enumprinters(PyObject *self, PyObject *args, PyObject *kw);
-PyObject *spoolss_addprinterex(PyObject *self, PyObject *args, PyObject *kw);
-
-/* The following definitions come from python/py_spoolss_printers_conv.c  */
-
-BOOL py_from_DEVICEMODE(PyObject **dict, DEVICEMODE *devmode);
-BOOL py_to_DEVICEMODE(DEVICEMODE *devmode, PyObject *dict);
-BOOL py_from_PRINTER_INFO_0(PyObject **dict, PRINTER_INFO_0 *info);
-BOOL py_to_PRINTER_INFO_0(PRINTER_INFO_0 *info, PyObject *dict);
-BOOL py_from_PRINTER_INFO_1(PyObject **dict, PRINTER_INFO_1 *info);
-BOOL py_to_PRINTER_INFO_1(PRINTER_INFO_1 *info, PyObject *dict);
-BOOL py_from_PRINTER_INFO_2(PyObject **dict, PRINTER_INFO_2 *info);
-BOOL py_to_PRINTER_INFO_2(PRINTER_INFO_2 *info, PyObject *dict,
-                         TALLOC_CTX *mem_ctx);
-BOOL py_from_PRINTER_INFO_3(PyObject **dict, PRINTER_INFO_3 *info);
-BOOL py_to_PRINTER_INFO_3(PRINTER_INFO_3 *info, PyObject *dict,
-                         TALLOC_CTX *mem_ctx);
-
-#endif /*  _PY_SPOOLSS_PROTO_H  */
index 40827cc2ed31660c1edf0fee06d06f539849e1e9..8ec2430285f2bb21747e7988423d9abcf7888c8a 100644 (file)
@@ -28,6 +28,33 @@ static struct const_vals {
        char *name;
        uint32 value;
 } module_const_vals[] = {
+       { "SV_TYPE_WORKSTATION", SV_TYPE_WORKSTATION },
+       { "SV_TYPE_SERVER", SV_TYPE_SERVER },
+       { "SV_TYPE_SQLSERVER", SV_TYPE_SQLSERVER },
+       { "SV_TYPE_DOMAIN_CTRL", SV_TYPE_DOMAIN_CTRL },
+       { "SV_TYPE_DOMAIN_BAKCTRL", SV_TYPE_DOMAIN_BAKCTRL },
+       { "SV_TYPE_TIME_SOURCE", SV_TYPE_TIME_SOURCE },
+       { "SV_TYPE_AFP", SV_TYPE_AFP },
+       { "SV_TYPE_NOVELL", SV_TYPE_NOVELL },
+       { "SV_TYPE_DOMAIN_MEMBER", SV_TYPE_DOMAIN_MEMBER },
+       { "SV_TYPE_PRINTQ_SERVER", SV_TYPE_PRINTQ_SERVER },
+       { "SV_TYPE_DIALIN_SERVER", SV_TYPE_DIALIN_SERVER },
+       { "SV_TYPE_SERVER_UNIX", SV_TYPE_SERVER_UNIX },
+       { "SV_TYPE_NT", SV_TYPE_NT },
+       { "SV_TYPE_WFW", SV_TYPE_WFW },
+       { "SV_TYPE_SERVER_MFPN", SV_TYPE_SERVER_MFPN },
+       { "SV_TYPE_SERVER_NT", SV_TYPE_SERVER_NT },
+       { "SV_TYPE_POTENTIAL_BROWSER", SV_TYPE_POTENTIAL_BROWSER },
+       { "SV_TYPE_BACKUP_BROWSER", SV_TYPE_BACKUP_BROWSER },
+       { "SV_TYPE_MASTER_BROWSER", SV_TYPE_MASTER_BROWSER },
+       { "SV_TYPE_DOMAIN_MASTER", SV_TYPE_DOMAIN_MASTER },
+       { "SV_TYPE_SERVER_OSF", SV_TYPE_SERVER_OSF },
+       { "SV_TYPE_SERVER_VMS", SV_TYPE_SERVER_VMS },
+       { "SV_TYPE_WIN95_PLUS", SV_TYPE_WIN95_PLUS },
+       { "SV_TYPE_DFS_SERVER", SV_TYPE_DFS_SERVER },
+       { "SV_TYPE_ALTERNATE_XPORT", SV_TYPE_ALTERNATE_XPORT },
+       { "SV_TYPE_LOCAL_LIST_ONLY", SV_TYPE_LOCAL_LIST_ONLY },
+       { "SV_TYPE_DOMAIN_ENUM", SV_TYPE_DOMAIN_ENUM },
        { NULL },
 };
 
@@ -100,8 +127,18 @@ PyObject *srvsvc_netservergetinfo(PyObject *self, PyObject *args,
                goto done;
        }
 
-       result = Py_None;
-       Py_INCREF(Py_None);
+       if (level != ctr.switch_value) {
+               PyErr_SetString(srvsvc_error, "container level value wrong");
+               goto done;
+       }
+
+       switch(level) {
+       case 101:
+               py_from_SRV_INFO_101(&result, &ctr.srv.sv101);
+               break;
+       }
+
+       Py_INCREF(result);
 
 done:
        if (mem_ctx)
index 17b8eeb5bd3201bf09a7ef0ed43600cb016e17eb..b440c32e13e5997c0c3bbd5ae76ff9894a1246f3 100644 (file)
@@ -21,9 +21,6 @@
 #ifndef _PY_SRVSVC_H
 #define _PY_SRVSVC_H
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 #endif /* _PY_SRVSVC_H */
diff --git a/source3/python/py_srvsvc_conv.c b/source3/python/py_srvsvc_conv.c
new file mode 100644 (file)
index 0000000..de43f07
--- /dev/null
@@ -0,0 +1,43 @@
+/* 
+   Python wrappers for DCERPC/SMB client routines.
+
+   Copyright (C) Tim Potter, 2003
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "python/py_srvsvc.h"
+#include "python/py_conv.h"
+
+static struct pyconv py_SRV_INFO_101[] = {
+       { "platform_id", PY_UINT32, offsetof(SRV_INFO_101, platform_id) },
+       { "major_version", PY_UINT32, offsetof(SRV_INFO_101, ver_major) },
+       { "minor_version", PY_UINT32, offsetof(SRV_INFO_101, ver_minor) },
+       { "server_type", PY_UINT32, offsetof(SRV_INFO_101, srv_type) },
+       { "name", PY_UNISTR2, offsetof(SRV_INFO_101, uni_name) },
+       { "comment", PY_UNISTR2, offsetof(SRV_INFO_101, uni_comment) },
+       { NULL }
+};     
+
+BOOL py_from_SRV_INFO_101(PyObject **dict, SRV_INFO_101 *info)
+{
+       PyObject *obj;  
+
+       *dict = from_struct(info, py_SRV_INFO_101);
+
+       PyDict_SetItemString(*dict, "level", PyInt_FromLong(101));
+
+       return True;
+}
index 794a20cf2b101d865d42a1adf64a54f03bb294e5..69f251c8c1f275bb2668320a4ac87efa765152d1 100644 (file)
@@ -21,9 +21,6 @@
 #ifndef _PY_TDB_H
 #define _PY_TDB_H
 
-#include "includes.h"
-#include "Python.h"
-
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 #endif /* _PY_TDB_H */
index 783ac5443904ab1bbd5a5dcfb815b6cdc53af464..e9fc4b7dd86c58acd61d22e3c474a635cc28685a 100644 (file)
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "includes.h"
-#include "Python.h"
-
-#include "py_common_proto.h"
+#include "py_winbind.h"
 
 /* 
  * Exceptions raised by this module 
@@ -49,7 +46,8 @@ static PyObject *py_name_to_sid(PyObject *self, PyObject *args)
        struct winbindd_request request;
        struct winbindd_response response;
        PyObject *result;
-       char *name, *p, *sep;
+       char *name, *p;
+       const char *sep;
 
        if (!PyArg_ParseTuple(args, "s", &name))
                return NULL;
@@ -137,7 +135,7 @@ static PyObject *py_enum_domain_users(PyObject *self, PyObject *args)
        result = PyList_New(0);
 
        if (response.extra_data) {
-               char *extra_data = response.extra_data;
+               const char *extra_data = response.extra_data;
                fstring name;
 
                while (next_token(&extra_data, name, ",", sizeof(fstring)))
@@ -168,7 +166,7 @@ static PyObject *py_enum_domain_groups(PyObject *self, PyObject *args)
        result = PyList_New(0);
 
        if (response.extra_data) {
-               char *extra_data = response.extra_data;
+               const char *extra_data = response.extra_data;
                fstring name;
 
                while (next_token(&extra_data, name, ",", sizeof(fstring)))
@@ -203,7 +201,7 @@ static PyObject *py_enum_trust_dom(PyObject *self, PyObject *args)
        result = PyList_New(0);
 
        if (response.extra_data) {
-               char *extra_data = response.extra_data;
+               const char *extra_data = response.extra_data;
                fstring name;
 
                while (next_token(&extra_data, name, ",", sizeof(fstring)))
@@ -522,12 +520,12 @@ static PyObject *py_getpwuid(PyObject *self, PyObject *args)
 
 static PyMethodDef winbind_methods[] = {
 
-       { "getpwnam", py_getpwnam, METH_VARARGS, "getpwnam(3)" },
-       { "getpwuid", py_getpwuid, METH_VARARGS, "getpwuid(3)" },
+       { "getpwnam", (PyCFunction)py_getpwnam, METH_VARARGS, "getpwnam(3)" },
+       { "getpwuid", (PyCFunction)py_getpwuid, METH_VARARGS, "getpwuid(3)" },
 
        /* Name <-> SID conversion */
 
-       { "name_to_sid", py_name_to_sid, METH_VARARGS,
+       { "name_to_sid", (PyCFunction)py_name_to_sid, METH_VARARGS,
          "name_to_sid(s) -> string
 
 Return the SID for a name.
@@ -537,7 +535,7 @@ Example:
 >>> winbind.name_to_sid('FOO/Administrator')
 'S-1-5-21-406022937-1377575209-526660263-500' " },
 
-       { "sid_to_name", py_sid_to_name, METH_VARARGS,
+       { "sid_to_name", (PyCFunction)py_sid_to_name, METH_VARARGS,
          "sid_to_name(s) -> string
 
 Return the name for a SID.
@@ -550,7 +548,7 @@ Example:
 
        /* Enumerate users/groups */
 
-       { "enum_domain_users", py_enum_domain_users, METH_VARARGS,
+       { "enum_domain_users", (PyCFunction)py_enum_domain_users, METH_VARARGS,
          "enum_domain_users() -> list of strings
 
 Return a list of domain users.
@@ -562,7 +560,8 @@ Example:
 'FOO/foo', 'FOO/foo2', 'FOO/foo3', 'FOO/Guest', 'FOO/user1', 
 'FOO/whoops-ptang'] " },
 
-       { "enum_domain_groups", py_enum_domain_groups, METH_VARARGS,
+       { "enum_domain_groups", (PyCFunction)py_enum_domain_groups, 
+         METH_VARARGS,
          "enum_domain_groups() -> list of strings
 
 Return a list of domain groups.
@@ -575,7 +574,7 @@ Example:
 
        /* ID mapping */
 
-       { "uid_to_sid", py_uid_to_sid, METH_VARARGS,
+       { "uid_to_sid", (PyCFunction)py_uid_to_sid, METH_VARARGS,
          "uid_to_sid(int) -> string
 
 Return the SID for a UNIX uid.
@@ -585,7 +584,7 @@ Example:
 >>> winbind.uid_to_sid(10000)   
 'S-1-5-21-406022937-1377575209-526660263-500' " },
 
-       { "gid_to_sid", py_gid_to_sid, METH_VARARGS,
+       { "gid_to_sid", (PyCFunction)py_gid_to_sid, METH_VARARGS,
          "gid_to_sid(int) -> string
 
 Return the UNIX gid for a SID.
@@ -595,7 +594,7 @@ Example:
 >>> winbind.gid_to_sid(10001)
 'S-1-5-21-406022937-1377575209-526660263-512' " },
 
-       { "sid_to_uid", py_sid_to_uid, METH_VARARGS,
+       { "sid_to_uid", (PyCFunction)py_sid_to_uid, METH_VARARGS,
          "sid_to_uid(string) -> int
 
 Return the UNIX uid for a SID.
@@ -605,7 +604,7 @@ Example:
 >>> winbind.sid_to_uid('S-1-5-21-406022937-1377575209-526660263-500')
 10000 " },
 
-       { "sid_to_gid", py_sid_to_gid, METH_VARARGS,
+       { "sid_to_gid", (PyCFunction)py_sid_to_gid, METH_VARARGS,
          "sid_to_gid(string) -> int
 
 Return the UNIX gid corresponding to a SID.
@@ -617,13 +616,13 @@ Example:
 
        /* Miscellaneous */
 
-       { "check_secret", py_check_secret, METH_VARARGS,
+       { "check_secret", (PyCFunction)py_check_secret, METH_VARARGS,
          "check_secret() -> int
 
 Check the machine trust account password.  The NT status is returned
 with zero indicating success. " },
 
-       { "enum_trust_dom", py_enum_trust_dom, METH_VARARGS,
+       { "enum_trust_dom", (PyCFunction)py_enum_trust_dom, METH_VARARGS,
          "enum_trust_dom() -> list of strings
 
 Return a list of trusted domains.  The domain the server is a member 
@@ -636,13 +635,13 @@ Example:
 
        /* PAM authorisation functions */
 
-       { "auth_plaintext", py_auth_plaintext, METH_VARARGS,
+       { "auth_plaintext", (PyCFunction)py_auth_plaintext, METH_VARARGS,
          "auth_plaintext(s, s) -> int
 
 Authenticate a username and password using plaintext authentication.
 The NT status code is returned with zero indicating success." },
 
-       { "auth_crap", py_auth_crap, METH_VARARGS,
+       { "auth_crap", (PyCFunction)py_auth_crap, METH_VARARGS,
          "auth_crap(s, s) -> int
 
 Authenticate a username and password using the challenge/response
diff --git a/source3/python/py_winbind.h b/source3/python/py_winbind.h
new file mode 100644 (file)
index 0000000..10927ea
--- /dev/null
@@ -0,0 +1,30 @@
+/* 
+   Python wrappers for DCERPC/SMB client routines.
+
+   Copyright (C) Tim Potter, 2002
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _PY_WINBIND_H
+#define _PY_WINBIND_H
+
+#include "python/py_common.h"
+
+/* The following definitions are from py_winbind_conv.c */
+
+BOOL py_from_winbind_passwd(PyObject **dict, struct winbindd_response *response);
+
+#endif /* _PY_WINBIND_H */
index c3e416171e74f75287560ef195a03beadddf80bd..6e2eab59414463e3b204fcccc3a06efb7caa312d 100644 (file)
@@ -18,8 +18,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include "includes.h"
-#include "Python.h"
+#include "python/py_common.h"
 #include "python/py_conv.h"
 
 /* Convert a struct passwd to a dictionary */
index 088be724e2abf0635c63482e0f1aa9341bbcb553..e19674d2181b2e7ffec4655a991f560f9dc64ade 100644 (file)
@@ -24,6 +24,6 @@
 #include "includes.h"
 #include "Python.h"
 
-#include "python/py_common_proto.h"
+#include "python/py_common.h"
 
 #endif /* _PY_WINREG_H */
index 7d5df71b1040b113c4de8166817484e1cc6ba5c6..48487fee4d0408185fb8c4ef19977ceec2f7b987 100755 (executable)
@@ -3,7 +3,7 @@
 # Unix SMB/CIFS implementation.
 # Module packaging setup for Samba python extensions
 #
-# Copyright (C) Tim Potter, 2002
+# Copyright (C) Tim Potter, 2002-2003
 # Copyright (C) Martin Pool, 2002
 #
 # This program is free software; you can redistribute it and/or modify
@@ -83,6 +83,7 @@ setup(
                          samba_srcdir + "python/py_common.c",
                          samba_srcdir + "python/py_conv.c",
                          samba_srcdir + "python/py_ntsec.c",
+                         samba_srcdir + "python/py_spoolss_common.c",
                          samba_srcdir + "python/py_spoolss_forms.c",
                          samba_srcdir + "python/py_spoolss_forms_conv.c",
                          samba_srcdir + "python/py_spoolss_drivers.c",
@@ -148,6 +149,8 @@ setup(
 
     Extension(name = "srvsvc",
               sources = [samba_srcdir + "python/py_srvsvc.c",
+                         samba_srcdir + "python/py_conv.c",
+                         samba_srcdir + "python/py_srvsvc_conv.c",
                          samba_srcdir + "python/py_common.c"],
               libraries = lib_list,
               library_dirs = ["/usr/kerberos/lib"],