summaryrefslogtreecommitdiff
path: root/auth/credentials
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2016-12-15 11:37:33 +0100
committerAndrew Bartlett <abartlet@samba.org>2016-12-20 01:11:24 +0100
commit7c344fbbe0568734beb982bb6e0f3c81e6eb5843 (patch)
treedd4a7897cca70a3ac253c6070671cc4439a895f9 /auth/credentials
parent9fa7f59f88cb0350c0616d6f0a6a06b4e7a52228 (diff)
downloadsamba-7c344fbbe0568734beb982bb6e0f3c81e6eb5843.tar.gz
auth/credentials: add python bindings for enum credentials_obtained
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth/credentials')
-rw-r--r--auth/credentials/pycredentials.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index d38d0e391d5..6da64a6e3db 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -528,12 +528,12 @@ static PyMethodDef py_creds_methods[] = {
{ "get_username", py_creds_get_username, METH_NOARGS,
"S.get_username() -> username\nObtain username." },
{ "set_username", py_creds_set_username, METH_VARARGS,
- "S.set_username(name, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_username(name[, credentials.SPECIFIED]) -> None\n"
"Change username." },
{ "get_principal", py_creds_get_principal, METH_NOARGS,
"S.get_principal() -> user@realm\nObtain user principal." },
{ "set_principal", py_creds_set_principal, METH_VARARGS,
- "S.set_principal(name, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_principal(name[, credentials.SPECIFIED]) -> None\n"
"Change principal." },
{ "get_password", py_creds_get_password, METH_NOARGS,
"S.get_password() -> password\n"
@@ -542,31 +542,31 @@ static PyMethodDef py_creds_methods[] = {
"S.get_ntlm_username_domain() -> (domain, username)\n"
"Obtain NTLM username and domain, split up either as (DOMAIN, user) or (\"\", \"user@realm\")." },
{ "set_password", py_creds_set_password, METH_VARARGS,
- "S.set_password(password, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_password(password[, credentials.SPECIFIED]) -> None\n"
"Change password." },
{ "set_utf16_password", py_creds_set_utf16_password, METH_VARARGS,
- "S.set_utf16_password(password, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_utf16_password(password[, credentials.SPECIFIED]) -> None\n"
"Change password." },
{ "get_old_password", py_creds_get_old_password, METH_NOARGS,
"S.get_old_password() -> password\n"
"Obtain old password." },
{ "set_old_password", py_creds_set_old_password, METH_VARARGS,
- "S.set_old_password(password, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_old_password(password[, credentials.SPECIFIED]) -> None\n"
"Change old password." },
{ "set_old_utf16_password", py_creds_set_old_utf16_password, METH_VARARGS,
- "S.set_old_utf16_password(password, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_old_utf16_password(password[, credentials.SPECIFIED]) -> None\n"
"Change old password." },
{ "get_domain", py_creds_get_domain, METH_NOARGS,
"S.get_domain() -> domain\n"
"Obtain domain name." },
{ "set_domain", py_creds_set_domain, METH_VARARGS,
- "S.set_domain(domain, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_domain(domain[, credentials.SPECIFIED]) -> None\n"
"Change domain name." },
{ "get_realm", py_creds_get_realm, METH_NOARGS,
"S.get_realm() -> realm\n"
"Obtain realm name." },
{ "set_realm", py_creds_set_realm, METH_VARARGS,
- "S.set_realm(realm, obtained=CRED_SPECIFIED) -> None\n"
+ "S.set_realm(realm[, credentials.SPECIFIED]) -> None\n"
"Change realm name." },
{ "get_bind_dn", py_creds_get_bind_dn, METH_NOARGS,
"S.get_bind_dn() -> bind dn\n"
@@ -592,10 +592,10 @@ static PyMethodDef py_creds_methods[] = {
"S.set_cmdline_callbacks() -> bool\n"
"Use command-line to obtain credentials not explicitly set." },
{ "parse_string", py_creds_parse_string, METH_VARARGS,
- "S.parse_string(text, obtained=CRED_SPECIFIED) -> None\n"
+ "S.parse_string(text[, credentials.SPECIFIED]) -> None\n"
"Parse credentials string." },
{ "parse_file", py_creds_parse_file, METH_VARARGS,
- "S.parse_file(filename, obtained=CRED_SPECIFIED) -> None\n"
+ "S.parse_file(filename[, credentials.SPECIFIED]) -> None\n"
"Parse credentials file." },
{ "set_password_will_be_nt_hash",
py_cli_credentials_set_password_will_be_nt_hash, METH_VARARGS,
@@ -649,6 +649,13 @@ void initcredentials(void)
if (m == NULL)
return;
+ PyModule_AddObject(m, "UNINITIALISED", PyInt_FromLong(CRED_UNINITIALISED));
+ PyModule_AddObject(m, "CALLBACK", PyInt_FromLong(CRED_CALLBACK));
+ PyModule_AddObject(m, "GUESS_ENV", PyInt_FromLong(CRED_GUESS_ENV));
+ PyModule_AddObject(m, "GUESS_FILE", PyInt_FromLong(CRED_GUESS_FILE));
+ PyModule_AddObject(m, "CALLBACK_RESULT", PyInt_FromLong(CRED_CALLBACK_RESULT));
+ PyModule_AddObject(m, "SPECIFIED", PyInt_FromLong(CRED_SPECIFIED));
+
PyModule_AddObject(m, "AUTO_USE_KERBEROS", PyInt_FromLong(CRED_AUTO_USE_KERBEROS));
PyModule_AddObject(m, "DONT_USE_KERBEROS", PyInt_FromLong(CRED_DONT_USE_KERBEROS));
PyModule_AddObject(m, "MUST_USE_KERBEROS", PyInt_FromLong(CRED_MUST_USE_KERBEROS));