mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
Add docstrings to a couple more python modules.
(This used to be commit b4560c90e5e8d3a35367d3a21d361dc4c9c0de23)
This commit is contained in:
parent
b9c3aae792
commit
73b789b6d2
@ -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
|
||||
|
||||
%{
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Authentication and authorization support.
|
||||
"""
|
||||
|
||||
import _auth
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
|
@ -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
|
||||
|
||||
%{
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Credentials management.
|
||||
"""
|
||||
|
||||
import _credentials
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
|
@ -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";
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Event management.
|
||||
"""
|
||||
|
||||
import _events
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
|
@ -3527,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},
|
||||
@ -3539,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},
|
||||
@ -3553,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 }
|
||||
|
@ -22,7 +22,11 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module dcerpc
|
||||
%define DOCSTRING
|
||||
"DCE/RPC protocol implementation"
|
||||
%enddef
|
||||
|
||||
%module(docstring=DOCSTRING) dcerpc
|
||||
|
||||
%{
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
DCE/RPC protocol implementation
|
||||
"""
|
||||
|
||||
import _dcerpc
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
|
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module(package="samba.param") param
|
||||
%module(docstring="Parsing and writing Samba configuration files.",package="samba.param") param
|
||||
|
||||
%{
|
||||
#include <stdint.h>
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Parsing and writing Samba configuration files.
|
||||
"""
|
||||
|
||||
import _param
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
|
@ -16,7 +16,7 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
%module(package="samba.misc") misc
|
||||
%module(docstring="Python bindings for miscellaneous Samba functions.",package="samba.misc") misc
|
||||
|
||||
%{
|
||||
#include "includes.h"
|
||||
@ -37,6 +37,9 @@
|
||||
%import "../../libcli/security/security.i"
|
||||
%import "../../libcli/util/errors.i"
|
||||
|
||||
%feature("docstring") generate_random_str "S.random_password(len) -> string\n" \
|
||||
"Generate random password with specified length.";
|
||||
|
||||
%rename(random_password) generate_random_str;
|
||||
char *generate_random_str(TALLOC_CTX *mem_ctx, size_t len);
|
||||
|
||||
|
@ -3,6 +3,10 @@
|
||||
#
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
Python bindings for miscellaneous Samba functions.
|
||||
"""
|
||||
|
||||
import _misc
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
@ -61,7 +65,13 @@ import ldb
|
||||
import credentials
|
||||
import param
|
||||
import security
|
||||
random_password = _misc.random_password
|
||||
|
||||
def random_password(*args, **kwargs):
|
||||
"""
|
||||
S.random_password(len) -> string
|
||||
Generate random password with specified length.
|
||||
"""
|
||||
return _misc.random_password(*args, **kwargs)
|
||||
|
||||
def ldb_set_credentials(*args, **kwargs):
|
||||
"""
|
||||
|
@ -3216,7 +3216,10 @@ fail:
|
||||
|
||||
|
||||
static PyMethodDef SwigMethods[] = {
|
||||
{ (char *)"random_password", (PyCFunction) _wrap_random_password, METH_VARARGS | METH_KEYWORDS, NULL},
|
||||
{ (char *)"random_password", (PyCFunction) _wrap_random_password, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.random_password(len) -> string\n"
|
||||
"Generate random password with specified length.\n"
|
||||
""},
|
||||
{ (char *)"ldb_set_credentials", (PyCFunction) _wrap_ldb_set_credentials, METH_VARARGS | METH_KEYWORDS, (char *)"\n"
|
||||
"S.set_credentials(credentials)\n"
|
||||
"Set credentials to use when connecting.\n"
|
||||
|
@ -20,6 +20,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""Samba 4."""
|
||||
|
||||
__docformat__ = "restructuredText"
|
||||
|
||||
import os
|
||||
|
@ -22,6 +22,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""Functions for setting up a Samba configuration."""
|
||||
|
||||
from base64 import b64encode
|
||||
import os
|
||||
import pwd
|
||||
@ -41,8 +43,6 @@ import urllib
|
||||
from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE, LdbError, \
|
||||
LDB_ERR_NO_SUCH_OBJECT, timestring, CHANGETYPE_MODIFY, CHANGETYPE_NONE
|
||||
|
||||
"""Functions for setting up a Samba configuration."""
|
||||
|
||||
__docformat__ = "restructuredText"
|
||||
|
||||
DEFAULTSITE = "Default-First-Site-Name"
|
||||
|
Loading…
x
Reference in New Issue
Block a user