From e7c171590aab4f4cd91c1a2f5a04c8f0ed88a70c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 26 Aug 2008 11:42:13 +0200 Subject: heimdal_build: split glue.c into krb5 and gssapi parts metze (This used to be commit 1c7bb21bd85900206e9ad831bc4795c1f765a9aa) --- source4/heimdal_build/glue.c | 65 ------------------------------------- source4/heimdal_build/gssapi-glue.c | 27 +++++++++++++++ source4/heimdal_build/internal.mk | 20 ++++-------- source4/heimdal_build/krb5-glue.c | 59 +++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 79 deletions(-) delete mode 100644 source4/heimdal_build/glue.c create mode 100644 source4/heimdal_build/gssapi-glue.c create mode 100644 source4/heimdal_build/krb5-glue.c diff --git a/source4/heimdal_build/glue.c b/source4/heimdal_build/glue.c deleted file mode 100644 index 07062ae8bf..0000000000 --- a/source4/heimdal_build/glue.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - provide glue functions between heimdal and samba - - Copyright (C) Andrew Tridgell 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 . -*/ - -#include "includes.h" -#include "system/network.h" -#include "system/kerberos.h" -#include "lib/socket/netif.h" -#include "param/param.h" - -/** - get the list of IP addresses for configured interfaces -*/ -krb5_error_code KRB5_LIB_FUNCTION krb5_get_all_client_addrs(krb5_context context, krb5_addresses *res) -{ - int i; - struct interface *ifaces; - - load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces); - - res->len = iface_count(ifaces); - res->val = malloc_array_p(HostAddress, res->len); - if (res->val == NULL) { - talloc_free(ifaces); - return ENOMEM; - } - for (i=0;ilen;i++) { - const char *ip = iface_n_ip(ifaces, i); - res->val[i].addr_type = AF_INET; - res->val[i].address.length = 4; - res->val[i].address.data = malloc(4); - if (res->val[i].address.data == NULL) { - talloc_free(ifaces); - return ENOMEM; - } - ((struct in_addr *)res->val[i].address.data)->s_addr = inet_addr(ip); - } - - talloc_free(ifaces); - - return 0; -} - - -void *__gss_ntlm_initialize(void) -{ - return NULL; -} diff --git a/source4/heimdal_build/gssapi-glue.c b/source4/heimdal_build/gssapi-glue.c new file mode 100644 index 0000000000..0885c2165b --- /dev/null +++ b/source4/heimdal_build/gssapi-glue.c @@ -0,0 +1,27 @@ +/* + Unix SMB/CIFS implementation. + + provide glue functions between heimdal and samba + + Copyright (C) Andrew Tridgell 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 . +*/ + +#include "lib/replace/replace.h" + +void *__gss_ntlm_initialize(void) +{ + return NULL; +} diff --git a/source4/heimdal_build/internal.mk b/source4/heimdal_build/internal.mk index 8c576bd2c6..3bda661946 100644 --- a/source4/heimdal_build/internal.mk +++ b/source4/heimdal_build/internal.mk @@ -174,15 +174,16 @@ HEIMDAL_GSSAPI_OBJ_FILES = \ $(heimdalsrcdir)/lib/gssapi/krb5/accept_sec_context.o \ $(heimdalsrcdir)/lib/gssapi/krb5/set_sec_context_option.o \ $(heimdalsrcdir)/lib/gssapi/krb5/process_context_token.o \ - $(heimdalsrcdir)/lib/gssapi/krb5/prf.o - + $(heimdalsrcdir)/lib/gssapi/krb5/prf.o \ + $(heimdalbuildsrcdir)/gssapi-glue.o ####################### # Start SUBSYSTEM HEIMDAL_KRB5 [SUBSYSTEM::HEIMDAL_KRB5] 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 \ - HEIMDAL_KRB5_ASN1 HEIMDAL_GLUE HEIMDAL_HX509 HEIMDAL_HCRYPTO + HEIMDAL_KRB5_ASN1 HEIMDAL_HX509 HEIMDAL_HCRYPTO \ + LIBNETIF LIBSAMBA-HOSTCONFIG PUBLIC_DEPENDENCIES = HEIMDAL_COM_ERR # End SUBSYSTEM HEIMDAL_KRB5 ####################### @@ -273,7 +274,8 @@ HEIMDAL_KRB5_OBJ_FILES = \ $(heimdalsrcdir)/lib/krb5/krb5_err.o \ $(heimdalsrcdir)/lib/krb5/heim_err.o \ $(heimdalsrcdir)/lib/krb5/k524_err.o \ - $(heimdalsrcdir)/lib/krb5/krb_err.o + $(heimdalsrcdir)/lib/krb5/krb_err.o \ + $(heimdalbuildsrcdir)/krb5-glue.o ####################### # Start SUBSYSTEM HEIMDAL_HEIM_ASN1 @@ -474,16 +476,6 @@ HEIMDAL_ROKEN_OBJ_FILES = \ $(heimdalsrcdir)/lib/roken/xfree.o \ $(heimdalbuildsrcdir)/replace.o -####################### -# Start SUBSYSTEM HEIMDAL_GLUE -[SUBSYSTEM::HEIMDAL_GLUE] -CFLAGS = -I$(heimdalbuildsrcdir) -I$(heimdalsrcdir)/lib/krb5 -I$(heimdalsrcdir)/lib/asn1 -I$(heimdalsrcdir)/lib/com_err -PRIVATE_DEPENDENCIES = LIBNETIF LIBSAMBA-HOSTCONFIG -# End SUBSYSTEM HEIMDAL_GLUE -####################### - -HEIMDAL_GLUE_OBJ_FILES = $(heimdalbuildsrcdir)/glue.o - ####################### # Start SUBSYSTEM HEIMDAL_COM_ERR [SUBSYSTEM::HEIMDAL_COM_ERR] diff --git a/source4/heimdal_build/krb5-glue.c b/source4/heimdal_build/krb5-glue.c new file mode 100644 index 0000000000..835e51cc02 --- /dev/null +++ b/source4/heimdal_build/krb5-glue.c @@ -0,0 +1,59 @@ +/* + Unix SMB/CIFS implementation. + + provide glue functions between heimdal and samba + + Copyright (C) Andrew Tridgell 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 . +*/ + +#include "includes.h" +#include "system/network.h" +#include "system/kerberos.h" +#include "lib/socket/netif.h" +#include "param/param.h" + +/** + get the list of IP addresses for configured interfaces +*/ +krb5_error_code KRB5_LIB_FUNCTION krb5_get_all_client_addrs(krb5_context context, krb5_addresses *res) +{ + int i; + struct interface *ifaces; + + load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces); + + res->len = iface_count(ifaces); + res->val = malloc_array_p(HostAddress, res->len); + if (res->val == NULL) { + talloc_free(ifaces); + return ENOMEM; + } + for (i=0;ilen;i++) { + const char *ip = iface_n_ip(ifaces, i); + res->val[i].addr_type = AF_INET; + res->val[i].address.length = 4; + res->val[i].address.data = malloc(4); + if (res->val[i].address.data == NULL) { + talloc_free(ifaces); + return ENOMEM; + } + ((struct in_addr *)res->val[i].address.data)->s_addr = inet_addr(ip); + } + + talloc_free(ifaces); + + return 0; +} -- cgit