mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-abartlet
It seems the format of main.mk changed in my sleep... Conflicts: source/main.mk
This commit is contained in:
commit
56f2288e4f
2
BUGS.txt
2
BUGS.txt
@ -3,4 +3,4 @@ than education you are insane, or perhaps just very interested.
|
||||
|
||||
We welcome your testing, please file bug reports at
|
||||
https://bugzilla.samba.org/, product: Samba4. Please include as much
|
||||
information as possible, such as SVN revision number and backtraces.
|
||||
information as possible, such as GIT revision number and backtraces.
|
||||
|
@ -6,7 +6,7 @@ include mkconfig.mk
|
||||
|
||||
pidldir := $(srcdir)/pidl
|
||||
|
||||
VPATH = $(builddir):$(srcdir):heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des
|
||||
VPATH = $(builddir):$(srcdir):$(srcdir)/heimdal_build:$(heimdalsrcdir)/lib/asn1:$(heimdalsrcdir)/lib/krb5:$(heimdalsrcdir)/lib/gssapi:$(heimdalsrcdir)/lib/hdb:$(heimdalsrcdir)/lib/roken:$(heimdalsrcdir)/lib/des
|
||||
|
||||
BASEDIR = $(prefix)
|
||||
TORTUREDIR = $(libdir)/torture
|
||||
@ -47,8 +47,57 @@ ALL_PREDEP = basics
|
||||
.NOTPARALLEL:
|
||||
endif
|
||||
|
||||
include build/make/rules.mk
|
||||
include build/make/python.mk
|
||||
include $(srcdir)/build/make/rules.mk
|
||||
include $(srcdir)/build/make/python.mk
|
||||
dynconfigsrcdir := dynconfig
|
||||
heimdalsrcdir := heimdal
|
||||
dsdbsrcdir := dsdb
|
||||
smbdsrcdir := smbd
|
||||
clustersrcdir := cluster
|
||||
libnetsrcdir := libnet
|
||||
authsrcdir := auth
|
||||
nsswitchsrcdir := nsswitch
|
||||
libsrcdir := lib
|
||||
libsocketsrcdir := lib/socket
|
||||
libcharsetsrcdir := lib/charset
|
||||
ldb_sambasrcdir := lib/ldb-samba
|
||||
libtlssrcdir := lib/tls
|
||||
libregistrysrcdir := lib/registry
|
||||
smbreadlinesrcdir := lib/smbreadline
|
||||
libmessagingsrcdir := lib/messaging
|
||||
libeventssrcdir := lib/events
|
||||
libcmdlinesrcdir := lib/cmdline
|
||||
socketwrappersrcdir := lib/socket_wrapper
|
||||
nsswrappersrcdir := lib/nss_wrapper
|
||||
appwebsrcdir := lib/appweb
|
||||
libstreamsrcdir := lib/stream
|
||||
libutilsrcdir := lib/util
|
||||
libtdrsrcdir := lib/tdr
|
||||
libdbwrapsrcdir := lib/dbwrap
|
||||
libcryptosrcdir := lib/crypto
|
||||
libtorturesrcdir := lib/torture
|
||||
smb_serversrcdir := smb_server
|
||||
libcompressionsrcdir := lib/compression
|
||||
libgencachesrcdir := lib
|
||||
paramsrcdir := param
|
||||
rpc_serversrcdir := rpc_server
|
||||
ldap_serversrcdir := ldap_server
|
||||
web_serversrcdir := web_server
|
||||
winbindsrcdir := winbind
|
||||
nbt_serversrcdir := nbt_server
|
||||
wrepl_serversrcdir := wrepl_server
|
||||
cldap_serversrcdir := cldap_server
|
||||
utilssrcdir := utils
|
||||
clientsrcdir := client
|
||||
torturesrcdir := torture
|
||||
ntvfssrcdir := ntvfs
|
||||
ntptrsrcdir := ntptr
|
||||
librpcsrcdir := librpc
|
||||
libclisrcdir := libcli
|
||||
ejsscriptsrcdir := scripting/ejs
|
||||
pyscriptsrcdir := $(srcdir)/scripting/python
|
||||
kdcsrcdir := kdc
|
||||
|
||||
include data.mk
|
||||
|
||||
BINARIES += $(BIN_PROGS) $(SBIN_PROGS)
|
||||
@ -233,8 +282,8 @@ data.mk: config.status $(MK_FILES)
|
||||
|
||||
testcov-html::
|
||||
|
||||
include pidl/config.mk
|
||||
include selftest/config.mk
|
||||
include $(pidldir)/config.mk
|
||||
include $(srcdir)/selftest/config.mk
|
||||
|
||||
showflags::
|
||||
@echo ' pwd = '`/bin/pwd`
|
||||
|
@ -16,7 +16,11 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module(package="samba.auth") auth
|
||||
%define DOCSTRING
|
||||
"Authentication and authorization support."
|
||||
%enddef
|
||||
|
||||
%module(docstring=DOCSTRING,package="samba.auth") auth
|
||||
|
||||
%{
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
# This file was automatically generated by SWIG (http://www.swig.org).
|
||||
# Version 1.3.33
|
||||
# Version 1.3.35
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Authentication and authorization support.
|
||||
"""
|
||||
|
||||
import _auth
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 1.3.33
|
||||
* Version 1.3.35
|
||||
*
|
||||
* This file is not intended to be easily readable and contains a number of
|
||||
* coding conventions designed to improve portability and efficiency. Do not make
|
||||
@ -126,7 +126,7 @@
|
||||
|
||||
/* This should only be incremented when either the layout of swig_type_info changes,
|
||||
or for whatever reason, the runtime changes incompatibly */
|
||||
#define SWIG_RUNTIME_VERSION "3"
|
||||
#define SWIG_RUNTIME_VERSION "4"
|
||||
|
||||
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
|
||||
#ifdef SWIG_TYPE_TABLE
|
||||
@ -161,6 +161,7 @@
|
||||
|
||||
/* Flags for pointer conversions */
|
||||
#define SWIG_POINTER_DISOWN 0x1
|
||||
#define SWIG_CAST_NEW_MEMORY 0x2
|
||||
|
||||
/* Flags for new pointer objects */
|
||||
#define SWIG_POINTER_OWN 0x1
|
||||
@ -301,10 +302,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *(*swig_converter_func)(void *);
|
||||
typedef void *(*swig_converter_func)(void *, int *);
|
||||
typedef struct swig_type_info *(*swig_dycast_func)(void **);
|
||||
|
||||
/* Structure to store inforomation on one type */
|
||||
/* Structure to store information on one type */
|
||||
typedef struct swig_type_info {
|
||||
const char *name; /* mangled name of this type */
|
||||
const char *str; /* human readable name of this type */
|
||||
@ -431,8 +432,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
|
||||
Cast a pointer up an inheritance hierarchy
|
||||
*/
|
||||
SWIGRUNTIMEINLINE void *
|
||||
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
|
||||
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
|
||||
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
|
||||
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -856,7 +857,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
|
||||
Py_DECREF(old_str);
|
||||
Py_DECREF(value);
|
||||
} else {
|
||||
PyErr_Format(PyExc_RuntimeError, mesg);
|
||||
PyErr_SetString(PyExc_RuntimeError, mesg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1416,7 +1417,7 @@ PySwigObject_dealloc(PyObject *v)
|
||||
{
|
||||
PySwigObject *sobj = (PySwigObject *) v;
|
||||
PyObject *next = sobj->next;
|
||||
if (sobj->own) {
|
||||
if (sobj->own == SWIG_POINTER_OWN) {
|
||||
swig_type_info *ty = sobj->ty;
|
||||
PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
|
||||
PyObject *destroy = data ? data->destroy : 0;
|
||||
@ -1434,12 +1435,13 @@ PySwigObject_dealloc(PyObject *v)
|
||||
res = ((*meth)(mself, v));
|
||||
}
|
||||
Py_XDECREF(res);
|
||||
} else {
|
||||
const char *name = SWIG_TypePrettyName(ty);
|
||||
}
|
||||
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
|
||||
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
|
||||
#endif
|
||||
else {
|
||||
const char *name = SWIG_TypePrettyName(ty);
|
||||
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Py_XDECREF(next);
|
||||
PyObject_DEL(v);
|
||||
@ -1944,7 +1946,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
|
||||
|
||||
SWIGRUNTIME int
|
||||
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
|
||||
if (own) {
|
||||
if (own == SWIG_POINTER_OWN) {
|
||||
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
|
||||
if (sobj) {
|
||||
int oldown = sobj->own;
|
||||
@ -1965,6 +1967,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
return SWIG_OK;
|
||||
} else {
|
||||
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
|
||||
if (own)
|
||||
*own = 0;
|
||||
while (sobj) {
|
||||
void *vptr = sobj->ptr;
|
||||
if (ty) {
|
||||
@ -1978,7 +1982,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
if (!tc) {
|
||||
sobj = (PySwigObject *)sobj->next;
|
||||
} else {
|
||||
if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
|
||||
if (ptr) {
|
||||
int newmemory = 0;
|
||||
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
||||
if (newmemory == SWIG_CAST_NEW_MEMORY) {
|
||||
assert(own);
|
||||
if (own)
|
||||
*own = *own | SWIG_CAST_NEW_MEMORY;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1988,7 +2000,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
}
|
||||
}
|
||||
if (sobj) {
|
||||
if (own) *own = sobj->own;
|
||||
if (own)
|
||||
*own = *own | sobj->own;
|
||||
if (flags & SWIG_POINTER_DISOWN) {
|
||||
sobj->own = 0;
|
||||
}
|
||||
@ -2053,8 +2066,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
|
||||
}
|
||||
if (ty) {
|
||||
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
|
||||
if (!tc) return SWIG_ERROR;
|
||||
*ptr = SWIG_TypeCast(tc,vptr);
|
||||
if (tc) {
|
||||
int newmemory = 0;
|
||||
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
||||
assert(!newmemory); /* newmemory handling not yet implemented */
|
||||
} else {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
} else {
|
||||
*ptr = vptr;
|
||||
}
|
||||
@ -2505,7 +2523,7 @@ static swig_module_info swig_module = {swig_types, 16, 0, 0, 0, 0};
|
||||
|
||||
#define SWIG_name "_auth"
|
||||
|
||||
#define SWIGVERSION 0x010333
|
||||
#define SWIGVERSION 0x010335
|
||||
#define SWIG_VERSION SWIGVERSION
|
||||
|
||||
|
||||
@ -2733,7 +2751,7 @@ SWIGRUNTIME void
|
||||
SWIG_InitializeModule(void *clientdata) {
|
||||
size_t i;
|
||||
swig_module_info *module_head, *iter;
|
||||
int found;
|
||||
int found, init;
|
||||
|
||||
clientdata = clientdata;
|
||||
|
||||
@ -2743,6 +2761,9 @@ SWIG_InitializeModule(void *clientdata) {
|
||||
swig_module.type_initial = swig_type_initial;
|
||||
swig_module.cast_initial = swig_cast_initial;
|
||||
swig_module.next = &swig_module;
|
||||
init = 1;
|
||||
} else {
|
||||
init = 0;
|
||||
}
|
||||
|
||||
/* Try and load any already created modules */
|
||||
@ -2771,6 +2792,12 @@ SWIG_InitializeModule(void *clientdata) {
|
||||
module_head->next = &swig_module;
|
||||
}
|
||||
|
||||
/* When multiple interpeters are used, a module could have already been initialized in
|
||||
a different interpreter, but not yet have a pointer in this interpreter.
|
||||
In this case, we do not want to continue adding types... everything should be
|
||||
set up already */
|
||||
if (init == 0) return;
|
||||
|
||||
/* Now work on filling in swig_module.types */
|
||||
#ifdef SWIGRUNTIME_DEBUG
|
||||
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
|
||||
|
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module(package="samba.credentials") credentials
|
||||
%module(docstring="Credentials management.",package="samba.credentials") credentials
|
||||
|
||||
%{
|
||||
|
||||
@ -59,36 +59,53 @@ typedef struct cli_credentials {
|
||||
return cli_credentials_init(NULL);
|
||||
}
|
||||
/* username */
|
||||
%feature("docstring") get_username "S.get_username() -> username\nObtain username.";
|
||||
const char *get_username(void);
|
||||
%feature("docstring") set_username "S.set_username(name, obtained=CRED_SPECIFIED) -> None\nChange username.";
|
||||
bool set_username(const char *value,
|
||||
enum credentials_obtained=CRED_SPECIFIED);
|
||||
enum credentials_obtained obtained=CRED_SPECIFIED);
|
||||
|
||||
/* password */
|
||||
%feature("docstring") get_password "S.get_password() -> password\n" \
|
||||
"Obtain password.";
|
||||
const char *get_password(void);
|
||||
%feature("docstring") set_password "S.set_password(password, obtained=CRED_SPECIFIED) -> None\n" \
|
||||
"Change password.";
|
||||
bool set_password(const char *val,
|
||||
enum credentials_obtained=CRED_SPECIFIED);
|
||||
enum credentials_obtained obtained=CRED_SPECIFIED);
|
||||
|
||||
/* domain */
|
||||
%feature("docstring") get_password "S.get_domain() -> domain\nObtain domain name.";
|
||||
const char *get_domain(void);
|
||||
%feature("docstring") set_domain "S.set_domain(domain, obtained=CRED_SPECIFIED) -> None\n" \
|
||||
"Change domain name.";
|
||||
bool set_domain(const char *val,
|
||||
enum credentials_obtained=CRED_SPECIFIED);
|
||||
enum credentials_obtained obtained=CRED_SPECIFIED);
|
||||
|
||||
/* realm */
|
||||
%feature("docstring") get_realm "S.get_realm() -> realm\nObtain realm name.";
|
||||
const char *get_realm(void);
|
||||
%feature("docstring") set_realm "S.set_realm(realm, obtained=CRED_SPECIFIED) -> None\n" \
|
||||
"Change realm name.";
|
||||
bool set_realm(const char *val,
|
||||
enum credentials_obtained=CRED_SPECIFIED);
|
||||
enum credentials_obtained obtained=CRED_SPECIFIED);
|
||||
|
||||
/* Kerberos */
|
||||
/* Kerberos */
|
||||
void set_kerberos_state(enum credentials_use_kerberos use_kerberos);
|
||||
|
||||
%feature("docstring") parse_string "S.parse_string(text, obtained=CRED_SPECIFIED) -> None\n" \
|
||||
"Parse credentials string.";
|
||||
void parse_string(const char *text,
|
||||
enum credentials_obtained=CRED_SPECIFIED);
|
||||
enum credentials_obtained obtained=CRED_SPECIFIED);
|
||||
|
||||
/* bind dn */
|
||||
%feature("docstring") get_bind_dn "S.get_bind_dn() -> bind dn\nObtain bind DN.";
|
||||
const char *get_bind_dn(void);
|
||||
%feature("docstring") set_bind_dn "S.set_bind_dn(bind_dn) -> None\nChange bind DN.";
|
||||
bool set_bind_dn(const char *bind_dn);
|
||||
|
||||
void set_anonymous();
|
||||
%feature("docstring") set_anonymous "S.set_anonymous() -> None\nUse anonymous credentials.";
|
||||
void set_anonymous();
|
||||
|
||||
/* workstation name */
|
||||
const char *get_workstation(void);
|
||||
@ -104,8 +121,10 @@ typedef struct cli_credentials {
|
||||
|
||||
bool authentication_requested(void);
|
||||
|
||||
%feature("docstring") wrong_password "S.wrong_password() -> bool\nIndicate the returned password was incorrect.";
|
||||
bool wrong_password(void);
|
||||
|
||||
%feature("docstring") set_cmdline_callbacks "S.set_cmdline_callbacks() -> bool\nUse command-line to obtain credentials not explicitly set.";
|
||||
bool set_cmdline_callbacks();
|
||||
}
|
||||
} cli_credentials;
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Credentials management.
|
||||
"""
|
||||
|
||||
import _credentials
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
@ -66,6 +70,97 @@ class Credentials(object):
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
_credentials.Credentials_swiginit(self,_credentials.new_Credentials(*args, **kwargs))
|
||||
def get_username(*args, **kwargs):
|
||||
"""
|
||||
S.get_username() -> username
|
||||
Obtain username.
|
||||
"""
|
||||
return _credentials.Credentials_get_username(*args, **kwargs)
|
||||
|
||||
def set_username(*args, **kwargs):
|
||||
"""
|
||||
S.set_username(name, obtained=CRED_SPECIFIED) -> None
|
||||
Change username.
|
||||
"""
|
||||
return _credentials.Credentials_set_username(*args, **kwargs)
|
||||
|
||||
def get_password(*args, **kwargs):
|
||||
"""
|
||||
S.get_password() -> password
|
||||
Obtain password.
|
||||
"""
|
||||
return _credentials.Credentials_get_password(*args, **kwargs)
|
||||
|
||||
def set_password(*args, **kwargs):
|
||||
"""
|
||||
S.set_password(password, obtained=CRED_SPECIFIED) -> None
|
||||
Change password.
|
||||
"""
|
||||
return _credentials.Credentials_set_password(*args, **kwargs)
|
||||
|
||||
def set_domain(*args, **kwargs):
|
||||
"""
|
||||
S.set_domain(domain, obtained=CRED_SPECIFIED) -> None
|
||||
Change domain name.
|
||||
"""
|
||||
return _credentials.Credentials_set_domain(*args, **kwargs)
|
||||
|
||||
def get_realm(*args, **kwargs):
|
||||
"""
|
||||
S.get_realm() -> realm
|
||||
Obtain realm name.
|
||||
"""
|
||||
return _credentials.Credentials_get_realm(*args, **kwargs)
|
||||
|
||||
def set_realm(*args, **kwargs):
|
||||
"""
|
||||
S.set_realm(realm, obtained=CRED_SPECIFIED) -> None
|
||||
Change realm name.
|
||||
"""
|
||||
return _credentials.Credentials_set_realm(*args, **kwargs)
|
||||
|
||||
def parse_string(*args, **kwargs):
|
||||
"""
|
||||
S.parse_string(text, obtained=CRED_SPECIFIED) -> None
|
||||
Parse credentials string.
|
||||
"""
|
||||
return _credentials.Credentials_parse_string(*args, **kwargs)
|
||||
|
||||
def get_bind_dn(*args, **kwargs):
|
||||
"""
|
||||
S.get_bind_dn() -> bind dn
|
||||
Obtain bind DN.
|
||||
"""
|
||||
return _credentials.Credentials_get_bind_dn(*args, **kwargs)
|
||||
|
||||
def set_bind_dn(*args, **kwargs):
|
||||
"""
|
||||
S.set_bind_dn(bind_dn) -> None
|
||||
Change bind DN.
|
||||
"""
|
||||
return _credentials.Credentials_set_bind_dn(*args, **kwargs)
|
||||
|
||||
def set_anonymous(*args, **kwargs):
|
||||
"""
|
||||
S.set_anonymous() -> None
|
||||
Use anonymous credentials.
|
||||
"""
|
||||
return _credentials.Credentials_set_anonymous(*args, **kwargs)
|
||||
|
||||
def wrong_password(*args, **kwargs):
|
||||
"""
|
||||
S.wrong_password() -> bool
|
||||
Indicate the returned password was incorrect.
|
||||
"""
|
||||
return _credentials.Credentials_wrong_password(*args, **kwargs)
|
||||
|
||||
def set_cmdline_callbacks(*args, **kwargs):
|
||||
"""
|
||||
S.set_cmdline_callbacks() -> bool
|
||||
Use command-line to obtain credentials not explicitly set.
|
||||
"""
|
||||
return _credentials.Credentials_set_cmdline_callbacks(*args, **kwargs)
|
||||
|
||||
__swig_destroy__ = _credentials.delete_Credentials
|
||||
Credentials.get_username = new_instancemethod(_credentials.Credentials_get_username,None,Credentials)
|
||||
Credentials.set_username = new_instancemethod(_credentials.Credentials_set_username,None,Credentials)
|
||||
|
@ -2881,7 +2881,7 @@ SWIGINTERN PyObject *_wrap_Credentials_set_username(PyObject *SWIGUNUSEDPARM(sel
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
char * kwnames[] = {
|
||||
(char *) "self",(char *) "value",(char *)"arg3", NULL
|
||||
(char *) "self",(char *) "value",(char *) "obtained", NULL
|
||||
};
|
||||
|
||||
arg1 = NULL;
|
||||
@ -2962,7 +2962,7 @@ SWIGINTERN PyObject *_wrap_Credentials_set_password(PyObject *SWIGUNUSEDPARM(sel
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
char * kwnames[] = {
|
||||
(char *) "self",(char *) "val",(char *)"arg3", NULL
|
||||
(char *) "self",(char *) "val",(char *) "obtained", NULL
|
||||
};
|
||||
|
||||
arg1 = NULL;
|
||||
@ -3043,7 +3043,7 @@ SWIGINTERN PyObject *_wrap_Credentials_set_domain(PyObject *SWIGUNUSEDPARM(self)
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
char * kwnames[] = {
|
||||
(char *) "self",(char *) "val",(char *)"arg3", NULL
|
||||
(char *) "self",(char *) "val",(char *) "obtained", NULL
|
||||
};
|
||||
|
||||
arg1 = NULL;
|
||||
@ -3124,7 +3124,7 @@ SWIGINTERN PyObject *_wrap_Credentials_set_realm(PyObject *SWIGUNUSEDPARM(self),
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
char * kwnames[] = {
|
||||
(char *) "self",(char *) "val",(char *)"arg3", NULL
|
||||
(char *) "self",(char *) "val",(char *) "obtained", NULL
|
||||
};
|
||||
|
||||
arg1 = NULL;
|
||||
@ -3214,7 +3214,7 @@ SWIGINTERN PyObject *_wrap_Credentials_parse_string(PyObject *SWIGUNUSEDPARM(sel
|
||||
PyObject * obj1 = 0 ;
|
||||
PyObject * obj2 = 0 ;
|
||||
char * kwnames[] = {
|
||||
(char *) "self",(char *) "text",(char *)"arg3", NULL
|
||||
(char *) "self",(char *) "text",(char *) "obtained", NULL
|
||||
};
|
||||
|
||||
arg1 = NULL;
|
||||
@ -3690,19 +3690,52 @@ SWIGINTERN PyObject *Credentials_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObje
|
||||
|
||||
static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"new_Credentials", (PyCFunction)_wrap_new_Credentials, METH_NOARGS, NULL},
|
||||
{ (char *)"Credentials_get_username", (PyCFunction) _wrap_Credentials_get_username, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_username", (PyCFunction) _wrap_Credentials_set_username, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_get_password", (PyCFunction) _wrap_Credentials_get_password, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_password", (PyCFunction) _wrap_Credentials_set_password, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_get_username", (PyCFunction) _wrap_Credentials_get_username, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.get_username() -> username\n"
|
||||
"Obtain username.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_set_username", (PyCFunction) _wrap_Credentials_set_username, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_username(name, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"Change username.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_get_password", (PyCFunction) _wrap_Credentials_get_password, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.get_password() -> password\n"
|
||||
"Obtain password.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_set_password", (PyCFunction) _wrap_Credentials_set_password, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_password(password, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"Change password.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_get_domain", (PyCFunction) _wrap_Credentials_get_domain, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_domain", (PyCFunction) _wrap_Credentials_set_domain, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_get_realm", (PyCFunction) _wrap_Credentials_get_realm, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_realm", (PyCFunction) _wrap_Credentials_set_realm, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_domain", (PyCFunction) _wrap_Credentials_set_domain, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_domain(domain, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"Change domain name.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_get_realm", (PyCFunction) _wrap_Credentials_get_realm, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.get_realm() -> realm\n"
|
||||
"Obtain realm name.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_set_realm", (PyCFunction) _wrap_Credentials_set_realm, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_realm(realm, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"Change realm name.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_set_kerberos_state", (PyCFunction) _wrap_Credentials_set_kerberos_state, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_parse_string", (PyCFunction) _wrap_Credentials_parse_string, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_get_bind_dn", (PyCFunction) _wrap_Credentials_get_bind_dn, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_bind_dn", (PyCFunction) _wrap_Credentials_set_bind_dn, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_anonymous", (PyCFunction) _wrap_Credentials_set_anonymous, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_parse_string", (PyCFunction) _wrap_Credentials_parse_string, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.parse_string(text, obtained=CRED_SPECIFIED) -> None\n"
|
||||
"Parse credentials string.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_get_bind_dn", (PyCFunction) _wrap_Credentials_get_bind_dn, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.get_bind_dn() -> bind dn\n"
|
||||
"Obtain bind DN.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_set_bind_dn", (PyCFunction) _wrap_Credentials_set_bind_dn, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_bind_dn(bind_dn) -> None\n"
|
||||
"Change bind DN.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_set_anonymous", (PyCFunction) _wrap_Credentials_set_anonymous, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_anonymous() -> None\n"
|
||||
"Use anonymous credentials.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_get_workstation", (PyCFunction) _wrap_Credentials_get_workstation, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_workstation", (PyCFunction) _wrap_Credentials_set_workstation, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_machine_account", (PyCFunction) _wrap_Credentials_set_machine_account, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
@ -3710,8 +3743,14 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"Credentials_is_anonymous", (PyCFunction) _wrap_Credentials_is_anonymous, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_get_nt_hash", (PyCFunction) _wrap_Credentials_get_nt_hash, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_authentication_requested", (PyCFunction) _wrap_Credentials_authentication_requested, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_wrong_password", (PyCFunction) _wrap_Credentials_wrong_password, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_set_cmdline_callbacks", (PyCFunction) _wrap_Credentials_set_cmdline_callbacks, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_wrong_password", (PyCFunction) _wrap_Credentials_wrong_password, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.wrong_password() -> bool\n"
|
||||
"Indicate the returned password was incorrect.\n"
|
||||
""},
|
||||
{ (char *)"Credentials_set_cmdline_callbacks", (PyCFunction) _wrap_Credentials_set_cmdline_callbacks, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_cmdline_callbacks() -> bool\n"
|
||||
"Use command-line to obtain credentials not explicitly set.\n"
|
||||
""},
|
||||
{ (char *)"delete_Credentials", (PyCFunction) _wrap_delete_Credentials, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Credentials_swigregister", Credentials_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"Credentials_swiginit", Credentials_swiginit, METH_VARARGS, NULL},
|
||||
|
@ -86,7 +86,7 @@ unused_macros:
|
||||
@mkdir -p $(@D)
|
||||
@$(STLD) $(STLD_FLAGS) $@ $^
|
||||
|
||||
include build/make/templates.mk
|
||||
include $(make_utility_dir)/templates.mk
|
||||
|
||||
###############################################################################
|
||||
# File types
|
||||
|
@ -92,7 +92,7 @@ PLUGINS += bin/modules/$(2)/$(3).$$(SHLIBEXT)
|
||||
uninstallplugins::
|
||||
@-rm $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
|
||||
installplugins::
|
||||
@ln -fs $(basename $(1)) $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
|
||||
@ln -fs $(notdir $(1)) $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
|
||||
|
||||
endef
|
||||
|
||||
|
@ -25,7 +25,6 @@ my $section_types = {
|
||||
"PUBLIC_DEPENDENCIES" => "list",
|
||||
"ENABLE" => "bool",
|
||||
"LDFLAGS" => "list",
|
||||
"CFLAGS" => "list",
|
||||
},
|
||||
"SUBSYSTEM" => {
|
||||
"PRIVATE_DEPENDENCIES" => "list",
|
||||
@ -60,7 +59,6 @@ my $section_types = {
|
||||
"ENABLE" => "bool",
|
||||
|
||||
"INSTALLDIR" => "string",
|
||||
"CFLAGS" => "list",
|
||||
"LDFLAGS" => "list",
|
||||
"STANDARD_VISIBILITY" => "string",
|
||||
|
||||
|
@ -262,6 +262,10 @@ sub CFlags($$)
|
||||
if($src_ne_build) {
|
||||
if($flag =~ m#^-I([^/].*$)#) {
|
||||
my $dir = $1;
|
||||
if ($dir =~ /^\$\(/) {
|
||||
push (@cflags, $flag);
|
||||
next;
|
||||
}
|
||||
$dir =~ s#^\$\((?:src|build)dir\)/?##;
|
||||
push(@cflags, "-I$builddir/$dir", "-I$srcdir/$dir");
|
||||
next;
|
||||
|
@ -1,6 +1,7 @@
|
||||
[SUBSYSTEM::DYNCONFIG]
|
||||
|
||||
DYNCONFIG_OBJ_FILES = dynconfig.o
|
||||
DYNCONFIG_OBJ_FILES = $(dynconfigsrcdir)/dynconfig.o \
|
||||
$(dynconfigsrcdir)/version.o
|
||||
|
||||
# set these to where to find various files
|
||||
# These can be overridden by command line switches (see smbd(8))
|
||||
@ -9,10 +10,7 @@ CONFIGFILE = $(sysconfdir)/smb.conf
|
||||
PKGCONFIGDIR = $(libdir)/pkgconfig
|
||||
LMHOSTSFILE = $(sysconfdir)/lmhosts
|
||||
|
||||
dynconfig.o: dynconfig.c Makefile
|
||||
@echo Compiling $<
|
||||
@$(CC) $(CFLAGS) $(CPPFLAGS) $(PICFLAG) -c $< -o $@ \
|
||||
-DCONFIGFILE=\"$(CONFIGFILE)\" -DBINDIR=\"$(bindir)\" \
|
||||
$(dynconfigsrcdir)/dynconfig.o: CFLAGS+=-DCONFIGFILE=\"$(CONFIGFILE)\" -DBINDIR=\"$(bindir)\" \
|
||||
-DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
|
||||
-DLOCKDIR=\"$(lockdir)\" -DPIDDIR=\"$(piddir)\" -DDATADIR=\"$(datadir)\" \
|
||||
-DLOGFILEBASE=\"$(logfilebase)\" \
|
||||
@ -23,4 +21,3 @@ dynconfig.o: dynconfig.c Makefile
|
||||
-DTORTUREDIR=\"$(TORTUREDIR)\" \
|
||||
-DSETUPDIR=\"$(SETUPDIR)\" -DWINBINDD_SOCKET_DIR=\"$(winbindd_socket_dir)\"
|
||||
|
||||
|
@ -4,21 +4,15 @@
|
||||
SELF=$0
|
||||
SELFDIR=`dirname ${SELF}`
|
||||
|
||||
SRCDIR=$1
|
||||
BUILDDIR=$2
|
||||
DESTDIR=$3
|
||||
BUILDDIR=$1
|
||||
DESTDIR=$2
|
||||
|
||||
CMD=$4
|
||||
FILE=$5
|
||||
NAME=$6
|
||||
shift 6
|
||||
CMD=$3
|
||||
FILE=$4
|
||||
NAME=$5
|
||||
shift 5
|
||||
OPTIONS="$@"
|
||||
|
||||
test -z "${SRCDIR}" && {
|
||||
echo "${SELF}:SRCDIR: '${SRCDIR}'" >&2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
test -z "${BUILDDIR}" && {
|
||||
echo "${SELF}:BUILDDIR: '${BUILDDIR}'" >&2;
|
||||
exit 1;
|
||||
@ -46,14 +40,6 @@ test -z "${NAME}" && {
|
||||
|
||||
CURDIR=`pwd`
|
||||
|
||||
cd ${SRCDIR} && {
|
||||
ABS_SRCDIR=`pwd`
|
||||
cd ${CURDIR}
|
||||
} || {
|
||||
echo "${SELF}:cannot cd into '${SRCDIR}'" >&2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
cd ${BUILDDIR} && {
|
||||
ABS_BUILDDIR=`pwd`
|
||||
cd ${CURDIR}
|
||||
@ -63,7 +49,7 @@ cd ${BUILDDIR} && {
|
||||
}
|
||||
|
||||
cd ${DESTDIR} && {
|
||||
${ABS_BUILDDIR}/${CMD} ${OPTIONS} ${ABS_SRCDIR}/${FILE} ${NAME} >&2 || exit 1;
|
||||
${ABS_BUILDDIR}/${CMD} ${OPTIONS} ${FILE} ${NAME} >&2 || exit 1;
|
||||
cd ${CURDIR}
|
||||
} || {
|
||||
echo "${SELF}:cannot cd into '${BUILDDIR}'" >&2;
|
||||
|
@ -29,11 +29,11 @@ if (not defined $options) {
|
||||
|
||||
my $header = "$dirname/$prefix.h";
|
||||
|
||||
print "$header: $file bin/asn1_compile\n";
|
||||
print "\t\@echo \"Compiling ASN1 file $file\"\n";
|
||||
print "\t\@\$(builddir)/heimdal_build/asn1_compile_wrapper.sh \$(srcdir) \$(builddir) $dirname bin/asn1_compile $file $prefix $options\n\n";
|
||||
print "$header: \$(heimdalsrcdir)/$file \$(ASN1C)\n";
|
||||
print "\t\@echo \"Compiling ASN1 file \$(heimdalsrcdir)/$file\"\n";
|
||||
print "\t\@\$(heimdalbuildsrcdir)/asn1_compile_wrapper.sh \$(builddir) $dirname \$(ASN1C) \$(abspath \$(heimdalsrcdir)/$file) $prefix $options\n\n";
|
||||
|
||||
open(IN,$file) or die("Can't open $file: $!");
|
||||
open(IN,"heimdal/$file") or die("Can't open heimdal/$file: $!");
|
||||
my @lines = <IN>;
|
||||
close(IN);
|
||||
foreach my $line (@lines) {
|
||||
|
@ -1,7 +1,9 @@
|
||||
heimdalbuildsrcdir = $(heimdalsrcdir)/../heimdal_build
|
||||
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_KDC
|
||||
[SUBSYSTEM::HEIMDAL_KDC]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/kdc
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/kdc
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_KRB5 HEIMDAL_HDB HEIMDAL_HEIM_ASN1 HEIMDAL_DIGEST_ASN1 HEIMDAL_KX509_ASN1
|
||||
PUBLIC_DEPENDENCIES = HEIMDAL_NTLM HEIMDAL_HCRYPTO
|
||||
# End SUBSYSTEM HEIMDAL_KDC
|
||||
@ -24,14 +26,14 @@ HEIMDAL_KDC_OBJ_FILES = \
|
||||
$(heimdalsrcdir)/kdc/kx509.o
|
||||
|
||||
[SUBSYSTEM::HEIMDAL_NTLM]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/ntlm
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/ntlm
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_KRB5
|
||||
|
||||
HEIMDAL_NTLM_OBJ_FILES = \
|
||||
$(heimdalsrcdir)/lib/ntlm/ntlm.o
|
||||
|
||||
[SUBSYSTEM::HEIMDAL_HDB_KEYS]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/hdb
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/hdb
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_KRB5 \
|
||||
HEIMDAL_HDB_ASN1
|
||||
|
||||
@ -40,7 +42,7 @@ HEIMDAL_HDB_KEYS_OBJ_FILES = $(heimdalsrcdir)/lib/hdb/keys.o
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_HDB
|
||||
[SUBSYSTEM::HEIMDAL_HDB]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/hdb
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/hdb
|
||||
PRIVATE_DEPENDENCIES = HDB_LDB HEIMDAL_KRB5 HEIMDAL_HDB_KEYS HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_COM_ERR HEIMDAL_HDB_ASN1
|
||||
# End SUBSYSTEM HEIMDAL_HDB
|
||||
#######################
|
||||
@ -58,7 +60,7 @@ HEIMDAL_HDB_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_GSSAPI
|
||||
[SUBSYSTEM::HEIMDAL_GSSAPI]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/gssapi -Iheimdal/lib/gssapi/gssapi -Iheimdal/lib/gssapi/spnego -Iheimdal/lib/gssapi/krb5 -Iheimdal/lib/gssapi/mech
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/gssapi -I$(heimdalsrcdir)/lib/gssapi/gssapi -I$(heimdalsrcdir)/lib/gssapi/spnego -I$(heimdalsrcdir)/lib/gssapi/krb5 -I$(heimdalsrcdir)/lib/gssapi/mech
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_HCRYPTO HEIMDAL_HEIM_ASN1 HEIMDAL_SPNEGO_ASN1
|
||||
PUBLIC_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_KRB5
|
||||
# End SUBSYSTEM HEIMDAL_GSSAPI
|
||||
@ -176,7 +178,7 @@ HEIMDAL_GSSAPI_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_KRB5
|
||||
[SUBSYSTEM::HEIMDAL_KRB5]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/asn1 -Iheimdal/lib/com_err
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/krb5 -I$(heimdalsrcdir)/lib/asn1 -I$(heimdalsrcdir)/lib/com_err
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_PKINIT_ASN1 HEIMDAL_WIND
|
||||
PUBLIC_DEPENDENCIES = HEIMDAL_KRB5_ASN1 HEIMDAL_GLUE HEIMDAL_HX509 HEIMDAL_HCRYPTO
|
||||
# End SUBSYSTEM HEIMDAL_KRB5
|
||||
@ -273,7 +275,7 @@ HEIMDAL_KRB5_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_HEIM_ASN1
|
||||
[SUBSYSTEM::HEIMDAL_HEIM_ASN1]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/asn1
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/asn1
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_COM_ERR
|
||||
# End SUBSYSTEM HEIMDAL_KRB5
|
||||
#######################
|
||||
@ -293,7 +295,7 @@ HEIMDAL_HEIM_ASN1_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_HCRYPTO_IMATH
|
||||
[SUBSYSTEM::HEIMDAL_HCRYPTO_IMATH]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/hcrypto/imath
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/hcrypto/imath
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN
|
||||
# End SUBSYSTEM HEIMDAL_HCRYPTO_IMATH
|
||||
#######################
|
||||
@ -303,7 +305,7 @@ HEIMDAL_HCRYPTO_IMATH_OBJ_FILES = \
|
||||
$(heimdalsrcdir)/lib/hcrypto/imath/iprime.o
|
||||
|
||||
[SUBSYSTEM::HEIMDAL_HCRYPTO]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/hcrypto -Iheimdal/lib
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/hcrypto -I$(heimdalsrcdir)/lib
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_HEIM_ASN1 HEIMDAL_HCRYPTO_IMATH HEIMDAL_RFC2459_ASN1
|
||||
# End SUBSYSTEM HEIMDAL_HCRYPTO
|
||||
#######################
|
||||
@ -343,7 +345,7 @@ HEIMDAL_HCRYPTO_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_HX509
|
||||
[SUBSYSTEM::HEIMDAL_HX509]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/hx509
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/hx509
|
||||
PRIVATE_DEPENDENCIES = \
|
||||
HEIMDAL_ROKEN HEIMDAL_COM_ERR \
|
||||
HEIMDAL_HEIM_ASN1 HEIMDAL_HCRYPTO \
|
||||
@ -383,7 +385,7 @@ HEIMDAL_HX509_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_WIND
|
||||
[SUBSYSTEM::HEIMDAL_WIND]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/wind
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/wind
|
||||
PRIVATE_DEPENDENCIES = \
|
||||
HEIMDAL_ROKEN HEIMDAL_COM_ERR
|
||||
|
||||
@ -406,24 +408,24 @@ HEIMDAL_WIND_OBJ_FILES = \
|
||||
#######################
|
||||
|
||||
[SUBSYSTEM::HEIMDAL_ROKEN_GETPROGNAME]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -Ilib/socket_wrapper
|
||||
|
||||
HEIMDAL_ROKEN_GETPROGNAME_OBJ_FILES = $(heimdalsrcdir)/lib/roken/getprogname.o
|
||||
$(HEIMDAL_ROKEN_GETPROGNAME_OBJ_FILES): CFLAGS+=-I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/roken -I$(socketwrappersrcdir)
|
||||
|
||||
[SUBSYSTEM::HEIMDAL_ROKEN_CLOSEFROM]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -Ilib/socket_wrapper
|
||||
|
||||
HEIMDAL_ROKEN_CLOSEFROM_OBJ_FILES = $(heimdalsrcdir)/lib/roken/closefrom.o
|
||||
$(HEIMDAL_ROKEN_CLOSEFROM_OBJ_FILES): CFLAGS+=-I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/roken -I$(socketwrappersrcdir)
|
||||
|
||||
[SUBSYSTEM::HEIMDAL_ROKEN_GETPROGNAME_H]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -Ilib/socket_wrapper
|
||||
|
||||
HEIMDAL_ROKEN_GETPROGNAME_H_OBJ_FILES = $(heimdalsrcdir)/lib/roken/getprogname.ho
|
||||
$(HEIMDAL_ROKEN_GETPROGNAME_H_OBJ_FILES): CFLAGS+=-I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/roken -I$(socketwrappersrcdir)
|
||||
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_ROKEN
|
||||
[SUBSYSTEM::HEIMDAL_ROKEN]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -Ilib/socket_wrapper
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/roken -I$(socketwrappersrcdir)
|
||||
PUBLIC_DEPENDENCIES = \
|
||||
HEIMDAL_ROKEN_GETPROGNAME \
|
||||
HEIMDAL_ROKEN_CLOSEFROM \
|
||||
@ -461,22 +463,22 @@ HEIMDAL_ROKEN_OBJ_FILES = \
|
||||
$(heimdalsrcdir)/lib/roken/simple_exec.o \
|
||||
$(heimdalsrcdir)/lib/roken/strcollect.o \
|
||||
$(heimdalsrcdir)/lib/roken/rtbl.o \
|
||||
./heimdal_build/replace.o
|
||||
$(heimdalbuildsrcdir)/replace.o
|
||||
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_GLUE
|
||||
[SUBSYSTEM::HEIMDAL_GLUE]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/krb5 -Iheimdal/lib/asn1 -Iheimdal/lib/com_err
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/krb5 -I$(heimdalsrcdir)/lib/asn1 -I$(heimdalsrcdir)/lib/com_err
|
||||
PUBLIC_DEPENDENCIES = LIBNETIF LIBSAMBA-HOSTCONFIG
|
||||
# End SUBSYSTEM HEIMDAL_GLUE
|
||||
#######################
|
||||
|
||||
HEIMDAL_GLUE_OBJ_FILES = heimdal_build/glue.o
|
||||
HEIMDAL_GLUE_OBJ_FILES = $(heimdalbuildsrcdir)/glue.o
|
||||
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_COM_ERR
|
||||
[SUBSYSTEM::HEIMDAL_COM_ERR]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/com_err
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/com_err
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN
|
||||
# End SUBSYSTEM HEIMDAL_COM_ERR
|
||||
#######################
|
||||
@ -488,19 +490,20 @@ HEIMDAL_COM_ERR_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_ASN1_COMPILE_LEX
|
||||
[SUBSYSTEM::HEIMDAL_ASN1_COMPILE_LEX]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/asn1 -Iheimdal/lib/roken -Ilib/socket_wrapper
|
||||
# End SUBSYSTEM HEIMDAL_ASN1_COMPILE_LEX
|
||||
#######################
|
||||
|
||||
HEIMDAL_ASN1_COMPILE_LEX_OBJ_FILES = $(heimdalsrcdir)/lib/asn1/lex.ho
|
||||
$(HEIMDAL_ASN1_COMPILE_LEX_OBJ_FILES): CFLAGS+=-I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/asn1 -I$(heimdalsrcdir)/lib/roken -I$(socketwrappersrcdir)
|
||||
|
||||
#######################
|
||||
# Start BINARY asn1_compile
|
||||
[BINARY::asn1_compile]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken
|
||||
USE_HOSTCC = YES
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_ASN1_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H LIBREPLACE_NETWORK
|
||||
|
||||
ASN1C = $(builddir)/bin/asn1_compile
|
||||
|
||||
asn1_compile_OBJ_FILES = \
|
||||
$(heimdalsrcdir)/lib/asn1/main.ho \
|
||||
$(heimdalsrcdir)/lib/asn1/gen.ho \
|
||||
@ -522,8 +525,10 @@ asn1_compile_OBJ_FILES = \
|
||||
$(heimdalsrcdir)/lib/roken/ecalloc.ho \
|
||||
$(heimdalsrcdir)/lib/asn1/symbol.ho \
|
||||
$(heimdalsrcdir)/lib/vers/print_version.ho \
|
||||
./lib/socket_wrapper/socket_wrapper.ho \
|
||||
./heimdal_build/replace.ho
|
||||
$(socketwrappersrcdir)/socket_wrapper.ho \
|
||||
$(heimdalbuildsrcdir)/replace.ho
|
||||
|
||||
$(asn1_compile_OBJ_FILES): CFLAGS+=-I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/roken -I$(heimdalsrcdir)/lib/asn1
|
||||
|
||||
# End BINARY asn1_compile
|
||||
#######################
|
||||
@ -531,7 +536,7 @@ asn1_compile_OBJ_FILES = \
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL_COM_ERR_COMPILE_LEX
|
||||
[SUBSYSTEM::HEIMDAL_COM_ERR_COMPILE_LEX]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/com_err -Iheimdal/lib/roken -Ilib/socket_wrapper
|
||||
CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/com_err -I$(heimdalsrcdir)/lib/roken -I$(socketwrappersrcdir)
|
||||
# End SUBSYSTEM HEIMDAL_COM_ERR_COMPILE_LEX
|
||||
#######################
|
||||
|
||||
@ -540,12 +545,13 @@ HEIMDAL_COM_ERR_COMPILE_LEX_OBJ_FILES = $(heimdalsrcdir)/lib/com_err/lex.ho
|
||||
#######################
|
||||
# Start BINARY compile_et
|
||||
[BINARY::compile_et]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken
|
||||
USE_HOSTCC = YES
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_COM_ERR_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H LIBREPLACE_NETWORK
|
||||
# End BINARY compile_et
|
||||
#######################
|
||||
|
||||
ET_COMPILER = $(builddir)/bin/compile_et
|
||||
|
||||
compile_et_OBJ_FILES = $(heimdalsrcdir)/lib/vers/print_version.ho \
|
||||
$(heimdalsrcdir)/lib/com_err/parse.ho \
|
||||
$(heimdalsrcdir)/lib/com_err/compile_et.ho \
|
||||
@ -553,37 +559,38 @@ compile_et_OBJ_FILES = $(heimdalsrcdir)/lib/vers/print_version.ho \
|
||||
$(heimdalsrcdir)/lib/roken/get_window_size.ho \
|
||||
$(heimdalsrcdir)/lib/roken/strupr.ho \
|
||||
$(heimdalsrcdir)/lib/roken/setprogname.ho \
|
||||
./lib/socket_wrapper/socket_wrapper.ho \
|
||||
./heimdal_build/replace.ho
|
||||
$(socketwrappersrcdir)/socket_wrapper.ho \
|
||||
$(heimdalbuildsrcdir)/replace.ho
|
||||
|
||||
$(compile_et_OBJ_FILES): CFLAGS+=-I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/roken
|
||||
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/hdb/hdb.asn1 hdb_asn1 heimdal/lib/hdb |
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/gssapi/spnego/spnego.asn1 spnego_asn1 heimdal/lib/gssapi --sequence=MechTypeList |
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/gssapi/mech/gssapi.asn1 gssapi_asn1 heimdal/lib/gssapi|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/k5.asn1 krb5_asn1 heimdal/lib/asn1 --encode-rfc1510-bit-string --sequence=KRB5SignedPathPrincipals --sequence=AuthorizationData --sequence=METHOD-DATA|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/digest.asn1 digest_asn1 heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/pkcs8.asn1 pkcs8_asn1 heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/pkcs9.asn1 pkcs9_asn1 heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/pkcs12.asn1 pkcs12_asn1 heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/rfc2459.asn1 rfc2459_asn1 heimdal/lib/asn1 --preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/pkinit.asn1 pkinit_asn1 heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/CMS.asn1 cms_asn1 heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/hx509/ocsp.asn1 ocsp_asn1 heimdal/lib/hx509 --preserve-binary=OCSPTBSRequest --preserve-binary=OCSPResponseData|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/asn1/kx509.asn1 kx509_asn1 heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl heimdal/lib/hx509/pkcs10.asn1 pkcs10_asn1 heimdal/lib/hx509 --preserve-binary=CertificationRequestInfo|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/hdb/hdb.asn1 hdb_asn1 \$\(heimdalsrcdir\)/lib/hdb |
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/gssapi/spnego/spnego.asn1 spnego_asn1 \$\(heimdalsrcdir\)/lib/gssapi --sequence=MechTypeList |
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/gssapi/mech/gssapi.asn1 gssapi_asn1 \$\(heimdalsrcdir\)/lib/gssapi|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/k5.asn1 krb5_asn1 \$\(heimdalsrcdir\)/lib/asn1 --encode-rfc1510-bit-string --sequence=KRB5SignedPathPrincipals --sequence=AuthorizationData --sequence=METHOD-DATA|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/digest.asn1 digest_asn1 \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/pkcs8.asn1 pkcs8_asn1 \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/pkcs9.asn1 pkcs9_asn1 \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/pkcs12.asn1 pkcs12_asn1 \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/rfc2459.asn1 rfc2459_asn1 \$\(heimdalsrcdir\)/lib/asn1 --preserve-binary=TBSCertificate --preserve-binary=TBSCRLCertList --preserve-binary=Name --sequence=GeneralNames --sequence=Extensions --sequence=CRLDistributionPoints|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/pkinit.asn1 pkinit_asn1 \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/CMS.asn1 cms_asn1 \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/hx509/ocsp.asn1 ocsp_asn1 \$\(heimdalsrcdir\)/lib/hx509 --preserve-binary=OCSPTBSRequest --preserve-binary=OCSPResponseData|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/asn1/kx509.asn1 kx509_asn1 \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh asn1_deps.pl lib/hx509/pkcs10.asn1 pkcs10_asn1 \$\(heimdalsrcdir\)/lib/hx509 --preserve-binary=CertificationRequestInfo|
|
||||
|
||||
#
|
||||
# Ensure to update ./static_deps.mk when you add a new entry here!
|
||||
#
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/asn1/asn1_err.et heimdal/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/hdb/hdb_err.et heimdal/lib/hdb|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/krb5/heim_err.et heimdal/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/krb5/k524_err.et heimdal/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/krb5/krb_err.et heimdal/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/krb5/krb5_err.et heimdal/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/gssapi/krb5/gkrb5_err.et heimdal/lib/gssapi|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/hx509/hx509_err.et heimdal/lib/hx509|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl heimdal/lib/wind/wind_err.et heimdal/lib/wind|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/asn1/asn1_err.et \$\(heimdalsrcdir\)/lib/asn1|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/hdb/hdb_err.et \$\(heimdalsrcdir\)/lib/hdb|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/krb5/heim_err.et \$\(heimdalsrcdir\)/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/krb5/k524_err.et \$\(heimdalsrcdir\)/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/krb5/krb_err.et \$\(heimdalsrcdir\)/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/krb5/krb5_err.et \$\(heimdalsrcdir\)/lib/krb5|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/gssapi/krb5/gkrb5_err.et \$\(heimdalsrcdir\)/lib/gssapi|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/hx509/hx509_err.et \$\(heimdalsrcdir\)/lib/hx509|
|
||||
mkinclude perl_path_wrapper.sh et_deps.pl lib/wind/wind_err.et \$\(heimdalsrcdir\)/lib/wind|
|
||||
|
||||
clean::
|
||||
@-rm -f bin/compile_et bin/asn1_compile
|
||||
@ -591,7 +598,7 @@ clean::
|
||||
#######################
|
||||
# Start SUBSYSTEM HEIMDAL
|
||||
[SUBSYSTEM::HEIMDAL]
|
||||
CFLAGS = -Iheimdal_build
|
||||
CFLAGS = -I$(heimdalbuildsrcdir)
|
||||
PUBLIC_DEPENDENCIES = \
|
||||
HEIMDAL_GSSAPI HEIMDAL_KRB5
|
||||
# End SUBSYSTEM HEIMDAL
|
||||
@ -602,7 +609,6 @@ HEIMDAL_OBJ_FILES = $(heimdalsrcdir)/lib/vers/print_version.o
|
||||
#######################
|
||||
# Start BINARY compile_et
|
||||
[BINARY::samba4kinit]
|
||||
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken
|
||||
PRIVATE_DEPENDENCIES = HEIMDAL_KRB5 HEIMDAL_NTLM
|
||||
# End BINARY compile_et
|
||||
#######################
|
||||
@ -612,5 +618,7 @@ samba4kinit_OBJ_FILES = $(heimdalsrcdir)/kuser/kinit.o \
|
||||
$(heimdalsrcdir)/lib/roken/setprogname.o \
|
||||
$(heimdalsrcdir)/lib/roken/getarg.o
|
||||
|
||||
$(samba4kinit_OBJ_FILES): CFLAGS+=-I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/roken
|
||||
|
||||
dist:: $(heimdalsrcdir)/lib/asn1/lex.c $(heimdalsrcdir)/lib/com_err/lex.c \
|
||||
$(heimdalsrcdir)/lib/asn1/parse.c $(heimdalsrcdir)/lib/com_err/parse.c
|
||||
|
@ -4,19 +4,13 @@
|
||||
SELF=$0
|
||||
SELFDIR=`dirname ${SELF}`
|
||||
|
||||
SRCDIR=$1
|
||||
BUILDDIR=$2
|
||||
DESTDIR=$3
|
||||
BUILDDIR=$1
|
||||
DESTDIR=$2
|
||||
|
||||
CMD=$4
|
||||
FILE=$5
|
||||
SOURCE=$6
|
||||
shift 6
|
||||
|
||||
test -z "${SRCDIR}" && {
|
||||
echo "${SELF}:SRCDIR: '${SRCDIR}'" >&2;
|
||||
exit 1;
|
||||
}
|
||||
CMD=$3
|
||||
FILE=$4
|
||||
SOURCE=$5
|
||||
shift 5
|
||||
|
||||
test -z "${BUILDDIR}" && {
|
||||
echo "${SELF}:BUILDDIR: '${BUILDDIR}'" >&2;
|
||||
@ -45,14 +39,6 @@ test -z "${SOURCE}" && {
|
||||
|
||||
CURDIR=`pwd`
|
||||
|
||||
cd ${SRCDIR} && {
|
||||
ABS_SRCDIR=`pwd`
|
||||
cd ${CURDIR}
|
||||
} || {
|
||||
echo "${SELF}:cannot cd into '${SRCDIR}'" >&2;
|
||||
exit 1;
|
||||
}
|
||||
|
||||
cd ${BUILDDIR} && {
|
||||
ABS_BUILDDIR=`pwd`
|
||||
cd ${CURDIR}
|
||||
@ -62,7 +48,7 @@ cd ${BUILDDIR} && {
|
||||
}
|
||||
|
||||
cd ${DESTDIR} && {
|
||||
${ABS_BUILDDIR}/${CMD} ${ABS_SRCDIR}/${FILE} >&2 || exit 1;
|
||||
${ABS_BUILDDIR}/${CMD} ${FILE} >&2 || exit 1;
|
||||
cd ${CURDIR}
|
||||
TMP="${SOURCE}.$$"
|
||||
mv ${SOURCE} ${TMP} && {
|
||||
|
@ -8,9 +8,9 @@ my $basename = basename($file);
|
||||
|
||||
my $header = "$dirname/$basename"; $header =~ s/\.et$/.h/;
|
||||
my $source = "$dirname/$basename"; $source =~ s/\.et$/.c/;
|
||||
print "$header $source: $file bin/compile_et\n";
|
||||
print "$header $source: \$(heimdalsrcdir)/$file \$(ET_COMPILER)\n";
|
||||
print "\t\@echo \"Compiling error table $file\"\n";
|
||||
print "\t\@\$(builddir)/heimdal_build/et_compile_wrapper.sh \$(srcdir) \$(builddir) $dirname bin/compile_et $file $source\n\n";
|
||||
print "\t\@\$(heimdalbuildsrcdir)/et_compile_wrapper.sh \$(builddir) $dirname \$(ET_COMPILER) \$(abspath \$(heimdalsrcdir)/$file) $source\n\n";
|
||||
|
||||
print "clean:: \n";
|
||||
print "\t\@rm -f $header $source\n\n";
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "system/locale.h"
|
||||
#include "dynconfig.h"
|
||||
#include "dynconfig/dynconfig.h"
|
||||
#include "param/param.h"
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "version.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "param/param.h"
|
||||
#include "dynconfig.h"
|
||||
#include "dynconfig/dynconfig.h"
|
||||
|
||||
/* Handle command line options:
|
||||
* -d,--debuglevel
|
||||
|
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module(package="samba.events") events;
|
||||
%module(docstring="Event management.",package="samba.events") events;
|
||||
|
||||
%import "../talloc/talloc.i";
|
||||
|
||||
@ -27,8 +27,11 @@ typedef struct event_context event;
|
||||
|
||||
typedef struct event_context {
|
||||
%extend {
|
||||
%feature("docstring") event "S.__init__()";
|
||||
event(TALLOC_CTX *mem_ctx) { return event_context_init(mem_ctx); }
|
||||
%feature("docstring") loop_once "S.loop_once() -> int";
|
||||
int loop_once(void);
|
||||
%feature("docstring") loop_wait "S.loop_wait() -> int";
|
||||
int loop_wait(void);
|
||||
}
|
||||
} event;
|
||||
@ -44,6 +47,8 @@ typedef struct event_context {
|
||||
|
||||
struct event_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char *name);
|
||||
|
||||
%feature("docstring") event_backend_list "event_backend_list() -> list";
|
||||
const char **event_backend_list(TALLOC_CTX *mem_ctx);
|
||||
%feature("docstring") event_set_default_backend "event_set_default_backend(name) -> None";
|
||||
%rename(set_default_backend) event_set_default_backend;
|
||||
void event_set_default_backend(const char *backend);
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Event management.
|
||||
"""
|
||||
|
||||
import _events
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
@ -61,7 +65,16 @@ class event(object):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""S.__init__()"""
|
||||
_events.event_swiginit(self,_events.new_event(*args, **kwargs))
|
||||
def loop_once(*args, **kwargs):
|
||||
"""S.loop_once() -> int"""
|
||||
return _events.event_loop_once(*args, **kwargs)
|
||||
|
||||
def loop_wait(*args, **kwargs):
|
||||
"""S.loop_wait() -> int"""
|
||||
return _events.event_loop_wait(*args, **kwargs)
|
||||
|
||||
__swig_destroy__ = _events.delete_event
|
||||
event.loop_once = new_instancemethod(_events.event_loop_once,None,event)
|
||||
event.loop_wait = new_instancemethod(_events.event_loop_wait,None,event)
|
||||
@ -69,7 +82,13 @@ event_swigregister = _events.event_swigregister
|
||||
event_swigregister(event)
|
||||
|
||||
event_context_init_byname = _events.event_context_init_byname
|
||||
event_backend_list = _events.event_backend_list
|
||||
set_default_backend = _events.set_default_backend
|
||||
|
||||
def event_backend_list(*args):
|
||||
"""event_backend_list() -> list"""
|
||||
return _events.event_backend_list(*args)
|
||||
|
||||
def set_default_backend(*args, **kwargs):
|
||||
"""event_set_default_backend(name) -> None"""
|
||||
return _events.set_default_backend(*args, **kwargs)
|
||||
|
||||
|
||||
|
@ -2773,15 +2773,15 @@ fail:
|
||||
|
||||
|
||||
static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"new_event", (PyCFunction)_wrap_new_event, METH_NOARGS, NULL},
|
||||
{ (char *)"event_loop_once", (PyCFunction)_wrap_event_loop_once, METH_O, NULL},
|
||||
{ (char *)"event_loop_wait", (PyCFunction)_wrap_event_loop_wait, METH_O, NULL},
|
||||
{ (char *)"new_event", (PyCFunction)_wrap_new_event, METH_NOARGS, (char *)"S.__init__()"},
|
||||
{ (char *)"event_loop_once", (PyCFunction)_wrap_event_loop_once, METH_O, (char *)"S.loop_once() -> int"},
|
||||
{ (char *)"event_loop_wait", (PyCFunction)_wrap_event_loop_wait, METH_O, (char *)"S.loop_wait() -> int"},
|
||||
{ (char *)"delete_event", (PyCFunction)_wrap_delete_event, METH_O, NULL},
|
||||
{ (char *)"event_swigregister", event_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"event_swiginit", event_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"event_context_init_byname", (PyCFunction) _wrap_event_context_init_byname, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"event_backend_list", (PyCFunction)_wrap_event_backend_list, METH_NOARGS, NULL},
|
||||
{ (char *)"set_default_backend", (PyCFunction) _wrap_set_default_backend, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"event_backend_list", (PyCFunction)_wrap_event_backend_list, METH_NOARGS, (char *)"event_backend_list() -> list"},
|
||||
{ (char *)"set_default_backend", (PyCFunction) _wrap_set_default_backend, METH_VARARGS | METH_KEYWORDS, (char *)"event_set_default_backend(name) -> None"},
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
|
@ -2,11 +2,11 @@
|
||||
# Start MODULE ldb_asq
|
||||
[MODULE::ldb_asq]
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
INIT_FUNCTION = LDB_MODULE(asq)
|
||||
SUBSYSTEM = LIBLDB
|
||||
|
||||
ldb_asq_OBJ_FILES = lib/ldb/modules/asq.o
|
||||
ldb_asq_OBJ_FILES = $(ldbdir)/modules/asq.o
|
||||
# End MODULE ldb_asq
|
||||
################################################
|
||||
|
||||
@ -14,106 +14,106 @@ ldb_asq_OBJ_FILES = lib/ldb/modules/asq.o
|
||||
# Start MODULE ldb_server_sort
|
||||
[MODULE::ldb_server_sort]
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
INIT_FUNCTION = LDB_MODULE(server_sort)
|
||||
SUBSYSTEM = LIBLDB
|
||||
|
||||
# End MODULE ldb_sort
|
||||
################################################
|
||||
ldb_server_sort_OBJ_FILES = lib/ldb/modules/sort.o
|
||||
ldb_server_sort_OBJ_FILES = $(ldbdir)/modules/sort.o
|
||||
|
||||
################################################
|
||||
# Start MODULE ldb_paged_results
|
||||
[MODULE::ldb_paged_results]
|
||||
INIT_FUNCTION = LDB_MODULE(paged_results)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_paged_results
|
||||
################################################
|
||||
|
||||
ldb_paged_results_OBJ_FILES = lib/ldb/modules/paged_results.o
|
||||
ldb_paged_results_OBJ_FILES = $(ldbdir)/modules/paged_results.o
|
||||
|
||||
################################################
|
||||
# Start MODULE ldb_paged_results
|
||||
[MODULE::ldb_paged_searches]
|
||||
INIT_FUNCTION = LDB_MODULE(paged_searches)
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
SUBSYSTEM = LIBLDB
|
||||
# End MODULE ldb_paged_results
|
||||
################################################
|
||||
|
||||
ldb_paged_searches_OBJ_FILES = lib/ldb/modules/paged_searches.o
|
||||
ldb_paged_searches_OBJ_FILES = $(ldbdir)/modules/paged_searches.o
|
||||
|
||||
################################################
|
||||
# Start MODULE ldb_operational
|
||||
[MODULE::ldb_operational]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
INIT_FUNCTION = LDB_MODULE(operational)
|
||||
# End MODULE ldb_operational
|
||||
################################################
|
||||
|
||||
ldb_operational_OBJ_FILES = lib/ldb/modules/operational.o
|
||||
ldb_operational_OBJ_FILES = $(ldbdir)/modules/operational.o
|
||||
|
||||
################################################
|
||||
# Start MODULE ldb_rdn_name
|
||||
[MODULE::ldb_rdn_name]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
INIT_FUNCTION = LDB_MODULE(rdn_name)
|
||||
# End MODULE ldb_rdn_name
|
||||
################################################
|
||||
|
||||
ldb_rdn_name_OBJ_FILES = lib/ldb/modules/rdn_name.o
|
||||
ldb_rdn_name_OBJ_FILES = $(ldbdir)/modules/rdn_name.o
|
||||
|
||||
ldb_map_OBJ_FILES = $(addprefix lib/ldb/ldb_map/, ldb_map_inbound.o ldb_map_outbound.o ldb_map.o)
|
||||
ldb_map_OBJ_FILES = $(addprefix $(ldbdir)/ldb_map/, ldb_map_inbound.o ldb_map_outbound.o ldb_map.o)
|
||||
|
||||
$(ldb_map_OBJ_FILES): CFLAGS+=-Ilib/ldb/ldb_map
|
||||
$(ldb_map_OBJ_FILES): CFLAGS+=-I$(ldbdir)/ldb_map
|
||||
|
||||
################################################
|
||||
# Start MODULE ldb_skel
|
||||
[MODULE::ldb_skel]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC
|
||||
INIT_FUNCTION = LDB_MODULE(skel)
|
||||
# End MODULE ldb_skel
|
||||
################################################
|
||||
|
||||
ldb_skel_OBJ_FILES = lib/ldb/modules/skel.o
|
||||
ldb_skel_OBJ_FILES = $(ldbdir)/modules/skel.o
|
||||
|
||||
################################################
|
||||
# Start MODULE ldb_sqlite3
|
||||
[MODULE::ldb_sqlite3]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC SQLITE3 LIBTALLOC
|
||||
# End MODULE ldb_sqlite3
|
||||
################################################
|
||||
|
||||
ldb_sqlite3_OBJ_FILES = lib/ldb/ldb_sqlite3/ldb_sqlite3.o
|
||||
ldb_sqlite3_OBJ_FILES = $(ldbdir)/ldb_sqlite3/ldb_sqlite3.o
|
||||
|
||||
################################################
|
||||
# Start MODULE ldb_tdb
|
||||
[MODULE::ldb_tdb]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -Ilib/ldb/include -Ilib/ldb/ldb_tdb
|
||||
CFLAGS = -I$(ldbdir)/include -I$(ldbdir)/ldb_tdb
|
||||
PRIVATE_DEPENDENCIES = \
|
||||
LIBTDB LIBTALLOC
|
||||
# End MODULE ldb_tdb
|
||||
################################################
|
||||
|
||||
ldb_tdb_OBJ_FILES = $(addprefix lib/ldb/ldb_tdb/, ldb_tdb.o ldb_search.o ldb_pack.o ldb_index.o ldb_cache.o ldb_tdb_wrap.o)
|
||||
ldb_tdb_OBJ_FILES = $(addprefix $(ldbdir)/ldb_tdb/, ldb_tdb.o ldb_search.o ldb_pack.o ldb_index.o ldb_cache.o ldb_tdb_wrap.o)
|
||||
|
||||
|
||||
################################################
|
||||
# Start SUBSYSTEM ldb
|
||||
[LIBRARY::LIBLDB]
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
INIT_FUNCTION_TYPE = extern const struct ldb_module_ops
|
||||
PUBLIC_DEPENDENCIES = \
|
||||
LIBTALLOC
|
||||
@ -128,7 +128,9 @@ PC_FILES += $(ldbdir)/ldb.pc
|
||||
LIBLDB_VERSION = 0.0.1
|
||||
LIBLDB_SOVERSION = 0
|
||||
|
||||
LIBLDB_OBJ_FILES = $(addprefix lib/ldb/common/, ldb.o ldb_ldif.o ldb_parse.o ldb_msg.o ldb_utf8.o ldb_debug.o ldb_modules.o ldb_match.o ldb_attributes.o attrib_handlers.o ldb_dn.o ldb_controls.o qsort.o) $(ldb_map_OBJ_FILES)
|
||||
LIBLDB_OBJ_FILES = $(addprefix $(ldbdir)/common/, ldb.o ldb_ldif.o ldb_parse.o ldb_msg.o ldb_utf8.o ldb_debug.o ldb_modules.o ldb_match.o ldb_attributes.o attrib_handlers.o ldb_dn.o ldb_controls.o qsort.o) $(ldb_map_OBJ_FILES)
|
||||
|
||||
$(LIBLDB_OBJ_FILES): CFLAGS+=-I$(ldbdir)/include
|
||||
|
||||
PUBLIC_HEADERS += $(ldbdir)/include/ldb.h $(ldbdir)/include/ldb_errors.h
|
||||
|
||||
@ -142,7 +144,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
# End BINARY ldbtest
|
||||
################################################
|
||||
|
||||
ldbtest_OBJ_FILES = lib/ldb/tools/ldbtest.o
|
||||
ldbtest_OBJ_FILES = $(ldbdir)/tools/ldbtest.o
|
||||
|
||||
################################################
|
||||
# Start BINARY oLschema2ldif
|
||||
@ -154,7 +156,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
################################################
|
||||
|
||||
|
||||
oLschema2ldif_OBJ_FILES = $(addprefix lib/ldb/tools/, convert.o oLschema2ldif.o)
|
||||
oLschema2ldif_OBJ_FILES = $(addprefix $(ldbdir)/tools/, convert.o oLschema2ldif.o)
|
||||
|
||||
MANPAGES += $(ldbdir)/man/oLschema2ldif.1
|
||||
|
||||
@ -167,7 +169,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
# End BINARY ad2oLschema
|
||||
################################################
|
||||
|
||||
ad2oLschema_OBJ_FILES = $(addprefix lib/ldb/tools/, convert.o ad2oLschema.o)
|
||||
ad2oLschema_OBJ_FILES = $(addprefix $(ldbdir)/tools/, convert.o ad2oLschema.o)
|
||||
|
||||
MANPAGES += $(ldbdir)/man/ad2oLschema.1
|
||||
|
||||
|
@ -25,7 +25,11 @@
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module ldb
|
||||
%define DOCSTRING
|
||||
"An interface to LDB, a LDAP-like API that can either to talk an embedded database (TDB-based) or a standards-compliant LDAP server."
|
||||
%enddef
|
||||
|
||||
%module(docstring=DOCSTRING) ldb
|
||||
|
||||
%{
|
||||
|
||||
@ -40,7 +44,7 @@ typedef struct ldb_message ldb_msg;
|
||||
typedef struct ldb_context ldb;
|
||||
typedef struct ldb_dn ldb_dn;
|
||||
typedef struct ldb_ldif ldb_ldif;
|
||||
typedef struct ldb_message_element ldb_msg_element;
|
||||
typedef struct ldb_message_element ldb_message_element;
|
||||
typedef int ldb_error;
|
||||
typedef int ldb_int_error;
|
||||
|
||||
@ -194,8 +198,11 @@ PyObject *ldb_val_to_py_object(struct ldb_context *ldb_ctx,
|
||||
%rename(__cmp__) ldb_dn::compare;
|
||||
%rename(__len__) ldb_dn::get_comp_num;
|
||||
%rename(Dn) ldb_dn;
|
||||
%feature("docstring") ldb_dn "A LDB distinguished name.";
|
||||
typedef struct ldb_dn {
|
||||
%extend {
|
||||
%feature("docstring") ldb_dn "S.__init__(ldb, string)\n" \
|
||||
"Create a new DN.";
|
||||
ldb_dn(ldb *ldb_ctx, const char *str)
|
||||
{
|
||||
ldb_dn *ret = ldb_dn_new(ldb_ctx, ldb_ctx, str);
|
||||
@ -210,21 +217,37 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
~ldb_dn() { talloc_free($self); }
|
||||
%feature("docstring") validate "S.validate() -> bool\n" \
|
||||
"Validate DN is correct.";
|
||||
bool validate();
|
||||
const char *get_casefold();
|
||||
const char *get_linearized();
|
||||
%feature("docstring") parent "S.parent() -> dn\n" \
|
||||
"Get the parent for this DN.";
|
||||
ldb_dn *parent() { return ldb_dn_get_parent(NULL, $self); }
|
||||
int compare(ldb_dn *other);
|
||||
bool is_valid();
|
||||
%feature("docstring") is_special "S.is_special() -> bool\n" \
|
||||
"Check whether this is a special LDB DN.";
|
||||
bool is_special();
|
||||
%feature("docstring") is_null "S.is_null() -> bool\n" \
|
||||
"Check whether this is a null DN.";
|
||||
bool is_null();
|
||||
bool check_special(const char *name);
|
||||
int get_comp_num();
|
||||
%feature("docstring") add_child "S.add_child(dn) -> None\n" \
|
||||
"Add a child DN to this DN.";
|
||||
bool add_child(ldb_dn *child);
|
||||
%feature("docstring") add_base "S.add_base(dn) -> None\n" \
|
||||
"Add a base DN to this DN.";
|
||||
bool add_base(ldb_dn *base);
|
||||
%feature("docstring") canonical_str "S.canonical_str() -> string\n" \
|
||||
"Canonical version of this DN (like a posix path).";
|
||||
const char *canonical_str() {
|
||||
return ldb_dn_canonical_string($self, $self);
|
||||
}
|
||||
%feature("docstring") canonical_ex_str "S.canonical_ex_str() -> string\n" \
|
||||
"Canonical version of this DN (like a posix path, with terminating newline).";
|
||||
const char *canonical_ex_str() {
|
||||
return ldb_dn_canonical_ex_string($self, $self);
|
||||
}
|
||||
@ -289,7 +312,7 @@ int ldb_dn_from_pyobject(TALLOC_CTX *mem_ctx, PyObject *object,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ldb_msg_element *ldb_msg_element_from_pyobject(TALLOC_CTX *mem_ctx,
|
||||
ldb_message_element *ldb_msg_element_from_pyobject(TALLOC_CTX *mem_ctx,
|
||||
PyObject *set_obj, int flags,
|
||||
const char *attr_name)
|
||||
{
|
||||
@ -320,7 +343,7 @@ ldb_msg_element *ldb_msg_element_from_pyobject(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
PyObject *ldb_msg_element_to_set(struct ldb_context *ldb_ctx,
|
||||
ldb_msg_element *me)
|
||||
ldb_message_element *me)
|
||||
{
|
||||
int i;
|
||||
PyObject *result;
|
||||
@ -340,11 +363,16 @@ PyObject *ldb_msg_element_to_set(struct ldb_context *ldb_ctx,
|
||||
#endif
|
||||
|
||||
/* ldb_message_element */
|
||||
%rename(__cmp__) ldb_message_element::compare;
|
||||
%rename(MessageElement) ldb_msg_element;
|
||||
%rename(MessageElement) ldb_message_element;
|
||||
%feature("docstring") ldb_message_element "Message element.";
|
||||
typedef struct ldb_message_element {
|
||||
%extend {
|
||||
#ifdef SWIGPYTHON
|
||||
int __cmp__(ldb_message_element *other)
|
||||
{
|
||||
return ldb_msg_element_compare($self, other);
|
||||
}
|
||||
|
||||
PyObject *__iter__(void)
|
||||
{
|
||||
return PyObject_GetIter(ldb_msg_element_to_set(NULL, $self));
|
||||
@ -355,7 +383,7 @@ typedef struct ldb_message_element {
|
||||
return ldb_msg_element_to_set(NULL, $self);
|
||||
}
|
||||
|
||||
ldb_msg_element(PyObject *set_obj, int flags=0, const char *name = NULL)
|
||||
ldb_message_element(PyObject *set_obj, int flags=0, const char *name = NULL)
|
||||
{
|
||||
return ldb_msg_element_from_pyobject(NULL, set_obj, flags, name);
|
||||
}
|
||||
@ -374,8 +402,7 @@ typedef struct ldb_message_element {
|
||||
return ldb_val_to_py_object(NULL, $self, &$self->values[i]);
|
||||
}
|
||||
|
||||
~ldb_msg_element() { talloc_free($self); }
|
||||
int compare(ldb_msg_element *);
|
||||
~ldb_message_element() { talloc_free($self); }
|
||||
}
|
||||
%pythoncode {
|
||||
def __getitem__(self, i):
|
||||
@ -398,21 +425,20 @@ typedef struct ldb_message_element {
|
||||
return False
|
||||
return True
|
||||
}
|
||||
} ldb_msg_element;
|
||||
} ldb_message_element;
|
||||
|
||||
/* ldb_message */
|
||||
|
||||
%feature("docstring") ldb_message "Message.";
|
||||
%rename(Message) ldb_message;
|
||||
#ifdef SWIGPYTHON
|
||||
%rename(__delitem__) ldb_message::remove_attr;
|
||||
%typemap(out) ldb_msg_element * {
|
||||
%typemap(out) ldb_message_element * {
|
||||
if ($1 == NULL)
|
||||
PyErr_SetString(PyExc_KeyError, "no such element");
|
||||
else
|
||||
$result = SWIG_NewPointerObj($1, SWIGTYPE_p_ldb_message_element, 0);
|
||||
}
|
||||
//%typemap(out) ldb_msg_element *;
|
||||
|
||||
|
||||
%inline {
|
||||
PyObject *ldb_msg_list_elements(ldb_msg *msg)
|
||||
@ -443,10 +469,10 @@ typedef struct ldb_message {
|
||||
return ret;
|
||||
}
|
||||
~ldb_msg() { talloc_free($self); }
|
||||
ldb_msg_element *find_element(const char *name);
|
||||
ldb_message_element *find_element(const char *name);
|
||||
|
||||
#ifdef SWIGPYTHON
|
||||
void __setitem__(const char *attr_name, ldb_msg_element *val)
|
||||
void __setitem__(const char *attr_name, ldb_message_element *val)
|
||||
{
|
||||
struct ldb_message_element *el;
|
||||
|
||||
@ -600,6 +626,7 @@ PyObject *PyExc_LdbError;
|
||||
}
|
||||
|
||||
%rename(Ldb) ldb_context;
|
||||
%feature("docstring") ldb_context "Connection to a LDB database.";
|
||||
|
||||
%typemap(in,noblock=1) struct ldb_dn * {
|
||||
if (ldb_dn_from_pyobject(NULL, $input, arg1, &$1) != 0) {
|
||||
@ -613,7 +640,7 @@ PyObject *PyExc_LdbError;
|
||||
|
||||
%typemap(in,numinputs=1) ldb_msg *add_msg {
|
||||
Py_ssize_t dict_pos, msg_pos;
|
||||
ldb_msg_element *msgel;
|
||||
ldb_message_element *msgel;
|
||||
PyObject *key, *value;
|
||||
|
||||
if (PyDict_Check($input)) {
|
||||
@ -660,6 +687,8 @@ typedef struct ldb_context {
|
||||
%extend {
|
||||
ldb(void) { return ldb_init(NULL); }
|
||||
|
||||
%feature("docstring") connect "S.connect(url,flags=0,options=None) -> None\n" \
|
||||
"Connect to a LDB URL.";
|
||||
ldb_error connect(const char *url, unsigned int flags = 0,
|
||||
const char *options[] = NULL);
|
||||
|
||||
@ -707,11 +736,19 @@ typedef struct ldb_context {
|
||||
return ret;
|
||||
}
|
||||
|
||||
%feature("docstring") delete "S.delete(dn) -> None\n" \
|
||||
"Remove an entry.";
|
||||
ldb_error delete(ldb_dn *dn);
|
||||
%feature("docstring") rename "S.rename(old_dn, new_dn) -> None\n" \
|
||||
"Rename an entry.";
|
||||
ldb_error rename(ldb_dn *olddn, ldb_dn *newdn);
|
||||
struct ldb_control **parse_control_strings(TALLOC_CTX *mem_ctx,
|
||||
const char * const*control_strings);
|
||||
%feature("docstring") add "S.add(message) -> None\n" \
|
||||
"Add an entry.";
|
||||
ldb_error add(ldb_msg *add_msg);
|
||||
%feature("docstring") modify "S.modify(message) -> None\n" \
|
||||
"Modify an entry.";
|
||||
ldb_error modify(ldb_msg *message);
|
||||
ldb_dn *get_config_basedn();
|
||||
ldb_dn *get_root_basedn();
|
||||
@ -747,20 +784,39 @@ typedef struct ldb_context {
|
||||
}
|
||||
|
||||
const char *errstring();
|
||||
%feature("docstring") set_create_perms "S.set_create_perms(mode) -> None\n" \
|
||||
"Set mode to use when creating new LDB files.";
|
||||
void set_create_perms(unsigned int perms);
|
||||
%feature("docstring") set_modules_dir "S.set_modules_dir(path) -> None\n" \
|
||||
"Set path LDB should search for modules";
|
||||
void set_modules_dir(const char *path);
|
||||
%feature("docstring") set_debug "S.set_debug(callback) -> None\n" \
|
||||
"Set callback for LDB debug messages.\n" \
|
||||
"The callback should accept a debug level and debug text.";
|
||||
ldb_error set_debug(void (*debug)(void *context, enum ldb_debug_level level,
|
||||
const char *fmt, va_list ap),
|
||||
void *context);
|
||||
%feature("docstring") set_opaque "S.set_opaque(name, value) -> None\n" \
|
||||
"Set an opaque value on this LDB connection. \n"
|
||||
":note: Passing incorrect values may cause crashes.";
|
||||
ldb_error set_opaque(const char *name, void *value);
|
||||
%feature("docstring") get_opaque "S.get_opaque(name) -> value\n" \
|
||||
"Get an opaque value set on this LDB connection. \n"
|
||||
":note: The returned value may not be useful in Python.";
|
||||
void *get_opaque(const char *name);
|
||||
%feature("docstring") transaction_start "S.transaction_start() -> None\n" \
|
||||
"Start a new transaction.";
|
||||
ldb_error transaction_start();
|
||||
%feature("docstring") transaction_commit "S.transaction_commit() -> None\n" \
|
||||
"Commit currently active transaction.";
|
||||
ldb_error transaction_commit();
|
||||
%feature("docstring") transaction_cancel "S.transaction_cancel() -> None\n" \
|
||||
"Cancel currently active transaction.";
|
||||
ldb_error transaction_cancel();
|
||||
void schema_attribute_remove(const char *name);
|
||||
ldb_error schema_attribute_add(const char *attribute, unsigned flags, const char *syntax);
|
||||
ldb_error setup_wellknown_attributes(void);
|
||||
|
||||
ldb_error setup_wellknown_attributes(void);
|
||||
|
||||
#ifdef SWIGPYTHON
|
||||
%typemap(in,numinputs=0,noblock=1) struct ldb_result **result_as_bool (struct ldb_result *tmp) { $1 = &tmp; }
|
||||
%typemap(argout,noblock=1) struct ldb_result **result_as_bool { $result = ((*$1)->count > 0)?Py_True:Py_False; }
|
||||
@ -771,6 +827,9 @@ typedef struct ldb_context {
|
||||
result_as_bool);
|
||||
}
|
||||
|
||||
%feature("docstring") parse_ldif "S.parse_ldif(ldif) -> iter(messages)\n" \
|
||||
"Parse a string formatted using LDIF.";
|
||||
|
||||
PyObject *parse_ldif(const char *s)
|
||||
{
|
||||
PyObject *list = PyList_New(0);
|
||||
@ -791,12 +850,25 @@ typedef struct ldb_context {
|
||||
}
|
||||
%pythoncode {
|
||||
def __init__(self, url=None, flags=0, options=None):
|
||||
"""Create a new LDB object.
|
||||
|
||||
Will also connect to the specified URL if one was given.
|
||||
"""
|
||||
_ldb.Ldb_swiginit(self,_ldb.new_Ldb())
|
||||
if url is not None:
|
||||
self.connect(url, flags, options)
|
||||
|
||||
def search(self, base=None, scope=SCOPE_DEFAULT, expression=None,
|
||||
attrs=None, controls=None):
|
||||
"""Search in a database.
|
||||
|
||||
:param base: Optional base DN to search
|
||||
:param scope: Search scope (SCOPE_BASE, SCOPE_ONELEVEL or SCOPE_SUBTREE)
|
||||
:param expression: Optional search expression
|
||||
:param attrs: Attributes to return (defaults to all)
|
||||
:param controls: Optional list of controls
|
||||
:return: Iterator over Message objects
|
||||
"""
|
||||
if not (attrs is None or isinstance(attrs, list)):
|
||||
raise TypeError("attributes not a list")
|
||||
parsed_controls = None
|
||||
@ -816,10 +888,15 @@ typedef struct ldb_context {
|
||||
%nodefault Dn;
|
||||
|
||||
%rename(valid_attr_name) ldb_valid_attr_name;
|
||||
%feature("docstring") ldb_valid_attr_name "S.valid_attr_name(name) -> bool\n"
|
||||
"Check whether the supplied name is a valid attribute name.";
|
||||
int ldb_valid_attr_name(const char *s);
|
||||
|
||||
typedef unsigned long time_t;
|
||||
|
||||
%feature("docstring") timestring "S.timestring(int) -> string\n"
|
||||
"Generate a LDAP time string from a UNIX timestamp";
|
||||
|
||||
%inline %{
|
||||
static char *timestring(time_t t)
|
||||
{
|
||||
@ -831,6 +908,8 @@ static char *timestring(time_t t)
|
||||
%}
|
||||
|
||||
%rename(string_to_time) ldb_string_to_time;
|
||||
%feature("docstring") ldb_string_to_time "S.string_to_time(string) -> int\n"
|
||||
"Parse a LDAP time string into a UNIX timestamp.";
|
||||
time_t ldb_string_to_time(const char *s);
|
||||
|
||||
%typemap(in,noblock=1) const struct ldb_module_ops * {
|
||||
@ -839,5 +918,11 @@ time_t ldb_string_to_time(const char *s);
|
||||
$1->name = (char *)PyObject_GetAttrString($input, (char *)"name");
|
||||
}
|
||||
|
||||
%feature("docstring") ldb_register_module "S.register_module(module) -> None\n"
|
||||
"Register a LDB module.";
|
||||
%rename(register_module) ldb_register_module;
|
||||
ldb_int_error ldb_register_module(const struct ldb_module_ops *);
|
||||
|
||||
%pythoncode {
|
||||
__docformat__ = "restructuredText"
|
||||
}
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
An interface to LDB, a LDAP-like API that can either to talk an embedded database (TDB-based) or a standards-compliant LDAP server.
|
||||
"""
|
||||
|
||||
import _ldb
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
@ -67,10 +71,71 @@ CHANGETYPE_DELETE = _ldb.CHANGETYPE_DELETE
|
||||
CHANGETYPE_MODIFY = _ldb.CHANGETYPE_MODIFY
|
||||
ldb_val_to_py_object = _ldb.ldb_val_to_py_object
|
||||
class Dn(object):
|
||||
"""A LDB distinguished name."""
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
S.__init__(ldb, string)
|
||||
Create a new DN.
|
||||
"""
|
||||
_ldb.Dn_swiginit(self,_ldb.new_Dn(*args, **kwargs))
|
||||
__swig_destroy__ = _ldb.delete_Dn
|
||||
def validate(*args, **kwargs):
|
||||
"""
|
||||
S.validate() -> bool
|
||||
Validate DN is correct.
|
||||
"""
|
||||
return _ldb.Dn_validate(*args, **kwargs)
|
||||
|
||||
def parent(*args, **kwargs):
|
||||
"""
|
||||
S.parent() -> dn
|
||||
Get the parent for this DN.
|
||||
"""
|
||||
return _ldb.Dn_parent(*args, **kwargs)
|
||||
|
||||
def is_special(*args, **kwargs):
|
||||
"""
|
||||
S.is_special() -> bool
|
||||
Check whether this is a special LDB DN.
|
||||
"""
|
||||
return _ldb.Dn_is_special(*args, **kwargs)
|
||||
|
||||
def is_null(*args, **kwargs):
|
||||
"""
|
||||
S.is_null() -> bool
|
||||
Check whether this is a null DN.
|
||||
"""
|
||||
return _ldb.Dn_is_null(*args, **kwargs)
|
||||
|
||||
def add_child(*args, **kwargs):
|
||||
"""
|
||||
S.add_child(dn) -> None
|
||||
Add a child DN to this DN.
|
||||
"""
|
||||
return _ldb.Dn_add_child(*args, **kwargs)
|
||||
|
||||
def add_base(*args, **kwargs):
|
||||
"""
|
||||
S.add_base(dn) -> None
|
||||
Add a base DN to this DN.
|
||||
"""
|
||||
return _ldb.Dn_add_base(*args, **kwargs)
|
||||
|
||||
def canonical_str(*args, **kwargs):
|
||||
"""
|
||||
S.canonical_str() -> string
|
||||
Canonical version of this DN (like a posix path).
|
||||
"""
|
||||
return _ldb.Dn_canonical_str(*args, **kwargs)
|
||||
|
||||
def canonical_ex_str(*args, **kwargs):
|
||||
"""
|
||||
S.canonical_ex_str() -> string
|
||||
Canonical version of this DN (like a posix path, with terminating newline).
|
||||
"""
|
||||
return _ldb.Dn_canonical_ex_str(*args, **kwargs)
|
||||
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, self.__class__):
|
||||
return self.__cmp__(other) == 0
|
||||
@ -97,11 +162,14 @@ Dn.__add__ = new_instancemethod(_ldb.Dn___add__,None,Dn)
|
||||
Dn_swigregister = _ldb.Dn_swigregister
|
||||
Dn_swigregister(Dn)
|
||||
|
||||
class ldb_msg_element(object):
|
||||
class MessageElement(object):
|
||||
"""Message element."""
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
__swig_destroy__ = _ldb.delete_ldb_msg_element
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""Message element."""
|
||||
_ldb.MessageElement_swiginit(self,_ldb.new_MessageElement(*args, **kwargs))
|
||||
__swig_destroy__ = _ldb.delete_MessageElement
|
||||
def __getitem__(self, i):
|
||||
ret = self.get(i)
|
||||
if ret is None:
|
||||
@ -122,20 +190,17 @@ class ldb_msg_element(object):
|
||||
return False
|
||||
return True
|
||||
|
||||
ldb_msg_element.__iter__ = new_instancemethod(_ldb.ldb_msg_element___iter__,None,ldb_msg_element)
|
||||
ldb_msg_element.__set__ = new_instancemethod(_ldb.ldb_msg_element___set__,None,ldb_msg_element)
|
||||
ldb_msg_element.__len__ = new_instancemethod(_ldb.ldb_msg_element___len__,None,ldb_msg_element)
|
||||
ldb_msg_element.get = new_instancemethod(_ldb.ldb_msg_element_get,None,ldb_msg_element)
|
||||
ldb_msg_element.__cmp__ = new_instancemethod(_ldb.ldb_msg_element___cmp__,None,ldb_msg_element)
|
||||
ldb_msg_element_swigregister = _ldb.ldb_msg_element_swigregister
|
||||
ldb_msg_element_swigregister(ldb_msg_element)
|
||||
|
||||
def MessageElement(*args, **kwargs):
|
||||
val = _ldb.new_MessageElement(*args, **kwargs)
|
||||
return val
|
||||
MessageElement.__cmp__ = new_instancemethod(_ldb.MessageElement___cmp__,None,MessageElement)
|
||||
MessageElement.__iter__ = new_instancemethod(_ldb.MessageElement___iter__,None,MessageElement)
|
||||
MessageElement.__set__ = new_instancemethod(_ldb.MessageElement___set__,None,MessageElement)
|
||||
MessageElement.__len__ = new_instancemethod(_ldb.MessageElement___len__,None,MessageElement)
|
||||
MessageElement.get = new_instancemethod(_ldb.MessageElement_get,None,MessageElement)
|
||||
MessageElement_swigregister = _ldb.MessageElement_swigregister
|
||||
MessageElement_swigregister(MessageElement)
|
||||
|
||||
ldb_msg_list_elements = _ldb.ldb_msg_list_elements
|
||||
class Message(object):
|
||||
"""Message."""
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
dn = _swig_property(_ldb.Message_dn_get, _ldb.Message_dn_set)
|
||||
@ -214,17 +279,132 @@ LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED = _ldb.LDB_ERR_OBJECT_CLASS_MODS_PROHIBITED
|
||||
LDB_ERR_AFFECTS_MULTIPLE_DSAS = _ldb.LDB_ERR_AFFECTS_MULTIPLE_DSAS
|
||||
LDB_ERR_OTHER = _ldb.LDB_ERR_OTHER
|
||||
class Ldb(object):
|
||||
"""Connection to a LDB database."""
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self, *args, **kwargs):
|
||||
_ldb.Ldb_swiginit(self,_ldb.new_Ldb(*args, **kwargs))
|
||||
def connect(*args, **kwargs):
|
||||
"""
|
||||
S.connect(url,flags=0,options=None) -> None
|
||||
Connect to a LDB URL.
|
||||
"""
|
||||
return _ldb.Ldb_connect(*args, **kwargs)
|
||||
|
||||
__swig_destroy__ = _ldb.delete_Ldb
|
||||
def delete(*args, **kwargs):
|
||||
"""
|
||||
S.delete(dn) -> None
|
||||
Remove an entry.
|
||||
"""
|
||||
return _ldb.Ldb_delete(*args, **kwargs)
|
||||
|
||||
def rename(*args, **kwargs):
|
||||
"""
|
||||
S.rename(old_dn, new_dn) -> None
|
||||
Rename an entry.
|
||||
"""
|
||||
return _ldb.Ldb_rename(*args, **kwargs)
|
||||
|
||||
def add(*args, **kwargs):
|
||||
"""
|
||||
S.add(message) -> None
|
||||
Add an entry.
|
||||
"""
|
||||
return _ldb.Ldb_add(*args, **kwargs)
|
||||
|
||||
def modify(*args, **kwargs):
|
||||
"""
|
||||
S.modify(message) -> None
|
||||
Modify an entry.
|
||||
"""
|
||||
return _ldb.Ldb_modify(*args, **kwargs)
|
||||
|
||||
def set_create_perms(*args, **kwargs):
|
||||
"""
|
||||
S.set_create_perms(mode) -> None
|
||||
Set mode to use when creating new LDB files.
|
||||
"""
|
||||
return _ldb.Ldb_set_create_perms(*args, **kwargs)
|
||||
|
||||
def set_modules_dir(*args, **kwargs):
|
||||
"""
|
||||
S.set_modules_dir(path) -> None
|
||||
Set path LDB should search for modules
|
||||
"""
|
||||
return _ldb.Ldb_set_modules_dir(*args, **kwargs)
|
||||
|
||||
def set_debug(*args, **kwargs):
|
||||
"""
|
||||
S.set_debug(callback) -> None
|
||||
Set callback for LDB debug messages.
|
||||
The callback should accept a debug level and debug text.
|
||||
"""
|
||||
return _ldb.Ldb_set_debug(*args, **kwargs)
|
||||
|
||||
def set_opaque(*args, **kwargs):
|
||||
"""
|
||||
S.set_opaque(name, value) -> None
|
||||
Set an opaque value on this LDB connection.
|
||||
:note: Passing incorrect values may cause crashes.
|
||||
"""
|
||||
return _ldb.Ldb_set_opaque(*args, **kwargs)
|
||||
|
||||
def get_opaque(*args, **kwargs):
|
||||
"""
|
||||
S.get_opaque(name) -> value
|
||||
Get an opaque value set on this LDB connection.
|
||||
:note: The returned value may not be useful in Python.
|
||||
"""
|
||||
return _ldb.Ldb_get_opaque(*args, **kwargs)
|
||||
|
||||
def transaction_start(*args, **kwargs):
|
||||
"""
|
||||
S.transaction_start() -> None
|
||||
Start a new transaction.
|
||||
"""
|
||||
return _ldb.Ldb_transaction_start(*args, **kwargs)
|
||||
|
||||
def transaction_commit(*args, **kwargs):
|
||||
"""
|
||||
S.transaction_commit() -> None
|
||||
Commit currently active transaction.
|
||||
"""
|
||||
return _ldb.Ldb_transaction_commit(*args, **kwargs)
|
||||
|
||||
def transaction_cancel(*args, **kwargs):
|
||||
"""
|
||||
S.transaction_cancel() -> None
|
||||
Cancel currently active transaction.
|
||||
"""
|
||||
return _ldb.Ldb_transaction_cancel(*args, **kwargs)
|
||||
|
||||
def parse_ldif(*args, **kwargs):
|
||||
"""
|
||||
S.parse_ldif(ldif) -> iter(messages)
|
||||
Parse a string formatted using LDIF.
|
||||
"""
|
||||
return _ldb.Ldb_parse_ldif(*args, **kwargs)
|
||||
|
||||
def __init__(self, url=None, flags=0, options=None):
|
||||
"""Create a new LDB object.
|
||||
|
||||
Will also connect to the specified URL if one was given.
|
||||
"""
|
||||
_ldb.Ldb_swiginit(self,_ldb.new_Ldb())
|
||||
if url is not None:
|
||||
self.connect(url, flags, options)
|
||||
|
||||
def search(self, base=None, scope=SCOPE_DEFAULT, expression=None,
|
||||
attrs=None, controls=None):
|
||||
"""Search in a database.
|
||||
|
||||
:param base: Optional base DN to search
|
||||
:param scope: Search scope (SCOPE_BASE, SCOPE_ONELEVEL or SCOPE_SUBTREE)
|
||||
:param expression: Optional search expression
|
||||
:param attrs: Attributes to return (defaults to all)
|
||||
:param controls: Optional list of controls
|
||||
:return: Iterator over Message objects
|
||||
"""
|
||||
if not (attrs is None or isinstance(attrs, list)):
|
||||
raise TypeError("attributes not a list")
|
||||
parsed_controls = None
|
||||
@ -263,9 +443,35 @@ Ldb.__repr__ = new_instancemethod(_ldb.Ldb___repr__,None,Ldb)
|
||||
Ldb_swigregister = _ldb.Ldb_swigregister
|
||||
Ldb_swigregister(Ldb)
|
||||
|
||||
valid_attr_name = _ldb.valid_attr_name
|
||||
timestring = _ldb.timestring
|
||||
string_to_time = _ldb.string_to_time
|
||||
register_module = _ldb.register_module
|
||||
|
||||
def valid_attr_name(*args, **kwargs):
|
||||
"""
|
||||
S.valid_attr_name(name) -> bool
|
||||
Check whether the supplied name is a valid attribute name.
|
||||
"""
|
||||
return _ldb.valid_attr_name(*args, **kwargs)
|
||||
|
||||
def timestring(*args, **kwargs):
|
||||
"""
|
||||
S.timestring(int) -> string
|
||||
Generate a LDAP time string from a UNIX timestamp
|
||||
"""
|
||||
return _ldb.timestring(*args, **kwargs)
|
||||
|
||||
def string_to_time(*args, **kwargs):
|
||||
"""
|
||||
S.string_to_time(string) -> int
|
||||
Parse a LDAP time string into a UNIX timestamp.
|
||||
"""
|
||||
return _ldb.string_to_time(*args, **kwargs)
|
||||
|
||||
def register_module(*args, **kwargs):
|
||||
"""
|
||||
S.register_module(module) -> None
|
||||
Register a LDB module.
|
||||
"""
|
||||
return _ldb.register_module(*args, **kwargs)
|
||||
__docformat__ = "restructuredText"
|
||||
|
||||
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
# Start MODULE ldb_ildap
|
||||
[MODULE::ldb_ildap]
|
||||
SUBSYSTEM = LIBLDB
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir)/include
|
||||
OUTPUT_TYPE = SHARED_LIBRARY
|
||||
PRIVATE_DEPENDENCIES = LIBTALLOC LIBCLI_LDAP CREDENTIALS
|
||||
ALIASES = ldapi ldaps ldap
|
||||
# End MODULE ldb_ildap
|
||||
################################################
|
||||
|
||||
ldb_ildap_OBJ_FILES = lib/ldb/ldb_ildap/ldb_ildap.o
|
||||
ldb_ildap_OBJ_FILES = $(ldbdir)/ldb_ildap/ldb_ildap.o
|
||||
|
||||
|
@ -2554,7 +2554,7 @@ typedef struct ldb_message ldb_msg;
|
||||
typedef struct ldb_context ldb;
|
||||
typedef struct ldb_dn ldb_dn;
|
||||
typedef struct ldb_ldif ldb_ldif;
|
||||
typedef struct ldb_message_element ldb_msg_element;
|
||||
typedef struct ldb_message_element ldb_message_element;
|
||||
typedef int ldb_error;
|
||||
typedef int ldb_int_error;
|
||||
|
||||
@ -2761,7 +2761,7 @@ int ldb_dn_from_pyobject(TALLOC_CTX *mem_ctx, PyObject *object,
|
||||
return ret;
|
||||
}
|
||||
|
||||
ldb_msg_element *ldb_msg_element_from_pyobject(TALLOC_CTX *mem_ctx,
|
||||
ldb_message_element *ldb_msg_element_from_pyobject(TALLOC_CTX *mem_ctx,
|
||||
PyObject *set_obj, int flags,
|
||||
const char *attr_name)
|
||||
{
|
||||
@ -2792,7 +2792,7 @@ ldb_msg_element *ldb_msg_element_from_pyobject(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
PyObject *ldb_msg_element_to_set(struct ldb_context *ldb_ctx,
|
||||
ldb_msg_element *me)
|
||||
ldb_message_element *me)
|
||||
{
|
||||
int i;
|
||||
PyObject *result;
|
||||
@ -2809,10 +2809,13 @@ PyObject *ldb_msg_element_to_set(struct ldb_context *ldb_ctx,
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *ldb_msg_element___iter__(ldb_msg_element *self){
|
||||
SWIGINTERN int ldb_message_element___cmp__(ldb_message_element *self,ldb_message_element *other){
|
||||
return ldb_msg_element_compare(self, other);
|
||||
}
|
||||
SWIGINTERN PyObject *ldb_message_element___iter__(ldb_message_element *self){
|
||||
return PyObject_GetIter(ldb_msg_element_to_set(NULL, self));
|
||||
}
|
||||
SWIGINTERN PyObject *ldb_msg_element___set__(ldb_msg_element *self){
|
||||
SWIGINTERN PyObject *ldb_message_element___set__(ldb_message_element *self){
|
||||
return ldb_msg_element_to_set(NULL, self);
|
||||
}
|
||||
|
||||
@ -2960,19 +2963,19 @@ SWIG_AsVal_int (PyObject * obj, int *val)
|
||||
return res;
|
||||
}
|
||||
|
||||
SWIGINTERN ldb_msg_element *new_ldb_msg_element(PyObject *set_obj,int flags,char const *name){
|
||||
SWIGINTERN ldb_message_element *new_ldb_message_element(PyObject *set_obj,int flags,char const *name){
|
||||
return ldb_msg_element_from_pyobject(NULL, set_obj, flags, name);
|
||||
}
|
||||
SWIGINTERN int ldb_msg_element___len__(ldb_msg_element *self){
|
||||
SWIGINTERN int ldb_message_element___len__(ldb_message_element *self){
|
||||
return self->num_values;
|
||||
}
|
||||
SWIGINTERN PyObject *ldb_msg_element_get(ldb_msg_element *self,int i){
|
||||
SWIGINTERN PyObject *ldb_message_element_get(ldb_message_element *self,int i){
|
||||
if (i < 0 || i >= self->num_values)
|
||||
return Py_None;
|
||||
|
||||
return ldb_val_to_py_object(NULL, self, &self->values[i]);
|
||||
}
|
||||
SWIGINTERN void delete_ldb_msg_element(ldb_msg_element *self){ talloc_free(self); }
|
||||
SWIGINTERN void delete_ldb_message_element(ldb_message_element *self){ talloc_free(self); }
|
||||
|
||||
PyObject *ldb_msg_list_elements(ldb_msg *msg)
|
||||
{
|
||||
@ -2995,7 +2998,7 @@ SWIGINTERN ldb_msg *new_ldb_msg(ldb_dn *dn){
|
||||
return ret;
|
||||
}
|
||||
SWIGINTERN void delete_ldb_msg(ldb_msg *self){ talloc_free(self); }
|
||||
SWIGINTERN void ldb_msg___setitem____SWIG_0(ldb_msg *self,char const *attr_name,ldb_msg_element *val){
|
||||
SWIGINTERN void ldb_msg___setitem____SWIG_0(ldb_msg *self,char const *attr_name,ldb_message_element *val){
|
||||
struct ldb_message_element *el;
|
||||
|
||||
ldb_msg_remove_attr(self, attr_name);
|
||||
@ -3763,9 +3766,43 @@ SWIGINTERN PyObject *Dn_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args)
|
||||
return SWIG_Python_InitShadowInstance(args);
|
||||
}
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ldb_msg_element___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_MessageElement___cmp__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg_element *arg1 = (ldb_msg_element *) 0 ;
|
||||
ldb_message_element *arg1 = (ldb_message_element *) 0 ;
|
||||
ldb_message_element *arg2 = (ldb_message_element *) 0 ;
|
||||
int result;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
void *argp2 = 0 ;
|
||||
int res2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
char * kwnames[] = {
|
||||
(char *) "self",(char *) "other", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:MessageElement___cmp__",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MessageElement___cmp__" "', argument " "1"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg1 = (ldb_message_element *)(argp1);
|
||||
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MessageElement___cmp__" "', argument " "2"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg2 = (ldb_message_element *)(argp2);
|
||||
result = (int)ldb_message_element___cmp__(arg1,arg2);
|
||||
resultobj = SWIG_From_int((int)(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MessageElement___iter__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_message_element *arg1 = (ldb_message_element *) 0 ;
|
||||
PyObject *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
@ -3775,10 +3812,10 @@ SWIGINTERN PyObject *_wrap_ldb_msg_element___iter__(PyObject *SWIGUNUSEDPARM(sel
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ldb_msg_element___iter__" "', argument " "1"" of type '" "ldb_msg_element *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MessageElement___iter__" "', argument " "1"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg1 = (ldb_msg_element *)(argp1);
|
||||
result = (PyObject *)ldb_msg_element___iter__(arg1);
|
||||
arg1 = (ldb_message_element *)(argp1);
|
||||
result = (PyObject *)ldb_message_element___iter__(arg1);
|
||||
resultobj = result;
|
||||
return resultobj;
|
||||
fail:
|
||||
@ -3786,9 +3823,9 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ldb_msg_element___set__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_MessageElement___set__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg_element *arg1 = (ldb_msg_element *) 0 ;
|
||||
ldb_message_element *arg1 = (ldb_message_element *) 0 ;
|
||||
PyObject *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
@ -3798,10 +3835,10 @@ SWIGINTERN PyObject *_wrap_ldb_msg_element___set__(PyObject *SWIGUNUSEDPARM(self
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ldb_msg_element___set__" "', argument " "1"" of type '" "ldb_msg_element *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MessageElement___set__" "', argument " "1"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg1 = (ldb_msg_element *)(argp1);
|
||||
result = (PyObject *)ldb_msg_element___set__(arg1);
|
||||
arg1 = (ldb_message_element *)(argp1);
|
||||
result = (PyObject *)ldb_message_element___set__(arg1);
|
||||
resultobj = result;
|
||||
return resultobj;
|
||||
fail:
|
||||
@ -3814,7 +3851,7 @@ SWIGINTERN PyObject *_wrap_new_MessageElement(PyObject *SWIGUNUSEDPARM(self), Py
|
||||
PyObject *arg1 = (PyObject *) 0 ;
|
||||
int arg2 = (int) 0 ;
|
||||
char *arg3 = (char *) NULL ;
|
||||
ldb_msg_element *result = 0 ;
|
||||
ldb_message_element *result = 0 ;
|
||||
int val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int res3 ;
|
||||
@ -3843,8 +3880,8 @@ SWIGINTERN PyObject *_wrap_new_MessageElement(PyObject *SWIGUNUSEDPARM(self), Py
|
||||
}
|
||||
arg3 = (char *)(buf3);
|
||||
}
|
||||
result = (ldb_msg_element *)new_ldb_msg_element(arg1,arg2,(char const *)arg3);
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ldb_message_element, SWIG_POINTER_OWN | 0 );
|
||||
result = (ldb_message_element *)new_ldb_message_element(arg1,arg2,(char const *)arg3);
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ldb_message_element, SWIG_POINTER_NEW | 0 );
|
||||
if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
|
||||
return resultobj;
|
||||
fail:
|
||||
@ -3853,9 +3890,9 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ldb_msg_element___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_MessageElement___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg_element *arg1 = (ldb_msg_element *) 0 ;
|
||||
ldb_message_element *arg1 = (ldb_message_element *) 0 ;
|
||||
int result;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
@ -3865,10 +3902,10 @@ SWIGINTERN PyObject *_wrap_ldb_msg_element___len__(PyObject *SWIGUNUSEDPARM(self
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ldb_msg_element___len__" "', argument " "1"" of type '" "ldb_msg_element *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MessageElement___len__" "', argument " "1"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg1 = (ldb_msg_element *)(argp1);
|
||||
result = (int)ldb_msg_element___len__(arg1);
|
||||
arg1 = (ldb_message_element *)(argp1);
|
||||
result = (int)ldb_message_element___len__(arg1);
|
||||
resultobj = SWIG_From_int((int)(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
@ -3876,9 +3913,9 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ldb_msg_element_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_MessageElement_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg_element *arg1 = (ldb_msg_element *) 0 ;
|
||||
ldb_message_element *arg1 = (ldb_message_element *) 0 ;
|
||||
int arg2 ;
|
||||
PyObject *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
@ -3891,18 +3928,18 @@ SWIGINTERN PyObject *_wrap_ldb_msg_element_get(PyObject *SWIGUNUSEDPARM(self), P
|
||||
(char *) "self",(char *) "i", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ldb_msg_element_get",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:MessageElement_get",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ldb_msg_element_get" "', argument " "1"" of type '" "ldb_msg_element *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MessageElement_get" "', argument " "1"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg1 = (ldb_msg_element *)(argp1);
|
||||
arg1 = (ldb_message_element *)(argp1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ldb_msg_element_get" "', argument " "2"" of type '" "int""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MessageElement_get" "', argument " "2"" of type '" "int""'");
|
||||
}
|
||||
arg2 = (int)(val2);
|
||||
result = (PyObject *)ldb_msg_element_get(arg1,arg2);
|
||||
result = (PyObject *)ldb_message_element_get(arg1,arg2);
|
||||
resultobj = result;
|
||||
return resultobj;
|
||||
fail:
|
||||
@ -3910,9 +3947,9 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_delete_ldb_msg_element(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_delete_MessageElement(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg_element *arg1 = (ldb_msg_element *) 0 ;
|
||||
ldb_message_element *arg1 = (ldb_message_element *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
PyObject *swig_obj[1] ;
|
||||
@ -3921,10 +3958,10 @@ SWIGINTERN PyObject *_wrap_delete_ldb_msg_element(PyObject *SWIGUNUSEDPARM(self)
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ldb_message_element, SWIG_POINTER_DISOWN | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ldb_msg_element" "', argument " "1"" of type '" "ldb_msg_element *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MessageElement" "', argument " "1"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg1 = (ldb_msg_element *)(argp1);
|
||||
delete_ldb_msg_element(arg1);
|
||||
arg1 = (ldb_message_element *)(argp1);
|
||||
delete_ldb_message_element(arg1);
|
||||
|
||||
resultobj = SWIG_Py_Void();
|
||||
return resultobj;
|
||||
@ -3933,47 +3970,17 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ldb_msg_element___cmp__(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg_element *arg1 = (ldb_msg_element *) 0 ;
|
||||
ldb_msg_element *arg2 = (ldb_msg_element *) 0 ;
|
||||
int result;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
void *argp2 = 0 ;
|
||||
int res2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
char * kwnames[] = {
|
||||
(char *) "self",(char *)"arg2", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ldb_msg_element___cmp__",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ldb_msg_element___cmp__" "', argument " "1"" of type '" "ldb_msg_element *""'");
|
||||
}
|
||||
arg1 = (ldb_msg_element *)(argp1);
|
||||
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ldb_msg_element___cmp__" "', argument " "2"" of type '" "ldb_msg_element *""'");
|
||||
}
|
||||
arg2 = (ldb_msg_element *)(argp2);
|
||||
result = (int)ldb_msg_element_compare(arg1,arg2);
|
||||
resultobj = SWIG_From_int((int)(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *ldb_msg_element_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *MessageElement_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *obj;
|
||||
if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
|
||||
SWIG_TypeNewClientData(SWIGTYPE_p_ldb_message_element, SWIG_NewClientData(obj));
|
||||
return SWIG_Py_Void();
|
||||
}
|
||||
|
||||
SWIGINTERN PyObject *MessageElement_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
return SWIG_Python_InitShadowInstance(args);
|
||||
}
|
||||
|
||||
SWIGINTERN PyObject *_wrap_ldb_msg_list_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg *arg1 = (ldb_msg *) 0 ;
|
||||
@ -4118,7 +4125,7 @@ SWIGINTERN PyObject *_wrap_Message_find_element(PyObject *SWIGUNUSEDPARM(self),
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg *arg1 = (ldb_msg *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
ldb_msg_element *result = 0 ;
|
||||
ldb_message_element *result = 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int res2 ;
|
||||
@ -4144,7 +4151,7 @@ SWIGINTERN PyObject *_wrap_Message_find_element(PyObject *SWIGUNUSEDPARM(self),
|
||||
if (arg1 == NULL)
|
||||
SWIG_exception(SWIG_ValueError,
|
||||
"Message can not be None");
|
||||
result = (ldb_msg_element *)ldb_msg_find_element(arg1,(char const *)arg2);
|
||||
result = (ldb_message_element *)ldb_msg_find_element(arg1,(char const *)arg2);
|
||||
{
|
||||
if (result == NULL)
|
||||
PyErr_SetString(PyExc_KeyError, "no such element");
|
||||
@ -4163,7 +4170,7 @@ SWIGINTERN PyObject *_wrap_Message___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(
|
||||
PyObject *resultobj = 0;
|
||||
ldb_msg *arg1 = (ldb_msg *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
ldb_msg_element *arg3 = (ldb_msg_element *) 0 ;
|
||||
ldb_message_element *arg3 = (ldb_message_element *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
int res2 ;
|
||||
@ -4185,9 +4192,9 @@ SWIGINTERN PyObject *_wrap_Message___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(
|
||||
arg2 = (char *)(buf2);
|
||||
res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_ldb_message_element, 0 | 0 );
|
||||
if (!SWIG_IsOK(res3)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Message___setitem__" "', argument " "3"" of type '" "ldb_msg_element *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Message___setitem__" "', argument " "3"" of type '" "ldb_message_element *""'");
|
||||
}
|
||||
arg3 = (ldb_msg_element *)(argp3);
|
||||
arg3 = (ldb_message_element *)(argp3);
|
||||
if (arg1 == NULL)
|
||||
SWIG_exception(SWIG_ValueError,
|
||||
"Message can not be None");
|
||||
@ -4262,7 +4269,7 @@ check_1:
|
||||
fail:
|
||||
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Message___setitem__'.\n"
|
||||
" Possible C/C++ prototypes are:\n"
|
||||
" __setitem__(ldb_msg *,char const *,ldb_msg_element *)\n"
|
||||
" __setitem__(ldb_msg *,char const *,ldb_message_element *)\n"
|
||||
" __setitem__(ldb_msg *,char const *,PyObject *)\n");
|
||||
return NULL;
|
||||
}
|
||||
@ -4787,7 +4794,7 @@ SWIGINTERN PyObject *_wrap_Ldb_add(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
|
||||
arg1 = (ldb *)(argp1);
|
||||
{
|
||||
Py_ssize_t dict_pos, msg_pos;
|
||||
ldb_msg_element *msgel;
|
||||
ldb_message_element *msgel;
|
||||
PyObject *key, *value;
|
||||
|
||||
if (PyDict_Check(obj1)) {
|
||||
@ -5723,34 +5730,62 @@ fail:
|
||||
|
||||
static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"ldb_val_to_py_object", (PyCFunction) _wrap_ldb_val_to_py_object, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"new_Dn", (PyCFunction) _wrap_new_Dn, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"new_Dn", (PyCFunction) _wrap_new_Dn, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.__init__(ldb, string)\n"
|
||||
"Create a new DN.\n"
|
||||
""},
|
||||
{ (char *)"delete_Dn", (PyCFunction)_wrap_delete_Dn, METH_O, NULL},
|
||||
{ (char *)"Dn_validate", (PyCFunction)_wrap_Dn_validate, METH_O, NULL},
|
||||
{ (char *)"Dn_validate", (PyCFunction)_wrap_Dn_validate, METH_O, (char *)"\n"
|
||||
"S.validate() -> bool\n"
|
||||
"Validate DN is correct.\n"
|
||||
""},
|
||||
{ (char *)"Dn_get_casefold", (PyCFunction)_wrap_Dn_get_casefold, METH_O, NULL},
|
||||
{ (char *)"Dn___str__", (PyCFunction)_wrap_Dn___str__, METH_O, NULL},
|
||||
{ (char *)"Dn_parent", (PyCFunction)_wrap_Dn_parent, METH_O, NULL},
|
||||
{ (char *)"Dn_parent", (PyCFunction)_wrap_Dn_parent, METH_O, (char *)"\n"
|
||||
"S.parent() -> dn\n"
|
||||
"Get the parent for this DN.\n"
|
||||
""},
|
||||
{ (char *)"Dn___cmp__", (PyCFunction) _wrap_Dn___cmp__, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Dn_is_valid", (PyCFunction)_wrap_Dn_is_valid, METH_O, NULL},
|
||||
{ (char *)"Dn_is_special", (PyCFunction)_wrap_Dn_is_special, METH_O, NULL},
|
||||
{ (char *)"Dn_is_null", (PyCFunction)_wrap_Dn_is_null, METH_O, NULL},
|
||||
{ (char *)"Dn_is_special", (PyCFunction)_wrap_Dn_is_special, METH_O, (char *)"\n"
|
||||
"S.is_special() -> bool\n"
|
||||
"Check whether this is a special LDB DN.\n"
|
||||
""},
|
||||
{ (char *)"Dn_is_null", (PyCFunction)_wrap_Dn_is_null, METH_O, (char *)"\n"
|
||||
"S.is_null() -> bool\n"
|
||||
"Check whether this is a null DN.\n"
|
||||
""},
|
||||
{ (char *)"Dn_check_special", (PyCFunction) _wrap_Dn_check_special, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Dn___len__", (PyCFunction)_wrap_Dn___len__, METH_O, NULL},
|
||||
{ (char *)"Dn_add_child", (PyCFunction) _wrap_Dn_add_child, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Dn_add_base", (PyCFunction) _wrap_Dn_add_base, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Dn_canonical_str", (PyCFunction)_wrap_Dn_canonical_str, METH_O, NULL},
|
||||
{ (char *)"Dn_canonical_ex_str", (PyCFunction)_wrap_Dn_canonical_ex_str, METH_O, NULL},
|
||||
{ (char *)"Dn_add_child", (PyCFunction) _wrap_Dn_add_child, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.add_child(dn) -> None\n"
|
||||
"Add a child DN to this DN.\n"
|
||||
""},
|
||||
{ (char *)"Dn_add_base", (PyCFunction) _wrap_Dn_add_base, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.add_base(dn) -> None\n"
|
||||
"Add a base DN to this DN.\n"
|
||||
""},
|
||||
{ (char *)"Dn_canonical_str", (PyCFunction)_wrap_Dn_canonical_str, METH_O, (char *)"\n"
|
||||
"S.canonical_str() -> string\n"
|
||||
"Canonical version of this DN (like a posix path).\n"
|
||||
""},
|
||||
{ (char *)"Dn_canonical_ex_str", (PyCFunction)_wrap_Dn_canonical_ex_str, METH_O, (char *)"\n"
|
||||
"S.canonical_ex_str() -> string\n"
|
||||
"Canonical version of this DN (like a posix path, with terminating newline).\n"
|
||||
""},
|
||||
{ (char *)"Dn___repr__", (PyCFunction)_wrap_Dn___repr__, METH_O, NULL},
|
||||
{ (char *)"Dn___add__", (PyCFunction) _wrap_Dn___add__, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Dn_swigregister", Dn_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"Dn_swiginit", Dn_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"ldb_msg_element___iter__", (PyCFunction)_wrap_ldb_msg_element___iter__, METH_O, NULL},
|
||||
{ (char *)"ldb_msg_element___set__", (PyCFunction)_wrap_ldb_msg_element___set__, METH_O, NULL},
|
||||
{ (char *)"new_MessageElement", (PyCFunction) _wrap_new_MessageElement, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"ldb_msg_element___len__", (PyCFunction)_wrap_ldb_msg_element___len__, METH_O, NULL},
|
||||
{ (char *)"ldb_msg_element_get", (PyCFunction) _wrap_ldb_msg_element_get, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"delete_ldb_msg_element", (PyCFunction)_wrap_delete_ldb_msg_element, METH_O, NULL},
|
||||
{ (char *)"ldb_msg_element___cmp__", (PyCFunction) _wrap_ldb_msg_element___cmp__, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"ldb_msg_element_swigregister", ldb_msg_element_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"MessageElement___cmp__", (PyCFunction) _wrap_MessageElement___cmp__, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"MessageElement___iter__", (PyCFunction)_wrap_MessageElement___iter__, METH_O, NULL},
|
||||
{ (char *)"MessageElement___set__", (PyCFunction)_wrap_MessageElement___set__, METH_O, NULL},
|
||||
{ (char *)"new_MessageElement", (PyCFunction) _wrap_new_MessageElement, METH_VARARGS | METH_KEYWORDS, (char *)"Message element."},
|
||||
{ (char *)"MessageElement___len__", (PyCFunction)_wrap_MessageElement___len__, METH_O, NULL},
|
||||
{ (char *)"MessageElement_get", (PyCFunction) _wrap_MessageElement_get, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"delete_MessageElement", (PyCFunction)_wrap_delete_MessageElement, METH_O, NULL},
|
||||
{ (char *)"MessageElement_swigregister", MessageElement_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"MessageElement_swiginit", MessageElement_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"ldb_msg_list_elements", (PyCFunction) _wrap_ldb_msg_list_elements, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Message_dn_set", _wrap_Message_dn_set, METH_VARARGS, NULL},
|
||||
{ (char *)"Message_dn_get", (PyCFunction)_wrap_Message_dn_get, METH_O, NULL},
|
||||
@ -5766,40 +5801,97 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"Message_swiginit", Message_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"ldb_ldif_to_pyobject", (PyCFunction) _wrap_ldb_ldif_to_pyobject, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"new_Ldb", (PyCFunction)_wrap_new_Ldb, METH_NOARGS, NULL},
|
||||
{ (char *)"Ldb_connect", (PyCFunction) _wrap_Ldb_connect, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_connect", (PyCFunction) _wrap_Ldb_connect, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.connect(url,flags=0,options=None) -> None\n"
|
||||
"Connect to a LDB URL.\n"
|
||||
""},
|
||||
{ (char *)"delete_Ldb", (PyCFunction)_wrap_delete_Ldb, METH_O, NULL},
|
||||
{ (char *)"Ldb_search_ex", (PyCFunction) _wrap_Ldb_search_ex, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_delete", (PyCFunction) _wrap_Ldb_delete, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_rename", (PyCFunction) _wrap_Ldb_rename, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_delete", (PyCFunction) _wrap_Ldb_delete, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.delete(dn) -> None\n"
|
||||
"Remove an entry.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_rename", (PyCFunction) _wrap_Ldb_rename, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.rename(old_dn, new_dn) -> None\n"
|
||||
"Rename an entry.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_parse_control_strings", (PyCFunction) _wrap_Ldb_parse_control_strings, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_add", (PyCFunction) _wrap_Ldb_add, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_modify", (PyCFunction) _wrap_Ldb_modify, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_add", (PyCFunction) _wrap_Ldb_add, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.add(message) -> None\n"
|
||||
"Add an entry.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_modify", (PyCFunction) _wrap_Ldb_modify, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.modify(message) -> None\n"
|
||||
"Modify an entry.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_get_config_basedn", (PyCFunction)_wrap_Ldb_get_config_basedn, METH_O, NULL},
|
||||
{ (char *)"Ldb_get_root_basedn", (PyCFunction)_wrap_Ldb_get_root_basedn, METH_O, NULL},
|
||||
{ (char *)"Ldb_get_schema_basedn", (PyCFunction)_wrap_Ldb_get_schema_basedn, METH_O, NULL},
|
||||
{ (char *)"Ldb_get_default_basedn", (PyCFunction)_wrap_Ldb_get_default_basedn, METH_O, NULL},
|
||||
{ (char *)"Ldb_schema_format_value", (PyCFunction) _wrap_Ldb_schema_format_value, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_errstring", (PyCFunction)_wrap_Ldb_errstring, METH_O, NULL},
|
||||
{ (char *)"Ldb_set_create_perms", (PyCFunction) _wrap_Ldb_set_create_perms, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_set_modules_dir", (PyCFunction) _wrap_Ldb_set_modules_dir, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_set_debug", (PyCFunction) _wrap_Ldb_set_debug, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_set_opaque", (PyCFunction) _wrap_Ldb_set_opaque, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_get_opaque", (PyCFunction) _wrap_Ldb_get_opaque, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_transaction_start", (PyCFunction)_wrap_Ldb_transaction_start, METH_O, NULL},
|
||||
{ (char *)"Ldb_transaction_commit", (PyCFunction)_wrap_Ldb_transaction_commit, METH_O, NULL},
|
||||
{ (char *)"Ldb_transaction_cancel", (PyCFunction)_wrap_Ldb_transaction_cancel, METH_O, NULL},
|
||||
{ (char *)"Ldb_set_create_perms", (PyCFunction) _wrap_Ldb_set_create_perms, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_create_perms(mode) -> None\n"
|
||||
"Set mode to use when creating new LDB files.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_set_modules_dir", (PyCFunction) _wrap_Ldb_set_modules_dir, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_modules_dir(path) -> None\n"
|
||||
"Set path LDB should search for modules\n"
|
||||
""},
|
||||
{ (char *)"Ldb_set_debug", (PyCFunction) _wrap_Ldb_set_debug, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_debug(callback) -> None\n"
|
||||
"Set callback for LDB debug messages.\n"
|
||||
"The callback should accept a debug level and debug text.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_set_opaque", (PyCFunction) _wrap_Ldb_set_opaque, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_opaque(name, value) -> None\n"
|
||||
"Set an opaque value on this LDB connection. \n"
|
||||
":note: Passing incorrect values may cause crashes.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_get_opaque", (PyCFunction) _wrap_Ldb_get_opaque, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.get_opaque(name) -> value\n"
|
||||
"Get an opaque value set on this LDB connection. \n"
|
||||
":note: The returned value may not be useful in Python.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_transaction_start", (PyCFunction)_wrap_Ldb_transaction_start, METH_O, (char *)"\n"
|
||||
"S.transaction_start() -> None\n"
|
||||
"Start a new transaction.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_transaction_commit", (PyCFunction)_wrap_Ldb_transaction_commit, METH_O, (char *)"\n"
|
||||
"S.transaction_commit() -> None\n"
|
||||
"Commit currently active transaction.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_transaction_cancel", (PyCFunction)_wrap_Ldb_transaction_cancel, METH_O, (char *)"\n"
|
||||
"S.transaction_cancel() -> None\n"
|
||||
"Cancel currently active transaction.\n"
|
||||
""},
|
||||
{ (char *)"Ldb_schema_attribute_remove", (PyCFunction) _wrap_Ldb_schema_attribute_remove, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_schema_attribute_add", (PyCFunction) _wrap_Ldb_schema_attribute_add, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_setup_wellknown_attributes", (PyCFunction)_wrap_Ldb_setup_wellknown_attributes, METH_O, NULL},
|
||||
{ (char *)"Ldb___contains__", (PyCFunction) _wrap_Ldb___contains__, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_parse_ldif", (PyCFunction) _wrap_Ldb_parse_ldif, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Ldb_parse_ldif", (PyCFunction) _wrap_Ldb_parse_ldif, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.parse_ldif(ldif) -> iter(messages)\n"
|
||||
"Parse a string formatted using LDIF.\n"
|
||||
""},
|
||||
{ (char *)"Ldb___repr__", (PyCFunction)_wrap_Ldb___repr__, METH_O, NULL},
|
||||
{ (char *)"Ldb_swigregister", Ldb_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"Ldb_swiginit", Ldb_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"valid_attr_name", (PyCFunction) _wrap_valid_attr_name, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"timestring", (PyCFunction) _wrap_timestring, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"string_to_time", (PyCFunction) _wrap_string_to_time, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"register_module", (PyCFunction) _wrap_register_module, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"valid_attr_name", (PyCFunction) _wrap_valid_attr_name, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.valid_attr_name(name) -> bool\n"
|
||||
"Check whether the supplied name is a valid attribute name.\n"
|
||||
""},
|
||||
{ (char *)"timestring", (PyCFunction) _wrap_timestring, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.timestring(int) -> string\n"
|
||||
"Generate a LDAP time string from a UNIX timestamp\n"
|
||||
""},
|
||||
{ (char *)"string_to_time", (PyCFunction) _wrap_string_to_time, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.string_to_time(string) -> int\n"
|
||||
"Parse a LDAP time string into a UNIX timestamp.\n"
|
||||
""},
|
||||
{ (char *)"register_module", (PyCFunction) _wrap_register_module, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.register_module(module) -> None\n"
|
||||
"Register a LDB module.\n"
|
||||
""},
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
@ -5814,7 +5906,7 @@ static swig_type_info _swigt__p_ldb_context = {"_p_ldb_context", "struct ldb_con
|
||||
static swig_type_info _swigt__p_ldb_dn = {"_p_ldb_dn", "struct ldb_dn *|ldb_dn *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_ldb_ldif = {"_p_ldb_ldif", "struct ldb_ldif *|ldb_ldif *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_ldb_message = {"_p_ldb_message", "ldb_msg *|struct ldb_message *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_ldb_message_element = {"_p_ldb_message_element", "struct ldb_message_element *|ldb_msg_element *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_ldb_message_element = {"_p_ldb_message_element", "struct ldb_message_element *|ldb_message_element *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_ldb_module_ops = {"_p_ldb_module_ops", "struct ldb_module_ops *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_ldb_result = {"_p_ldb_result", "struct ldb_result *", 0, 0, (void*)0, 0};
|
||||
static swig_type_info _swigt__p_ldb_val = {"_p_ldb_val", "struct ldb_val *", 0, 0, (void*)0, 0};
|
||||
|
@ -1,10 +1,10 @@
|
||||
[PYTHON::swig_ldb]
|
||||
LIBRARY_REALNAME = _ldb.$(SHLIBEXT)
|
||||
PUBLIC_DEPENDENCIES = LIBLDB
|
||||
CFLAGS = -Ilib/ldb/include
|
||||
|
||||
swig_ldb_OBJ_FILES = lib/ldb/ldb_wrap.o
|
||||
swig_ldb_OBJ_FILES = $(ldbdir)/ldb_wrap.o
|
||||
$(swig_ldb_OBJ_FILES): CFLAGS+=-I$(ldbdir)/include
|
||||
|
||||
$(eval $(call python_py_module_template,ldb.py,lib/ldb/ldb.py))
|
||||
$(eval $(call python_py_module_template,ldb.py,$(ldbdir)/ldb.py))
|
||||
|
||||
$(swig_ldb_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
|
||||
|
@ -1,13 +1,13 @@
|
||||
################################################
|
||||
# Start SUBSYSTEM LIBLDB_CMDLINE
|
||||
[SUBSYSTEM::LIBLDB_CMDLINE]
|
||||
CFLAGS = -Ilib/ldb -Ilib/ldb/include
|
||||
CFLAGS = -I$(ldbdir) -I$(ldbdir)/include
|
||||
PUBLIC_DEPENDENCIES = LIBLDB LIBPOPT
|
||||
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL POPT_SAMBA POPT_CREDENTIALS gensec
|
||||
# End SUBSYSTEM LIBLDB_CMDLINE
|
||||
################################################
|
||||
|
||||
LIBLDB_CMDLINE_OBJ_FILES = lib/ldb/tools/cmdline.o
|
||||
LIBLDB_CMDLINE_OBJ_FILES = $(ldbdir)/tools/cmdline.o
|
||||
|
||||
################################################
|
||||
# Start BINARY ldbadd
|
||||
@ -19,7 +19,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
################################################
|
||||
|
||||
|
||||
ldbadd_OBJ_FILES = lib/ldb/tools/ldbadd.o
|
||||
ldbadd_OBJ_FILES = $(ldbdir)/tools/ldbadd.o
|
||||
|
||||
MANPAGES += $(ldbdir)/man/ldbadd.1
|
||||
|
||||
@ -32,7 +32,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
# End BINARY ldbdel
|
||||
################################################
|
||||
|
||||
ldbdel_OBJ_FILES = lib/ldb/tools/ldbdel.o
|
||||
ldbdel_OBJ_FILES = $(ldbdir)/tools/ldbdel.o
|
||||
|
||||
MANPAGES += $(ldbdir)/man/ldbdel.1
|
||||
|
||||
@ -45,7 +45,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
# End BINARY ldbmodify
|
||||
################################################
|
||||
|
||||
ldbmodify_OBJ_FILES = lib/ldb/tools/ldbmodify.o
|
||||
ldbmodify_OBJ_FILES = $(ldbdir)/tools/ldbmodify.o
|
||||
MANPAGES += $(ldbdir)/man/ldbmodify.1
|
||||
|
||||
################################################
|
||||
@ -57,7 +57,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
# End BINARY ldbsearch
|
||||
################################################
|
||||
|
||||
ldbsearch_OBJ_FILES = lib/ldb/tools/ldbsearch.o
|
||||
ldbsearch_OBJ_FILES = $(ldbdir)/tools/ldbsearch.o
|
||||
|
||||
MANPAGES += $(ldbdir)/man/ldbsearch.1
|
||||
|
||||
@ -70,7 +70,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
# End BINARY ldbedit
|
||||
################################################
|
||||
|
||||
ldbedit_OBJ_FILES = lib/ldb/tools/ldbedit.o
|
||||
ldbedit_OBJ_FILES = $(ldbdir)/tools/ldbedit.o
|
||||
|
||||
MANPAGES += $(ldbdir)/man/ldbedit.1
|
||||
|
||||
@ -83,7 +83,7 @@ PRIVATE_DEPENDENCIES = \
|
||||
# End BINARY ldbrename
|
||||
################################################
|
||||
|
||||
ldbrename_OBJ_FILES = lib/ldb/tools/ldbrename.o
|
||||
ldbrename_OBJ_FILES = $(ldbdir)/tools/ldbrename.o
|
||||
|
||||
MANPAGES += $(ldbdir)/man/ldbrename.1
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
|
||||
################################################
|
||||
# Start SUBSYSTEM MESSAGING
|
||||
[SUBSYSTEM::MESSAGING]
|
||||
PUBLIC_DEPENDENCIES = \
|
||||
LIBSAMBA-UTIL \
|
||||
@ -9,8 +6,13 @@ PUBLIC_DEPENDENCIES = \
|
||||
UNIX_PRIVS \
|
||||
UTIL_TDB \
|
||||
CLUSTER \
|
||||
LIBNDR
|
||||
# End SUBSYSTEM MESSAGING
|
||||
################################################
|
||||
LIBNDR \
|
||||
samba-socket
|
||||
|
||||
MESSAGING_OBJ_FILES = $(libmessagingsrcdir)/messaging.o
|
||||
|
||||
[PYTHON::python_messaging]
|
||||
LIBRARY_REALNAME = samba/messaging.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = MESSAGING LIBEVENTS python_irpc
|
||||
|
||||
python_messaging_OBJ_FILES = $(libmessagingsrcdir)/pymessaging.o
|
||||
|
@ -125,6 +125,7 @@ NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name);
|
||||
struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, const char *name);
|
||||
void irpc_remove_name(struct messaging_context *msg_ctx, const char *name);
|
||||
NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status);
|
||||
struct server_id messaging_get_server_id(struct messaging_context *msg_ctx);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1113,3 +1113,8 @@ void irpc_remove_name(struct messaging_context *msg_ctx, const char *name)
|
||||
tdb_unlock_bystring(t->tdb, name);
|
||||
talloc_free(t);
|
||||
}
|
||||
|
||||
struct server_id messaging_get_server_id(struct messaging_context *msg_ctx)
|
||||
{
|
||||
return msg_ctx->server_id;
|
||||
}
|
||||
|
559
source/lib/messaging/pymessaging.c
Normal file
559
source/lib/messaging/pymessaging.c
Normal file
@ -0,0 +1,559 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
|
||||
|
||||
Based on the equivalent for EJS:
|
||||
Copyright © Andrew Tridgell <tridge@samba.org> 2005
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include <Python.h>
|
||||
#include "libcli/util/pyerrors.h"
|
||||
#include "librpc/rpc/pyrpc.h"
|
||||
#include "lib/messaging/irpc.h"
|
||||
#include "lib/messaging/messaging.h"
|
||||
#include "lib/events/events.h"
|
||||
#include "cluster/cluster.h"
|
||||
#include "param/param.h"
|
||||
#include "librpc/gen_ndr/py_irpc.h"
|
||||
|
||||
PyAPI_DATA(PyTypeObject) messaging_Type;
|
||||
PyAPI_DATA(PyTypeObject) irpc_ClientConnectionType;
|
||||
|
||||
static bool server_id_from_py(PyObject *object, struct server_id *server_id)
|
||||
{
|
||||
if (!PyTuple_Check(object)) {
|
||||
PyErr_SetString(PyExc_ValueError, "Expected tuple");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PyTuple_Size(object) == 3) {
|
||||
return PyArg_ParseTuple(object, "iii", &server_id->id, &server_id->id2, &server_id->node);
|
||||
} else {
|
||||
int id, id2;
|
||||
if (!PyArg_ParseTuple(object, "ii", &id, &id2))
|
||||
return false;
|
||||
*server_id = cluster_id(id, id2);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
TALLOC_CTX *mem_ctx;
|
||||
struct messaging_context *msg_ctx;
|
||||
} messaging_Object;
|
||||
|
||||
PyObject *py_messaging_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
struct event_context *ev;
|
||||
const char *kwnames[] = { "own_id", "messaging_path", NULL };
|
||||
PyObject *own_id = Py_None;
|
||||
const char *messaging_path = NULL;
|
||||
messaging_Object *ret;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|Oz:connect",
|
||||
discard_const_p(char *, kwnames), &own_id, &messaging_path)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = PyObject_New(messaging_Object, &messaging_Type);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
|
||||
ret->mem_ctx = talloc_new(NULL);
|
||||
|
||||
ev = event_context_init(ret->mem_ctx);
|
||||
|
||||
if (messaging_path == NULL) {
|
||||
messaging_path = lp_messaging_path(ret, global_loadparm);
|
||||
} else {
|
||||
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
|
||||
}
|
||||
|
||||
if (own_id != Py_None) {
|
||||
struct server_id server_id;
|
||||
|
||||
if (!server_id_from_py(own_id, &server_id))
|
||||
return NULL;
|
||||
|
||||
ret->msg_ctx = messaging_init(ret->mem_ctx,
|
||||
messaging_path,
|
||||
server_id,
|
||||
lp_iconv_convenience(global_loadparm),
|
||||
ev);
|
||||
} else {
|
||||
ret->msg_ctx = messaging_client_init(ret->mem_ctx,
|
||||
messaging_path,
|
||||
lp_iconv_convenience(global_loadparm),
|
||||
ev);
|
||||
}
|
||||
|
||||
if (ret->msg_ctx == NULL) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "messaging_connect unable to create a messaging context");
|
||||
talloc_free(ret->mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (PyObject *)ret;
|
||||
}
|
||||
|
||||
static void py_messaging_dealloc(PyObject *self)
|
||||
{
|
||||
messaging_Object *iface = (messaging_Object *)self;
|
||||
talloc_free(iface->msg_ctx);
|
||||
PyObject_Del(self);
|
||||
}
|
||||
|
||||
static PyObject *py_messaging_send(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
messaging_Object *iface = (messaging_Object *)self;
|
||||
uint32_t msg_type;
|
||||
DATA_BLOB data;
|
||||
PyObject *target;
|
||||
NTSTATUS status;
|
||||
struct server_id server;
|
||||
const char *kwnames[] = { "target", "msg_type", "data", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Ois#|:send",
|
||||
discard_const_p(char *, kwnames), &target, &msg_type, &data.data, &data.length)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!server_id_from_py(target, &server))
|
||||
return NULL;
|
||||
|
||||
status = messaging_send(iface->msg_ctx, server, msg_type, &data);
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static void py_msg_callback_wrapper(struct messaging_context *msg, void *private,
|
||||
uint32_t msg_type,
|
||||
struct server_id server_id, DATA_BLOB *data)
|
||||
{
|
||||
PyObject *callback = (PyObject *)private;
|
||||
|
||||
PyObject_CallFunction(callback, discard_const_p(char, "i(iii)s#"), msg_type,
|
||||
server_id.id, server_id.id2, server_id.node,
|
||||
data->data, data->length);
|
||||
}
|
||||
|
||||
static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
messaging_Object *iface = (messaging_Object *)self;
|
||||
uint32_t msg_type = -1;
|
||||
PyObject *callback;
|
||||
NTSTATUS status;
|
||||
const char *kwnames[] = { "callback", "msg_type", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:send",
|
||||
discard_const_p(char *, kwnames), &callback, &msg_type)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_INCREF(callback);
|
||||
|
||||
if (msg_type == -1) {
|
||||
status = messaging_register_tmp(iface->msg_ctx, callback,
|
||||
py_msg_callback_wrapper, &msg_type);
|
||||
} else {
|
||||
status = messaging_register(iface->msg_ctx, callback,
|
||||
msg_type, py_msg_callback_wrapper);
|
||||
}
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return PyLong_FromLong(msg_type);
|
||||
}
|
||||
|
||||
static PyObject *py_messaging_deregister(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
messaging_Object *iface = (messaging_Object *)self;
|
||||
uint32_t msg_type = -1;
|
||||
PyObject *callback;
|
||||
const char *kwnames[] = { "callback", "msg_type", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:send",
|
||||
discard_const_p(char *, kwnames), &callback, &msg_type)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
messaging_deregister(iface->msg_ctx, msg_type, callback);
|
||||
|
||||
Py_DECREF(callback);
|
||||
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static PyObject *py_messaging_add_name(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
messaging_Object *iface = (messaging_Object *)self;
|
||||
NTSTATUS status;
|
||||
char *name;
|
||||
const char *kwnames[] = { "name", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|:send",
|
||||
discard_const_p(char *, kwnames), &name)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = irpc_add_name(iface->msg_ctx, name);
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
|
||||
static PyObject *py_messaging_remove_name(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
messaging_Object *iface = (messaging_Object *)self;
|
||||
char *name;
|
||||
const char *kwnames[] = { "name", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|:send",
|
||||
discard_const_p(char *, kwnames), &name)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
irpc_remove_name(iface->msg_ctx, name);
|
||||
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static PyMethodDef py_messaging_methods[] = {
|
||||
{ "send", (PyCFunction)py_messaging_send, METH_VARARGS|METH_KEYWORDS,
|
||||
"S.send(target, msg_type, data) -> None\nSend a message" },
|
||||
{ "register", (PyCFunction)py_messaging_register, METH_VARARGS|METH_KEYWORDS,
|
||||
"S.register(callback, msg_type=None) -> msg_type\nRegister a message handler" },
|
||||
{ "deregister", (PyCFunction)py_messaging_deregister, METH_VARARGS|METH_KEYWORDS,
|
||||
"S.deregister(callback, msg_type) -> None\nDeregister a message handler" },
|
||||
{ "add_name", (PyCFunction)py_messaging_add_name, METH_VARARGS|METH_KEYWORDS, "S.add_name(name) -> None\nListen on another name" },
|
||||
{ "remove_name", (PyCFunction)py_messaging_remove_name, METH_VARARGS|METH_KEYWORDS, "S.remove_name(name) -> None\nStop listening on a name" },
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
static PyObject *py_messaging_server_id(PyObject *obj, void *closure)
|
||||
{
|
||||
messaging_Object *iface = (messaging_Object *)obj;
|
||||
struct server_id server_id = messaging_get_server_id(iface->msg_ctx);
|
||||
|
||||
return Py_BuildValue("(iii)", server_id.id, server_id.id2,
|
||||
server_id.node);
|
||||
}
|
||||
|
||||
static PyGetSetDef py_messaging_getset[] = {
|
||||
{ discard_const_p(char, "server_id"), py_messaging_server_id, NULL,
|
||||
discard_const_p(char, "local server id") },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
||||
PyTypeObject messaging_Type = {
|
||||
PyObject_HEAD_INIT(NULL) 0,
|
||||
.tp_name = "irpc.Messaging",
|
||||
.tp_basicsize = sizeof(messaging_Object),
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
|
||||
.tp_new = py_messaging_connect,
|
||||
.tp_dealloc = py_messaging_dealloc,
|
||||
.tp_methods = py_messaging_methods,
|
||||
.tp_getset = py_messaging_getset,
|
||||
.tp_doc = "Messaging(own_id=None, messaging_path=None)\n" \
|
||||
"Create a new object that can be used to communicate with the peers in the specified messaging path.\n" \
|
||||
"If no path is specified, the default path from smb.conf will be used."
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
state of a irpc 'connection'
|
||||
*/
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
const char *server_name;
|
||||
struct server_id *dest_ids;
|
||||
struct messaging_context *msg_ctx;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
} irpc_ClientConnectionObject;
|
||||
|
||||
/*
|
||||
setup a context for talking to a irpc server
|
||||
example:
|
||||
status = irpc.connect("smb_server");
|
||||
*/
|
||||
|
||||
PyObject *py_irpc_connect(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
struct event_context *ev;
|
||||
const char *kwnames[] = { "server", "own_id", "messaging_path", NULL };
|
||||
char *server;
|
||||
const char *messaging_path = NULL;
|
||||
PyObject *own_id = Py_None;
|
||||
irpc_ClientConnectionObject *ret;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|Oz:connect",
|
||||
discard_const_p(char *, kwnames), &server, &own_id, &messaging_path)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = PyObject_New(irpc_ClientConnectionObject, &irpc_ClientConnectionType);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
|
||||
ret->mem_ctx = talloc_new(NULL);
|
||||
|
||||
ret->server_name = server;
|
||||
|
||||
ev = event_context_init(ret->mem_ctx);
|
||||
|
||||
if (messaging_path == NULL) {
|
||||
messaging_path = lp_messaging_path(ret, global_loadparm);
|
||||
} else {
|
||||
messaging_path = talloc_strdup(ret->mem_ctx, messaging_path);
|
||||
}
|
||||
|
||||
if (own_id != Py_None) {
|
||||
struct server_id server_id;
|
||||
|
||||
if (!server_id_from_py(own_id, &server_id))
|
||||
return NULL;
|
||||
|
||||
ret->msg_ctx = messaging_init(ret->mem_ctx,
|
||||
messaging_path,
|
||||
server_id,
|
||||
lp_iconv_convenience(global_loadparm),
|
||||
ev);
|
||||
} else {
|
||||
ret->msg_ctx = messaging_client_init(ret->mem_ctx,
|
||||
messaging_path,
|
||||
lp_iconv_convenience(global_loadparm),
|
||||
ev);
|
||||
}
|
||||
|
||||
if (ret->msg_ctx == NULL) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "irpc_connect unable to create a messaging context");
|
||||
talloc_free(ret->mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret->dest_ids = irpc_servers_byname(ret->msg_ctx, ret->mem_ctx, ret->server_name);
|
||||
if (ret->dest_ids == NULL || ret->dest_ids[0].id == 0) {
|
||||
talloc_free(ret->mem_ctx);
|
||||
PyErr_SetNTSTATUS(NT_STATUS_OBJECT_NAME_NOT_FOUND);
|
||||
return NULL;
|
||||
} else {
|
||||
return (PyObject *)ret;
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
struct irpc_request **reqs;
|
||||
int count;
|
||||
int current;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
py_data_unpack_fn unpack_fn;
|
||||
} irpc_ResultObject;
|
||||
|
||||
|
||||
static PyObject *irpc_result_next(irpc_ResultObject *iterator)
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
if (iterator->current >= iterator->count) {
|
||||
PyErr_SetString(PyExc_StopIteration, "No more results");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = irpc_call_recv(iterator->reqs[iterator->current]);
|
||||
iterator->current++;
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return iterator->unpack_fn(iterator->reqs[iterator->current-1]->r);
|
||||
}
|
||||
|
||||
static PyObject *irpc_result_len(irpc_ResultObject *self)
|
||||
{
|
||||
return PyLong_FromLong(self->count);
|
||||
}
|
||||
|
||||
static PyMethodDef irpc_result_methods[] = {
|
||||
{ "__len__", (PyCFunction)irpc_result_len, METH_NOARGS,
|
||||
"Number of elements returned"},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static void irpc_result_dealloc(PyObject *self)
|
||||
{
|
||||
talloc_free(((irpc_ResultObject *)self)->mem_ctx);
|
||||
PyObject_Del(self);
|
||||
}
|
||||
|
||||
PyTypeObject irpc_ResultIteratorType = {
|
||||
PyObject_HEAD_INIT(NULL) 0,
|
||||
.tp_name = "irpc.ResultIterator",
|
||||
.tp_basicsize = sizeof(irpc_ResultObject),
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
|
||||
.tp_iternext = (iternextfunc)irpc_result_next,
|
||||
.tp_iter = PyObject_SelfIter,
|
||||
.tp_methods = irpc_result_methods,
|
||||
.tp_dealloc = irpc_result_dealloc,
|
||||
};
|
||||
|
||||
static PyObject *py_irpc_call(irpc_ClientConnectionObject *p, struct PyNdrRpcMethodDef *method_def, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
void *ptr;
|
||||
struct irpc_request **reqs;
|
||||
int i, count;
|
||||
NTSTATUS status;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(NULL);
|
||||
irpc_ResultObject *ret;
|
||||
|
||||
/* allocate the C structure */
|
||||
ptr = talloc_zero_size(mem_ctx, method_def->table->calls[method_def->opnum].struct_size);
|
||||
if (ptr == NULL) {
|
||||
status = NT_STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* convert the mpr object into a C structure */
|
||||
if (!method_def->pack_in_data(args, kwargs, ptr)) {
|
||||
talloc_free(mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (count=0;p->dest_ids[count].id;count++) /* noop */ ;
|
||||
|
||||
/* we need to make a call per server */
|
||||
reqs = talloc_array(mem_ctx, struct irpc_request *, count);
|
||||
if (reqs == NULL) {
|
||||
status = NT_STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* make the actual calls */
|
||||
for (i=0;i<count;i++) {
|
||||
reqs[i] = irpc_call_send(p->msg_ctx, p->dest_ids[i],
|
||||
method_def->table, method_def->opnum, ptr, ptr);
|
||||
if (reqs[i] == NULL) {
|
||||
status = NT_STATUS_NO_MEMORY;
|
||||
goto done;
|
||||
}
|
||||
talloc_steal(reqs, reqs[i]);
|
||||
}
|
||||
|
||||
ret = PyObject_New(irpc_ResultObject, &irpc_ResultIteratorType);
|
||||
ret->mem_ctx = mem_ctx;
|
||||
ret->reqs = reqs;
|
||||
ret->count = count;
|
||||
ret->current = 0;
|
||||
ret->unpack_fn = method_def->unpack_out_data;
|
||||
|
||||
return (PyObject *)ret;
|
||||
done:
|
||||
talloc_free(mem_ctx);
|
||||
PyErr_SetNTSTATUS(status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static PyObject *py_irpc_call_wrapper(PyObject *self, PyObject *args, void *wrapped, PyObject *kwargs)
|
||||
{
|
||||
irpc_ClientConnectionObject *iface = (irpc_ClientConnectionObject *)self;
|
||||
struct PyNdrRpcMethodDef *md = wrapped;
|
||||
|
||||
return py_irpc_call(iface, md, args, kwargs);
|
||||
}
|
||||
|
||||
static void py_irpc_dealloc(PyObject *self)
|
||||
{
|
||||
irpc_ClientConnectionObject *iface = (irpc_ClientConnectionObject *)self;
|
||||
talloc_free(iface->mem_ctx);
|
||||
PyObject_Del(self);
|
||||
}
|
||||
|
||||
PyTypeObject irpc_ClientConnectionType = {
|
||||
PyObject_HEAD_INIT(NULL) 0,
|
||||
.tp_name = "irpc.ClientConnection",
|
||||
.tp_basicsize = sizeof(irpc_ClientConnectionObject),
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,
|
||||
.tp_new = py_irpc_connect,
|
||||
.tp_dealloc = py_irpc_dealloc,
|
||||
.tp_doc = "ClientConnection(server, own_id=None, messaging_path=None)\n" \
|
||||
"Create a new IRPC client connection to communicate with the servers in the specified path.\n" \
|
||||
"If no path is specified, the default path from smb.conf will be used."
|
||||
};
|
||||
|
||||
static bool irpc_AddNdrRpcMethods(PyTypeObject *ifacetype, const struct PyNdrRpcMethodDef *mds)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; mds[i].name; i++) {
|
||||
PyObject *ret;
|
||||
struct wrapperbase *wb = calloc(sizeof(struct wrapperbase), 1);
|
||||
|
||||
wb->name = discard_const_p(char, mds[i].name);
|
||||
wb->flags = PyWrapperFlag_KEYWORDS;
|
||||
wb->wrapper = (wrapperfunc)py_irpc_call_wrapper;
|
||||
wb->doc = discard_const_p(char, mds[i].doc);
|
||||
|
||||
ret = PyDescr_NewWrapper(ifacetype, wb, discard_const_p(void, &mds[i]));
|
||||
|
||||
PyDict_SetItemString(ifacetype->tp_dict, mds[i].name,
|
||||
(PyObject *)ret);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void initmessaging(void)
|
||||
{
|
||||
extern void initirpc(void);
|
||||
PyObject *mod;
|
||||
|
||||
if (PyType_Ready(&irpc_ClientConnectionType) < 0)
|
||||
return;
|
||||
|
||||
if (PyType_Ready(&messaging_Type) < 0)
|
||||
return;
|
||||
|
||||
if (PyType_Ready(&irpc_ResultIteratorType) < 0)
|
||||
return;
|
||||
|
||||
if (!irpc_AddNdrRpcMethods(&irpc_ClientConnectionType, py_ndr_irpc_methods))
|
||||
return;
|
||||
|
||||
mod = Py_InitModule3("messaging", NULL, "Internal RPC");
|
||||
if (mod == NULL)
|
||||
return;
|
||||
|
||||
initirpc();
|
||||
|
||||
Py_INCREF((PyObject *)&irpc_ClientConnectionType);
|
||||
PyModule_AddObject(mod, "ClientConnection", (PyObject *)&irpc_ClientConnectionType);
|
||||
|
||||
Py_INCREF((PyObject *)&messaging_Type);
|
||||
PyModule_AddObject(mod, "Messaging", (PyObject *)&messaging_Type);
|
||||
}
|
57
source/lib/messaging/tests/bindings.py
Normal file
57
source/lib/messaging/tests/bindings.py
Normal file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Unix SMB/CIFS implementation.
|
||||
# Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from samba.messaging import Messaging
|
||||
from unittest import TestCase
|
||||
|
||||
class MessagingTests(TestCase):
|
||||
def get_context(self, *args, **kwargs):
|
||||
kwargs["messaging_path"] = "."
|
||||
return Messaging(*args, **kwargs)
|
||||
|
||||
def test_register(self):
|
||||
x = self.get_context()
|
||||
def callback():
|
||||
pass
|
||||
msg_type = x.register(callback)
|
||||
x.deregister(callback, msg_type)
|
||||
|
||||
def test_assign_server_id(self):
|
||||
x = self.get_context()
|
||||
self.assertTrue(isinstance(x.server_id, tuple))
|
||||
self.assertEquals(3, len(x.server_id))
|
||||
|
||||
def test_ping_speed(self):
|
||||
server_ctx = self.get_context((0, 1))
|
||||
def ping_callback(src, data):
|
||||
server_ctx.send(src, data)
|
||||
def exit_callback():
|
||||
print "received exit"
|
||||
msg_ping = server_ctx.register(ping_callback)
|
||||
msg_exit = server_ctx.register(exit_callback)
|
||||
|
||||
def pong_callback():
|
||||
print "received pong"
|
||||
client_ctx = self.get_context((0, 2))
|
||||
msg_pong = client_ctx.register(pong_callback)
|
||||
|
||||
client_ctx.send((0,1), msg_ping, "testing")
|
||||
client_ctx.send((0,1), msg_ping, "")
|
||||
|
@ -5,12 +5,11 @@ TDR_REGF_OBJ_FILES = $(libregistrysrcdir)/tdr_regf.o
|
||||
|
||||
# Special support for external builddirs
|
||||
$(libregistrysrcdir)/regf.c: $(libregistrysrcdir)/tdr_regf.c
|
||||
$(srcdir)/$(libregistrysrcdir)/regf.c: $(libregistrysrcdir)/tdr_regf.c
|
||||
$(libregistrysrcdir)/tdr_regf.h: $(libregistrysrcdir)/tdr_regf.c
|
||||
$(libregistrysrcdir)/tdr_regf.c: $(srcdir)/$(libregistrysrcdir)/regf.idl
|
||||
@CPP="$(CPP)" srcdir="$(srcdir)" $(PERL) $(srcdir)/pidl/pidl $(PIDL_ARGS) \
|
||||
--header --outputdir=lib/registry \
|
||||
--tdr-parser -- $(srcdir)/$(libregistrysrcdir)/regf.idl
|
||||
$(libregistrysrcdir)/tdr_regf.c: $(libregistrysrcdir)/regf.idl
|
||||
@CPP="$(CPP)" $(PERL) $(pidldir)/pidl $(PIDL_ARGS) \
|
||||
--header --outputdir=$(libregistrysrcdir) \
|
||||
--tdr-parser -- $(libregistrysrcdir)/regf.idl
|
||||
|
||||
clean::
|
||||
@-rm -f $(libregistrysrcdir)/regf.h $(libregistrysrcdir)/tdr_regf*
|
||||
|
@ -144,6 +144,24 @@ WERROR hive_get_value_by_index(TALLOC_CTX *mem_ctx,
|
||||
return key->ops->enum_value(mem_ctx, key, idx, name, type, data);
|
||||
}
|
||||
|
||||
WERROR hive_get_sec_desc(TALLOC_CTX *mem_ctx,
|
||||
struct hive_key *key,
|
||||
struct security_descriptor **security)
|
||||
{
|
||||
if (key->ops->get_sec_desc == NULL)
|
||||
return WERR_NOT_SUPPORTED;
|
||||
|
||||
return key->ops->get_sec_desc(mem_ctx, key, security);
|
||||
}
|
||||
|
||||
WERROR hive_set_sec_desc(struct hive_key *key,
|
||||
const struct security_descriptor *security)
|
||||
{
|
||||
if (key->ops->set_sec_desc == NULL)
|
||||
return WERR_NOT_SUPPORTED;
|
||||
|
||||
return key->ops->set_sec_desc(key, security);
|
||||
}
|
||||
|
||||
WERROR hive_key_del_value(struct hive_key *key, const char *name)
|
||||
{
|
||||
|
@ -248,10 +248,10 @@ _PUBLIC_ WERROR reg_get_sec_desc(TALLOC_CTX *ctx,
|
||||
return WERR_INVALID_PARAM;
|
||||
|
||||
/* A 'real' set function has preference */
|
||||
if (key->context->ops->get_security == NULL)
|
||||
if (key->context->ops->get_sec_desc == NULL)
|
||||
return WERR_NOT_SUPPORTED;
|
||||
|
||||
return key->context->ops->get_security(ctx, key, secdesc);
|
||||
return key->context->ops->get_sec_desc(ctx, key, secdesc);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -282,27 +282,14 @@ _PUBLIC_ WERROR reg_key_flush(struct registry_key *key)
|
||||
return key->context->ops->flush_key(key);
|
||||
}
|
||||
|
||||
_PUBLIC_ WERROR reg_get_security(TALLOC_CTX *mem_ctx,
|
||||
const struct registry_key *key,
|
||||
struct security_descriptor **security)
|
||||
_PUBLIC_ WERROR reg_set_sec_desc(struct registry_key *key,
|
||||
const struct security_descriptor *security)
|
||||
{
|
||||
if (key == NULL)
|
||||
return WERR_INVALID_PARAM;
|
||||
|
||||
if (key->context->ops->get_security == NULL)
|
||||
if (key->context->ops->set_sec_desc == NULL)
|
||||
return WERR_NOT_SUPPORTED;
|
||||
|
||||
return key->context->ops->get_security(mem_ctx, key, security);
|
||||
}
|
||||
|
||||
_PUBLIC_ WERROR reg_set_security(struct registry_key *key,
|
||||
struct security_descriptor *security)
|
||||
{
|
||||
if (key == NULL)
|
||||
return WERR_INVALID_PARAM;
|
||||
|
||||
if (key->context->ops->set_security == NULL)
|
||||
return WERR_NOT_SUPPORTED;
|
||||
|
||||
return key->context->ops->set_security(key, security);
|
||||
return key->context->ops->set_sec_desc(key, security);
|
||||
}
|
||||
|
@ -274,7 +274,21 @@ static WERROR local_get_key_info(TALLOC_CTX *mem_ctx,
|
||||
last_change_time, max_subkeynamelen,
|
||||
max_valnamelen, max_valbufsize);
|
||||
}
|
||||
static WERROR local_get_sec_desc(TALLOC_CTX *mem_ctx,
|
||||
const struct registry_key *key,
|
||||
struct security_descriptor **security)
|
||||
{
|
||||
const struct local_key *local = (const struct local_key *)key;
|
||||
|
||||
return hive_get_sec_desc(mem_ctx, local->hive_key, security);
|
||||
}
|
||||
static WERROR local_set_sec_desc(struct registry_key *key,
|
||||
const struct security_descriptor *security)
|
||||
{
|
||||
const struct local_key *local = (const struct local_key *)key;
|
||||
|
||||
return hive_set_sec_desc(local->hive_key, security);
|
||||
}
|
||||
const static struct registry_operations local_ops = {
|
||||
.name = "local",
|
||||
.open_key = local_open_key,
|
||||
@ -288,6 +302,8 @@ const static struct registry_operations local_ops = {
|
||||
.delete_value = local_delete_value,
|
||||
.flush_key = local_flush_key,
|
||||
.get_key_info = local_get_key_info,
|
||||
.get_sec_desc = local_get_sec_desc,
|
||||
.set_sec_desc = local_set_sec_desc,
|
||||
};
|
||||
|
||||
WERROR reg_open_local(TALLOC_CTX *mem_ctx, struct registry_context **ctx)
|
||||
|
@ -45,7 +45,7 @@ WERROR reg_generate_diff_key(struct registry_key *oldkey,
|
||||
void *callback_data)
|
||||
{
|
||||
int i;
|
||||
struct registry_key *t1, *t2;
|
||||
struct registry_key *t1 = NULL, *t2 = NULL;
|
||||
char *tmppath;
|
||||
const char *keyname1;
|
||||
WERROR error, error1, error2;
|
||||
@ -295,7 +295,7 @@ _PUBLIC_ WERROR reg_diff_load(const char *filename,
|
||||
|
||||
/* Reset position in file */
|
||||
lseek(fd, 0, SEEK_SET);
|
||||
#if 0
|
||||
#if 0 /* These backends are not supported yet. */
|
||||
if (strncmp(hdr, "CREG", 4) == 0) {
|
||||
/* Must be a W9x CREG Config.pol file */
|
||||
return reg_creg_diff_load(diff, fd);
|
||||
@ -320,12 +320,33 @@ static WERROR reg_diff_apply_add_key(void *_ctx, const char *key_name)
|
||||
{
|
||||
struct registry_context *ctx = (struct registry_context *)_ctx;
|
||||
struct registry_key *tmp;
|
||||
char *buf, *buf_ptr;
|
||||
WERROR error;
|
||||
|
||||
/* Recursively create the path */
|
||||
buf = talloc_strdup(ctx, key_name);
|
||||
buf_ptr = buf;
|
||||
|
||||
while (*buf_ptr++ != '\0' ) {
|
||||
if (*buf_ptr == '\\') {
|
||||
*buf_ptr = '\0';
|
||||
error = reg_key_add_abs(ctx, ctx, buf, 0, NULL, &tmp);
|
||||
|
||||
if (!W_ERROR_EQUAL(error, WERR_ALREADY_EXISTS) &&
|
||||
!W_ERROR_IS_OK(error)) {
|
||||
DEBUG(0, ("Error adding new key '%s': %s\n",
|
||||
key_name, win_errstr(error)));
|
||||
return error;
|
||||
}
|
||||
*buf_ptr++ = '\\';
|
||||
}
|
||||
}
|
||||
|
||||
/* Add the key */
|
||||
error = reg_key_add_abs(ctx, ctx, key_name, 0, NULL, &tmp);
|
||||
|
||||
if (!W_ERROR_EQUAL(error, WERR_ALREADY_EXISTS) &&
|
||||
!W_ERROR_IS_OK(error)) {
|
||||
!W_ERROR_IS_OK(error)) {
|
||||
DEBUG(0, ("Error adding new key '%s': %s\n",
|
||||
key_name, win_errstr(error)));
|
||||
return error;
|
||||
|
@ -3,7 +3,7 @@
|
||||
Reading .REG files
|
||||
|
||||
Copyright (C) Jelmer Vernooij 2004-2007
|
||||
Copyright (C) Wilco Baan Hofman 2006
|
||||
Copyright (C) Wilco Baan Hofman 2006-2008
|
||||
|
||||
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
|
||||
@ -20,7 +20,7 @@
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* FIXME Newer .REG files, created by Windows XP and above use unicode UTF-16 */
|
||||
/* FIXME Newer .REG files, created by Windows XP and above use unicode UCS-2 */
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/registry/registry.h"
|
||||
@ -112,8 +112,8 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
|
||||
data->iconv_convenience = iconv_convenience;
|
||||
|
||||
if (filename) {
|
||||
data->fd = open(filename, O_CREAT, 0755);
|
||||
if (data->fd == -1) {
|
||||
data->fd = open(filename, O_CREAT|O_WRONLY, 0755);
|
||||
if (data->fd < 0) {
|
||||
DEBUG(0, ("Unable to open %s\n", filename));
|
||||
return WERR_BADFILE;
|
||||
}
|
||||
@ -121,7 +121,7 @@ _PUBLIC_ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
|
||||
data->fd = STDOUT_FILENO;
|
||||
}
|
||||
|
||||
fdprintf(data->fd, "%s\n", HEADER_STRING);
|
||||
fdprintf(data->fd, "%s\n\n", HEADER_STRING);
|
||||
|
||||
*callbacks = talloc(ctx, struct reg_diff_callbacks);
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
Unix SMB/CIFS implementation.
|
||||
Reading Registry.pol PReg registry files
|
||||
|
||||
Copyright (C) Wilco Baan Hofman 2006
|
||||
Copyright (C) Wilco Baan Hofman 2006-2008
|
||||
|
||||
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
|
||||
@ -23,9 +23,12 @@
|
||||
#include "lib/registry/registry.h"
|
||||
#include "system/filesys.h"
|
||||
#include "param/param.h"
|
||||
#include "librpc/gen_ndr/winreg.h"
|
||||
|
||||
struct preg_data {
|
||||
int fd;
|
||||
TALLOC_CTX *ctx;
|
||||
struct smb_iconv_convenience *ic;
|
||||
};
|
||||
|
||||
static WERROR preg_read_utf16(struct smb_iconv_convenience *ic, int fd, char *c)
|
||||
@ -38,14 +41,22 @@ static WERROR preg_read_utf16(struct smb_iconv_convenience *ic, int fd, char *c)
|
||||
push_codepoint(ic, c, v);
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
/* FIXME These functions need to be implemented */
|
||||
static WERROR reg_preg_diff_add_key(void *_data, const char *key_name)
|
||||
static WERROR preg_write_utf16(struct smb_iconv_convenience *ic, int fd, const char *string)
|
||||
{
|
||||
codepoint_t v;
|
||||
uint16_t i;
|
||||
size_t size;
|
||||
|
||||
for (i = 0; i < strlen(string); i+=size) {
|
||||
v = next_codepoint(ic, &string[i], &size);
|
||||
if (write(fd, &v, 2) < 2) {
|
||||
return WERR_GENERAL_FAILURE;
|
||||
}
|
||||
}
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_del_key(void *_data, const char *key_name)
|
||||
/* PReg does not support adding keys. */
|
||||
static WERROR reg_preg_diff_add_key(void *_data, const char *key_name)
|
||||
{
|
||||
return WERR_OK;
|
||||
}
|
||||
@ -54,24 +65,73 @@ static WERROR reg_preg_diff_set_value(void *_data, const char *key_name,
|
||||
const char *value_name,
|
||||
uint32_t value_type, DATA_BLOB value_data)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
uint32_t buf;
|
||||
|
||||
preg_write_utf16(data->ic, data->fd, "[");
|
||||
preg_write_utf16(data->ic, data->fd, key_name);
|
||||
preg_write_utf16(data->ic, data->fd, ";");
|
||||
preg_write_utf16(data->ic, data->fd, value_name);
|
||||
preg_write_utf16(data->ic, data->fd, ";");
|
||||
SIVAL(&buf, 0, value_type);
|
||||
write(data->fd, &buf, sizeof(uint32_t));
|
||||
preg_write_utf16(data->ic, data->fd, ";");
|
||||
SIVAL(&buf, 0, value_data.length);
|
||||
write(data->fd, &buf, sizeof(uint32_t));
|
||||
preg_write_utf16(data->ic, data->fd, ";");
|
||||
write(data->fd, value_data.data, value_data.length);
|
||||
preg_write_utf16(data->ic, data->fd, "]");
|
||||
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_del_key(void *_data, const char *key_name)
|
||||
{
|
||||
struct preg_data *data = _data;
|
||||
char *parent_name;
|
||||
DATA_BLOB blob;
|
||||
|
||||
parent_name = talloc_strndup(data->ctx, key_name, strrchr(key_name, '\\')-key_name);
|
||||
blob.data = (void *)talloc_strndup(data->ctx, key_name+(strrchr(key_name, '\\')-key_name)+1,
|
||||
strlen(key_name)-(strrchr(key_name, '\\')-key_name));
|
||||
blob.length = strlen((char *)blob.data)+1;
|
||||
|
||||
|
||||
/* FIXME: These values should be accumulated to be written at done(). */
|
||||
return reg_preg_diff_set_value(data, parent_name, "**DeleteKeys", REG_SZ, blob);
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_del_value(void *_data, const char *key_name,
|
||||
const char *value_name)
|
||||
{
|
||||
return WERR_OK;
|
||||
struct preg_data *data = _data;
|
||||
char *val;
|
||||
DATA_BLOB blob;
|
||||
|
||||
val = talloc_asprintf(data->ctx, "**Del.%s", value_name);
|
||||
|
||||
blob.data = (void *)talloc(data->ctx, uint32_t);
|
||||
*(uint32_t *)blob.data = 0;
|
||||
blob.length = 4;
|
||||
return reg_preg_diff_set_value(data, key_name, val, REG_DWORD, blob);
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_del_all_values(void *_data, const char *key_name)
|
||||
{
|
||||
return WERR_OK;
|
||||
struct preg_data *data = _data;
|
||||
DATA_BLOB blob;
|
||||
|
||||
blob.data = (void *)talloc(data->ctx, uint32_t);
|
||||
*(uint32_t *)blob.data = 0;
|
||||
blob.length = 4;
|
||||
|
||||
return reg_preg_diff_set_value(data, key_name, "**DelVals.", REG_DWORD, blob);
|
||||
}
|
||||
|
||||
static WERROR reg_preg_diff_done(void *_data)
|
||||
{
|
||||
struct preg_data *data = (struct preg_data *)_data;
|
||||
|
||||
|
||||
close(data->fd);
|
||||
talloc_free(data);
|
||||
return WERR_OK;
|
||||
@ -81,6 +141,7 @@ static WERROR reg_preg_diff_done(void *_data)
|
||||
* Save registry diff
|
||||
*/
|
||||
_PUBLIC_ WERROR reg_preg_diff_save(TALLOC_CTX *ctx, const char *filename,
|
||||
struct smb_iconv_convenience *ic,
|
||||
struct reg_diff_callbacks **callbacks,
|
||||
void **callback_data)
|
||||
{
|
||||
@ -95,18 +156,22 @@ _PUBLIC_ WERROR reg_preg_diff_save(TALLOC_CTX *ctx, const char *filename,
|
||||
*callback_data = data;
|
||||
|
||||
if (filename) {
|
||||
data->fd = open(filename, O_CREAT, 0755);
|
||||
if (data->fd == -1) {
|
||||
data->fd = open(filename, O_CREAT|O_WRONLY, 0755);
|
||||
if (data->fd < 0) {
|
||||
DEBUG(0, ("Unable to open %s\n", filename));
|
||||
return WERR_BADFILE;
|
||||
}
|
||||
} else {
|
||||
data->fd = STDOUT_FILENO;
|
||||
}
|
||||
snprintf(preg_header.hdr, 4, "PReg");
|
||||
|
||||
strncpy(preg_header.hdr, "PReg", 4);
|
||||
SIVAL(&preg_header, 4, 1);
|
||||
write(data->fd, (uint8_t *)&preg_header,8);
|
||||
|
||||
data->ctx = ctx;
|
||||
data->ic = ic;
|
||||
|
||||
*callbacks = talloc(ctx, struct reg_diff_callbacks);
|
||||
|
||||
(*callbacks)->add_key = reg_preg_diff_add_key;
|
||||
@ -149,6 +214,8 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd,
|
||||
ret = WERR_GENERAL_FAILURE;
|
||||
goto cleanup;
|
||||
}
|
||||
preg_header.version = IVAL(&preg_header.version, 0);
|
||||
|
||||
if (strncmp(preg_header.hdr, "PReg", 4) != 0) {
|
||||
DEBUG(0, ("This file is not a valid preg registry file\n"));
|
||||
ret = WERR_GENERAL_FAILURE;
|
||||
@ -177,7 +244,8 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd,
|
||||
*buf_ptr != ';' && buf_ptr-buf < buf_size) {
|
||||
buf_ptr++;
|
||||
}
|
||||
key = talloc_asprintf(mem_ctx, "\\%s", buf);
|
||||
buf[buf_ptr-buf] = '\0';
|
||||
key = talloc_strdup(mem_ctx, buf);
|
||||
|
||||
/* Get the name */
|
||||
buf_ptr = buf;
|
||||
@ -185,6 +253,7 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd,
|
||||
*buf_ptr != ';' && buf_ptr-buf < buf_size) {
|
||||
buf_ptr++;
|
||||
}
|
||||
buf[buf_ptr-buf] = '\0';
|
||||
value_name = talloc_strdup(mem_ctx, buf);
|
||||
|
||||
/* Get the type */
|
||||
@ -193,6 +262,8 @@ _PUBLIC_ WERROR reg_preg_diff_load(int fd,
|
||||
ret = WERR_GENERAL_FAILURE;
|
||||
goto cleanup;
|
||||
}
|
||||
value_type = IVAL(&value_type, 0);
|
||||
|
||||
/* Read past delimiter */
|
||||
buf_ptr = buf;
|
||||
if (!(W_ERROR_IS_OK(preg_read_utf16(iconv_convenience, fd, buf_ptr)) &&
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "librpc/gen_ndr/winreg.h"
|
||||
#include "param/param.h"
|
||||
#include "lib/registry/registry.h"
|
||||
#include "libcli/security/security.h"
|
||||
|
||||
|
||||
static struct hive_operations reg_backend_regf;
|
||||
|
||||
@ -1915,9 +1917,12 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx,
|
||||
{
|
||||
struct regf_data *regf;
|
||||
struct regf_hdr *regf_hdr;
|
||||
int i;
|
||||
struct nk_block nk;
|
||||
struct sk_block sk;
|
||||
WERROR error;
|
||||
DATA_BLOB data;
|
||||
struct security_descriptor *sd;
|
||||
uint32_t sk_offset;
|
||||
|
||||
regf = (struct regf_data *)talloc_zero(NULL, struct regf_data);
|
||||
|
||||
@ -1945,20 +1950,17 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx,
|
||||
regf_hdr->version.minor = minor_version;
|
||||
regf_hdr->last_block = 0x1000; /* Block size */
|
||||
regf_hdr->description = talloc_strdup(regf_hdr,
|
||||
"registry created by Samba 4");
|
||||
"Registry created by Samba 4");
|
||||
W_ERROR_HAVE_NO_MEMORY(regf_hdr->description);
|
||||
regf_hdr->chksum = 0;
|
||||
|
||||
regf->header = regf_hdr;
|
||||
|
||||
i = 0;
|
||||
/* Create all hbin blocks */
|
||||
regf->hbins = talloc_array(regf, struct hbin_block *, 1);
|
||||
W_ERROR_HAVE_NO_MEMORY(regf->hbins);
|
||||
regf->hbins[0] = NULL;
|
||||
|
||||
regf_hdr->data_offset = -1; /* FIXME */
|
||||
|
||||
nk.header = "nk";
|
||||
nk.type = REG_SUB_KEY;
|
||||
unix_to_nt_time(&nk.last_change, time(NULL));
|
||||
@ -1971,27 +1973,67 @@ WERROR reg_create_regf_file(TALLOC_CTX *parent_ctx,
|
||||
nk.num_values = 0;
|
||||
nk.values_offset = -1;
|
||||
memset(nk.unk3, 0, 5);
|
||||
nk.clsname_offset = -1; /* FIXME: fill in */
|
||||
nk.clsname_offset = -1;
|
||||
nk.clsname_length = 0;
|
||||
nk.key_name = "";
|
||||
nk.sk_offset = 0x80;
|
||||
nk.key_name = "SambaRootKey";
|
||||
|
||||
nk.sk_offset = -1; /* FIXME: fill in */
|
||||
/*
|
||||
* It should be noted that changing the key_name to something shorter
|
||||
* creates a shorter nk block, which makes the position of the sk block
|
||||
* change. All Windows registries I've seen have the sk at 0x80.
|
||||
* I therefore recommend that our regf files share that offset -- Wilco
|
||||
*/
|
||||
|
||||
/* Create a security descriptor. */
|
||||
sd = security_descriptor_dacl_create(regf,
|
||||
0,
|
||||
NULL, NULL,
|
||||
SID_NT_AUTHENTICATED_USERS,
|
||||
SEC_ACE_TYPE_ACCESS_ALLOWED,
|
||||
SEC_GENERIC_ALL,
|
||||
SEC_ACE_FLAG_OBJECT_INHERIT,
|
||||
NULL);
|
||||
|
||||
/* Push the security descriptor to a blob */
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_struct_blob(&data, regf, NULL,
|
||||
sd, (ndr_push_flags_fn_t)ndr_push_security_descriptor))) {
|
||||
DEBUG(0, ("Unable to push security descriptor\n"));
|
||||
return WERR_GENERAL_FAILURE;
|
||||
}
|
||||
|
||||
ZERO_STRUCT(sk);
|
||||
sk.header = "sk";
|
||||
sk.prev_offset = 0x80;
|
||||
sk.next_offset = 0x80;
|
||||
sk.ref_cnt = 1;
|
||||
sk.rec_size = data.length;
|
||||
sk.sec_desc = data.data;
|
||||
|
||||
/* Store the new nk key */
|
||||
regf->header->data_offset = hbin_store_tdr(regf,
|
||||
(tdr_push_fn_t)tdr_push_nk_block,
|
||||
&nk);
|
||||
/* Store the sk block */
|
||||
sk_offset = hbin_store_tdr(regf,
|
||||
(tdr_push_fn_t) tdr_push_sk_block,
|
||||
&sk);
|
||||
if (sk_offset != 0x80) {
|
||||
DEBUG(0, ("Error storing sk block, should be at 0x80, stored at 0x%x\n", nk.sk_offset));
|
||||
return WERR_GENERAL_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
*key = (struct hive_key *)regf_get_key(parent_ctx, regf,
|
||||
regf->header->data_offset);
|
||||
|
||||
/* We can drop our own reference now that *key will have created one */
|
||||
talloc_free(regf);
|
||||
|
||||
error = regf_save_hbin(regf);
|
||||
if (!W_ERROR_IS_OK(error)) {
|
||||
return error;
|
||||
}
|
||||
|
||||
/* We can drop our own reference now that *key will have created one */
|
||||
talloc_free(regf);
|
||||
|
||||
return WERR_OK;
|
||||
}
|
||||
|
@ -186,6 +186,12 @@ WERROR hive_get_value_by_index(TALLOC_CTX *mem_ctx,
|
||||
struct hive_key *key, uint32_t idx,
|
||||
const char **name,
|
||||
uint32_t *type, DATA_BLOB *data);
|
||||
WERROR hive_get_sec_desc(TALLOC_CTX *mem_ctx,
|
||||
struct hive_key *key,
|
||||
struct security_descriptor **security);
|
||||
|
||||
WERROR hive_set_sec_desc(struct hive_key *key,
|
||||
const struct security_descriptor *security);
|
||||
|
||||
WERROR hive_key_del_value(struct hive_key *key, const char *name);
|
||||
|
||||
@ -314,11 +320,11 @@ struct registry_operations {
|
||||
uint32_t *type,
|
||||
DATA_BLOB *data);
|
||||
|
||||
WERROR (*get_security) (TALLOC_CTX *mem_ctx,
|
||||
WERROR (*get_sec_desc) (TALLOC_CTX *mem_ctx,
|
||||
const struct registry_key *key,
|
||||
struct security_descriptor **security);
|
||||
|
||||
WERROR (*set_security) (struct registry_key *key,
|
||||
WERROR (*set_sec_desc) (struct registry_key *key,
|
||||
const struct security_descriptor *security);
|
||||
|
||||
WERROR (*load_key) (struct registry_key *key,
|
||||
@ -463,12 +469,8 @@ struct registry_key *reg_import_hive_key(struct registry_context *ctx,
|
||||
struct hive_key *hive,
|
||||
uint32_t predef_key,
|
||||
const char **elements);
|
||||
WERROR reg_get_security(TALLOC_CTX *mem_ctx,
|
||||
const struct registry_key *key,
|
||||
struct security_descriptor **security);
|
||||
|
||||
WERROR reg_set_security(struct registry_key *key,
|
||||
struct security_descriptor *security);
|
||||
WERROR reg_set_sec_desc(struct registry_key *key,
|
||||
const struct security_descriptor *security);
|
||||
|
||||
struct reg_diff_callbacks {
|
||||
WERROR (*add_key) (void *callback_data, const char *key_name);
|
||||
@ -492,11 +494,19 @@ WERROR reg_dotreg_diff_save(TALLOC_CTX *ctx, const char *filename,
|
||||
struct smb_iconv_convenience *iconv_convenience,
|
||||
struct reg_diff_callbacks **callbacks,
|
||||
void **callback_data);
|
||||
WERROR reg_preg_diff_save(TALLOC_CTX *ctx, const char *filename,
|
||||
struct smb_iconv_convenience *ic,
|
||||
struct reg_diff_callbacks **callbacks,
|
||||
void **callback_data);
|
||||
WERROR reg_generate_diff_key(struct registry_key *oldkey,
|
||||
struct registry_key *newkey,
|
||||
const char *path,
|
||||
const struct reg_diff_callbacks *callbacks,
|
||||
void *callback_data);
|
||||
WERROR reg_diff_load(const char *filename,
|
||||
struct smb_iconv_convenience *iconv_convenience,
|
||||
const struct reg_diff_callbacks *callbacks,
|
||||
void *callback_data);
|
||||
|
||||
|
||||
|
||||
|
@ -16,7 +16,11 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module registry
|
||||
%define DOCSTRING
|
||||
"Access to various registry formats and the Samba registry."
|
||||
%enddef
|
||||
|
||||
%module(docstring=DOCSTRING) registry
|
||||
|
||||
%{
|
||||
/* Include headers */
|
||||
@ -93,11 +97,20 @@ WERROR reg_open_local(TALLOC_CTX *parent_ctx, struct registry_context **ctx);
|
||||
typedef struct registry_context {
|
||||
%extend {
|
||||
|
||||
%feature("docstring") get_predefined_key_by_name "S.get_predefined_key_by_name(name) -> key\n"
|
||||
"Find a predefined key by name";
|
||||
WERROR get_predefined_key_by_name(const char *name,
|
||||
struct registry_key **key);
|
||||
|
||||
%feature("docstring") key_del_abs "S.key_del_abs(name) -> None\n"
|
||||
"Delete a key by absolute path.";
|
||||
WERROR key_del_abs(const char *path);
|
||||
%feature("docstring") get_predefined_key "S.get_predefined_key(hkey_id) -> key\n"
|
||||
"Find a predefined key by id";
|
||||
WERROR get_predefined_key(uint32_t hkey_id, struct registry_key **key);
|
||||
%feature("docstring") diff_apply "S.diff_apply(filename) -> None\n"
|
||||
"Apply the diff from the specified file";
|
||||
|
||||
WERROR diff_apply(const char *filename);
|
||||
WERROR generate_diff(struct registry_context *ctx2, const struct reg_diff_callbacks *callbacks,
|
||||
void *callback_data);
|
||||
@ -106,6 +119,8 @@ typedef struct registry_context {
|
||||
const char **elements=NULL);
|
||||
|
||||
struct registry_key *import_hive_key(struct hive_key *hive, uint32_t predef_key, const char **elements);
|
||||
%feature("docstring") mount_hive "S.mount_hive(key, predef_name) -> None\n"
|
||||
"Mount the specified key at the specified path.";
|
||||
WERROR mount_hive(struct hive_key *key, const char *predef_name)
|
||||
{
|
||||
int i;
|
||||
@ -130,6 +145,7 @@ typedef struct registry_context {
|
||||
$result = SWIG_NewPointerObj(*$1, SWIGTYPE_p_hive_key, 0);
|
||||
}
|
||||
|
||||
%feature("docstring") reg_open_hive "S.__init__(location, session_info=None, credentials=None, loadparm_context=None)";
|
||||
%rename(hive_key) reg_open_hive;
|
||||
WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
|
||||
struct auth_session_info *session_info,
|
||||
@ -138,6 +154,7 @@ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
|
||||
struct loadparm_context *lp_ctx,
|
||||
struct hive_key **root);
|
||||
|
||||
%feature("docstring") reg_open_ldb_file "open_ldb(location, session_info=None, credentials=None, loadparm_context=None) -> key";
|
||||
%rename(open_ldb) reg_open_ldb_file;
|
||||
WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
|
||||
struct auth_session_info *session_info,
|
||||
@ -146,10 +163,12 @@ WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location,
|
||||
struct loadparm_context *lp_ctx,
|
||||
struct hive_key **k);
|
||||
|
||||
%feature("docstring") reg_create_directory "create_dir(location) -> key";
|
||||
%rename(create_dir) reg_create_directory;
|
||||
WERROR reg_create_directory(TALLOC_CTX *parent_ctx,
|
||||
const char *location, struct hive_key **key);
|
||||
|
||||
%feature("docstring") reg_open_directory "open_dir(location) -> key";
|
||||
%rename(open_dir) reg_open_directory;
|
||||
WERROR reg_open_directory(TALLOC_CTX *parent_ctx,
|
||||
const char *location, struct hive_key **key);
|
||||
@ -158,15 +177,24 @@ WERROR reg_open_directory(TALLOC_CTX *parent_ctx,
|
||||
|
||||
typedef struct hive_key {
|
||||
%extend {
|
||||
%feature("docstring") del "S.del(name) -> None\n"
|
||||
"Delete a subkey";
|
||||
WERROR del(const char *name);
|
||||
%feature("docstring") flush "S.flush() -> None\n"
|
||||
"Flush this key to disk";
|
||||
WERROR flush(void);
|
||||
%feature("docstring") del_value "S.del_value(name) -> None\n"
|
||||
"Delete a value";
|
||||
WERROR del_value(const char *name);
|
||||
%feature("docstring") set_value "S.set_value(name, type, data) -> None\n"
|
||||
"Set a value";
|
||||
WERROR set_value(const char *name, uint32_t type, const DATA_BLOB data);
|
||||
}
|
||||
} hive_key;
|
||||
|
||||
%rename(open_samba) reg_open_samba;
|
||||
|
||||
%feature("docstring") reg_open_samba "open_samba() -> reg";
|
||||
WERROR reg_open_samba(TALLOC_CTX *mem_ctx,
|
||||
struct registry_context **ctx,
|
||||
struct event_context *ev_ctx,
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Access to various registry formats and the Samba registry.
|
||||
"""
|
||||
|
||||
import _registry
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
@ -66,6 +70,41 @@ Registry = _registry.Registry
|
||||
class reg(object):
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
__repr__ = _swig_repr
|
||||
def get_predefined_key_by_name(*args, **kwargs):
|
||||
"""
|
||||
S.get_predefined_key_by_name(name) -> key
|
||||
Find a predefined key by name
|
||||
"""
|
||||
return _registry.reg_get_predefined_key_by_name(*args, **kwargs)
|
||||
|
||||
def key_del_abs(*args, **kwargs):
|
||||
"""
|
||||
S.key_del_abs(name) -> None
|
||||
Delete a key by absolute path.
|
||||
"""
|
||||
return _registry.reg_key_del_abs(*args, **kwargs)
|
||||
|
||||
def get_predefined_key(*args, **kwargs):
|
||||
"""
|
||||
S.get_predefined_key(hkey_id) -> key
|
||||
Find a predefined key by id
|
||||
"""
|
||||
return _registry.reg_get_predefined_key(*args, **kwargs)
|
||||
|
||||
def diff_apply(*args, **kwargs):
|
||||
"""
|
||||
S.diff_apply(filename) -> None
|
||||
Apply the diff from the specified file
|
||||
"""
|
||||
return _registry.reg_diff_apply(*args, **kwargs)
|
||||
|
||||
def mount_hive(*args):
|
||||
"""
|
||||
S.mount_hive(key, predef_name) -> None
|
||||
Mount the specified key at the specified path.
|
||||
"""
|
||||
return _registry.reg_mount_hive(*args)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
_registry.reg_swiginit(self,_registry.new_reg(*args, **kwargs))
|
||||
__swig_destroy__ = _registry.delete_reg
|
||||
@ -79,11 +118,26 @@ reg.mount_hive = new_instancemethod(_registry.reg_mount_hive,None,reg)
|
||||
reg_swigregister = _registry.reg_swigregister
|
||||
reg_swigregister(reg)
|
||||
|
||||
hive_key = _registry.hive_key
|
||||
open_ldb = _registry.open_ldb
|
||||
create_dir = _registry.create_dir
|
||||
open_dir = _registry.open_dir
|
||||
open_samba = _registry.open_samba
|
||||
|
||||
def hive_key(*args, **kwargs):
|
||||
"""S.__init__(location, session_info=None, credentials=None, loadparm_context=None)"""
|
||||
return _registry.hive_key(*args, **kwargs)
|
||||
|
||||
def open_ldb(*args, **kwargs):
|
||||
"""open_ldb(location, session_info=None, credentials=None, loadparm_context=None) -> key"""
|
||||
return _registry.open_ldb(*args, **kwargs)
|
||||
|
||||
def create_dir(*args, **kwargs):
|
||||
"""create_dir(location) -> key"""
|
||||
return _registry.create_dir(*args, **kwargs)
|
||||
|
||||
def open_dir(*args, **kwargs):
|
||||
"""open_dir(location) -> key"""
|
||||
return _registry.open_dir(*args, **kwargs)
|
||||
|
||||
def open_samba(*args, **kwargs):
|
||||
"""open_samba() -> reg"""
|
||||
return _registry.open_samba(*args, **kwargs)
|
||||
HKEY_CLASSES_ROOT = _registry.HKEY_CLASSES_ROOT
|
||||
HKEY_CURRENT_USER = _registry.HKEY_CURRENT_USER
|
||||
HKEY_LOCAL_MACHINE = _registry.HKEY_LOCAL_MACHINE
|
||||
|
@ -3798,10 +3798,22 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"reg_get_predef_name", (PyCFunction) _wrap_reg_get_predef_name, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"str_regtype", (PyCFunction) _wrap_str_regtype, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Registry", (PyCFunction)_wrap_Registry, METH_NOARGS, NULL},
|
||||
{ (char *)"reg_get_predefined_key_by_name", (PyCFunction) _wrap_reg_get_predefined_key_by_name, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"reg_key_del_abs", (PyCFunction) _wrap_reg_key_del_abs, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"reg_get_predefined_key", (PyCFunction) _wrap_reg_get_predefined_key, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"reg_diff_apply", (PyCFunction) _wrap_reg_diff_apply, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"reg_get_predefined_key_by_name", (PyCFunction) _wrap_reg_get_predefined_key_by_name, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.get_predefined_key_by_name(name) -> key\n"
|
||||
"Find a predefined key by name\n"
|
||||
""},
|
||||
{ (char *)"reg_key_del_abs", (PyCFunction) _wrap_reg_key_del_abs, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.key_del_abs(name) -> None\n"
|
||||
"Delete a key by absolute path.\n"
|
||||
""},
|
||||
{ (char *)"reg_get_predefined_key", (PyCFunction) _wrap_reg_get_predefined_key, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.get_predefined_key(hkey_id) -> key\n"
|
||||
"Find a predefined key by id\n"
|
||||
""},
|
||||
{ (char *)"reg_diff_apply", (PyCFunction) _wrap_reg_diff_apply, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.diff_apply(filename) -> None\n"
|
||||
"Apply the diff from the specified file\n"
|
||||
""},
|
||||
{ (char *)"reg_generate_diff", (PyCFunction) _wrap_reg_generate_diff, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"reg_import_hive_key", (PyCFunction) _wrap_reg_import_hive_key, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"reg_mount_hive", _wrap_reg_mount_hive, METH_VARARGS, NULL},
|
||||
@ -3809,11 +3821,11 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"delete_reg", (PyCFunction)_wrap_delete_reg, METH_O, NULL},
|
||||
{ (char *)"reg_swigregister", reg_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"reg_swiginit", reg_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"hive_key", (PyCFunction) _wrap_hive_key, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"open_ldb", (PyCFunction) _wrap_open_ldb, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"create_dir", (PyCFunction) _wrap_create_dir, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"open_dir", (PyCFunction) _wrap_open_dir, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"open_samba", (PyCFunction) _wrap_open_samba, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"hive_key", (PyCFunction) _wrap_hive_key, METH_VARARGS | METH_KEYWORDS, (char *)"S.__init__(location, session_info=None, credentials=None, loadparm_context=None)"},
|
||||
{ (char *)"open_ldb", (PyCFunction) _wrap_open_ldb, METH_VARARGS | METH_KEYWORDS, (char *)"open_ldb(location, session_info=None, credentials=None, loadparm_context=None) -> key"},
|
||||
{ (char *)"create_dir", (PyCFunction) _wrap_create_dir, METH_VARARGS | METH_KEYWORDS, (char *)"create_dir(location) -> key"},
|
||||
{ (char *)"open_dir", (PyCFunction) _wrap_open_dir, METH_VARARGS | METH_KEYWORDS, (char *)"open_dir(location) -> key"},
|
||||
{ (char *)"open_samba", (PyCFunction) _wrap_open_samba, METH_VARARGS | METH_KEYWORDS, (char *)"open_samba() -> reg"},
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
local testing of registry diff functionality
|
||||
|
||||
Copyright (C) Jelmer Vernooij 2007
|
||||
Copyright (C) Wilco Baan Hofman 2008
|
||||
|
||||
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
|
||||
@ -23,28 +24,73 @@
|
||||
#include "lib/registry/registry.h"
|
||||
#include "torture/torture.h"
|
||||
#include "librpc/gen_ndr/winreg.h"
|
||||
#include "param/param.h"
|
||||
|
||||
static bool test_generate_diff(struct torture_context *test)
|
||||
struct diff_tcase_data {
|
||||
struct registry_context *r1_ctx;
|
||||
struct registry_context *r2_ctx;
|
||||
struct reg_diff_callbacks *callbacks;
|
||||
void *callback_data;
|
||||
char *tempdir;
|
||||
char *filename;
|
||||
};
|
||||
|
||||
static bool test_generate_diff(struct torture_context *tctx, void *tcase_data)
|
||||
{
|
||||
/* WERROR reg_generate_diff(struct registry_context *ctx1,
|
||||
struct registry_context *ctx2,
|
||||
const struct reg_diff_callbacks *callbacks,
|
||||
void *callback_data)
|
||||
*/
|
||||
return true;
|
||||
}
|
||||
WERROR error;
|
||||
struct diff_tcase_data *td = tcase_data;
|
||||
|
||||
|
||||
static bool test_diff_load(struct torture_context *test)
|
||||
{
|
||||
/* WERROR reg_diff_load(const char *filename, const struct reg_diff_callbacks *callbacks, void *callback_data) */
|
||||
error = reg_generate_diff(td->r1_ctx, td->r2_ctx,
|
||||
td->callbacks,
|
||||
td->callback_data);
|
||||
torture_assert_werr_ok(tctx, error, "reg_generate_diff");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_diff_apply(struct torture_context *test)
|
||||
#if 0
|
||||
static bool test_diff_load(struct torture_context *tctx, void *tcase_data)
|
||||
{
|
||||
/* _PUBLIC_ WERROR reg_diff_apply (const char *filename, struct registry_context *ctx) */
|
||||
struct diff_tcase_data *td = tcase_data;
|
||||
struct smb_iconv_convenience *ic;
|
||||
struct reg_diff_callbacks *callbacks;
|
||||
void *data;
|
||||
WERROR error;
|
||||
|
||||
ic = lp_iconv_convenience(tctx->lp_ctx);
|
||||
|
||||
error = reg_diff_load(td->filename, iconv_convenience, callbacks, data);
|
||||
torture_assert_werr_ok(tctx, error, "reg_diff_load");
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
static bool test_diff_apply(struct torture_context *tctx, void *tcase_data)
|
||||
{
|
||||
struct diff_tcase_data *td = tcase_data;
|
||||
struct registry_key *key;
|
||||
WERROR error;
|
||||
|
||||
error = reg_diff_apply(td->r1_ctx, td->filename);
|
||||
torture_assert_werr_ok(tctx, error, "reg_diff_apply");
|
||||
|
||||
error = td->r1_ctx->ops->get_predefined_key(td->r1_ctx, HKEY_LOCAL_MACHINE, &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKEY_LOCAL_MACHINE failed");
|
||||
|
||||
/* If this generates an error it could be that the apply doesn't work,
|
||||
* but also that the reg_generate_diff didn't work. */
|
||||
error = td->r1_ctx->ops->open_key(td->r1_ctx, key, "Software", &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKLM\\Software failed");
|
||||
error = td->r1_ctx->ops->open_key(td->r1_ctx, key, "Microsoft", &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKLM\\Software\\Microsoft failed");
|
||||
error = td->r1_ctx->ops->open_key(td->r1_ctx, key, "Windows", &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKLM\\..\\Microsoft\\Windows failed");
|
||||
error = td->r1_ctx->ops->open_key(td->r1_ctx, key, "CurrentVersion", &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKLM\\..\\Windows\\CurrentVersion failed");
|
||||
error = td->r1_ctx->ops->open_key(td->r1_ctx, key, "Policies", &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKLM\\..\\CurrentVersion\\Policies failed");
|
||||
error = td->r1_ctx->ops->open_key(td->r1_ctx, key, "Explorer", &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKLM\\..\\Policies\\Explorer failed");
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -58,7 +104,7 @@ static WERROR test_add_key(void *callback_data, const char *key_name)
|
||||
return WERR_OK;
|
||||
}
|
||||
|
||||
static bool test_generate_diff_key_add(struct torture_context *test)
|
||||
static bool test_generate_diff_key_add(struct torture_context *tctx, void *tcase_data)
|
||||
{
|
||||
struct reg_diff_callbacks cb;
|
||||
struct registry_key rk;
|
||||
@ -69,15 +115,15 @@ static bool test_generate_diff_key_add(struct torture_context *test)
|
||||
|
||||
cb.add_key = test_add_key;
|
||||
|
||||
if (W_ERROR_IS_OK(reg_generate_diff_key(&rk, NULL, "bla", &cb, test)))
|
||||
if (W_ERROR_IS_OK(reg_generate_diff_key(&rk, NULL, "bla", &cb, tctx)))
|
||||
return false;
|
||||
|
||||
torture_assert_str_equal(test, added_key, "bla", "key added");
|
||||
torture_assert_str_equal(tctx, added_key, "bla", "key added");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_generate_diff_key_null(struct torture_context *test)
|
||||
static bool test_generate_diff_key_null(struct torture_context *tctx, void *tcase_data)
|
||||
{
|
||||
struct reg_diff_callbacks cb;
|
||||
|
||||
@ -89,18 +135,162 @@ static bool test_generate_diff_key_null(struct torture_context *test)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void tcase_add_tests (struct torture_tcase *tcase)
|
||||
{
|
||||
torture_tcase_add_simple_test(tcase, "test_generate_diff_key_add",
|
||||
test_generate_diff_key_add);
|
||||
torture_tcase_add_simple_test(tcase, "test_generate_diff_key_null",
|
||||
test_generate_diff_key_null);
|
||||
torture_tcase_add_simple_test(tcase, "test_generate_diff",
|
||||
test_generate_diff);
|
||||
torture_tcase_add_simple_test(tcase, "test_diff_apply",
|
||||
test_diff_apply);
|
||||
/* torture_tcase_add_simple_test(tcase, "test_diff_load",
|
||||
test_diff_load);
|
||||
*/
|
||||
}
|
||||
|
||||
static bool diff_setup_tcase(struct torture_context *tctx, void **data)
|
||||
{
|
||||
struct registry_context *r1_ctx, *r2_ctx;
|
||||
WERROR error;
|
||||
NTSTATUS status;
|
||||
struct hive_key *r1_hklm, *r1_hkcu;
|
||||
struct hive_key *r2_hklm, *r2_hkcu;
|
||||
const char *filename;
|
||||
struct diff_tcase_data *td;
|
||||
struct registry_key *key, *newkey;
|
||||
DATA_BLOB blob;
|
||||
|
||||
td = talloc(tctx, struct diff_tcase_data);
|
||||
|
||||
/* Create two registry contexts */
|
||||
error = reg_open_local(tctx, &r1_ctx);
|
||||
torture_assert_werr_ok(tctx, error, "Opening registry 1 for patch tests failed");
|
||||
|
||||
error = reg_open_local(tctx, &r2_ctx);
|
||||
torture_assert_werr_ok(tctx, error, "Opening registry 2 for patch tests failed");
|
||||
|
||||
/* Create temp directory */
|
||||
status = torture_temp_dir(tctx, "patchfile", &td->tempdir);
|
||||
torture_assert_ntstatus_ok(tctx, status, "Creating temp dir failed");
|
||||
|
||||
/* Create and mount HKLM and HKCU hives for registry 1 */
|
||||
filename = talloc_asprintf(tctx, "%s/r1_local_machine.ldb", td->tempdir);
|
||||
error = reg_open_ldb_file(tctx, filename, NULL, NULL, tctx->ev, tctx->lp_ctx, &r1_hklm);
|
||||
torture_assert_werr_ok(tctx, error, "Opening local machine file failed");
|
||||
|
||||
error = reg_mount_hive(r1_ctx, r1_hklm, HKEY_LOCAL_MACHINE, NULL);
|
||||
torture_assert_werr_ok(tctx, error, "Mounting hive failed");
|
||||
|
||||
filename = talloc_asprintf(tctx, "%s/r1_current_user.ldb", td->tempdir);
|
||||
error = reg_open_ldb_file(tctx, filename, NULL, NULL, tctx->ev, tctx->lp_ctx, &r1_hkcu);
|
||||
torture_assert_werr_ok(tctx, error, "Opening current user file failed");
|
||||
|
||||
error = reg_mount_hive(r1_ctx, r1_hkcu, HKEY_CURRENT_USER, NULL);
|
||||
torture_assert_werr_ok(tctx, error, "Mounting hive failed");
|
||||
|
||||
/* Create and mount HKLM and HKCU hives for registry 2 */
|
||||
filename = talloc_asprintf(tctx, "%s/r2_local_machine.ldb", td->tempdir);
|
||||
error = reg_open_ldb_file(tctx, filename, NULL, NULL, tctx->ev, tctx->lp_ctx, &r2_hklm);
|
||||
torture_assert_werr_ok(tctx, error, "Opening local machine file failed");
|
||||
|
||||
error = reg_mount_hive(r2_ctx, r2_hklm, HKEY_LOCAL_MACHINE, NULL);
|
||||
torture_assert_werr_ok(tctx, error, "Mounting hive failed");
|
||||
|
||||
filename = talloc_asprintf(tctx, "%s/r2_current_user.ldb", td->tempdir);
|
||||
error = reg_open_ldb_file(tctx, filename, NULL, NULL, tctx->ev, tctx->lp_ctx, &r2_hkcu);
|
||||
torture_assert_werr_ok(tctx, error, "Opening current user file failed");
|
||||
|
||||
error = reg_mount_hive(r2_ctx, r2_hkcu, HKEY_CURRENT_USER, NULL);
|
||||
torture_assert_werr_ok(tctx, error, "Mounting hive failed");
|
||||
|
||||
error = r1_ctx->ops->get_predefined_key(r1_ctx, HKEY_CURRENT_USER, &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKEY_CURRENT_USER failed");
|
||||
error = r1_ctx->ops->create_key(r1_ctx, key, "Network", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKCU\\Network failed");
|
||||
error = r1_ctx->ops->create_key(r1_ctx, newkey, "L", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKCU\\Network\\L failed");
|
||||
|
||||
error = r2_ctx->ops->get_predefined_key(r2_ctx, HKEY_LOCAL_MACHINE, &key);
|
||||
torture_assert_werr_ok(tctx, error, "Opening HKEY_LOCAL_MACHINE failed");
|
||||
error = r2_ctx->ops->create_key(r2_ctx, key, "Software", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Creating HKLM\\Sofware failed");
|
||||
error = r2_ctx->ops->create_key(r2_ctx, newkey, "Microsoft", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Creating HKLM\\Software\\Microsoft failed");
|
||||
error = r2_ctx->ops->create_key(r2_ctx, newkey, "Windows", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Creating HKLM\\Software\\Microsoft\\Windows failed");
|
||||
error = r2_ctx->ops->create_key(r2_ctx, newkey, "CurrentVersion", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Creating HKLM\\..\\Windows\\CurrentVersion failed");
|
||||
error = r2_ctx->ops->create_key(r2_ctx, newkey, "Policies", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Creating HKLM\\..\\CurrentVersion\\Policies failed");
|
||||
error = r2_ctx->ops->create_key(r2_ctx, newkey, "Explorer", NULL, NULL, &newkey);
|
||||
torture_assert_werr_ok(tctx, error, "Creating HKLM\\..\\Policies\\Explorer failed");
|
||||
|
||||
|
||||
blob.data = (void *)talloc(r2_ctx, uint32_t);
|
||||
SIVAL(blob.data, 0, 0x03ffffff);
|
||||
blob.length = sizeof(uint32_t);
|
||||
|
||||
r1_ctx->ops->set_value(newkey, "NoDrives", REG_DWORD, blob);
|
||||
|
||||
/* Set test case data */
|
||||
td->r1_ctx = r1_ctx;
|
||||
td->r2_ctx = r2_ctx;
|
||||
|
||||
*data = td;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool diff_setup_preg_tcase (struct torture_context *tctx, void **data)
|
||||
{
|
||||
struct diff_tcase_data *td;
|
||||
struct smb_iconv_convenience *ic;
|
||||
WERROR error;
|
||||
|
||||
diff_setup_tcase(tctx, data);
|
||||
td = *data;
|
||||
|
||||
ic = lp_iconv_convenience(tctx->lp_ctx);
|
||||
|
||||
td->filename = talloc_asprintf(tctx, "%s/test.pol", td->tempdir);
|
||||
error = reg_preg_diff_save(tctx, td->filename, ic, &td->callbacks, &td->callback_data);
|
||||
torture_assert_werr_ok(tctx, error, "reg_preg_diff_save");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool diff_setup_dotreg_tcase (struct torture_context *tctx, void **data)
|
||||
{
|
||||
struct diff_tcase_data *td;
|
||||
struct smb_iconv_convenience *ic;
|
||||
WERROR error;
|
||||
|
||||
diff_setup_tcase(tctx, data);
|
||||
td = *data;
|
||||
|
||||
ic = lp_iconv_convenience(tctx->lp_ctx);
|
||||
|
||||
td->filename = talloc_asprintf(tctx, "%s/test.reg", td->tempdir);
|
||||
error = reg_dotreg_diff_save(tctx, td->filename, ic, &td->callbacks, &td->callback_data);
|
||||
torture_assert_werr_ok(tctx, error, "reg_dotreg_diff_save");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct torture_suite *torture_registry_diff(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct torture_tcase *tcase;
|
||||
struct torture_suite *suite = torture_suite_create(mem_ctx, "DIFF");
|
||||
torture_suite_add_simple_test(suite, "test_generate_diff_key_add",
|
||||
test_generate_diff_key_add);
|
||||
torture_suite_add_simple_test(suite, "test_generate_diff_key_null",
|
||||
test_generate_diff_key_null);
|
||||
torture_suite_add_simple_test(suite, "test_diff_apply",
|
||||
test_diff_apply);
|
||||
torture_suite_add_simple_test(suite, "test_generate_diff",
|
||||
test_generate_diff);
|
||||
torture_suite_add_simple_test(suite, "test_diff_load",
|
||||
test_diff_load);
|
||||
|
||||
tcase = torture_suite_add_tcase(suite, "PReg");
|
||||
torture_tcase_set_fixture(tcase, diff_setup_preg_tcase, NULL);
|
||||
tcase_add_tests(tcase);
|
||||
|
||||
tcase = torture_suite_add_tcase(suite, "dotreg");
|
||||
torture_tcase_set_fixture(tcase, diff_setup_dotreg_tcase, NULL);
|
||||
tcase_add_tests(tcase);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "librpc/gen_ndr/winreg.h"
|
||||
#include "system/filesys.h"
|
||||
#include "param/param.h"
|
||||
#include "libcli/security/security.h"
|
||||
|
||||
static bool test_del_nonexistant_key(struct torture_context *tctx,
|
||||
const void *test_data)
|
||||
@ -306,6 +307,56 @@ static bool test_list_values(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_hive_security(struct torture_context *tctx, const void *_data)
|
||||
{
|
||||
struct hive_key *subkey = NULL;
|
||||
const struct hive_key *root = _data;
|
||||
WERROR error;
|
||||
struct security_descriptor *osd, *nsd;
|
||||
|
||||
osd = security_descriptor_dacl_create(tctx,
|
||||
0,
|
||||
NULL, NULL,
|
||||
SID_NT_AUTHENTICATED_USERS,
|
||||
SEC_ACE_TYPE_ACCESS_ALLOWED,
|
||||
SEC_GENERIC_ALL,
|
||||
SEC_ACE_FLAG_OBJECT_INHERIT,
|
||||
NULL);
|
||||
|
||||
|
||||
error = hive_key_add_name(tctx, root, "SecurityKey", NULL,
|
||||
osd, &subkey);
|
||||
torture_assert_werr_ok(tctx, error, "hive_key_add_name");
|
||||
|
||||
error = hive_get_sec_desc(tctx, subkey, &nsd);
|
||||
torture_assert_werr_ok (tctx, error, "getting security descriptor");
|
||||
|
||||
torture_assert(tctx, security_descriptor_equal(osd, nsd),
|
||||
"security descriptor changed!");
|
||||
|
||||
/* Create a fresh security descriptor */
|
||||
talloc_free(osd);
|
||||
osd = security_descriptor_dacl_create(tctx,
|
||||
0,
|
||||
NULL, NULL,
|
||||
SID_NT_AUTHENTICATED_USERS,
|
||||
SEC_ACE_TYPE_ACCESS_ALLOWED,
|
||||
SEC_GENERIC_ALL,
|
||||
SEC_ACE_FLAG_OBJECT_INHERIT,
|
||||
NULL);
|
||||
|
||||
error = hive_set_sec_desc(subkey, osd);
|
||||
torture_assert_werr_ok(tctx, error, "setting security descriptor");
|
||||
|
||||
error = hive_get_sec_desc(tctx, subkey, &nsd);
|
||||
torture_assert_werr_ok (tctx, error, "getting security descriptor");
|
||||
|
||||
torture_assert(tctx, security_descriptor_equal(osd, nsd),
|
||||
"security descriptor changed!");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void tcase_add_tests(struct torture_tcase *tcase)
|
||||
{
|
||||
torture_tcase_add_simple_test_const(tcase, "del_nonexistant_key",
|
||||
@ -333,6 +384,8 @@ static void tcase_add_tests(struct torture_tcase *tcase)
|
||||
test_del_key);
|
||||
torture_tcase_add_simple_test_const(tcase, "del_value",
|
||||
test_del_value);
|
||||
torture_tcase_add_simple_test_const(tcase, "check hive security",
|
||||
test_hive_security);
|
||||
}
|
||||
|
||||
static bool hive_setup_dir(struct torture_context *tctx, void **data)
|
||||
@ -390,7 +443,7 @@ static bool hive_setup_regf(struct torture_context *tctx, void **data)
|
||||
char *dirname;
|
||||
NTSTATUS status;
|
||||
|
||||
status = torture_temp_dir(tctx, "hive-dir", &dirname);
|
||||
status = torture_temp_dir(tctx, "hive-regf", &dirname);
|
||||
if (!NT_STATUS_IS_OK(status))
|
||||
return false;
|
||||
|
||||
|
@ -390,11 +390,11 @@ static bool test_security(struct torture_context *tctx, void *_data)
|
||||
SEC_ACE_FLAG_OBJECT_INHERIT,
|
||||
NULL);
|
||||
|
||||
error = reg_set_security(subkey, osd);
|
||||
torture_assert_werr_ok(tctx, error, "setting security");
|
||||
error = reg_set_sec_desc(subkey, osd);
|
||||
torture_assert_werr_ok(tctx, error, "setting security descriptor");
|
||||
|
||||
error = reg_get_security(tctx, subkey, &nsd);
|
||||
torture_assert_werr_ok (tctx, error, "setting security");
|
||||
error = reg_get_sec_desc(tctx, subkey, &nsd);
|
||||
torture_assert_werr_ok (tctx, error, "getting security descriptor");
|
||||
|
||||
torture_assert(tctx, security_descriptor_equal(osd, nsd),
|
||||
"security descriptor changed!");
|
||||
|
@ -341,7 +341,7 @@ fi
|
||||
|
||||
dnl test for ipv6
|
||||
AC_CACHE_CHECK([for ipv6 support],libreplace_cv_HAVE_IPV6,[
|
||||
AC_TRY_COMPILE([
|
||||
AC_TRY_LINK([
|
||||
#include <stdlib.h> /* for NULL */
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -79,10 +79,10 @@ AC_MSG_CHECKING(whether to use extern readline)
|
||||
if test x"$EXTERNAL_READLINE" = x"yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
|
||||
SMB_SUBSYSTEM(SMBREADLINE, [lib/smbreadline/smbreadline.o], [READLINE])
|
||||
SMB_SUBSYSTEM(SMBREADLINE, [\$(smbreadlinesrcdir)/smbreadline.o], [READLINE])
|
||||
SMB_EXT_LIB(READLINE, [${TERMLIBS}])
|
||||
SMB_ENABLE(READLINE,YES)
|
||||
else
|
||||
SMB_SUBSYSTEM(SMBREADLINE, [lib/smbreadline/smbreadline.o], [])
|
||||
SMB_SUBSYSTEM(SMBREADLINE, [\$(smbreadlinesrcdir)/smbreadline.o], [])
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
@ -24,7 +24,11 @@
|
||||
License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module tdb
|
||||
%define DOCSTRING
|
||||
"TDB is a simple key-value database similar to GDBM that supports multiple writers."
|
||||
%enddef
|
||||
|
||||
%module(docstring=DOCSTRING) tdb
|
||||
|
||||
%{
|
||||
|
||||
@ -138,7 +142,8 @@ enum TDB_ERROR {
|
||||
$1 = TDB_REPLACE;
|
||||
}
|
||||
|
||||
%rename(Tdb) tdb;
|
||||
%rename(Tdb) tdb_context;
|
||||
%feature("docstring") tdb_context "A TDB file.";
|
||||
%typemap(out,noblock=1) tdb * {
|
||||
/* Throw an IOError exception from errno if tdb_open() returns NULL */
|
||||
if ($1 == NULL) {
|
||||
@ -150,34 +155,68 @@ enum TDB_ERROR {
|
||||
|
||||
typedef struct tdb_context {
|
||||
%extend {
|
||||
%feature("docstring") tdb "S.__init__(name,hash_size=0,tdb_flags=TDB_DEFAULT,flags=O_RDWR,mode=0600)\n"
|
||||
"Open a TDB file.";
|
||||
tdb(const char *name, int hash_size, int tdb_flags, int flags, mode_t mode) {
|
||||
return tdb_open(name, hash_size, tdb_flags, flags, mode);
|
||||
}
|
||||
enum TDB_ERROR error();
|
||||
~tdb() { tdb_close($self); }
|
||||
%feature("docstring") close "S.close() -> None\n"
|
||||
"Close the TDB file.";
|
||||
int close();
|
||||
int append(TDB_DATA key, TDB_DATA new_dbuf);
|
||||
%feature("docstring") errorstr "S.errorstr() -> errorstring\n"
|
||||
"Obtain last error message.";
|
||||
const char *errorstr();
|
||||
%rename(get) fetch;
|
||||
%feature("docstring") fetch "S.fetch(key) -> value\n"
|
||||
"Fetch a value.";
|
||||
TDB_DATA fetch(TDB_DATA key);
|
||||
%feature("docstring") delete "S.delete(key) -> None\n"
|
||||
"Delete an entry.";
|
||||
int delete(TDB_DATA key);
|
||||
%feature("docstring") store "S.store(key, value, flag=TDB_REPLACE) -> None\n"
|
||||
"Store an entry.";
|
||||
int store(TDB_DATA key, TDB_DATA dbuf, int flag);
|
||||
int exists(TDB_DATA key);
|
||||
%feature("docstring") firstkey "S.firstkey() -> data\n"
|
||||
"Return the first key in this database.";
|
||||
TDB_DATA firstkey();
|
||||
%feature("docstring") nextkey "S.nextkey(prev) -> data\n"
|
||||
"Return the next key in this database.";
|
||||
TDB_DATA nextkey(TDB_DATA key);
|
||||
%feature("docstring") lockall "S.lockall() -> bool";
|
||||
int lockall();
|
||||
%feature("docstring") unlockall "S.unlockall() -> bool";
|
||||
int unlockall();
|
||||
%feature("docstring") unlockall "S.lockall_read() -> bool";
|
||||
int lockall_read();
|
||||
%feature("docstring") unlockall "S.unlockall_read() -> bool";
|
||||
int unlockall_read();
|
||||
%feature("docstring") reopen "S.reopen() -> bool\n"
|
||||
"Reopen this file.";
|
||||
int reopen();
|
||||
%feature("docstring") transaction_start "S.transaction_start() -> None\n"
|
||||
"Start a new transaction.";
|
||||
int transaction_start();
|
||||
%feature("docstring") transaction_commit "S.transaction_commit() -> None\n"
|
||||
"Commit the currently active transaction.";
|
||||
int transaction_commit();
|
||||
%feature("docstring") transaction_cancel "S.transaction_cancel() -> None\n"
|
||||
"Cancel the currently active transaction.";
|
||||
int transaction_cancel();
|
||||
int transaction_recover();
|
||||
%feature("docstring") hash_size "S.hash_size() -> int";
|
||||
int hash_size();
|
||||
%feature("docstring") map_size "S.map_size() -> int";
|
||||
size_t map_size();
|
||||
%feature("docstring") get_flags "S.get_flags() -> int";
|
||||
int get_flags();
|
||||
%feature("docstring") set_max_dead "S.set_max_dead(int) -> None";
|
||||
void set_max_dead(int max_dead);
|
||||
%feature("docstring") name "S.name() -> path\n" \
|
||||
"Return filename of this TDB file.";
|
||||
const char *name();
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
TDB is a simple key-value database similar to GDBM that supports multiple writers.
|
||||
"""
|
||||
|
||||
import _tdb
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
@ -78,11 +82,125 @@ TDB_ERR_LOCK_TIMEOUT = _tdb.TDB_ERR_LOCK_TIMEOUT
|
||||
TDB_ERR_NOEXIST = _tdb.TDB_ERR_NOEXIST
|
||||
TDB_ERR_EINVAL = _tdb.TDB_ERR_EINVAL
|
||||
TDB_ERR_RDONLY = _tdb.TDB_ERR_RDONLY
|
||||
class tdb(object):
|
||||
class Tdb(object):
|
||||
"""A TDB file."""
|
||||
thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
__swig_destroy__ = _tdb.delete_tdb
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
S.__init__(name,hash_size=0,tdb_flags=TDB_DEFAULT,flags=O_RDWR,mode=0600)
|
||||
Open a TDB file.
|
||||
"""
|
||||
_tdb.Tdb_swiginit(self,_tdb.new_Tdb(*args, **kwargs))
|
||||
__swig_destroy__ = _tdb.delete_Tdb
|
||||
def close(*args, **kwargs):
|
||||
"""
|
||||
S.close() -> None
|
||||
Close the TDB file.
|
||||
"""
|
||||
return _tdb.Tdb_close(*args, **kwargs)
|
||||
|
||||
def errorstr(*args, **kwargs):
|
||||
"""
|
||||
S.errorstr() -> errorstring
|
||||
Obtain last error message.
|
||||
"""
|
||||
return _tdb.Tdb_errorstr(*args, **kwargs)
|
||||
|
||||
def get(*args, **kwargs):
|
||||
"""
|
||||
S.fetch(key) -> value
|
||||
Fetch a value.
|
||||
"""
|
||||
return _tdb.Tdb_get(*args, **kwargs)
|
||||
|
||||
def delete(*args, **kwargs):
|
||||
"""
|
||||
S.delete(key) -> None
|
||||
Delete an entry.
|
||||
"""
|
||||
return _tdb.Tdb_delete(*args, **kwargs)
|
||||
|
||||
def store(*args, **kwargs):
|
||||
"""
|
||||
S.store(key, value, flag=TDB_REPLACE) -> None
|
||||
Store an entry.
|
||||
"""
|
||||
return _tdb.Tdb_store(*args, **kwargs)
|
||||
|
||||
def firstkey(*args, **kwargs):
|
||||
"""
|
||||
S.firstkey() -> data
|
||||
Return the first key in this database.
|
||||
"""
|
||||
return _tdb.Tdb_firstkey(*args, **kwargs)
|
||||
|
||||
def nextkey(*args, **kwargs):
|
||||
"""
|
||||
S.nextkey(prev) -> data
|
||||
Return the next key in this database.
|
||||
"""
|
||||
return _tdb.Tdb_nextkey(*args, **kwargs)
|
||||
|
||||
def lock_all(*args, **kwargs):
|
||||
"""S.lockall() -> bool"""
|
||||
return _tdb.Tdb_lock_all(*args, **kwargs)
|
||||
|
||||
def unlock_all(*args, **kwargs):
|
||||
"""S.unlockall() -> bool"""
|
||||
return _tdb.Tdb_unlock_all(*args, **kwargs)
|
||||
|
||||
def reopen(*args, **kwargs):
|
||||
"""
|
||||
S.reopen() -> bool
|
||||
Reopen this file.
|
||||
"""
|
||||
return _tdb.Tdb_reopen(*args, **kwargs)
|
||||
|
||||
def transaction_start(*args, **kwargs):
|
||||
"""
|
||||
S.transaction_start() -> None
|
||||
Start a new transaction.
|
||||
"""
|
||||
return _tdb.Tdb_transaction_start(*args, **kwargs)
|
||||
|
||||
def transaction_commit(*args, **kwargs):
|
||||
"""
|
||||
S.transaction_commit() -> None
|
||||
Commit the currently active transaction.
|
||||
"""
|
||||
return _tdb.Tdb_transaction_commit(*args, **kwargs)
|
||||
|
||||
def transaction_cancel(*args, **kwargs):
|
||||
"""
|
||||
S.transaction_cancel() -> None
|
||||
Cancel the currently active transaction.
|
||||
"""
|
||||
return _tdb.Tdb_transaction_cancel(*args, **kwargs)
|
||||
|
||||
def hash_size(*args, **kwargs):
|
||||
"""S.hash_size() -> int"""
|
||||
return _tdb.Tdb_hash_size(*args, **kwargs)
|
||||
|
||||
def map_size(*args, **kwargs):
|
||||
"""S.map_size() -> int"""
|
||||
return _tdb.Tdb_map_size(*args, **kwargs)
|
||||
|
||||
def get_flags(*args, **kwargs):
|
||||
"""S.get_flags() -> int"""
|
||||
return _tdb.Tdb_get_flags(*args, **kwargs)
|
||||
|
||||
def set_max_dead(*args, **kwargs):
|
||||
"""S.set_max_dead(int) -> None"""
|
||||
return _tdb.Tdb_set_max_dead(*args, **kwargs)
|
||||
|
||||
def name(*args, **kwargs):
|
||||
"""
|
||||
S.name() -> path
|
||||
Return filename of this TDB file.
|
||||
"""
|
||||
return _tdb.Tdb_name(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return "Tdb('%s')" % self.name()
|
||||
|
||||
@ -178,36 +296,32 @@ class tdb(object):
|
||||
|
||||
|
||||
|
||||
tdb.error = new_instancemethod(_tdb.tdb_error,None,tdb)
|
||||
tdb.close = new_instancemethod(_tdb.tdb_close,None,tdb)
|
||||
tdb.append = new_instancemethod(_tdb.tdb_append,None,tdb)
|
||||
tdb.errorstr = new_instancemethod(_tdb.tdb_errorstr,None,tdb)
|
||||
tdb.get = new_instancemethod(_tdb.tdb_get,None,tdb)
|
||||
tdb.delete = new_instancemethod(_tdb.tdb_delete,None,tdb)
|
||||
tdb.store = new_instancemethod(_tdb.tdb_store,None,tdb)
|
||||
tdb.exists = new_instancemethod(_tdb.tdb_exists,None,tdb)
|
||||
tdb.firstkey = new_instancemethod(_tdb.tdb_firstkey,None,tdb)
|
||||
tdb.nextkey = new_instancemethod(_tdb.tdb_nextkey,None,tdb)
|
||||
tdb.lock_all = new_instancemethod(_tdb.tdb_lock_all,None,tdb)
|
||||
tdb.unlock_all = new_instancemethod(_tdb.tdb_unlock_all,None,tdb)
|
||||
tdb.read_lock_all = new_instancemethod(_tdb.tdb_read_lock_all,None,tdb)
|
||||
tdb.read_unlock_all = new_instancemethod(_tdb.tdb_read_unlock_all,None,tdb)
|
||||
tdb.reopen = new_instancemethod(_tdb.tdb_reopen,None,tdb)
|
||||
tdb.transaction_start = new_instancemethod(_tdb.tdb_transaction_start,None,tdb)
|
||||
tdb.transaction_commit = new_instancemethod(_tdb.tdb_transaction_commit,None,tdb)
|
||||
tdb.transaction_cancel = new_instancemethod(_tdb.tdb_transaction_cancel,None,tdb)
|
||||
tdb.transaction_recover = new_instancemethod(_tdb.tdb_transaction_recover,None,tdb)
|
||||
tdb.hash_size = new_instancemethod(_tdb.tdb_hash_size,None,tdb)
|
||||
tdb.map_size = new_instancemethod(_tdb.tdb_map_size,None,tdb)
|
||||
tdb.get_flags = new_instancemethod(_tdb.tdb_get_flags,None,tdb)
|
||||
tdb.set_max_dead = new_instancemethod(_tdb.tdb_set_max_dead,None,tdb)
|
||||
tdb.name = new_instancemethod(_tdb.tdb_name,None,tdb)
|
||||
tdb_swigregister = _tdb.tdb_swigregister
|
||||
tdb_swigregister(tdb)
|
||||
|
||||
def Tdb(*args, **kwargs):
|
||||
val = _tdb.new_Tdb(*args, **kwargs)
|
||||
return val
|
||||
Tdb.error = new_instancemethod(_tdb.Tdb_error,None,Tdb)
|
||||
Tdb.close = new_instancemethod(_tdb.Tdb_close,None,Tdb)
|
||||
Tdb.append = new_instancemethod(_tdb.Tdb_append,None,Tdb)
|
||||
Tdb.errorstr = new_instancemethod(_tdb.Tdb_errorstr,None,Tdb)
|
||||
Tdb.get = new_instancemethod(_tdb.Tdb_get,None,Tdb)
|
||||
Tdb.delete = new_instancemethod(_tdb.Tdb_delete,None,Tdb)
|
||||
Tdb.store = new_instancemethod(_tdb.Tdb_store,None,Tdb)
|
||||
Tdb.exists = new_instancemethod(_tdb.Tdb_exists,None,Tdb)
|
||||
Tdb.firstkey = new_instancemethod(_tdb.Tdb_firstkey,None,Tdb)
|
||||
Tdb.nextkey = new_instancemethod(_tdb.Tdb_nextkey,None,Tdb)
|
||||
Tdb.lock_all = new_instancemethod(_tdb.Tdb_lock_all,None,Tdb)
|
||||
Tdb.unlock_all = new_instancemethod(_tdb.Tdb_unlock_all,None,Tdb)
|
||||
Tdb.read_lock_all = new_instancemethod(_tdb.Tdb_read_lock_all,None,Tdb)
|
||||
Tdb.read_unlock_all = new_instancemethod(_tdb.Tdb_read_unlock_all,None,Tdb)
|
||||
Tdb.reopen = new_instancemethod(_tdb.Tdb_reopen,None,Tdb)
|
||||
Tdb.transaction_start = new_instancemethod(_tdb.Tdb_transaction_start,None,Tdb)
|
||||
Tdb.transaction_commit = new_instancemethod(_tdb.Tdb_transaction_commit,None,Tdb)
|
||||
Tdb.transaction_cancel = new_instancemethod(_tdb.Tdb_transaction_cancel,None,Tdb)
|
||||
Tdb.transaction_recover = new_instancemethod(_tdb.Tdb_transaction_recover,None,Tdb)
|
||||
Tdb.hash_size = new_instancemethod(_tdb.Tdb_hash_size,None,Tdb)
|
||||
Tdb.map_size = new_instancemethod(_tdb.Tdb_map_size,None,Tdb)
|
||||
Tdb.get_flags = new_instancemethod(_tdb.Tdb_get_flags,None,Tdb)
|
||||
Tdb.set_max_dead = new_instancemethod(_tdb.Tdb_set_max_dead,None,Tdb)
|
||||
Tdb.name = new_instancemethod(_tdb.Tdb_name,None,Tdb)
|
||||
Tdb_swigregister = _tdb.Tdb_swigregister
|
||||
Tdb_swigregister(Tdb)
|
||||
|
||||
|
||||
|
||||
|
@ -2892,7 +2892,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_error(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_error(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
enum TDB_ERROR result;
|
||||
@ -2904,7 +2904,7 @@ SWIGINTERN PyObject *_wrap_tdb_error(PyObject *SWIGUNUSEDPARM(self), PyObject *a
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_error" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_error" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (enum TDB_ERROR)tdb_error(arg1);
|
||||
@ -2915,7 +2915,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_delete_tdb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_delete_Tdb(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
void *argp1 = 0 ;
|
||||
@ -2926,7 +2926,7 @@ SWIGINTERN PyObject *_wrap_delete_tdb(PyObject *SWIGUNUSEDPARM(self), PyObject *
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, SWIG_POINTER_DISOWN | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_tdb" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Tdb" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
delete_tdb(arg1);
|
||||
@ -2938,7 +2938,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_close(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -2950,7 +2950,7 @@ SWIGINTERN PyObject *_wrap_tdb_close(PyObject *SWIGUNUSEDPARM(self), PyObject *a
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_close" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_close" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_close(arg1);
|
||||
@ -2961,7 +2961,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
TDB_DATA arg2 ;
|
||||
@ -2976,10 +2976,10 @@ SWIGINTERN PyObject *_wrap_tdb_append(PyObject *SWIGUNUSEDPARM(self), PyObject *
|
||||
(char *) "self",(char *) "key",(char *) "new_dbuf", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:tdb_append",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:Tdb_append",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_append" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_append" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
if (obj1 == Py_None) {
|
||||
@ -3010,7 +3010,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_errorstr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_errorstr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
char *result = 0 ;
|
||||
@ -3022,7 +3022,7 @@ SWIGINTERN PyObject *_wrap_tdb_errorstr(PyObject *SWIGUNUSEDPARM(self), PyObject
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_errorstr" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_errorstr" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (char *)tdb_errorstr(arg1);
|
||||
@ -3033,7 +3033,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
TDB_DATA arg2 ;
|
||||
@ -3046,10 +3046,10 @@ SWIGINTERN PyObject *_wrap_tdb_get(PyObject *SWIGUNUSEDPARM(self), PyObject *arg
|
||||
(char *) "self",(char *) "key", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:tdb_get",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_get",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_get" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_get" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
if (obj1 == Py_None) {
|
||||
@ -3075,7 +3075,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_delete(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_delete(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
TDB_DATA arg2 ;
|
||||
@ -3088,10 +3088,10 @@ SWIGINTERN PyObject *_wrap_tdb_delete(PyObject *SWIGUNUSEDPARM(self), PyObject *
|
||||
(char *) "self",(char *) "key", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:tdb_delete",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_delete",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_delete" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_delete" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
if (obj1 == Py_None) {
|
||||
@ -3112,7 +3112,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_store(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_store(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
TDB_DATA arg2 ;
|
||||
@ -3132,10 +3132,10 @@ SWIGINTERN PyObject *_wrap_tdb_store(PyObject *SWIGUNUSEDPARM(self), PyObject *a
|
||||
};
|
||||
|
||||
arg4 = TDB_REPLACE;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:tdb_store",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Tdb_store",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_store" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_store" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
if (obj1 == Py_None) {
|
||||
@ -3161,7 +3161,7 @@ SWIGINTERN PyObject *_wrap_tdb_store(PyObject *SWIGUNUSEDPARM(self), PyObject *a
|
||||
if (obj3) {
|
||||
ecode4 = SWIG_AsVal_int(obj3, &val4);
|
||||
if (!SWIG_IsOK(ecode4)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "tdb_store" "', argument " "4"" of type '" "int""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Tdb_store" "', argument " "4"" of type '" "int""'");
|
||||
}
|
||||
arg4 = (int)(val4);
|
||||
}
|
||||
@ -3173,7 +3173,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_exists(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_exists(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
TDB_DATA arg2 ;
|
||||
@ -3186,10 +3186,10 @@ SWIGINTERN PyObject *_wrap_tdb_exists(PyObject *SWIGUNUSEDPARM(self), PyObject *
|
||||
(char *) "self",(char *) "key", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:tdb_exists",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_exists",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_exists" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_exists" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
if (obj1 == Py_None) {
|
||||
@ -3210,7 +3210,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_firstkey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_firstkey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
TDB_DATA result;
|
||||
@ -3222,7 +3222,7 @@ SWIGINTERN PyObject *_wrap_tdb_firstkey(PyObject *SWIGUNUSEDPARM(self), PyObject
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_firstkey" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_firstkey" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = tdb_firstkey(arg1);
|
||||
@ -3238,7 +3238,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_nextkey(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_nextkey(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
TDB_DATA arg2 ;
|
||||
@ -3251,10 +3251,10 @@ SWIGINTERN PyObject *_wrap_tdb_nextkey(PyObject *SWIGUNUSEDPARM(self), PyObject
|
||||
(char *) "self",(char *) "key", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:tdb_nextkey",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_nextkey",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_nextkey" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_nextkey" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
if (obj1 == Py_None) {
|
||||
@ -3280,7 +3280,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_lock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_lock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3292,7 +3292,7 @@ SWIGINTERN PyObject *_wrap_tdb_lock_all(PyObject *SWIGUNUSEDPARM(self), PyObject
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_lock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_lock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_lockall(arg1);
|
||||
@ -3303,7 +3303,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_unlock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_unlock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3315,7 +3315,7 @@ SWIGINTERN PyObject *_wrap_tdb_unlock_all(PyObject *SWIGUNUSEDPARM(self), PyObje
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_unlock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_unlock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_unlockall(arg1);
|
||||
@ -3326,7 +3326,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_read_lock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_read_lock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3338,7 +3338,7 @@ SWIGINTERN PyObject *_wrap_tdb_read_lock_all(PyObject *SWIGUNUSEDPARM(self), PyO
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_read_lock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_read_lock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_lockall_read(arg1);
|
||||
@ -3349,7 +3349,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_read_unlock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_read_unlock_all(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3361,7 +3361,7 @@ SWIGINTERN PyObject *_wrap_tdb_read_unlock_all(PyObject *SWIGUNUSEDPARM(self), P
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_read_unlock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_read_unlock_all" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_unlockall_read(arg1);
|
||||
@ -3372,7 +3372,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_reopen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_reopen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3384,7 +3384,7 @@ SWIGINTERN PyObject *_wrap_tdb_reopen(PyObject *SWIGUNUSEDPARM(self), PyObject *
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_reopen" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_reopen" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_reopen(arg1);
|
||||
@ -3395,7 +3395,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_transaction_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_transaction_start(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3407,7 +3407,7 @@ SWIGINTERN PyObject *_wrap_tdb_transaction_start(PyObject *SWIGUNUSEDPARM(self),
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_transaction_start" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_transaction_start" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_transaction_start(arg1);
|
||||
@ -3418,7 +3418,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_transaction_commit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_transaction_commit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3430,7 +3430,7 @@ SWIGINTERN PyObject *_wrap_tdb_transaction_commit(PyObject *SWIGUNUSEDPARM(self)
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_transaction_commit" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_transaction_commit" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_transaction_commit(arg1);
|
||||
@ -3441,7 +3441,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_transaction_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_transaction_cancel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3453,7 +3453,7 @@ SWIGINTERN PyObject *_wrap_tdb_transaction_cancel(PyObject *SWIGUNUSEDPARM(self)
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_transaction_cancel" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_transaction_cancel" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_transaction_cancel(arg1);
|
||||
@ -3464,7 +3464,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_transaction_recover(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_transaction_recover(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3476,7 +3476,7 @@ SWIGINTERN PyObject *_wrap_tdb_transaction_recover(PyObject *SWIGUNUSEDPARM(self
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_transaction_recover" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_transaction_recover" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_transaction_recover(arg1);
|
||||
@ -3487,7 +3487,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_hash_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_hash_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3499,7 +3499,7 @@ SWIGINTERN PyObject *_wrap_tdb_hash_size(PyObject *SWIGUNUSEDPARM(self), PyObjec
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_hash_size" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_hash_size" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_hash_size(arg1);
|
||||
@ -3510,7 +3510,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_map_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_map_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
size_t result;
|
||||
@ -3522,7 +3522,7 @@ SWIGINTERN PyObject *_wrap_tdb_map_size(PyObject *SWIGUNUSEDPARM(self), PyObject
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_map_size" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_map_size" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = tdb_map_size(arg1);
|
||||
@ -3533,7 +3533,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_get_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_get_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int result;
|
||||
@ -3545,7 +3545,7 @@ SWIGINTERN PyObject *_wrap_tdb_get_flags(PyObject *SWIGUNUSEDPARM(self), PyObjec
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_get_flags" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_get_flags" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (int)tdb_get_flags(arg1);
|
||||
@ -3556,7 +3556,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_set_max_dead(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_set_max_dead(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
int arg2 ;
|
||||
@ -3570,15 +3570,15 @@ SWIGINTERN PyObject *_wrap_tdb_set_max_dead(PyObject *SWIGUNUSEDPARM(self), PyOb
|
||||
(char *) "self",(char *) "max_dead", NULL
|
||||
};
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:tdb_set_max_dead",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:Tdb_set_max_dead",kwnames,&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_set_max_dead" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_set_max_dead" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
ecode2 = SWIG_AsVal_int(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tdb_set_max_dead" "', argument " "2"" of type '" "int""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Tdb_set_max_dead" "', argument " "2"" of type '" "int""'");
|
||||
}
|
||||
arg2 = (int)(val2);
|
||||
tdb_set_max_dead(arg1,arg2);
|
||||
@ -3589,7 +3589,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_tdb_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_Tdb_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
tdb *arg1 = (tdb *) 0 ;
|
||||
char *result = 0 ;
|
||||
@ -3601,7 +3601,7 @@ SWIGINTERN PyObject *_wrap_tdb_name(PyObject *SWIGUNUSEDPARM(self), PyObject *ar
|
||||
swig_obj[0] = args;
|
||||
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_tdb_context, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tdb_name" "', argument " "1"" of type '" "tdb *""'");
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Tdb_name" "', argument " "1"" of type '" "tdb *""'");
|
||||
}
|
||||
arg1 = (tdb *)(argp1);
|
||||
result = (char *)tdb_name(arg1);
|
||||
@ -3612,41 +3612,85 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *tdb_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
SWIGINTERN PyObject *Tdb_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *obj;
|
||||
if (!SWIG_Python_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
|
||||
SWIG_TypeNewClientData(SWIGTYPE_p_tdb_context, SWIG_NewClientData(obj));
|
||||
return SWIG_Py_Void();
|
||||
}
|
||||
|
||||
SWIGINTERN PyObject *Tdb_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
return SWIG_Python_InitShadowInstance(args);
|
||||
}
|
||||
|
||||
static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"new_Tdb", (PyCFunction) _wrap_new_Tdb, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_error", (PyCFunction)_wrap_tdb_error, METH_O, NULL},
|
||||
{ (char *)"delete_tdb", (PyCFunction)_wrap_delete_tdb, METH_O, NULL},
|
||||
{ (char *)"tdb_close", (PyCFunction)_wrap_tdb_close, METH_O, NULL},
|
||||
{ (char *)"tdb_append", (PyCFunction) _wrap_tdb_append, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_errorstr", (PyCFunction)_wrap_tdb_errorstr, METH_O, NULL},
|
||||
{ (char *)"tdb_get", (PyCFunction) _wrap_tdb_get, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_delete", (PyCFunction) _wrap_tdb_delete, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_store", (PyCFunction) _wrap_tdb_store, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_exists", (PyCFunction) _wrap_tdb_exists, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_firstkey", (PyCFunction)_wrap_tdb_firstkey, METH_O, NULL},
|
||||
{ (char *)"tdb_nextkey", (PyCFunction) _wrap_tdb_nextkey, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_lock_all", (PyCFunction)_wrap_tdb_lock_all, METH_O, NULL},
|
||||
{ (char *)"tdb_unlock_all", (PyCFunction)_wrap_tdb_unlock_all, METH_O, NULL},
|
||||
{ (char *)"tdb_read_lock_all", (PyCFunction)_wrap_tdb_read_lock_all, METH_O, NULL},
|
||||
{ (char *)"tdb_read_unlock_all", (PyCFunction)_wrap_tdb_read_unlock_all, METH_O, NULL},
|
||||
{ (char *)"tdb_reopen", (PyCFunction)_wrap_tdb_reopen, METH_O, NULL},
|
||||
{ (char *)"tdb_transaction_start", (PyCFunction)_wrap_tdb_transaction_start, METH_O, NULL},
|
||||
{ (char *)"tdb_transaction_commit", (PyCFunction)_wrap_tdb_transaction_commit, METH_O, NULL},
|
||||
{ (char *)"tdb_transaction_cancel", (PyCFunction)_wrap_tdb_transaction_cancel, METH_O, NULL},
|
||||
{ (char *)"tdb_transaction_recover", (PyCFunction)_wrap_tdb_transaction_recover, METH_O, NULL},
|
||||
{ (char *)"tdb_hash_size", (PyCFunction)_wrap_tdb_hash_size, METH_O, NULL},
|
||||
{ (char *)"tdb_map_size", (PyCFunction)_wrap_tdb_map_size, METH_O, NULL},
|
||||
{ (char *)"tdb_get_flags", (PyCFunction)_wrap_tdb_get_flags, METH_O, NULL},
|
||||
{ (char *)"tdb_set_max_dead", (PyCFunction) _wrap_tdb_set_max_dead, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"tdb_name", (PyCFunction)_wrap_tdb_name, METH_O, NULL},
|
||||
{ (char *)"tdb_swigregister", tdb_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"new_Tdb", (PyCFunction) _wrap_new_Tdb, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.__init__(name,hash_size=0,tdb_flags=TDB_DEFAULT,flags=O_RDWR,mode=0600)\n"
|
||||
"Open a TDB file.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_error", (PyCFunction)_wrap_Tdb_error, METH_O, NULL},
|
||||
{ (char *)"delete_Tdb", (PyCFunction)_wrap_delete_Tdb, METH_O, NULL},
|
||||
{ (char *)"Tdb_close", (PyCFunction)_wrap_Tdb_close, METH_O, (char *)"\n"
|
||||
"S.close() -> None\n"
|
||||
"Close the TDB file.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_append", (PyCFunction) _wrap_Tdb_append, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Tdb_errorstr", (PyCFunction)_wrap_Tdb_errorstr, METH_O, (char *)"\n"
|
||||
"S.errorstr() -> errorstring\n"
|
||||
"Obtain last error message.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_get", (PyCFunction) _wrap_Tdb_get, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.fetch(key) -> value\n"
|
||||
"Fetch a value.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_delete", (PyCFunction) _wrap_Tdb_delete, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.delete(key) -> None\n"
|
||||
"Delete an entry.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_store", (PyCFunction) _wrap_Tdb_store, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.store(key, value, flag=TDB_REPLACE) -> None\n"
|
||||
"Store an entry.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_exists", (PyCFunction) _wrap_Tdb_exists, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"Tdb_firstkey", (PyCFunction)_wrap_Tdb_firstkey, METH_O, (char *)"\n"
|
||||
"S.firstkey() -> data\n"
|
||||
"Return the first key in this database.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_nextkey", (PyCFunction) _wrap_Tdb_nextkey, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.nextkey(prev) -> data\n"
|
||||
"Return the next key in this database.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_lock_all", (PyCFunction)_wrap_Tdb_lock_all, METH_O, (char *)"S.lockall() -> bool"},
|
||||
{ (char *)"Tdb_unlock_all", (PyCFunction)_wrap_Tdb_unlock_all, METH_O, (char *)"S.unlockall() -> bool"},
|
||||
{ (char *)"Tdb_read_lock_all", (PyCFunction)_wrap_Tdb_read_lock_all, METH_O, NULL},
|
||||
{ (char *)"Tdb_read_unlock_all", (PyCFunction)_wrap_Tdb_read_unlock_all, METH_O, NULL},
|
||||
{ (char *)"Tdb_reopen", (PyCFunction)_wrap_Tdb_reopen, METH_O, (char *)"\n"
|
||||
"S.reopen() -> bool\n"
|
||||
"Reopen this file.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_transaction_start", (PyCFunction)_wrap_Tdb_transaction_start, METH_O, (char *)"\n"
|
||||
"S.transaction_start() -> None\n"
|
||||
"Start a new transaction.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_transaction_commit", (PyCFunction)_wrap_Tdb_transaction_commit, METH_O, (char *)"\n"
|
||||
"S.transaction_commit() -> None\n"
|
||||
"Commit the currently active transaction.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_transaction_cancel", (PyCFunction)_wrap_Tdb_transaction_cancel, METH_O, (char *)"\n"
|
||||
"S.transaction_cancel() -> None\n"
|
||||
"Cancel the currently active transaction.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_transaction_recover", (PyCFunction)_wrap_Tdb_transaction_recover, METH_O, NULL},
|
||||
{ (char *)"Tdb_hash_size", (PyCFunction)_wrap_Tdb_hash_size, METH_O, (char *)"S.hash_size() -> int"},
|
||||
{ (char *)"Tdb_map_size", (PyCFunction)_wrap_Tdb_map_size, METH_O, (char *)"S.map_size() -> int"},
|
||||
{ (char *)"Tdb_get_flags", (PyCFunction)_wrap_Tdb_get_flags, METH_O, (char *)"S.get_flags() -> int"},
|
||||
{ (char *)"Tdb_set_max_dead", (PyCFunction) _wrap_Tdb_set_max_dead, METH_VARARGS | METH_KEYWORDS, (char *)"S.set_max_dead(int) -> None"},
|
||||
{ (char *)"Tdb_name", (PyCFunction)_wrap_Tdb_name, METH_O, (char *)"\n"
|
||||
"S.name() -> path\n"
|
||||
"Return filename of this TDB file.\n"
|
||||
""},
|
||||
{ (char *)"Tdb_swigregister", Tdb_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"Tdb_swiginit", Tdb_swiginit, METH_VARARGS, NULL},
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "includes.h"
|
||||
#include "system/filesys.h"
|
||||
#include "system/time.h"
|
||||
#include "dynconfig.h"
|
||||
#include "dynconfig/dynconfig.h"
|
||||
|
||||
/**
|
||||
* @file
|
||||
|
@ -61,15 +61,14 @@ $(eval $(call proto_header_template,$(libclisrcdir)/nbt/nbt_proto.h,$(LIBCLI_NBT
|
||||
PUBLIC_DEPENDENCIES = LIBNDR \
|
||||
NDR_SECURITY
|
||||
|
||||
LIBCLI_NDR_NETLOGON_OBJ_FILES = $(addprefix libcli/, \
|
||||
ndr_netlogon.o)
|
||||
LIBCLI_NDR_NETLOGON_OBJ_FILES = $(addprefix $(libclisrcdir)/, ndr_netlogon.o)
|
||||
|
||||
$(eval $(call proto_header_template,$(libclisrcdir)/ndr_netlogon_proto.h,$(LIBCLI_NDR_NETLOGON_OBJ_FILES:.o=.c)))
|
||||
|
||||
[SUBSYSTEM::LIBCLI_NETLOGON]
|
||||
PUBLIC_DEPENDENCIES = LIBSAMBA-UTIL LIBCLI_NDR_NETLOGON
|
||||
|
||||
LIBCLI_NETLOGON_OBJ_FILES = $(addprefix libcli/, \
|
||||
LIBCLI_NETLOGON_OBJ_FILES = $(addprefix $(libclisrcdir)/, \
|
||||
netlogon.o)
|
||||
|
||||
$(eval $(call proto_header_template,$(libclisrcdir)/netlogon_proto.h,$(LIBCLI_NETLOGON_OBJ_FILES:.o=.c)))
|
||||
|
@ -626,3 +626,24 @@ _PUBLIC_ void ndr_print_wrepl_nbt_name(struct ndr_print *ndr, const char *name,
|
||||
ndr_print_string(ndr, name, s);
|
||||
talloc_free(s);
|
||||
}
|
||||
|
||||
_PUBLIC_ enum ndr_err_code ndr_push_nbt_res_rec(struct ndr_push *ndr, int ndr_flags, const struct nbt_res_rec *r)
|
||||
{
|
||||
{
|
||||
uint32_t _flags_save_STRUCT = ndr->flags;
|
||||
ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX);
|
||||
if (ndr_flags & NDR_SCALARS) {
|
||||
NDR_CHECK(ndr_push_align(ndr, 4));
|
||||
NDR_CHECK(ndr_push_nbt_name(ndr, NDR_SCALARS, &r->name));
|
||||
NDR_CHECK(ndr_push_nbt_qtype(ndr, NDR_SCALARS, r->rr_type));
|
||||
NDR_CHECK(ndr_push_nbt_qclass(ndr, NDR_SCALARS, r->rr_class));
|
||||
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ttl));
|
||||
NDR_CHECK(ndr_push_set_switch_value(ndr, &r->rdata, ((((r->rr_type) == NBT_QTYPE_NETBIOS) && ((r->rdata).data.length == 2))?0:r->rr_type)));
|
||||
NDR_CHECK(ndr_push_nbt_rdata(ndr, NDR_SCALARS, &r->rdata));
|
||||
}
|
||||
if (ndr_flags & NDR_BUFFERS) {
|
||||
}
|
||||
ndr->flags = _flags_save_STRUCT;
|
||||
}
|
||||
return NDR_ERR_SUCCESS;
|
||||
}
|
||||
|
@ -684,7 +684,8 @@ union smb_fileinfo {
|
||||
uint32_t ea_size;
|
||||
uint32_t access_mask;
|
||||
uint64_t position;
|
||||
uint64_t mode;
|
||||
uint32_t mode;
|
||||
uint32_t alignment_requirement;
|
||||
struct smb_wire_string fname;
|
||||
} out;
|
||||
} all_info2;
|
||||
@ -1646,7 +1647,7 @@ union smb_read {
|
||||
struct {
|
||||
union smb_handle file;
|
||||
uint64_t offset;
|
||||
uint16_t mincnt;
|
||||
uint32_t mincnt; /* enforced on SMB2, 16 bit on SMB */
|
||||
uint32_t maxcnt;
|
||||
uint16_t remaining;
|
||||
bool read_for_execute;
|
||||
@ -1918,6 +1919,7 @@ union smb_lock {
|
||||
#define SMB2_LOCK_FLAG_EXCLUSIVE 0x00000002
|
||||
#define SMB2_LOCK_FLAG_UNLOCK 0x00000004
|
||||
#define SMB2_LOCK_FLAG_FAIL_IMMEDIATELY 0x00000010
|
||||
#define SMB2_LOCK_FLAG_ALL_MASK 0x00000017
|
||||
uint32_t flags;
|
||||
uint32_t reserved;
|
||||
} *locks;
|
||||
@ -1948,23 +1950,43 @@ union smb_lock {
|
||||
enum smb_close_level {
|
||||
RAW_CLOSE_CLOSE,
|
||||
RAW_CLOSE_SPLCLOSE,
|
||||
RAW_CLOSE_SMB2
|
||||
RAW_CLOSE_SMB2,
|
||||
RAW_CLOSE_GENERIC,
|
||||
};
|
||||
|
||||
#define RAW_CLOSE_GENERIC RAW_CLOSE_CLOSE
|
||||
|
||||
/*
|
||||
union for close() backend call
|
||||
*/
|
||||
union smb_close {
|
||||
/* SMBclose (and generic) interface */
|
||||
/* generic interface */
|
||||
struct {
|
||||
enum smb_close_level level;
|
||||
struct {
|
||||
union smb_handle file;
|
||||
time_t write_time;
|
||||
#define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)
|
||||
uint16_t flags; /* SMB2_CLOSE_FLAGS_* */
|
||||
} in;
|
||||
struct {
|
||||
uint16_t flags;
|
||||
NTTIME create_time;
|
||||
NTTIME access_time;
|
||||
NTTIME write_time;
|
||||
NTTIME change_time;
|
||||
uint64_t alloc_size;
|
||||
uint64_t size;
|
||||
uint32_t file_attr;
|
||||
} out;
|
||||
} generic;
|
||||
|
||||
/* SMBclose interface */
|
||||
struct {
|
||||
enum smb_close_level level;
|
||||
struct {
|
||||
union smb_handle file;
|
||||
time_t write_time;
|
||||
} in;
|
||||
} close, generic;
|
||||
} close;
|
||||
|
||||
/* SMBsplclose interface - empty! */
|
||||
struct {
|
||||
@ -1982,7 +2004,6 @@ union smb_close {
|
||||
|
||||
/* static body buffer 24 (0x18) bytes */
|
||||
/* uint16_t buffer_code; 0x18 */
|
||||
#define SMB2_CLOSE_FLAGS_FULL_INFORMATION (1<<0)
|
||||
uint16_t flags; /* SMB2_CLOSE_FLAGS_* */
|
||||
uint32_t _pad;
|
||||
} in;
|
||||
|
@ -54,13 +54,13 @@ static uint_t ea_name_list_size(uint_t num_names, struct ea_name *eas)
|
||||
This assumes the names are strict ascii, which should be a
|
||||
reasonable assumption
|
||||
*/
|
||||
size_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas)
|
||||
size_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas, unsigned alignment)
|
||||
{
|
||||
uint_t total = 0;
|
||||
int i;
|
||||
for (i=0;i<num_eas;i++) {
|
||||
uint_t len = 8 + strlen(eas[i].name.s)+1 + eas[i].value.length;
|
||||
len = (len + 3) & ~3;
|
||||
len = (len + (alignment-1)) & ~(alignment-1);
|
||||
total += len;
|
||||
}
|
||||
return total;
|
||||
@ -96,14 +96,15 @@ void ea_put_list(uint8_t *data, uint_t num_eas, struct ea_struct *eas)
|
||||
put a chained ea_list into a pre-allocated buffer - buffer must be
|
||||
at least of size ea_list_size()
|
||||
*/
|
||||
void ea_put_list_chained(uint8_t *data, uint_t num_eas, struct ea_struct *eas)
|
||||
void ea_put_list_chained(uint8_t *data, uint_t num_eas, struct ea_struct *eas,
|
||||
unsigned alignment)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0;i<num_eas;i++) {
|
||||
uint_t nlen = strlen(eas[i].name.s);
|
||||
uint32_t len = 8+nlen+1+eas[i].value.length;
|
||||
uint_t pad = ((len + 3) & ~3) - len;
|
||||
uint_t pad = ((len + (alignment-1)) & ~(alignment-1)) - len;
|
||||
if (i == num_eas-1) {
|
||||
SIVAL(data, 0, 0);
|
||||
} else {
|
||||
|
@ -314,14 +314,14 @@ static struct smbcli_request *smb_raw_nttrans_create_send(struct smbcli_tree *tr
|
||||
|
||||
if (parms->ntcreatex.in.ea_list) {
|
||||
uint32_t ea_size = ea_list_size_chained(parms->ntcreatex.in.ea_list->num_eas,
|
||||
parms->ntcreatex.in.ea_list->eas);
|
||||
parms->ntcreatex.in.ea_list->eas, 4);
|
||||
ea_blob = data_blob_talloc(mem_ctx, NULL, ea_size);
|
||||
if (ea_blob.data == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
ea_put_list_chained(ea_blob.data,
|
||||
parms->ntcreatex.in.ea_list->num_eas,
|
||||
parms->ntcreatex.in.ea_list->eas);
|
||||
parms->ntcreatex.in.ea_list->eas, 4);
|
||||
}
|
||||
|
||||
nt.in.params = data_blob_talloc(mem_ctx, NULL, 53);
|
||||
|
@ -243,7 +243,8 @@ NTSTATUS smb_raw_fileinfo_passthru_parse(const DATA_BLOB *blob, TALLOC_CTX *mem_
|
||||
parms->all_info2.out.ea_size = IVAL(blob->data, 0x48);
|
||||
parms->all_info2.out.access_mask = IVAL(blob->data, 0x4C);
|
||||
parms->all_info2.out.position = BVAL(blob->data, 0x50);
|
||||
parms->all_info2.out.mode = BVAL(blob->data, 0x58);
|
||||
parms->all_info2.out.mode = IVAL(blob->data, 0x58);
|
||||
parms->all_info2.out.alignment_requirement = IVAL(blob->data, 0x5C);
|
||||
smbcli_blob_pull_string(NULL, mem_ctx, blob,
|
||||
&parms->all_info2.out.fname, 0x60, 0x64, STR_UNICODE);
|
||||
return NT_STATUS_OK;
|
||||
|
@ -133,6 +133,7 @@
|
||||
#define NTCREATEX_SHARE_ACCESS_READ 1
|
||||
#define NTCREATEX_SHARE_ACCESS_WRITE 2
|
||||
#define NTCREATEX_SHARE_ACCESS_DELETE 4
|
||||
#define NTCREATEX_SHARE_ACCESS_MASK 7
|
||||
|
||||
/* ntcreatex open_disposition field */
|
||||
#define NTCREATEX_DISP_SUPERSEDE 0 /* supersede existing file (if it exists) */
|
||||
@ -154,14 +155,18 @@
|
||||
#define NTCREATEX_OPTIONS_RANDOM_ACCESS 0x0800
|
||||
#define NTCREATEX_OPTIONS_DELETE_ON_CLOSE 0x1000
|
||||
#define NTCREATEX_OPTIONS_OPEN_BY_FILE_ID 0x2000
|
||||
#define NTCREATEX_OPTIONS_UNKNOWN_400000 0x400000
|
||||
|
||||
#define NTCREATEX_OPTIONS_BACKUP_INTENT 0x4000
|
||||
#define NTCREATEX_OPTIONS_REPARSE_POINT 0x200000
|
||||
#define NTCREATEX_OPTIONS_UNKNOWN_400000 0x400000
|
||||
/* create options these bits are for private use by backends, they are
|
||||
not valid on the wire */
|
||||
#define NTCREATEX_OPTIONS_PRIVATE_MASK 0xFF000000
|
||||
#define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS 0x01000000
|
||||
#define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB 0x02000000
|
||||
|
||||
#define NTCREATEX_OPTIONS_NOT_SUPPORTED_MASK 0x00DFA188
|
||||
|
||||
|
||||
|
||||
/* ntcreatex impersonation field */
|
||||
#define NTCREATEX_IMPERSONATION_ANONYMOUS 0
|
||||
@ -370,6 +375,7 @@
|
||||
#define FILE_ATTRIBUTE_OFFLINE 0x1000
|
||||
#define FILE_ATTRIBUTE_NONINDEXED 0x2000
|
||||
#define FILE_ATTRIBUTE_ENCRYPTED 0x4000
|
||||
#define FILE_ATTRIBUTE_ALL_MASK 0x7FFF
|
||||
|
||||
/* Flags - combined with attributes. */
|
||||
#define FILE_FLAG_WRITE_THROUGH 0x80000000L
|
||||
|
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module(package="samba.security") security
|
||||
%module(docstring="Security-related classes.",package="samba.security") security
|
||||
|
||||
%{
|
||||
#include "includes.h"
|
||||
@ -65,8 +65,14 @@ enum sec_privilege {
|
||||
typedef struct security_token {
|
||||
%extend {
|
||||
security_token(TALLOC_CTX *mem_ctx) { return security_token_initialise(mem_ctx); }
|
||||
%feature("docstring") is_sid "S.is_sid(sid) -> bool\n" \
|
||||
"Check whether this token is of the specified SID.";
|
||||
bool is_sid(const struct dom_sid *sid);
|
||||
%feature("docstring") is_system "S.is_system() -> bool\n" \
|
||||
"Check whether this is a system token.";
|
||||
bool is_system();
|
||||
%feature("docstring") is_anonymous "S.is_anonymus() -> bool\n" \
|
||||
"Check whether this is an anonymous token.";
|
||||
bool is_anonymous();
|
||||
bool has_sid(const struct dom_sid *sid);
|
||||
bool has_builtin_administrators();
|
||||
@ -81,6 +87,8 @@ typedef struct security_token {
|
||||
typedef struct security_descriptor {
|
||||
%extend {
|
||||
security_descriptor(TALLOC_CTX *mem_ctx) { return security_descriptor_initialise(mem_ctx); }
|
||||
%feature("docstring") sacl_add "S.sacl_add(ace) -> None\n" \
|
||||
"Add a security ace to this security descriptor";
|
||||
NTSTATUS sacl_add(const struct security_ace *ace);
|
||||
NTSTATUS dacl_add(const struct security_ace *ace);
|
||||
NTSTATUS dacl_del(const struct dom_sid *trustee);
|
||||
@ -111,6 +119,9 @@ typedef struct dom_sid {
|
||||
}
|
||||
} dom_sid;
|
||||
|
||||
%feature("docstring") random_sid "random_sid() -> sid\n" \
|
||||
"Generate a random SID";
|
||||
|
||||
%inline %{
|
||||
static struct dom_sid *random_sid(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
|
@ -1,8 +1,12 @@
|
||||
# This file was automatically generated by SWIG (http://www.swig.org).
|
||||
# Version 1.3.33
|
||||
# Version 1.3.35
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Security-related classes.
|
||||
"""
|
||||
|
||||
import _security
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
@ -86,6 +90,27 @@ class SecurityToken(object):
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
_security.SecurityToken_swiginit(self,_security.new_SecurityToken(*args, **kwargs))
|
||||
def is_sid(*args, **kwargs):
|
||||
"""
|
||||
S.is_sid(sid) -> bool
|
||||
Check whether this token is of the specified SID.
|
||||
"""
|
||||
return _security.SecurityToken_is_sid(*args, **kwargs)
|
||||
|
||||
def is_system(*args, **kwargs):
|
||||
"""
|
||||
S.is_system() -> bool
|
||||
Check whether this is a system token.
|
||||
"""
|
||||
return _security.SecurityToken_is_system(*args, **kwargs)
|
||||
|
||||
def is_anonymous(*args, **kwargs):
|
||||
"""
|
||||
S.is_anonymus() -> bool
|
||||
Check whether this is an anonymous token.
|
||||
"""
|
||||
return _security.SecurityToken_is_anonymous(*args, **kwargs)
|
||||
|
||||
__swig_destroy__ = _security.delete_SecurityToken
|
||||
SecurityToken.is_sid = new_instancemethod(_security.SecurityToken_is_sid,None,SecurityToken)
|
||||
SecurityToken.is_system = new_instancemethod(_security.SecurityToken_is_system,None,SecurityToken)
|
||||
@ -103,6 +128,13 @@ class security_descriptor(object):
|
||||
__repr__ = _swig_repr
|
||||
def __init__(self, *args, **kwargs):
|
||||
_security.security_descriptor_swiginit(self,_security.new_security_descriptor(*args, **kwargs))
|
||||
def sacl_add(*args, **kwargs):
|
||||
"""
|
||||
S.sacl_add(ace) -> None
|
||||
Add a security ace to this security descriptor
|
||||
"""
|
||||
return _security.security_descriptor_sacl_add(*args, **kwargs)
|
||||
|
||||
__swig_destroy__ = _security.delete_security_descriptor
|
||||
security_descriptor.sacl_add = new_instancemethod(_security.security_descriptor_sacl_add,None,security_descriptor)
|
||||
security_descriptor.dacl_add = new_instancemethod(_security.security_descriptor_dacl_add,None,security_descriptor)
|
||||
@ -123,7 +155,13 @@ Sid.__eq__ = new_instancemethod(_security.Sid___eq__,None,Sid)
|
||||
Sid_swigregister = _security.Sid_swigregister
|
||||
Sid_swigregister(Sid)
|
||||
|
||||
random_sid = _security.random_sid
|
||||
|
||||
def random_sid(*args):
|
||||
"""
|
||||
random_sid() -> sid
|
||||
Generate a random SID
|
||||
"""
|
||||
return _security.random_sid(*args)
|
||||
privilege_name = _security.privilege_name
|
||||
privilege_id = _security.privilege_id
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 1.3.33
|
||||
* Version 1.3.35
|
||||
*
|
||||
* This file is not intended to be easily readable and contains a number of
|
||||
* coding conventions designed to improve portability and efficiency. Do not make
|
||||
@ -126,7 +126,7 @@
|
||||
|
||||
/* This should only be incremented when either the layout of swig_type_info changes,
|
||||
or for whatever reason, the runtime changes incompatibly */
|
||||
#define SWIG_RUNTIME_VERSION "3"
|
||||
#define SWIG_RUNTIME_VERSION "4"
|
||||
|
||||
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
|
||||
#ifdef SWIG_TYPE_TABLE
|
||||
@ -161,6 +161,7 @@
|
||||
|
||||
/* Flags for pointer conversions */
|
||||
#define SWIG_POINTER_DISOWN 0x1
|
||||
#define SWIG_CAST_NEW_MEMORY 0x2
|
||||
|
||||
/* Flags for new pointer objects */
|
||||
#define SWIG_POINTER_OWN 0x1
|
||||
@ -301,10 +302,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *(*swig_converter_func)(void *);
|
||||
typedef void *(*swig_converter_func)(void *, int *);
|
||||
typedef struct swig_type_info *(*swig_dycast_func)(void **);
|
||||
|
||||
/* Structure to store inforomation on one type */
|
||||
/* Structure to store information on one type */
|
||||
typedef struct swig_type_info {
|
||||
const char *name; /* mangled name of this type */
|
||||
const char *str; /* human readable name of this type */
|
||||
@ -431,8 +432,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
|
||||
Cast a pointer up an inheritance hierarchy
|
||||
*/
|
||||
SWIGRUNTIMEINLINE void *
|
||||
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
|
||||
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
|
||||
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
|
||||
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -856,7 +857,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
|
||||
Py_DECREF(old_str);
|
||||
Py_DECREF(value);
|
||||
} else {
|
||||
PyErr_Format(PyExc_RuntimeError, mesg);
|
||||
PyErr_SetString(PyExc_RuntimeError, mesg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1416,7 +1417,7 @@ PySwigObject_dealloc(PyObject *v)
|
||||
{
|
||||
PySwigObject *sobj = (PySwigObject *) v;
|
||||
PyObject *next = sobj->next;
|
||||
if (sobj->own) {
|
||||
if (sobj->own == SWIG_POINTER_OWN) {
|
||||
swig_type_info *ty = sobj->ty;
|
||||
PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
|
||||
PyObject *destroy = data ? data->destroy : 0;
|
||||
@ -1434,12 +1435,13 @@ PySwigObject_dealloc(PyObject *v)
|
||||
res = ((*meth)(mself, v));
|
||||
}
|
||||
Py_XDECREF(res);
|
||||
} else {
|
||||
const char *name = SWIG_TypePrettyName(ty);
|
||||
}
|
||||
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
|
||||
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
|
||||
#endif
|
||||
else {
|
||||
const char *name = SWIG_TypePrettyName(ty);
|
||||
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Py_XDECREF(next);
|
||||
PyObject_DEL(v);
|
||||
@ -1944,7 +1946,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
|
||||
|
||||
SWIGRUNTIME int
|
||||
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
|
||||
if (own) {
|
||||
if (own == SWIG_POINTER_OWN) {
|
||||
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
|
||||
if (sobj) {
|
||||
int oldown = sobj->own;
|
||||
@ -1965,6 +1967,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
return SWIG_OK;
|
||||
} else {
|
||||
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
|
||||
if (own)
|
||||
*own = 0;
|
||||
while (sobj) {
|
||||
void *vptr = sobj->ptr;
|
||||
if (ty) {
|
||||
@ -1978,7 +1982,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
if (!tc) {
|
||||
sobj = (PySwigObject *)sobj->next;
|
||||
} else {
|
||||
if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
|
||||
if (ptr) {
|
||||
int newmemory = 0;
|
||||
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
||||
if (newmemory == SWIG_CAST_NEW_MEMORY) {
|
||||
assert(own);
|
||||
if (own)
|
||||
*own = *own | SWIG_CAST_NEW_MEMORY;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1988,7 +2000,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
}
|
||||
}
|
||||
if (sobj) {
|
||||
if (own) *own = sobj->own;
|
||||
if (own)
|
||||
*own = *own | sobj->own;
|
||||
if (flags & SWIG_POINTER_DISOWN) {
|
||||
sobj->own = 0;
|
||||
}
|
||||
@ -2053,8 +2066,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
|
||||
}
|
||||
if (ty) {
|
||||
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
|
||||
if (!tc) return SWIG_ERROR;
|
||||
*ptr = SWIG_TypeCast(tc,vptr);
|
||||
if (tc) {
|
||||
int newmemory = 0;
|
||||
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
||||
assert(!newmemory); /* newmemory handling not yet implemented */
|
||||
} else {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
} else {
|
||||
*ptr = vptr;
|
||||
}
|
||||
@ -2503,7 +2521,7 @@ static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
|
||||
|
||||
#define SWIG_name "_security"
|
||||
|
||||
#define SWIGVERSION 0x010333
|
||||
#define SWIGVERSION 0x010335
|
||||
#define SWIG_VERSION SWIGVERSION
|
||||
|
||||
|
||||
@ -3509,9 +3527,18 @@ fail:
|
||||
|
||||
static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"new_SecurityToken", (PyCFunction)_wrap_new_SecurityToken, METH_NOARGS, NULL},
|
||||
{ (char *)"SecurityToken_is_sid", (PyCFunction) _wrap_SecurityToken_is_sid, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"SecurityToken_is_system", (PyCFunction)_wrap_SecurityToken_is_system, METH_O, NULL},
|
||||
{ (char *)"SecurityToken_is_anonymous", (PyCFunction)_wrap_SecurityToken_is_anonymous, METH_O, NULL},
|
||||
{ (char *)"SecurityToken_is_sid", (PyCFunction) _wrap_SecurityToken_is_sid, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.is_sid(sid) -> bool\n"
|
||||
"Check whether this token is of the specified SID.\n"
|
||||
""},
|
||||
{ (char *)"SecurityToken_is_system", (PyCFunction)_wrap_SecurityToken_is_system, METH_O, (char *)"\n"
|
||||
"S.is_system() -> bool\n"
|
||||
"Check whether this is a system token.\n"
|
||||
""},
|
||||
{ (char *)"SecurityToken_is_anonymous", (PyCFunction)_wrap_SecurityToken_is_anonymous, METH_O, (char *)"\n"
|
||||
"S.is_anonymus() -> bool\n"
|
||||
"Check whether this is an anonymous token.\n"
|
||||
""},
|
||||
{ (char *)"SecurityToken_has_sid", (PyCFunction) _wrap_SecurityToken_has_sid, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"SecurityToken_has_builtin_administrators", (PyCFunction)_wrap_SecurityToken_has_builtin_administrators, METH_O, NULL},
|
||||
{ (char *)"SecurityToken_has_nt_authenticated_users", (PyCFunction)_wrap_SecurityToken_has_nt_authenticated_users, METH_O, NULL},
|
||||
@ -3521,7 +3548,10 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"SecurityToken_swigregister", SecurityToken_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"SecurityToken_swiginit", SecurityToken_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"new_security_descriptor", (PyCFunction)_wrap_new_security_descriptor, METH_NOARGS, NULL},
|
||||
{ (char *)"security_descriptor_sacl_add", (PyCFunction) _wrap_security_descriptor_sacl_add, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"security_descriptor_sacl_add", (PyCFunction) _wrap_security_descriptor_sacl_add, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.sacl_add(ace) -> None\n"
|
||||
"Add a security ace to this security descriptor\n"
|
||||
""},
|
||||
{ (char *)"security_descriptor_dacl_add", (PyCFunction) _wrap_security_descriptor_dacl_add, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"security_descriptor_dacl_del", (PyCFunction) _wrap_security_descriptor_dacl_del, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"security_descriptor_sacl_del", (PyCFunction) _wrap_security_descriptor_sacl_del, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
@ -3535,7 +3565,10 @@ static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"delete_Sid", (PyCFunction)_wrap_delete_Sid, METH_O, NULL},
|
||||
{ (char *)"Sid_swigregister", Sid_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"Sid_swiginit", Sid_swiginit, METH_VARARGS, NULL},
|
||||
{ (char *)"random_sid", (PyCFunction)_wrap_random_sid, METH_NOARGS, NULL},
|
||||
{ (char *)"random_sid", (PyCFunction)_wrap_random_sid, METH_NOARGS, (char *)"\n"
|
||||
"random_sid() -> sid\n"
|
||||
"Generate a random SID\n"
|
||||
""},
|
||||
{ (char *)"privilege_name", (PyCFunction) _wrap_privilege_name, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"privilege_id", (PyCFunction) _wrap_privilege_id, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ NULL, NULL, 0, NULL }
|
||||
@ -3674,7 +3707,7 @@ SWIGRUNTIME void
|
||||
SWIG_InitializeModule(void *clientdata) {
|
||||
size_t i;
|
||||
swig_module_info *module_head, *iter;
|
||||
int found;
|
||||
int found, init;
|
||||
|
||||
clientdata = clientdata;
|
||||
|
||||
@ -3684,6 +3717,9 @@ SWIG_InitializeModule(void *clientdata) {
|
||||
swig_module.type_initial = swig_type_initial;
|
||||
swig_module.cast_initial = swig_cast_initial;
|
||||
swig_module.next = &swig_module;
|
||||
init = 1;
|
||||
} else {
|
||||
init = 0;
|
||||
}
|
||||
|
||||
/* Try and load any already created modules */
|
||||
@ -3712,6 +3748,12 @@ SWIG_InitializeModule(void *clientdata) {
|
||||
module_head->next = &swig_module;
|
||||
}
|
||||
|
||||
/* When multiple interpeters are used, a module could have already been initialized in
|
||||
a different interpreter, but not yet have a pointer in this interpreter.
|
||||
In this case, we do not want to continue adding types... everything should be
|
||||
set up already */
|
||||
if (init == 0) return;
|
||||
|
||||
/* Now work on filling in swig_module.types */
|
||||
#ifdef SWIGRUNTIME_DEBUG
|
||||
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
|
||||
|
@ -94,6 +94,7 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
|
||||
NTSTATUS status;
|
||||
DATA_BLOB blob = data_blob(NULL, 0);
|
||||
uint32_t i;
|
||||
struct smb2_create_blobs blobs = io->in.blobs;
|
||||
|
||||
req = smb2_request_init_tree(tree, SMB2_OP_CREATE, 0x38, true, 0);
|
||||
if (req == NULL) return NULL;
|
||||
@ -117,9 +118,9 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
|
||||
|
||||
if (io->in.eas.num_eas != 0) {
|
||||
DATA_BLOB b = data_blob_talloc(req, NULL,
|
||||
ea_list_size_chained(io->in.eas.num_eas, io->in.eas.eas));
|
||||
ea_put_list_chained(b.data, io->in.eas.num_eas, io->in.eas.eas);
|
||||
status = smb2_create_blob_add(req, &io->in.blobs,
|
||||
ea_list_size_chained(io->in.eas.num_eas, io->in.eas.eas, 4));
|
||||
ea_put_list_chained(b.data, io->in.eas.num_eas, io->in.eas.eas, 4);
|
||||
status = smb2_create_blob_add(req, &blobs,
|
||||
SMB2_CREATE_TAG_EXTA, b);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
talloc_free(req);
|
||||
@ -130,22 +131,22 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
|
||||
|
||||
/* an empty MxAc tag seems to be used to ask the server to
|
||||
return the maximum access mask allowed on the file */
|
||||
status = smb2_create_blob_add(req, &io->in.blobs,
|
||||
status = smb2_create_blob_add(req, &blobs,
|
||||
SMB2_CREATE_TAG_MXAC, data_blob(NULL, 0));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
talloc_free(req);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i=0; i < io->in.blobs.num_blobs; i++) {
|
||||
for (i=0; i < blobs.num_blobs; i++) {
|
||||
bool last = false;
|
||||
const struct smb2_create_blob *c;
|
||||
|
||||
if ((i + 1) == io->in.blobs.num_blobs) {
|
||||
if ((i + 1) == blobs.num_blobs) {
|
||||
last = true;
|
||||
}
|
||||
|
||||
c = &io->in.blobs.blobs[i];
|
||||
c = &blobs.blobs[i];
|
||||
status = smb2_create_blob_push_one(req, &blob,
|
||||
c, last);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
|
@ -127,6 +127,16 @@ int smb2_deltree(struct smb2_tree *tree, const char *dname)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_CANNOT_DELETE)) {
|
||||
/* it could be read-only */
|
||||
status = smb2_util_setatr(tree, dname, FILE_ATTRIBUTE_NORMAL);
|
||||
status = smb2_util_unlink(tree, dname);
|
||||
}
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
talloc_free(tmp_ctx);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ZERO_STRUCT(create_parm);
|
||||
create_parm.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
|
||||
create_parm.in.share_access =
|
||||
|
@ -1,5 +1,5 @@
|
||||
# This file was automatically generated by SWIG (http://www.swig.org).
|
||||
# Version 1.3.33
|
||||
# Version 1.3.35
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 1.3.33
|
||||
* Version 1.3.35
|
||||
*
|
||||
* This file is not intended to be easily readable and contains a number of
|
||||
* coding conventions designed to improve portability and efficiency. Do not make
|
||||
@ -126,7 +126,7 @@
|
||||
|
||||
/* This should only be incremented when either the layout of swig_type_info changes,
|
||||
or for whatever reason, the runtime changes incompatibly */
|
||||
#define SWIG_RUNTIME_VERSION "3"
|
||||
#define SWIG_RUNTIME_VERSION "4"
|
||||
|
||||
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
|
||||
#ifdef SWIG_TYPE_TABLE
|
||||
@ -161,6 +161,7 @@
|
||||
|
||||
/* Flags for pointer conversions */
|
||||
#define SWIG_POINTER_DISOWN 0x1
|
||||
#define SWIG_CAST_NEW_MEMORY 0x2
|
||||
|
||||
/* Flags for new pointer objects */
|
||||
#define SWIG_POINTER_OWN 0x1
|
||||
@ -301,10 +302,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void *(*swig_converter_func)(void *);
|
||||
typedef void *(*swig_converter_func)(void *, int *);
|
||||
typedef struct swig_type_info *(*swig_dycast_func)(void **);
|
||||
|
||||
/* Structure to store inforomation on one type */
|
||||
/* Structure to store information on one type */
|
||||
typedef struct swig_type_info {
|
||||
const char *name; /* mangled name of this type */
|
||||
const char *str; /* human readable name of this type */
|
||||
@ -431,8 +432,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
|
||||
Cast a pointer up an inheritance hierarchy
|
||||
*/
|
||||
SWIGRUNTIMEINLINE void *
|
||||
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
|
||||
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
|
||||
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
|
||||
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -856,7 +857,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
|
||||
Py_DECREF(old_str);
|
||||
Py_DECREF(value);
|
||||
} else {
|
||||
PyErr_Format(PyExc_RuntimeError, mesg);
|
||||
PyErr_SetString(PyExc_RuntimeError, mesg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1416,7 +1417,7 @@ PySwigObject_dealloc(PyObject *v)
|
||||
{
|
||||
PySwigObject *sobj = (PySwigObject *) v;
|
||||
PyObject *next = sobj->next;
|
||||
if (sobj->own) {
|
||||
if (sobj->own == SWIG_POINTER_OWN) {
|
||||
swig_type_info *ty = sobj->ty;
|
||||
PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
|
||||
PyObject *destroy = data ? data->destroy : 0;
|
||||
@ -1434,12 +1435,13 @@ PySwigObject_dealloc(PyObject *v)
|
||||
res = ((*meth)(mself, v));
|
||||
}
|
||||
Py_XDECREF(res);
|
||||
} else {
|
||||
const char *name = SWIG_TypePrettyName(ty);
|
||||
}
|
||||
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
|
||||
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
|
||||
#endif
|
||||
else {
|
||||
const char *name = SWIG_TypePrettyName(ty);
|
||||
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Py_XDECREF(next);
|
||||
PyObject_DEL(v);
|
||||
@ -1944,7 +1946,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
|
||||
|
||||
SWIGRUNTIME int
|
||||
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
|
||||
if (own) {
|
||||
if (own == SWIG_POINTER_OWN) {
|
||||
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
|
||||
if (sobj) {
|
||||
int oldown = sobj->own;
|
||||
@ -1965,6 +1967,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
return SWIG_OK;
|
||||
} else {
|
||||
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
|
||||
if (own)
|
||||
*own = 0;
|
||||
while (sobj) {
|
||||
void *vptr = sobj->ptr;
|
||||
if (ty) {
|
||||
@ -1978,7 +1982,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
if (!tc) {
|
||||
sobj = (PySwigObject *)sobj->next;
|
||||
} else {
|
||||
if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
|
||||
if (ptr) {
|
||||
int newmemory = 0;
|
||||
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
||||
if (newmemory == SWIG_CAST_NEW_MEMORY) {
|
||||
assert(own);
|
||||
if (own)
|
||||
*own = *own | SWIG_CAST_NEW_MEMORY;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1988,7 +2000,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
|
||||
}
|
||||
}
|
||||
if (sobj) {
|
||||
if (own) *own = sobj->own;
|
||||
if (own)
|
||||
*own = *own | sobj->own;
|
||||
if (flags & SWIG_POINTER_DISOWN) {
|
||||
sobj->own = 0;
|
||||
}
|
||||
@ -2053,8 +2066,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
|
||||
}
|
||||
if (ty) {
|
||||
swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
|
||||
if (!tc) return SWIG_ERROR;
|
||||
*ptr = SWIG_TypeCast(tc,vptr);
|
||||
if (tc) {
|
||||
int newmemory = 0;
|
||||
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
|
||||
assert(!newmemory); /* newmemory handling not yet implemented */
|
||||
} else {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
} else {
|
||||
*ptr = vptr;
|
||||
}
|
||||
@ -2495,7 +2513,7 @@ static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
|
||||
|
||||
#define SWIG_name "_libcli_smb"
|
||||
|
||||
#define SWIGVERSION 0x010333
|
||||
#define SWIGVERSION 0x010335
|
||||
#define SWIG_VERSION SWIGVERSION
|
||||
|
||||
|
||||
@ -2769,7 +2787,7 @@ SWIGRUNTIME void
|
||||
SWIG_InitializeModule(void *clientdata) {
|
||||
size_t i;
|
||||
swig_module_info *module_head, *iter;
|
||||
int found;
|
||||
int found, init;
|
||||
|
||||
clientdata = clientdata;
|
||||
|
||||
@ -2779,6 +2797,9 @@ SWIG_InitializeModule(void *clientdata) {
|
||||
swig_module.type_initial = swig_type_initial;
|
||||
swig_module.cast_initial = swig_cast_initial;
|
||||
swig_module.next = &swig_module;
|
||||
init = 1;
|
||||
} else {
|
||||
init = 0;
|
||||
}
|
||||
|
||||
/* Try and load any already created modules */
|
||||
@ -2807,6 +2828,12 @@ SWIG_InitializeModule(void *clientdata) {
|
||||
module_head->next = &swig_module;
|
||||
}
|
||||
|
||||
/* When multiple interpeters are used, a module could have already been initialized in
|
||||
a different interpreter, but not yet have a pointer in this interpreter.
|
||||
In this case, we do not want to continue adding types... everything should be
|
||||
set up already */
|
||||
if (init == 0) return;
|
||||
|
||||
/* Now work on filling in swig_module.types */
|
||||
#ifdef SWIGRUNTIME_DEBUG
|
||||
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
|
||||
|
@ -18,10 +18,13 @@
|
||||
*/
|
||||
|
||||
#ifdef SWIGPYTHON
|
||||
%{
|
||||
#include "libcli/util/pyerrors.h"
|
||||
%}
|
||||
|
||||
%typemap(out,noblock=1) WERROR {
|
||||
if (!W_ERROR_IS_OK($1)) {
|
||||
PyObject *obj = Py_BuildValue((char *)"(i,s)", W_ERROR_V($1), win_errstr($1));
|
||||
PyErr_SetObject(PyExc_RuntimeError, obj);
|
||||
PyErr_SetWERROR($1);
|
||||
SWIG_fail;
|
||||
} else if ($result == NULL) {
|
||||
$result = Py_None;
|
||||
@ -30,8 +33,7 @@
|
||||
|
||||
%typemap(out,noblock=1) NTSTATUS {
|
||||
if (NT_STATUS_IS_ERR($1)) {
|
||||
PyObject *obj = Py_BuildValue((char *)"(i,s)", NT_STATUS_V($1), nt_errstr($1));
|
||||
PyErr_SetObject(PyExc_RuntimeError, obj);
|
||||
PyErr_SetNTSTATUS($1);
|
||||
SWIG_fail;
|
||||
} else if ($result == NULL) {
|
||||
$result = Py_None;
|
||||
|
@ -17,23 +17,17 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _PYRPC_H_
|
||||
#define _PYRPC_H_
|
||||
#ifndef __PYERRORS_H__
|
||||
#define __PYERRORS_H__
|
||||
|
||||
#define PY_CHECK_TYPE(type, var, fail) \
|
||||
if (!type ## _Check(var)) {\
|
||||
PyErr_Format(PyExc_TypeError, "Expected type %s", type ## _Type.tp_name); \
|
||||
fail; \
|
||||
}
|
||||
#define PyErr_FromWERROR(err) Py_BuildValue("(i,s)", W_ERROR_V(err), discard_const_p(char, win_errstr(err)))
|
||||
|
||||
#define dom_sid2_Type dom_sid_Type
|
||||
#define dom_sid28_Type dom_sid_Type
|
||||
#define dom_sid2_Check dom_sid_Check
|
||||
#define dom_sid28_Check dom_sid_Check
|
||||
#define PyErr_FromNTSTATUS(status) Py_BuildValue("(i,s)", NT_STATUS_V(status), discard_const_p(char, nt_errstr(status)))
|
||||
|
||||
/* This macro is only provided by Python >= 2.3 */
|
||||
#ifndef PyAPI_DATA
|
||||
# define PyAPI_DATA(RTYPE) extern RTYPE
|
||||
#endif
|
||||
#define PyErr_SetWERROR(err) \
|
||||
PyErr_SetObject(PyExc_RuntimeError, PyErr_FromWERROR(err))
|
||||
|
||||
#endif /* _PYRPC_H_ */
|
||||
#define PyErr_SetNTSTATUS(status) \
|
||||
PyErr_SetObject(PyExc_RuntimeError, PyErr_FromNTSTATUS(status))
|
||||
|
||||
#endif /* __PYERRORS_H__ */
|
@ -71,8 +71,11 @@ static PyObject *py_net_join(PyObject *cls, PyObject *args, PyObject *kwargs)
|
||||
return result;
|
||||
}
|
||||
|
||||
static char py_net_join_doc[] = "join(domain_name, netbios_name, join_type, level) -> (join_password, domain_sid, domain_name)\n\n" \
|
||||
"Join the domain with the specified name.";
|
||||
|
||||
static struct PyMethodDef net_methods[] = {
|
||||
{"Join", (PyCFunction)py_net_join, METH_VARARGS|METH_KEYWORDS},
|
||||
{"Join", (PyCFunction)py_net_join, METH_VARARGS|METH_KEYWORDS, py_net_join_doc},
|
||||
{NULL }
|
||||
};
|
||||
|
||||
|
@ -357,7 +357,7 @@ NDR_WINBIND_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winbind.o
|
||||
#PUBLIC_HEADERS += $(gen_ndrsrcdir)/winbind.h
|
||||
|
||||
$(librpcsrcdir)/idl-deps:
|
||||
./$(librpcsrcdir)/idl-deps.pl $(librpcsrcdir)/idl/*.idl >$@
|
||||
$(PERL) $(librpcsrcdir)/idl-deps.pl $(librpcsrcdir)/idl/*.idl >$@
|
||||
|
||||
clean::
|
||||
rm -f $(librpcsrcdir)/idl-deps
|
||||
@ -441,6 +441,11 @@ PUBLIC_DEPENDENCIES = dcerpc NDR_UNIXINFO
|
||||
|
||||
RPC_NDR_UNIXINFO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_unixinfo_c.o
|
||||
|
||||
[SUBSYSTEM::RPC_NDR_IRPC]
|
||||
PUBLIC_DEPENDENCIES = dcerpc NDR_IRPC
|
||||
|
||||
RPC_NDR_IRPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_irpc_c.o
|
||||
|
||||
[LIBRARY::dcerpc_samr]
|
||||
PUBLIC_DEPENDENCIES = dcerpc NDR_SAMR
|
||||
|
||||
@ -614,217 +619,114 @@ PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, rpc/dcerpc.h \
|
||||
gen_ndr/epmapper.h gen_ndr/ndr_epmapper.h gen_ndr/ndr_epmapper_c.h)
|
||||
|
||||
|
||||
[MODULE::RPC_EJS_ECHO]
|
||||
INIT_FUNCTION = ejs_init_rpcecho
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_ECHO EJSRPC
|
||||
[PYTHON::python_dcerpc]
|
||||
LIBRARY_REALNAME = samba/dcerpc/base.$(SHLIBEXT)
|
||||
PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG swig_credentials param
|
||||
|
||||
RPC_EJS_ECHO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_echo_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_MISC]
|
||||
INIT_FUNCTION = ejs_init_misc
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_MISC EJSRPC
|
||||
|
||||
RPC_EJS_MISC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_misc_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_SAMR]
|
||||
INIT_FUNCTION = ejs_init_samr
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_SAMR EJSRPC RPC_EJS_LSA RPC_EJS_SECURITY RPC_EJS_MISC
|
||||
|
||||
RPC_EJS_SAMR_OBJ_FILES = $(gen_ndrsrcdir)/ndr_samr_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_SECURITY]
|
||||
INIT_FUNCTION = ejs_init_security
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_SECURITY EJSRPC
|
||||
|
||||
RPC_EJS_SECURITY_OBJ_FILES = $(gen_ndrsrcdir)/ndr_security_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_LSA]
|
||||
INIT_FUNCTION = ejs_init_lsarpc
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_LSA EJSRPC RPC_EJS_SECURITY RPC_EJS_MISC
|
||||
|
||||
RPC_EJS_LSA_OBJ_FILES = $(gen_ndrsrcdir)/ndr_lsa_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_DFS]
|
||||
INIT_FUNCTION = ejs_init_netdfs
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_DFS EJSRPC
|
||||
|
||||
RPC_EJS_DFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dfs_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_DRSUAPI]
|
||||
INIT_FUNCTION = ejs_init_drsuapi
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_DRSUAPI EJSRPC RPC_EJS_MISC RPC_EJS_SAMR
|
||||
|
||||
RPC_EJS_DRSUAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsuapi_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_SPOOLSS]
|
||||
INIT_FUNCTION = ejs_init_spoolss
|
||||
SUBSYSTEM = smbcalls
|
||||
ENABLE = NO
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_SPOOLSS EJSRPC
|
||||
|
||||
RPC_EJS_SPOOLSS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_spoolss_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_WKSSVC]
|
||||
INIT_FUNCTION = ejs_init_wkssvc
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_WKSSVC EJSRPC RPC_EJS_SRVSVC RPC_EJS_MISC
|
||||
|
||||
RPC_EJS_WKSSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wkssvc_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_SRVSVC]
|
||||
INIT_FUNCTION = ejs_init_srvsvc
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_SRVSVC EJSRPC RPC_EJS_MISC RPC_EJS_SVCCTL RPC_EJS_SECURITY
|
||||
|
||||
RPC_EJS_SRVSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_srvsvc_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_EVENTLOG]
|
||||
INIT_FUNCTION = ejs_init_eventlog
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_EVENTLOG EJSRPC RPC_EJS_MISC
|
||||
|
||||
RPC_EJS_EVENTLOG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_eventlog_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_WINREG]
|
||||
INIT_FUNCTION = ejs_init_winreg
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_WINREG EJSRPC RPC_EJS_INITSHUTDOWN \
|
||||
RPC_EJS_MISC RPC_EJS_SECURITY
|
||||
|
||||
RPC_EJS_WINREG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winreg_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_INITSHUTDOWN]
|
||||
INIT_FUNCTION = ejs_init_initshutdown
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_INITSHUTDOWN EJSRPC
|
||||
|
||||
RPC_EJS_INITSHUTDOWN_OBJ_FILES = $(gen_ndrsrcdir)/ndr_initshutdown_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_NETLOGON]
|
||||
INIT_FUNCTION = ejs_init_netlogon
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_NETLOGON EJSRPC RPC_EJS_SAMR RPC_EJS_SECURITY RPC_EJS_MISC
|
||||
|
||||
RPC_EJS_NETLOGON_OBJ_FILES = $(gen_ndrsrcdir)/ndr_netlogon_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_SVCCTL]
|
||||
INIT_FUNCTION = ejs_init_svcctl
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_SVCCTL EJSRPC RPC_EJS_MISC
|
||||
|
||||
RPC_EJS_SVCCTL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_svcctl_ejs.o
|
||||
|
||||
[MODULE::RPC_EJS_IRPC]
|
||||
INIT_FUNCTION = ejs_init_irpc
|
||||
SUBSYSTEM = smbcalls
|
||||
PRIVATE_DEPENDENCIES = dcerpc NDR_IRPC EJSRPC
|
||||
|
||||
RPC_EJS_IRPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_irpc_ejs.o
|
||||
|
||||
[PYTHON::swig_dcerpc]
|
||||
LIBRARY_REALNAME = samba/dcerpc/_dcerpc.$(SHLIBEXT)
|
||||
PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
|
||||
|
||||
swig_dcerpc_OBJ_FILES = $(dcerpcsrcdir)/dcerpc_wrap.o
|
||||
python_dcerpc_OBJ_FILES = $(dcerpcsrcdir)/pyrpc.o
|
||||
|
||||
$(eval $(call python_py_module_template,samba/dcerpc/__init__.py,$(dcerpcsrcdir)/dcerpc.py))
|
||||
|
||||
$(swig_dcerpc_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
|
||||
|
||||
[PYTHON::python_echo]
|
||||
LIBRARY_REALNAME = samba/dcerpc/echo.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_ECHO PYTALLOC param swig_credentials
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_ECHO PYTALLOC param swig_credentials python_dcerpc
|
||||
|
||||
python_echo_OBJ_FILES = $(gen_ndrsrcdir)/py_echo.o
|
||||
|
||||
[PYTHON::python_winreg]
|
||||
LIBRARY_REALNAME = samba/dcerpc/winreg.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_WINREG python_misc PYTALLOC param swig_credentials python_dcerpc_misc python_lsa
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_WINREG python_misc PYTALLOC param swig_credentials python_dcerpc_misc python_lsa python_dcerpc
|
||||
|
||||
python_winreg_OBJ_FILES = $(gen_ndrsrcdir)/py_winreg.o
|
||||
|
||||
[PYTHON::python_dcerpc_misc]
|
||||
LIBRARY_REALNAME = samba/dcerpc/misc.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = PYTALLOC
|
||||
PRIVATE_DEPENDENCIES = PYTALLOC python_dcerpc
|
||||
|
||||
python_dcerpc_misc_OBJ_FILES = $(gen_ndrsrcdir)/py_misc.o
|
||||
|
||||
[PYTHON::python_initshutdown]
|
||||
LIBRARY_REALNAME = samba/dcerpc/initshutdown.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN PYTALLOC param swig_credentials python_lsa python_dcerpc_security
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN PYTALLOC param swig_credentials python_lsa python_dcerpc_security python_dcerpc
|
||||
|
||||
python_initshutdown_OBJ_FILES = $(gen_ndrsrcdir)/py_initshutdown.o
|
||||
|
||||
[PYTHON::python_epmapper]
|
||||
LIBRARY_REALNAME = samba/dcerpc/epmapper.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = dcerpc PYTALLOC param swig_credentials python_dcerpc_misc
|
||||
PRIVATE_DEPENDENCIES = dcerpc PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc
|
||||
|
||||
python_epmapper_OBJ_FILES = $(gen_ndrsrcdir)/py_epmapper.o
|
||||
|
||||
[PYTHON::python_mgmt]
|
||||
LIBRARY_REALNAME = samba/dcerpc/mgmt.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = PYTALLOC param swig_credentials dcerpc python_dcerpc_misc
|
||||
PRIVATE_DEPENDENCIES = PYTALLOC param swig_credentials dcerpc python_dcerpc_misc python_dcerpc
|
||||
|
||||
python_mgmt_OBJ_FILES = $(gen_ndrsrcdir)/py_mgmt.o
|
||||
|
||||
[PYTHON::python_atsvc]
|
||||
LIBRARY_REALNAME = samba/dcerpc/atsvc.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = dcerpc_atsvc PYTALLOC param swig_credentials
|
||||
PRIVATE_DEPENDENCIES = dcerpc_atsvc PYTALLOC param swig_credentials python_dcerpc
|
||||
|
||||
python_atsvc_OBJ_FILES = $(gen_ndrsrcdir)/py_atsvc.o
|
||||
|
||||
[PYTHON::python_nbt]
|
||||
LIBRARY_REALNAME = samba/nbt.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = NDR_NBT PYTALLOC param swig_credentials python_dcerpc
|
||||
|
||||
python_nbt_OBJ_FILES = $(gen_ndrsrcdir)/py_nbt.o
|
||||
|
||||
[PYTHON::python_samr]
|
||||
LIBRARY_REALNAME = samba/dcerpc/samr.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = dcerpc_samr PYTALLOC python_dcerpc_security python_lsa python_dcerpc_misc swig_credentials param
|
||||
PRIVATE_DEPENDENCIES = dcerpc_samr PYTALLOC python_dcerpc_security python_lsa python_dcerpc_misc swig_credentials param python_dcerpc
|
||||
|
||||
python_samr_OBJ_FILES = $(gen_ndrsrcdir)/py_samr.o
|
||||
|
||||
[PYTHON::python_svcctl]
|
||||
LIBRARY_REALNAME = samba/dcerpc/svcctl.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL PYTALLOC param swig_credentials python_dcerpc_misc
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc
|
||||
|
||||
python_svcctl_OBJ_FILES = $(gen_ndrsrcdir)/py_svcctl.o
|
||||
|
||||
[PYTHON::python_lsa]
|
||||
LIBRARY_REALNAME = samba/dcerpc/lsa.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_LSA PYTALLOC param swig_credentials python_dcerpc_security
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_LSA PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc
|
||||
|
||||
python_lsa_OBJ_FILES = $(gen_ndrsrcdir)/py_lsa.o
|
||||
|
||||
[PYTHON::python_wkssvc]
|
||||
LIBRARY_REALNAME = samba/dcerpc/wkssvc.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC PYTALLOC param swig_credentials python_lsa python_dcerpc_security
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC PYTALLOC param swig_credentials python_lsa python_dcerpc_security python_dcerpc
|
||||
|
||||
python_wkssvc_OBJ_FILES = $(gen_ndrsrcdir)/py_wkssvc.o
|
||||
|
||||
[PYTHON::python_dfs]
|
||||
LIBRARY_REALNAME = samba/dcerpc/dfs.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_DFS PYTALLOC param swig_credentials python_dcerpc_misc
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_DFS PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc
|
||||
|
||||
python_dfs_OBJ_FILES = $(gen_ndrsrcdir)/py_dfs.o
|
||||
|
||||
[PYTHON::python_unixinfo]
|
||||
LIBRARY_REALNAME = samba/dcerpc/unixinfo.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_UNIXINFO PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc_misc
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_UNIXINFO PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc_misc python_dcerpc
|
||||
|
||||
python_unixinfo_OBJ_FILES = $(gen_ndrsrcdir)/py_unixinfo.o
|
||||
|
||||
[PYTHON::python_irpc]
|
||||
LIBRARY_REALNAME = samba/irpc.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_IRPC PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc_misc python_dcerpc python_nbt
|
||||
|
||||
python_irpc_OBJ_FILES = $(gen_ndrsrcdir)/py_irpc.o
|
||||
|
||||
[PYTHON::python_drsuapi]
|
||||
LIBRARY_REALNAME = samba/dcerpc/drsuapi.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_DRSUAPI PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc_security
|
||||
PRIVATE_DEPENDENCIES = RPC_NDR_DRSUAPI PYTALLOC param swig_credentials python_dcerpc_misc python_dcerpc_security python_dcerpc
|
||||
|
||||
python_drsuapi_OBJ_FILES = $(gen_ndrsrcdir)/py_drsuapi.o
|
||||
|
||||
[PYTHON::python_dcerpc_security]
|
||||
LIBRARY_REALNAME = samba/dcerpc/security.$(SHLIBEXT)
|
||||
PRIVATE_DEPENDENCIES = PYTALLOC python_dcerpc_misc
|
||||
PRIVATE_DEPENDENCIES = PYTALLOC python_dcerpc_misc python_dcerpc
|
||||
|
||||
python_dcerpc_security_OBJ_FILES = $(gen_ndrsrcdir)/py_security.o
|
||||
|
||||
|
@ -4,8 +4,8 @@ use strict;
|
||||
my %vars = ();
|
||||
|
||||
foreach(@ARGV) {
|
||||
push (@{$vars{IDL_FILES}}, $_);
|
||||
my $b = $_; $b =~ s/.*\/(.*?).idl$/$1/;
|
||||
push (@{$vars{IDL_FILES}}, "\$(librpcsrcdir)/idl/$b.idl");
|
||||
push (@{$vars{IDL_HEADER_FILES}}, "\$(librpcsrcdir)/gen_ndr/$b.h");
|
||||
push (@{$vars{IDL_NDR_PARSE_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b.h");
|
||||
push (@{$vars{IDL_NDR_PARSE_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b.c");
|
||||
|
@ -38,7 +38,7 @@ interface rpcecho
|
||||
|
||||
|
||||
/* test some alignment issues */
|
||||
typedef struct {
|
||||
typedef [public] struct {
|
||||
uint8 v;
|
||||
} echo_info1;
|
||||
|
||||
|
@ -73,11 +73,11 @@ interface nbt
|
||||
nbt_name_type type;
|
||||
} nbt_name;
|
||||
|
||||
typedef [enum16bit] enum {
|
||||
typedef [public,enum16bit] enum {
|
||||
NBT_QCLASS_IP = 0x01
|
||||
} nbt_qclass;
|
||||
|
||||
typedef [enum16bit] enum {
|
||||
typedef [public,enum16bit] enum {
|
||||
NBT_QTYPE_ADDRESS = 0x0001,
|
||||
NBT_QTYPE_NAMESERVICE = 0x0002,
|
||||
NBT_QTYPE_NULL = 0x000A,
|
||||
@ -160,30 +160,24 @@ interface nbt
|
||||
uint8 data[length];
|
||||
} nbt_rdata_data;
|
||||
|
||||
typedef [nodiscriminant] union {
|
||||
typedef [nodiscriminant,public] union {
|
||||
[case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios;
|
||||
[case(NBT_QTYPE_STATUS)] nbt_rdata_status status;
|
||||
[default] nbt_rdata_data data;
|
||||
} nbt_rdata;
|
||||
|
||||
/*
|
||||
* this macro works arround the problem
|
||||
* this macro works around the problem
|
||||
* that we need to use nbt_rdata_data
|
||||
* together with NBT_QTYPE_NETBIOS
|
||||
* for WACK replies
|
||||
*/
|
||||
#define NBT_RES_REC_LEVEL(rr_type, rdata) (\
|
||||
(((rr_type) == NBT_QTYPE_NETBIOS) && \
|
||||
talloc_check_name(ndr, "struct ndr_push") && \
|
||||
((rdata).data.length == 2)) \
|
||||
? 0 : rr_type)
|
||||
|
||||
typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct {
|
||||
typedef [flag(LIBNDR_PRINT_ARRAY_HEX),nopush] struct {
|
||||
nbt_name name;
|
||||
nbt_qtype rr_type;
|
||||
nbt_qclass rr_class;
|
||||
uint32 ttl;
|
||||
[switch_is(NBT_RES_REC_LEVEL(rr_type, rdata))] nbt_rdata rdata;
|
||||
[switch_is(rr_type)] nbt_rdata rdata;
|
||||
} nbt_res_rec;
|
||||
|
||||
typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
|
||||
|
@ -106,6 +106,9 @@ interface security
|
||||
const int SEC_ADS_LIST_OBJECT = 0x00000080;
|
||||
const int SEC_ADS_CONTROL_ACCESS = 0x00000100;
|
||||
|
||||
/* invalid bits */
|
||||
const int SEC_MASK_INVALID = 0x0ce0fe00;
|
||||
|
||||
/* generic->specific mappings for files */
|
||||
const int SEC_RIGHTS_FILE_READ = SEC_STD_READ_CONTROL |
|
||||
SEC_STD_SYNCHRONIZE |
|
||||
|
@ -86,7 +86,8 @@ interface xattr
|
||||
/* stream data is stored in attributes with the given prefix */
|
||||
const char *XATTR_DOSSTREAM_PREFIX = "user.DosStream.";
|
||||
|
||||
const int XATTR_MAX_STREAM_SIZE = 0x4000;
|
||||
const int XATTR_MAX_STREAM_SIZE = 0x4000;
|
||||
const int XATTR_MAX_STREAM_SIZE_TDB = 0x100000;
|
||||
|
||||
typedef struct {
|
||||
uint32 flags;
|
||||
|
@ -362,5 +362,14 @@ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
|
||||
struct epm_tower *tower,
|
||||
struct dcerpc_binding **b_out);
|
||||
|
||||
NTSTATUS dcerpc_request(struct dcerpc_pipe *p,
|
||||
struct GUID *object,
|
||||
uint16_t opnum,
|
||||
bool async,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
DATA_BLOB *stub_data_in,
|
||||
DATA_BLOB *stub_data_out);
|
||||
|
||||
typedef NTSTATUS (*dcerpc_call_fn) (struct dcerpc_pipe *, TALLOC_CTX *, void *);
|
||||
|
||||
#endif /* __DCERPC_H__ */
|
||||
|
@ -1,121 +0,0 @@
|
||||
/* Tastes like -*- C -*- */
|
||||
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
|
||||
Swig interface to librpc functions.
|
||||
|
||||
Copyright (C) Tim Potter 2004
|
||||
Copyright (C) Jelmer Vernooij 2007
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module dcerpc
|
||||
|
||||
%{
|
||||
|
||||
/* 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 "includes.h"
|
||||
#include "dynconfig.h"
|
||||
#include "librpc/rpc/dcerpc.h"
|
||||
#include "param/param.h"
|
||||
|
||||
#undef strcpy
|
||||
|
||||
%}
|
||||
|
||||
%import "../../lib/talloc/talloc.i"
|
||||
%import "../../auth/credentials/credentials.i"
|
||||
|
||||
%typemap(in,noblock=1, numinputs=0) struct dcerpc_pipe **OUT (struct dcerpc_pipe *temp_dcerpc_pipe) {
|
||||
$1 = &temp_dcerpc_pipe;
|
||||
}
|
||||
|
||||
%typemap(argout,noblock=1) struct dcerpc_pipe ** {
|
||||
/* Set REF_ALLOC flag so we don't have to do too much extra
|
||||
mucking around with ref variables in ndr unmarshalling. */
|
||||
|
||||
(*$1)->conn->flags |= DCERPC_NDR_REF_ALLOC;
|
||||
|
||||
/* Return swig handle on dcerpc_pipe */
|
||||
|
||||
$result = SWIG_NewPointerObj(*$1, SWIGTYPE_p_dcerpc_pipe, 0);
|
||||
}
|
||||
|
||||
%types(struct dcerpc_pipe *);
|
||||
|
||||
%rename(pipe_connect) dcerpc_pipe_connect;
|
||||
|
||||
NTSTATUS dcerpc_pipe_connect(TALLOC_CTX *parent_ctx,
|
||||
struct dcerpc_pipe **pp,
|
||||
const char *binding,
|
||||
const struct ndr_interface_table *table,
|
||||
struct cli_credentials *credentials,
|
||||
struct event_context *ev,
|
||||
struct loadparm_context *lp_ctx);
|
||||
|
||||
%typemap(in,noblock=1) DATA_BLOB * (DATA_BLOB temp_data_blob) {
|
||||
temp_data_blob.data = PyString_AsString($input);
|
||||
temp_data_blob.length = PyString_Size($input);
|
||||
$1 = &temp_data_blob;
|
||||
}
|
||||
|
||||
const char *dcerpc_server_name(struct dcerpc_pipe *p);
|
||||
|
||||
/* Some typemaps for easier access to resume handles. Really this can
|
||||
also be done using the uint32 carray functions, but it's a bit of a
|
||||
hassle. TODO: Fix memory leak here. */
|
||||
|
||||
%typemap(in,noblock=1) uint32_t *resume_handle {
|
||||
$1 = malloc(sizeof(*$1));
|
||||
*$1 = PyLong_AsLong($input);
|
||||
}
|
||||
|
||||
%typemap(out,noblock=1) uint32_t *resume_handle {
|
||||
$result = PyLong_FromLong(*$1);
|
||||
}
|
||||
|
||||
%typemap(in,noblock=1) struct policy_handle * {
|
||||
|
||||
if ((SWIG_ConvertPtr($input, (void **) &$1, $1_descriptor,
|
||||
SWIG_POINTER_EXCEPTION)) == -1)
|
||||
return NULL;
|
||||
|
||||
if ($1 == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "None is not a valid policy handle");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* When returning a policy handle to Python we need to make a copy of
|
||||
as the talloc context it is created under is destroyed after the
|
||||
wrapper function returns. TODO: Fix memory leak created here. */
|
||||
|
||||
%typemap(out,noblock=1) struct policy_handle * {
|
||||
if ($1) {
|
||||
struct policy_handle *temp = (struct policy_handle *)malloc(sizeof(struct policy_handle));
|
||||
memcpy(temp, $1, sizeof(struct policy_handle));
|
||||
$result = SWIG_NewPointerObj(temp, SWIGTYPE_p_policy_handle, 0);
|
||||
} else {
|
||||
Py_INCREF(Py_None);
|
||||
$result = Py_None;
|
||||
}
|
||||
}
|
@ -1,63 +1,20 @@
|
||||
# This file was automatically generated by SWIG (http://www.swig.org).
|
||||
# Version 1.3.35
|
||||
#!/usr/bin/python
|
||||
|
||||
# Unix SMB/CIFS implementation.
|
||||
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
import _dcerpc
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
try:
|
||||
_swig_property = property
|
||||
except NameError:
|
||||
pass # Python < 2.2 doesn't have 'property'.
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
pipe_connect = _dcerpc.pipe_connect
|
||||
dcerpc_server_name = _dcerpc.dcerpc_server_name
|
||||
|
||||
|
||||
from base import *
|
||||
|
File diff suppressed because it is too large
Load Diff
417
source/librpc/rpc/pyrpc.c
Normal file
417
source/librpc/rpc/pyrpc.c
Normal file
@ -0,0 +1,417 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Samba utility functions
|
||||
Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include <Python.h>
|
||||
#include <structmember.h>
|
||||
#include "librpc/rpc/pyrpc.h"
|
||||
#include "librpc/rpc/dcerpc.h"
|
||||
#include "lib/events/events.h"
|
||||
|
||||
static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface, struct PyNdrRpcMethodDef *md, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
TALLOC_CTX *mem_ctx;
|
||||
NTSTATUS status;
|
||||
void *r;
|
||||
PyObject *result = Py_None;
|
||||
|
||||
if (md->pack_in_data == NULL || md->unpack_out_data == NULL) {
|
||||
PyErr_SetString(PyExc_NotImplementedError, "No marshalling code available yet");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mem_ctx = talloc_new(NULL);
|
||||
if (mem_ctx == NULL)
|
||||
return NULL;
|
||||
|
||||
r = talloc_zero_size(mem_ctx, md->table->calls[md->opnum].struct_size);
|
||||
if (r == NULL)
|
||||
return NULL;
|
||||
|
||||
if (!md->pack_in_data(args, kwargs, r)) {
|
||||
talloc_free(mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = md->call(iface->pipe, mem_ctx, r);
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetDCERPCStatus(iface->pipe, status);
|
||||
talloc_free(mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = md->unpack_out_data(r);
|
||||
|
||||
talloc_free(mem_ctx);
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyObject *py_dcerpc_call_wrapper(PyObject *self, PyObject *args, void *wrapped, PyObject *kwargs)
|
||||
{
|
||||
dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)self;
|
||||
struct PyNdrRpcMethodDef *md = wrapped;
|
||||
|
||||
return py_dcerpc_run_function(iface, md, args, kwargs);
|
||||
}
|
||||
|
||||
|
||||
bool PyInterface_AddNdrRpcMethods(PyTypeObject *ifacetype, const struct PyNdrRpcMethodDef *mds)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; mds[i].name; i++) {
|
||||
PyObject *ret;
|
||||
struct wrapperbase *wb = calloc(sizeof(struct wrapperbase), 1);
|
||||
|
||||
wb->name = discard_const_p(char, mds[i].name);
|
||||
wb->flags = PyWrapperFlag_KEYWORDS;
|
||||
wb->wrapper = (wrapperfunc)py_dcerpc_call_wrapper;
|
||||
wb->doc = discard_const_p(char, mds[i].doc);
|
||||
|
||||
ret = PyDescr_NewWrapper(ifacetype, wb, discard_const_p(void, &mds[i]));
|
||||
|
||||
PyDict_SetItemString(ifacetype->tp_dict, mds[i].name,
|
||||
(PyObject *)ret);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool PyString_AsGUID(PyObject *object, struct GUID *uuid)
|
||||
{
|
||||
NTSTATUS status;
|
||||
status = GUID_from_string(PyString_AsString(object), uuid);
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool ndr_syntax_from_py_object(PyObject *object, struct ndr_syntax_id *syntax_id)
|
||||
{
|
||||
ZERO_STRUCTP(syntax_id);
|
||||
|
||||
if (PyString_Check(object)) {
|
||||
return PyString_AsGUID(object, &syntax_id->uuid);
|
||||
} else if (PyTuple_Check(object)) {
|
||||
if (PyTuple_Size(object) < 1 || PyTuple_Size(object) > 2) {
|
||||
PyErr_SetString(PyExc_ValueError, "Syntax ID tuple has invalid size");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!PyString_Check(PyTuple_GetItem(object, 0))) {
|
||||
PyErr_SetString(PyExc_ValueError, "Expected GUID as first element in tuple");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!PyString_AsGUID(PyTuple_GetItem(object, 0), &syntax_id->uuid))
|
||||
return false;
|
||||
|
||||
if (!PyInt_Check(PyTuple_GetItem(object, 1))) {
|
||||
PyErr_SetString(PyExc_ValueError, "Expected version as second element in tuple");
|
||||
return false;
|
||||
}
|
||||
|
||||
syntax_id->if_version = PyInt_AsLong(PyTuple_GetItem(object, 1));
|
||||
return true;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError, "Expected UUID or syntax id tuple");
|
||||
return false;
|
||||
}
|
||||
|
||||
static PyObject *py_iface_server_name(PyObject *obj, void *closure)
|
||||
{
|
||||
const char *server_name;
|
||||
dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)obj;
|
||||
|
||||
server_name = dcerpc_server_name(iface->pipe);
|
||||
if (server_name == NULL)
|
||||
return Py_None;
|
||||
|
||||
return PyString_FromString(server_name);
|
||||
}
|
||||
|
||||
static PyObject *py_ndr_syntax_id(struct ndr_syntax_id *syntax_id)
|
||||
{
|
||||
PyObject *ret;
|
||||
char *uuid_str;
|
||||
|
||||
uuid_str = GUID_string(NULL, &syntax_id->uuid);
|
||||
if (uuid_str == NULL)
|
||||
return NULL;
|
||||
|
||||
ret = Py_BuildValue("(s,i)", uuid_str, syntax_id->if_version);
|
||||
|
||||
talloc_free(uuid_str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static PyObject *py_iface_abstract_syntax(PyObject *obj, void *closure)
|
||||
{
|
||||
dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)obj;
|
||||
|
||||
return py_ndr_syntax_id(&iface->pipe->syntax);
|
||||
}
|
||||
|
||||
static PyObject *py_iface_transfer_syntax(PyObject *obj, void *closure)
|
||||
{
|
||||
dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)obj;
|
||||
|
||||
return py_ndr_syntax_id(&iface->pipe->transfer_syntax);
|
||||
}
|
||||
|
||||
static PyGetSetDef dcerpc_interface_getsetters[] = {
|
||||
{ discard_const_p(char, "server_name"), py_iface_server_name, NULL,
|
||||
discard_const_p(char, "name of the server, if connected over SMB") },
|
||||
{ discard_const_p(char, "abstract_syntax"), py_iface_abstract_syntax, NULL,
|
||||
discard_const_p(char, "syntax id of the abstract syntax") },
|
||||
{ discard_const_p(char, "transfer_syntax"), py_iface_transfer_syntax, NULL,
|
||||
discard_const_p(char, "syntax id of the transfersyntax") },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static PyMemberDef dcerpc_interface_members[] = {
|
||||
{ discard_const_p(char, "request_timeout"), T_INT,
|
||||
offsetof(struct dcerpc_pipe, request_timeout), 0,
|
||||
discard_const_p(char, "request timeout, in seconds") },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status)
|
||||
{
|
||||
if (p != NULL && NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
|
||||
const char *errstr = dcerpc_errstr(NULL, p->last_fault_code);
|
||||
PyErr_SetObject(PyExc_RuntimeError,
|
||||
Py_BuildValue("(i,s)", p->last_fault_code,
|
||||
errstr));
|
||||
} else {
|
||||
PyErr_SetNTSTATUS(status);
|
||||
}
|
||||
}
|
||||
|
||||
static PyObject *py_iface_request(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)self;
|
||||
int opnum;
|
||||
DATA_BLOB data_in, data_out;
|
||||
NTSTATUS status;
|
||||
char *in_data;
|
||||
int in_length;
|
||||
PyObject *ret;
|
||||
PyObject *object = NULL;
|
||||
struct GUID object_guid;
|
||||
TALLOC_CTX *mem_ctx = talloc_new(NULL);
|
||||
const char *kwnames[] = { "opnum", "data", "object", NULL };
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "is#|O:request",
|
||||
discard_const_p(char *, kwnames), &opnum, &in_data, &in_length, &object)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
data_in.data = (uint8_t *)talloc_memdup(mem_ctx, in_data, in_length);
|
||||
data_in.length = in_length;
|
||||
|
||||
ZERO_STRUCT(data_out);
|
||||
|
||||
if (object != NULL && !PyString_AsGUID(object, &object_guid)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = dcerpc_request(iface->pipe, object?&object_guid:NULL,
|
||||
opnum, false, mem_ctx, &data_in, &data_out);
|
||||
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetDCERPCStatus(iface->pipe, status);
|
||||
talloc_free(mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = PyString_FromStringAndSize((char *)data_out.data, data_out.length);
|
||||
|
||||
talloc_free(mem_ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static PyObject *py_iface_later_context(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)self;
|
||||
NTSTATUS status;
|
||||
const char *kwnames[] = { "abstract_syntax", "transfer_syntax", NULL };
|
||||
PyObject *py_abstract_syntax = Py_None, *py_transfer_syntax = Py_None;
|
||||
struct ndr_syntax_id abstract_syntax, transfer_syntax;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|O:alter_context",
|
||||
discard_const_p(char *, kwnames), &py_abstract_syntax,
|
||||
&py_transfer_syntax)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ndr_syntax_from_py_object(py_abstract_syntax, &abstract_syntax))
|
||||
return NULL;
|
||||
|
||||
if (py_transfer_syntax == Py_None) {
|
||||
transfer_syntax = ndr_transfer_syntax;
|
||||
} else {
|
||||
if (!ndr_syntax_from_py_object(py_transfer_syntax,
|
||||
&transfer_syntax))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
status = dcerpc_alter_context(iface->pipe, iface->pipe, &abstract_syntax,
|
||||
&transfer_syntax);
|
||||
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetDCERPCStatus(iface->pipe, status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return Py_None;
|
||||
}
|
||||
|
||||
static PyMethodDef dcerpc_interface_methods[] = {
|
||||
{ "request", (PyCFunction)py_iface_request, METH_VARARGS|METH_KEYWORDS, "S.request(opnum, data, object=None) -> data\nMake a raw request" },
|
||||
{ "alter_context", (PyCFunction)py_iface_later_context, METH_VARARGS|METH_KEYWORDS, "S.alter_context(syntax)\nChange to a different interface" },
|
||||
{ NULL, NULL, 0, NULL },
|
||||
};
|
||||
|
||||
|
||||
static void dcerpc_interface_dealloc(PyObject* self)
|
||||
{
|
||||
dcerpc_InterfaceObject *interface = (dcerpc_InterfaceObject *)self;
|
||||
talloc_free(interface->pipe);
|
||||
PyObject_Del(self);
|
||||
}
|
||||
|
||||
static PyObject *dcerpc_interface_new(PyTypeObject *self, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
dcerpc_InterfaceObject *ret;
|
||||
const char *binding_string;
|
||||
struct cli_credentials *credentials;
|
||||
struct loadparm_context *lp_ctx = NULL;
|
||||
PyObject *py_lp_ctx = Py_None, *py_credentials = Py_None;
|
||||
TALLOC_CTX *mem_ctx = NULL;
|
||||
struct event_context *event_ctx;
|
||||
NTSTATUS status;
|
||||
|
||||
PyObject *syntax, *py_basis = Py_None;
|
||||
const char *kwnames[] = {
|
||||
"binding", "syntax", "lp_ctx", "credentials", "basis_connection", NULL
|
||||
};
|
||||
extern struct loadparm_context *lp_from_py_object(PyObject *py_obj);
|
||||
extern struct cli_credentials *cli_credentials_from_py_object(PyObject *py_obj);
|
||||
struct ndr_interface_table *table;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sO|OOO:connect", discard_const_p(char *, kwnames), &binding_string, &syntax, &py_lp_ctx, &py_credentials, &py_basis)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lp_ctx = lp_from_py_object(py_lp_ctx);
|
||||
if (lp_ctx == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected loadparm context");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
credentials = cli_credentials_from_py_object(py_credentials);
|
||||
if (credentials == NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected credentials");
|
||||
return NULL;
|
||||
}
|
||||
ret = PyObject_New(dcerpc_InterfaceObject, &dcerpc_InterfaceType);
|
||||
|
||||
event_ctx = event_context_init(mem_ctx);
|
||||
|
||||
/* Create a dummy interface table struct. TODO: In the future, we should rather just allow
|
||||
* connecting without requiring an interface table.
|
||||
*/
|
||||
|
||||
table = talloc_zero(mem_ctx, struct ndr_interface_table);
|
||||
|
||||
if (table == NULL) {
|
||||
PyErr_SetString(PyExc_MemoryError, "Allocating interface table");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!ndr_syntax_from_py_object(syntax, &table->syntax_id)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret->pipe = NULL;
|
||||
|
||||
if (py_basis != Py_None) {
|
||||
struct dcerpc_pipe *base_pipe;
|
||||
|
||||
if (!PyObject_TypeCheck(py_basis, &dcerpc_InterfaceType)) {
|
||||
PyErr_SetString(PyExc_ValueError, "basis_connection must be a DCE/RPC connection");
|
||||
talloc_free(mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
base_pipe = ((dcerpc_InterfaceObject *)py_basis)->pipe;
|
||||
|
||||
status = dcerpc_secondary_context(base_pipe, &ret->pipe,
|
||||
table);
|
||||
ret->pipe = talloc_steal(NULL, ret->pipe);
|
||||
} else {
|
||||
status = dcerpc_pipe_connect(NULL, &ret->pipe, binding_string,
|
||||
table, credentials, event_ctx, lp_ctx);
|
||||
}
|
||||
|
||||
if (NT_STATUS_IS_ERR(status)) {
|
||||
PyErr_SetDCERPCStatus(ret->pipe, status);
|
||||
talloc_free(mem_ctx);
|
||||
return NULL;
|
||||
}
|
||||
ret->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC;
|
||||
return (PyObject *)ret;
|
||||
}
|
||||
|
||||
PyTypeObject dcerpc_InterfaceType = {
|
||||
PyObject_HEAD_INIT(NULL) 0,
|
||||
.tp_name = "dcerpc.ClientConnection",
|
||||
.tp_basicsize = sizeof(dcerpc_InterfaceObject),
|
||||
.tp_dealloc = dcerpc_interface_dealloc,
|
||||
.tp_getset = dcerpc_interface_getsetters,
|
||||
.tp_members = dcerpc_interface_members,
|
||||
.tp_methods = dcerpc_interface_methods,
|
||||
.tp_doc = "ClientConnection(binding, syntax, lp_ctx=None, credentials=None) -> connection\n"
|
||||
"\n"
|
||||
"binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
|
||||
"syntax should be a tuple with a GUID and version number of an interface\n"
|
||||
"lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
|
||||
"credentials should be a credentials.Credentials object.\n\n",
|
||||
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
|
||||
.tp_new = dcerpc_interface_new,
|
||||
};
|
||||
|
||||
void initbase(void)
|
||||
{
|
||||
PyObject *m;
|
||||
|
||||
if (PyType_Ready(&dcerpc_InterfaceType) < 0)
|
||||
return;
|
||||
|
||||
m = Py_InitModule3("base", NULL, "DCE/RPC protocol implementation");
|
||||
if (m == NULL)
|
||||
return;
|
||||
|
||||
Py_INCREF((PyObject *)&dcerpc_InterfaceType);
|
||||
PyModule_AddObject(m, "ClientConnection", (PyObject *)&dcerpc_InterfaceType);
|
||||
}
|
73
source/librpc/rpc/pyrpc.h
Normal file
73
source/librpc/rpc/pyrpc.h
Normal file
@ -0,0 +1,73 @@
|
||||
/*
|
||||
Unix SMB/CIFS implementation.
|
||||
Samba utility functions
|
||||
Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _PYRPC_H_
|
||||
#define _PYRPC_H_
|
||||
|
||||
#include "libcli/util/pyerrors.h"
|
||||
#include "librpc/rpc/dcerpc.h"
|
||||
|
||||
#define PY_CHECK_TYPE(type, var, fail) \
|
||||
if (!type ## _Check(var)) {\
|
||||
PyErr_Format(PyExc_TypeError, "Expected type %s", type ## _Type.tp_name); \
|
||||
fail; \
|
||||
}
|
||||
|
||||
#define dom_sid0_Type dom_sid_Type
|
||||
#define dom_sid2_Type dom_sid_Type
|
||||
#define dom_sid28_Type dom_sid_Type
|
||||
#define dom_sid0_Check dom_sid_Check
|
||||
#define dom_sid2_Check dom_sid_Check
|
||||
#define dom_sid28_Check dom_sid_Check
|
||||
|
||||
/* This macro is only provided by Python >= 2.3 */
|
||||
#ifndef PyAPI_DATA
|
||||
# define PyAPI_DATA(RTYPE) extern RTYPE
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
struct dcerpc_pipe *pipe;
|
||||
} dcerpc_InterfaceObject;
|
||||
|
||||
PyAPI_DATA(PyTypeObject) dcerpc_InterfaceType;
|
||||
|
||||
#define PyErr_FromNdrError(err) PyErr_FromNTSTATUS(ndr_map_error2ntstatus(err))
|
||||
|
||||
#define PyErr_SetNdrError(err) \
|
||||
PyErr_SetObject(PyExc_RuntimeError, PyErr_FromNdrError(err))
|
||||
|
||||
void PyErr_SetDCERPCStatus(struct dcerpc_pipe *pipe, NTSTATUS status);
|
||||
|
||||
typedef bool (*py_data_pack_fn) (PyObject *args, PyObject *kwargs, void *r);
|
||||
typedef PyObject *(*py_data_unpack_fn) (void *r);
|
||||
|
||||
struct PyNdrRpcMethodDef {
|
||||
const char *name;
|
||||
const char *doc;
|
||||
dcerpc_call_fn call;
|
||||
py_data_pack_fn pack_in_data;
|
||||
py_data_unpack_fn unpack_out_data;
|
||||
uint32_t opnum;
|
||||
const struct ndr_interface_table *table;
|
||||
};
|
||||
|
||||
bool PyInterface_AddNdrRpcMethods(PyTypeObject *object, const struct PyNdrRpcMethodDef *mds);
|
||||
|
||||
#endif /* _PYRPC_H_ */
|
@ -8,7 +8,7 @@ PIDL_EXTRA_ARGS="$*"
|
||||
|
||||
[ -d $OUTDIR ] || mkdir -p $OUTDIR || exit 1
|
||||
|
||||
PIDL="$PIDL --outputdir $OUTDIR --header --ndr-parser --server --client --swig --ejs --python $PIDL_EXTRA_ARGS"
|
||||
PIDL="$PIDL --outputdir $OUTDIR --header --ndr-parser --server --client --swig --python $PIDL_EXTRA_ARGS"
|
||||
|
||||
if [ x$FULLBUILD = xFULL ]; then
|
||||
echo Rebuilding all idl files in $IDLDIR
|
||||
|
@ -1,97 +1,50 @@
|
||||
mkinclude dynconfig.mk
|
||||
heimdalsrcdir := heimdal
|
||||
mkinclude dynconfig/config.mk
|
||||
mkinclude heimdal_build/config.mk
|
||||
mkinclude config.mk
|
||||
dsdbsrcdir := dsdb
|
||||
mkinclude dsdb/config.mk
|
||||
smbdsrcdir := smbd
|
||||
mkinclude smbd/config.mk
|
||||
clustersrcdir := cluster
|
||||
mkinclude cluster/config.mk
|
||||
mkinclude smbd/process_model.mk
|
||||
libnetsrcdir := libnet
|
||||
mkinclude libnet/config.mk
|
||||
authsrcdir := auth
|
||||
mkinclude auth/config.mk
|
||||
nsswitchsrcdir := nsswitch
|
||||
mkinclude nsswitch/config.mk
|
||||
libsrcdir := lib
|
||||
mkinclude lib/samba3/config.mk
|
||||
libsocketsrcdir := lib/socket
|
||||
mkinclude lib/socket/config.mk
|
||||
libcharsetsrcdir := lib/charset
|
||||
mkinclude lib/charset/config.mk
|
||||
ldb_sambasrcdir := lib/ldb-samba
|
||||
mkinclude lib/ldb-samba/config.mk
|
||||
libtlssrcdir := lib/tls
|
||||
mkinclude lib/tls/config.mk
|
||||
libregistrysrcdir := lib/registry
|
||||
mkinclude lib/registry/config.mk
|
||||
libmessagingsrcdir := lib/messaging
|
||||
mkinclude lib/messaging/config.mk
|
||||
libeventssrcdir := lib/events
|
||||
mkinclude lib/events/config.mk
|
||||
libcmdlinesrcdir := lib/cmdline
|
||||
mkinclude lib/cmdline/config.mk
|
||||
socketwrappersrcdir := lib/socket_wrapper
|
||||
mkinclude lib/socket_wrapper/config.mk
|
||||
nsswrappersrcdir := lib/nss_wrapper
|
||||
mkinclude lib/nss_wrapper/config.mk
|
||||
appwebsrcdir := lib/appweb
|
||||
mkinclude lib/appweb/config.mk
|
||||
libstreamsrcdir := lib/stream
|
||||
mkinclude lib/stream/config.mk
|
||||
libutilsrcdir := lib/util
|
||||
mkinclude lib/util/config.mk
|
||||
libtdrsrcdir := lib/tdr
|
||||
mkinclude lib/tdr/config.mk
|
||||
libdbwrapsrcdir := lib/dbwrap
|
||||
mkinclude lib/dbwrap/config.mk
|
||||
libcryptosrcdir := lib/crypto
|
||||
mkinclude lib/crypto/config.mk
|
||||
libtorturesrcdir := lib/torture
|
||||
mkinclude lib/torture/config.mk
|
||||
libcompressionsrcdir := lib/compression
|
||||
libgencachesrcdir := lib
|
||||
mkinclude lib/basic.mk
|
||||
paramsrcdir := param
|
||||
mkinclude param/config.mk
|
||||
smb_serversrcdir := smb_server
|
||||
mkinclude smb_server/config.mk
|
||||
rpc_serversrcdir := rpc_server
|
||||
mkinclude rpc_server/config.mk
|
||||
ldap_serversrcdir := ldap_server
|
||||
mkinclude ldap_server/config.mk
|
||||
web_serversrcdir := web_server
|
||||
mkinclude web_server/config.mk
|
||||
winbindsrcdir := winbind
|
||||
mkinclude winbind/config.mk
|
||||
nbt_serversrcdir := nbt_server
|
||||
mkinclude nbt_server/config.mk
|
||||
wrepl_serversrcdir := wrepl_server
|
||||
mkinclude wrepl_server/config.mk
|
||||
cldap_serversrcdir := cldap_server
|
||||
mkinclude cldap_server/config.mk
|
||||
ntp_signd_srcdir := ntp_signd
|
||||
mkinclude ntp_signd/config.mk
|
||||
utilssrcdir := utils
|
||||
mkinclude utils/net/config.mk
|
||||
mkinclude utils/config.mk
|
||||
ntvfssrcdir := ntvfs
|
||||
mkinclude ntvfs/config.mk
|
||||
ntptrsrcdir := ntptr
|
||||
mkinclude ntptr/config.mk
|
||||
torturesrcdir := torture
|
||||
mkinclude torture/config.mk
|
||||
librpcsrcdir := librpc
|
||||
mkinclude librpc/config.mk
|
||||
clientsrcdir := client
|
||||
mkinclude client/config.mk
|
||||
libclisrcdir := libcli
|
||||
mkinclude libcli/config.mk
|
||||
ejsscriptsrcdir := scripting/ejs
|
||||
mkinclude scripting/ejs/config.mk
|
||||
pyscriptsrcdir := scripting/python
|
||||
mkinclude scripting/python/config.mk
|
||||
kdcsrcdir := kdc
|
||||
mkinclude kdc/config.mk
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include "libcli/auth/libcli_auth.h"
|
||||
#include "libcli/security/security.h"
|
||||
#include "lib/cmdline/popt_common.h"
|
||||
#include "dynconfig.h"
|
||||
#include "dynconfig/dynconfig.h"
|
||||
#include "param/param.h"
|
||||
|
||||
extern int winbindd_fd;
|
||||
|
@ -769,6 +769,7 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
|
||||
struct cvfs_private *private = ntvfs->private_data;
|
||||
struct smbcli_request *c_req;
|
||||
struct cvfs_file *f;
|
||||
union smb_close io2;
|
||||
|
||||
SETUP_PID;
|
||||
|
||||
@ -776,6 +777,15 @@ static NTSTATUS cvfs_close(struct ntvfs_module_context *ntvfs,
|
||||
private->map_generic) {
|
||||
return ntvfs_map_close(ntvfs, req, io);
|
||||
}
|
||||
|
||||
if (io->generic.level == RAW_CLOSE_GENERIC) {
|
||||
ZERO_STRUCT(io2);
|
||||
io2.close.level = RAW_CLOSE_CLOSE;
|
||||
io2.close.in.file = io->generic.in.file;
|
||||
io2.close.in.write_time = io->generic.in.write_time;
|
||||
io = &io2;
|
||||
}
|
||||
|
||||
SETUP_FILE_HERE(f);
|
||||
/* Note, we aren't free-ing f, or it's h here. Should we?
|
||||
even if file-close fails, we'll remove it from the list,
|
||||
|
@ -522,6 +522,19 @@ NTSTATUS ntvfs_map_open(struct ntvfs_module_context *ntvfs,
|
||||
io2->generic.in.fname = io->smb2.in.fname;
|
||||
io2->generic.in.sec_desc = NULL;
|
||||
io2->generic.in.ea_list = NULL;
|
||||
|
||||
/* we need to check these bits before we check the private mask */
|
||||
if (io2->generic.in.create_options & NTCREATEX_OPTIONS_NOT_SUPPORTED_MASK) {
|
||||
status = NT_STATUS_NOT_SUPPORTED;
|
||||
break;
|
||||
}
|
||||
|
||||
/* we use a couple of bits of the create options internally */
|
||||
if (io2->generic.in.create_options & NTCREATEX_OPTIONS_PRIVATE_MASK) {
|
||||
status = NT_STATUS_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
status = ntvfs->ops->open(ntvfs, req, io2);
|
||||
break;
|
||||
|
||||
@ -1014,7 +1027,7 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
|
||||
case RAW_LOCK_SMB2: {
|
||||
/* this is only approximate! We need to change the
|
||||
generic structure to fix this properly */
|
||||
int i;
|
||||
int i, j;
|
||||
if (lck->smb2.in.lock_count < 1) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
@ -1030,31 +1043,37 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs,
|
||||
if (lck2->generic.in.locks == NULL) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
for (i=0;i<lck->smb2.in.lock_count;i++) {
|
||||
if (lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_UNLOCK) {
|
||||
int j = lck2->generic.in.ulock_cnt;
|
||||
lck2->generic.in.ulock_cnt++;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
lck2->generic.in.locks[j].offset = lck->smb2.in.locks[i].offset;
|
||||
lck2->generic.in.locks[j].count = lck->smb2.in.locks[i].length;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
}
|
||||
}
|
||||
for (i=0;i<lck->smb2.in.lock_count;i++) {
|
||||
if (!(lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_UNLOCK)) {
|
||||
int j = lck2->generic.in.ulock_cnt +
|
||||
lck2->generic.in.lock_cnt;
|
||||
lck2->generic.in.lock_cnt++;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
lck2->generic.in.locks[j].offset = lck->smb2.in.locks[i].offset;
|
||||
lck2->generic.in.locks[j].count = lck->smb2.in.locks[i].length;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
if (!(lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_EXCLUSIVE)) {
|
||||
lck2->generic.in.mode = LOCKING_ANDX_SHARED_LOCK;
|
||||
}
|
||||
if (lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_FAIL_IMMEDIATELY) {
|
||||
lck2->generic.in.timeout = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
j = lck2->generic.in.ulock_cnt;
|
||||
if (lck->smb2.in.locks[i].flags &
|
||||
(SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_EXCLUSIVE)) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
lck2->generic.in.ulock_cnt++;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
lck2->generic.in.locks[j].offset = lck->smb2.in.locks[i].offset;
|
||||
lck2->generic.in.locks[j].count = lck->smb2.in.locks[i].length;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
}
|
||||
for (;i<lck->smb2.in.lock_count;i++) {
|
||||
if (lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_UNLOCK) {
|
||||
/* w2008 requires unlocks to come first */
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
j = lck2->generic.in.ulock_cnt + lck2->generic.in.lock_cnt;
|
||||
lck2->generic.in.lock_cnt++;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
lck2->generic.in.locks[j].offset = lck->smb2.in.locks[i].offset;
|
||||
lck2->generic.in.locks[j].count = lck->smb2.in.locks[i].length;
|
||||
lck2->generic.in.locks[j].pid = 0;
|
||||
if (!(lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_EXCLUSIVE)) {
|
||||
lck2->generic.in.mode = LOCKING_ANDX_SHARED_LOCK;
|
||||
}
|
||||
if (lck->smb2.in.locks[i].flags & SMB2_LOCK_FLAG_FAIL_IMMEDIATELY) {
|
||||
lck2->generic.in.timeout = 0;
|
||||
}
|
||||
}
|
||||
/* initialize output value */
|
||||
@ -1367,7 +1386,7 @@ NTSTATUS ntvfs_map_read(struct ntvfs_module_context *ntvfs,
|
||||
case RAW_READ_SMB2:
|
||||
rd2->readx.in.file.ntvfs= rd->smb2.in.file.ntvfs;
|
||||
rd2->readx.in.offset = rd->smb2.in.offset;
|
||||
rd2->readx.in.mincnt = rd->smb2.in.length;
|
||||
rd2->readx.in.mincnt = rd->smb2.in.min_count;
|
||||
rd2->readx.in.maxcnt = rd->smb2.in.length;
|
||||
rd2->readx.in.remaining = 0;
|
||||
rd2->readx.out.data = rd->smb2.out.data.data;
|
||||
@ -1380,6 +1399,36 @@ done:
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
NTVFS close generic to any mapper
|
||||
*/
|
||||
static NTSTATUS ntvfs_map_close_finish(struct ntvfs_module_context *ntvfs,
|
||||
struct ntvfs_request *req,
|
||||
union smb_close *cl,
|
||||
union smb_close *cl2,
|
||||
NTSTATUS status)
|
||||
{
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
|
||||
switch (cl->generic.level) {
|
||||
case RAW_CLOSE_SMB2:
|
||||
cl->smb2.out.flags = cl2->generic.out.flags;
|
||||
cl->smb2.out._pad = 0;
|
||||
cl->smb2.out.create_time = cl2->generic.out.create_time;
|
||||
cl->smb2.out.access_time = cl2->generic.out.access_time;
|
||||
cl->smb2.out.write_time = cl2->generic.out.write_time;
|
||||
cl->smb2.out.change_time = cl2->generic.out.change_time;
|
||||
cl->smb2.out.alloc_size = cl2->generic.out.alloc_size;
|
||||
cl->smb2.out.size = cl2->generic.out.size;
|
||||
cl->smb2.out.file_attr = cl2->generic.out.file_attr;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
NTVFS close generic to any mapper
|
||||
*/
|
||||
@ -1388,6 +1437,7 @@ NTSTATUS ntvfs_map_close(struct ntvfs_module_context *ntvfs,
|
||||
union smb_close *cl)
|
||||
{
|
||||
union smb_close *cl2;
|
||||
NTSTATUS status;
|
||||
|
||||
cl2 = talloc(req, union smb_close);
|
||||
if (cl2 == NULL) {
|
||||
@ -1395,30 +1445,38 @@ NTSTATUS ntvfs_map_close(struct ntvfs_module_context *ntvfs,
|
||||
}
|
||||
|
||||
switch (cl->generic.level) {
|
||||
case RAW_CLOSE_CLOSE:
|
||||
case RAW_CLOSE_GENERIC:
|
||||
return NT_STATUS_INVALID_LEVEL;
|
||||
|
||||
case RAW_CLOSE_CLOSE:
|
||||
cl2->generic.level = RAW_CLOSE_GENERIC;
|
||||
cl2->generic.in.file = cl->close.in.file;
|
||||
cl2->generic.in.write_time = cl->close.in.write_time;
|
||||
cl2->generic.in.flags = 0;
|
||||
break;
|
||||
|
||||
case RAW_CLOSE_SPLCLOSE:
|
||||
cl2->generic.level = RAW_CLOSE_CLOSE;
|
||||
cl2->generic.in.file.ntvfs = cl->splclose.in.file.ntvfs;
|
||||
cl2->generic.level = RAW_CLOSE_GENERIC;
|
||||
cl2->generic.in.file = cl->splclose.in.file;
|
||||
cl2->generic.in.write_time = 0;
|
||||
cl2->generic.in.flags = 0;
|
||||
break;
|
||||
|
||||
case RAW_CLOSE_SMB2:
|
||||
cl2->generic.level = RAW_CLOSE_CLOSE;
|
||||
cl2->generic.in.file.ntvfs = cl->smb2.in.file.ntvfs;
|
||||
cl2->generic.level = RAW_CLOSE_GENERIC;
|
||||
cl2->generic.in.file = cl->smb2.in.file;
|
||||
cl2->generic.in.write_time = 0;
|
||||
/* SMB2 Close has output parameter, but we just zero them */
|
||||
ZERO_STRUCT(cl->smb2.out);
|
||||
cl2->generic.in.flags = cl->smb2.in.flags;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* we don't need to call ntvfs_map_async_setup() here,
|
||||
* as close() doesn't have any output fields
|
||||
*/
|
||||
status = ntvfs_map_async_setup(ntvfs, req, cl, cl2,
|
||||
(second_stage_t)ntvfs_map_close_finish);
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
|
||||
return ntvfs->ops->close(ntvfs, req, cl2);
|
||||
status = ntvfs->ops->close(ntvfs, req, cl2);
|
||||
|
||||
return ntvfs_map_async_finish(req, status);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -457,7 +457,7 @@ NTSTATUS pvfs_access_check_unix(struct pvfs_state *pvfs,
|
||||
}
|
||||
|
||||
if (uid != 0 && (*access_mask & SEC_FLAG_SYSTEM_SECURITY)) {
|
||||
return NT_STATUS_PRIVILEGE_NOT_HELD;
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if (*access_mask & ~max_bits) {
|
||||
|
@ -58,6 +58,8 @@ NTSTATUS pvfs_fill_dos_info(struct pvfs_state *pvfs, struct pvfs_filename *name,
|
||||
if (S_ISDIR(name->st.st_mode)) {
|
||||
name->st.st_size = 0;
|
||||
name->st.st_nlink = 1;
|
||||
} else if (name->stream_id == 0) {
|
||||
name->stream_name = NULL;
|
||||
}
|
||||
|
||||
/* for now just use the simple samba mapping */
|
||||
@ -75,6 +77,11 @@ NTSTATUS pvfs_fill_dos_info(struct pvfs_state *pvfs, struct pvfs_filename *name,
|
||||
name->dos.alloc_size = pvfs_round_alloc_size(pvfs, name->st.st_size);
|
||||
name->dos.nlink = name->st.st_nlink;
|
||||
name->dos.ea_size = 4;
|
||||
if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2) {
|
||||
/* SMB2 represents a null EA with zero bytes */
|
||||
name->dos.ea_size = 0;
|
||||
}
|
||||
|
||||
name->dos.file_id = (((uint64_t)name->st.st_dev)<<32) | name->st.st_ino;
|
||||
name->dos.flags = 0;
|
||||
|
||||
|
@ -54,6 +54,7 @@ NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs,
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
pvfs_flush_file(pvfs, f);
|
||||
io->smb2.out.reserved = 0;
|
||||
return NT_STATUS_OK;
|
||||
|
||||
case RAW_FLUSH_ALL:
|
||||
|
@ -182,12 +182,19 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
|
||||
bool del_on_close;
|
||||
uint32_t create_options;
|
||||
uint32_t share_access;
|
||||
bool forced;
|
||||
|
||||
create_options = io->generic.in.create_options;
|
||||
share_access = io->generic.in.share_access;
|
||||
|
||||
forced = (io->generic.in.create_options & NTCREATEX_OPTIONS_DIRECTORY)?true:false;
|
||||
|
||||
if (name->stream_name) {
|
||||
return NT_STATUS_NOT_A_DIRECTORY;
|
||||
if (forced) {
|
||||
return NT_STATUS_NOT_A_DIRECTORY;
|
||||
} else {
|
||||
return NT_STATUS_FILE_IS_A_DIRECTORY;
|
||||
}
|
||||
}
|
||||
|
||||
/* if the client says it must be a directory, and it isn't,
|
||||
@ -196,6 +203,13 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
|
||||
return NT_STATUS_NOT_A_DIRECTORY;
|
||||
}
|
||||
|
||||
/* found with gentest */
|
||||
if (io->ntcreatex.in.access_mask == SEC_FLAG_MAXIMUM_ALLOWED &&
|
||||
(io->ntcreatex.in.create_options & NTCREATEX_OPTIONS_DIRECTORY) &&
|
||||
(io->ntcreatex.in.create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE)) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
switch (io->generic.in.open_disposition) {
|
||||
case NTCREATEX_DISP_OPEN_IF:
|
||||
break;
|
||||
@ -548,11 +562,19 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
|
||||
uint32_t oplock_level = OPLOCK_NONE, oplock_granted;
|
||||
bool allow_level_II_oplock = false;
|
||||
|
||||
if (io->ntcreatex.in.file_attr & ~FILE_ATTRIBUTE_ALL_MASK) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (io->ntcreatex.in.file_attr & FILE_ATTRIBUTE_ENCRYPTED) {
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if ((io->ntcreatex.in.file_attr & FILE_ATTRIBUTE_READONLY) &&
|
||||
(create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE)) {
|
||||
return NT_STATUS_CANNOT_DELETE;
|
||||
}
|
||||
|
||||
|
||||
status = pvfs_access_check_create(pvfs, req, name, &access_mask);
|
||||
NT_STATUS_NOT_OK_RETURN(status);
|
||||
|
||||
@ -1110,6 +1132,41 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
|
||||
return ntvfs_map_open(ntvfs, req, io);
|
||||
}
|
||||
|
||||
create_options = io->generic.in.create_options;
|
||||
share_access = io->generic.in.share_access;
|
||||
access_mask = io->generic.in.access_mask;
|
||||
|
||||
if (share_access & ~NTCREATEX_SHARE_ACCESS_MASK) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* some create options are not supported */
|
||||
if (create_options & NTCREATEX_OPTIONS_NOT_SUPPORTED_MASK) {
|
||||
return NT_STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
/* other create options are not allowed */
|
||||
if ((create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) &&
|
||||
!(access_mask & SEC_STD_DELETE)) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (access_mask & SEC_MASK_INVALID) {
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
/* what does this bit really mean?? */
|
||||
if (req->ctx->protocol == PROTOCOL_SMB2 &&
|
||||
access_mask == SEC_STD_SYNCHRONIZE) {
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if (io->ntcreatex.in.file_attr & (FILE_ATTRIBUTE_DEVICE|
|
||||
FILE_ATTRIBUTE_VOLUME|
|
||||
(~FILE_ATTRIBUTE_ALL_MASK))) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* resolve the cifs name to a posix name */
|
||||
status = pvfs_resolve_name(pvfs, req, io->ntcreatex.in.fname,
|
||||
PVFS_RESOLVE_STREAMS, &name);
|
||||
@ -1141,16 +1198,6 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
|
||||
open doesn't match */
|
||||
io->generic.in.file_attr &= ~FILE_ATTRIBUTE_DIRECTORY;
|
||||
|
||||
create_options = io->generic.in.create_options;
|
||||
share_access = io->generic.in.share_access;
|
||||
access_mask = io->generic.in.access_mask;
|
||||
|
||||
/* certain create options are not allowed */
|
||||
if ((create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE) &&
|
||||
!(access_mask & SEC_STD_DELETE)) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
|
||||
switch (io->generic.in.open_disposition) {
|
||||
@ -1467,21 +1514,44 @@ NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
|
||||
return NT_STATUS_DOS(ERRSRV, ERRerror);
|
||||
}
|
||||
|
||||
if (io->generic.level != RAW_CLOSE_CLOSE) {
|
||||
if (io->generic.level != RAW_CLOSE_GENERIC) {
|
||||
return ntvfs_map_close(ntvfs, req, io);
|
||||
}
|
||||
|
||||
f = pvfs_find_fd(pvfs, req, io->close.in.file.ntvfs);
|
||||
f = pvfs_find_fd(pvfs, req, io->generic.in.file.ntvfs);
|
||||
if (!f) {
|
||||
return NT_STATUS_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (!null_time(io->close.in.write_time)) {
|
||||
if (!null_time(io->generic.in.write_time)) {
|
||||
unix_times.actime = 0;
|
||||
unix_times.modtime = io->close.in.write_time;
|
||||
utime(f->handle->name->full_name, &unix_times);
|
||||
}
|
||||
|
||||
if (io->generic.in.flags & SMB2_CLOSE_FLAGS_FULL_INFORMATION) {
|
||||
struct pvfs_filename *name;
|
||||
NTSTATUS status;
|
||||
struct pvfs_file_handle *h = f->handle;
|
||||
|
||||
status = pvfs_resolve_name_handle(pvfs, h);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
name = h->name;
|
||||
|
||||
io->generic.out.flags = SMB2_CLOSE_FLAGS_FULL_INFORMATION;
|
||||
io->generic.out.create_time = name->dos.create_time;
|
||||
io->generic.out.access_time = name->dos.access_time;
|
||||
io->generic.out.write_time = name->dos.write_time;
|
||||
io->generic.out.change_time = name->dos.change_time;
|
||||
io->generic.out.alloc_size = name->dos.alloc_size;
|
||||
io->generic.out.size = name->st.st_size;
|
||||
io->generic.out.file_attr = name->dos.attrib;
|
||||
} else {
|
||||
ZERO_STRUCT(io->generic.out);
|
||||
}
|
||||
|
||||
talloc_free(f);
|
||||
|
||||
return NT_STATUS_OK;
|
||||
|
@ -301,7 +301,14 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
|
||||
info->all_info2.out.access_mask = 0; /* only set by qfileinfo */
|
||||
info->all_info2.out.position = 0; /* only set by qfileinfo */
|
||||
info->all_info2.out.mode = 0; /* only set by qfileinfo */
|
||||
info->all_info2.out.fname.s = name->original_name;
|
||||
/* windows wants the full path on disk for this
|
||||
result, but I really don't want to expose that on
|
||||
the wire, so I'll give the path with a share
|
||||
prefix, which is a good approximation */
|
||||
info->all_info2.out.fname.s = talloc_asprintf(req, "\\%s\\%s",
|
||||
pvfs->share_name,
|
||||
name->original_name);
|
||||
NT_STATUS_HAVE_NO_MEMORY(info->all_info2.out.fname.s);
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
|
@ -93,6 +93,14 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
|
||||
return pvfs_map_errno(pvfs, errno);
|
||||
}
|
||||
|
||||
/* only SMB2 honors mincnt */
|
||||
if (req->ctx->protocol == PROTOCOL_SMB2) {
|
||||
if (rd->readx.in.mincnt > ret ||
|
||||
(ret == 0 && maxcnt > 0)) {
|
||||
return NT_STATUS_END_OF_FILE;
|
||||
}
|
||||
}
|
||||
|
||||
f->handle->position = f->handle->seek_offset = rd->readx.in.offset + ret;
|
||||
|
||||
rd->readx.out.nread = ret;
|
||||
|
@ -202,7 +202,13 @@ static NTSTATUS parse_stream_name(struct pvfs_filename *name, const char *s)
|
||||
}
|
||||
*p = 0;
|
||||
if (strcmp(name->stream_name, "") == 0) {
|
||||
name->stream_name = NULL;
|
||||
/*
|
||||
* we don't set stream_name to NULL, here
|
||||
* as this would be wrong for directories
|
||||
*
|
||||
* pvfs_fill_dos_info() will set it to NULL
|
||||
* if it's not a directory.
|
||||
*/
|
||||
name->stream_id = 0;
|
||||
} else {
|
||||
name->stream_id = pvfs_name_hash(name->stream_name,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user