diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-04-05 16:15:27 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-04-05 23:46:04 +0200 |
commit | 663dc94e630910b0b5b61801a03622641b2b83b4 (patch) | |
tree | 3d74a050420ec92dd686f618b3b3ad40b647fc86 /librpc | |
parent | f261266c9d66d7143a867f4719d1549f58915036 (diff) | |
download | samba-663dc94e630910b0b5b61801a03622641b2b83b4.tar.gz samba-663dc94e630910b0b5b61801a03622641b2b83b4.tar.bz2 samba-663dc94e630910b0b5b61801a03622641b2b83b4.zip |
auth: Move auth_session_info into IDL
This changes auth_session_info_transport to just be a wrapper, rather
than a copy that has to be kept in sync.
As auth_session_info was already wrapped in python, this required
changes to the existing pyauth wrapper and it's users.
Andrew Bartlett
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/idl/auth.idl | 18 | ||||
-rw-r--r-- | librpc/ndr/ndr_auth.c | 44 | ||||
-rw-r--r-- | librpc/ndr/ndr_auth.h | 32 | ||||
-rw-r--r-- | librpc/wscript_build | 2 |
4 files changed, 94 insertions, 2 deletions
diff --git a/librpc/idl/auth.idl b/librpc/idl/auth.idl index 7b4556a6d7..904becac61 100644 --- a/librpc/idl/auth.idl +++ b/librpc/idl/auth.idl @@ -1,10 +1,20 @@ #include "idl_types.h" /* - security IDL structures + Authentication IDL structures + + These are NOT public network structures, but it is helpful to define + these things in IDL. They may change without ABI breakage or + warning. + */ import "misc.idl", "security.idl", "lsa.idl", "krb5pac.idl"; +[ + pyhelper("librpc/ndr/py_auth.c"), + helper("../librpc/ndr/ndr_auth.h"), + helpstring("internal Samba authentication structures") +] interface auth { @@ -79,7 +89,13 @@ interface auth security_unix_token *unix_token; auth_user_info *info; auth_user_info_unix *unix_info; + [value(NULL), ignore] auth_user_info_torture *torture; DATA_BLOB session_key; + [value(NULL), ignore] cli_credentials *credentials; + } auth_session_info; + + typedef [public] struct { + auth_session_info *session_info; DATA_BLOB exported_gssapi_credentials; } auth_session_info_transport; } diff --git a/librpc/ndr/ndr_auth.c b/librpc/ndr/ndr_auth.c new file mode 100644 index 0000000000..5252d80052 --- /dev/null +++ b/librpc/ndr/ndr_auth.c @@ -0,0 +1,44 @@ +/* + Unix SMB/CIFS implementation. + + Helper routines for marshalling the internal 'auth.idl' + + Copyright (C) Andrew Bartlett 2011 + + 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 "librpc/ndr/ndr_auth.h" +#include "librpc/ndr/libndr.h" + +_PUBLIC_ void ndr_print_cli_credentials(struct ndr_print *ndr, const char *name, struct cli_credentials *v) +{ + ndr->print(ndr, "%-25s: NULL", name); +} + +/* + cli_credentials does not have a network representation, just pull/push a NULL pointer +*/ +_PUBLIC_ enum ndr_err_code ndr_pull_cli_credentials(struct ndr_pull *ndr, int ndr_flags, struct cli_credentials *v) +{ + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_push_cli_credentials(struct ndr_push *ndr, int ndr_flags, struct cli_credentials *v) +{ + return ndr_push_pointer(ndr, ndr_flags, NULL); +} + + diff --git a/librpc/ndr/ndr_auth.h b/librpc/ndr/ndr_auth.h new file mode 100644 index 0000000000..57f653551f --- /dev/null +++ b/librpc/ndr/ndr_auth.h @@ -0,0 +1,32 @@ +/* + Unix SMB/CIFS implementation. + + Helper routines for marshalling the internal 'auth.idl' + + Copyright (C) Andrew Bartlett 2011 + + 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/>. +*/ + +/* + cli_credentials does not have a network representation, just pull/push a NULL pointer +*/ + +#include "librpc/gen_ndr/ndr_auth.h" + +struct cli_credentials; +_PUBLIC_ enum ndr_err_code ndr_pull_cli_credentials(struct ndr_pull *ndr, int ndr_flags, struct cli_credentials *v); +_PUBLIC_ enum ndr_err_code ndr_push_cli_credentials(struct ndr_push *ndr, int ndr_flags, struct cli_credentials *v); + +_PUBLIC_ void ndr_print_cli_credentials(struct ndr_print *ndr, const char *name, struct cli_credentials *v); diff --git a/librpc/wscript_build b/librpc/wscript_build index ce78cb6767..b71a3ae5d9 100644 --- a/librpc/wscript_build +++ b/librpc/wscript_build @@ -9,7 +9,7 @@ bld.SAMBA_SUBSYSTEM('NDR_AUDIOSRV', ) bld.SAMBA_SUBSYSTEM('NDR_AUTH', - source='gen_ndr/ndr_auth.c', + source='gen_ndr/ndr_auth.c ndr/ndr_auth.c', public_headers='gen_ndr/auth.h', header_path='gen_ndr', public_deps='ndr NDR_SECURITY ndr-krb5pac' |