nuke extra definitions of krb5_read_priv_message et.al
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8735 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -12,8 +12,8 @@ libexec_PROGRAMS = hprop hpropd kdc
|
||||
|
||||
man_MANS = kdc.8 kstash.8 hprop.8 hpropd.8 string2key.8
|
||||
|
||||
hprop_SOURCES = hprop.c hprop-common.c mit_dump.c v4_dump.c hprop.h kadb.h
|
||||
hpropd_SOURCES = hpropd.c hprop-common.c hprop.h
|
||||
hprop_SOURCES = hprop.c mit_dump.c v4_dump.c hprop.h kadb.h
|
||||
hpropd_SOURCES = hpropd.c hprop.h
|
||||
|
||||
kstash_SOURCES = kstash.c headers.h
|
||||
|
||||
|
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "hprop.h"
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
krb5_error_code
|
||||
send_priv(krb5_context context, krb5_auth_context ac,
|
||||
krb5_data *data, int fd)
|
||||
{
|
||||
krb5_data packet;
|
||||
krb5_error_code ret;
|
||||
|
||||
ret = krb5_mk_priv (context,
|
||||
ac,
|
||||
data,
|
||||
&packet,
|
||||
NULL);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = krb5_write_message (context, &fd, &packet);
|
||||
krb5_data_free(&packet);
|
||||
return ret;
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
recv_priv(krb5_context context, krb5_auth_context ac, int fd, krb5_data *out)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
krb5_data data;
|
||||
|
||||
ret = krb5_read_message (context, &fd, &data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = krb5_rd_priv(context, ac, &data, out, NULL);
|
||||
krb5_data_free (&data);
|
||||
return ret;
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
send_clear(krb5_context context, int fd, krb5_data data)
|
||||
{
|
||||
return krb5_write_message (context, &fd, &data);
|
||||
}
|
||||
|
||||
krb5_error_code
|
||||
recv_clear(krb5_context context, int fd, krb5_data *out)
|
||||
{
|
||||
return krb5_read_message (context, &fd, out);
|
||||
}
|
15
kdc/hprop.c
15
kdc/hprop.c
@@ -98,8 +98,6 @@ open_socket(krb5_context context, const char *hostname, const char *port)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int hdb_entry2value(krb5_context, hdb_entry*, krb5_data*);
|
||||
|
||||
krb5_error_code
|
||||
v5_prop(krb5_context context, HDB *db, hdb_entry *entry, void *appdata)
|
||||
{
|
||||
@@ -119,9 +117,10 @@ v5_prop(krb5_context context, HDB *db, hdb_entry *entry, void *appdata)
|
||||
}
|
||||
|
||||
if(to_stdout)
|
||||
ret = send_clear(context, STDOUT_FILENO, data);
|
||||
ret = krb5_write_message(context, &pd->sock, &data);
|
||||
else
|
||||
ret = send_priv(context, pd->auth_context, &data, pd->sock);
|
||||
ret = krb5_write_priv_message(context, pd->auth_context,
|
||||
&pd->sock, &data);
|
||||
krb5_data_free(&data);
|
||||
return ret;
|
||||
}
|
||||
@@ -649,13 +648,13 @@ propagate_database (krb5_context context, int type,
|
||||
|
||||
data.data = NULL;
|
||||
data.length = 0;
|
||||
ret = send_priv(context, auth_context, &data, fd);
|
||||
ret = krb5_write_priv_message(context, auth_context, &fd, &data);
|
||||
if(ret)
|
||||
krb5_warn(context, ret, "send_priv");
|
||||
krb5_warn(context, ret, "krb5_write_priv_message");
|
||||
|
||||
ret = recv_priv(context, auth_context, fd, &data);
|
||||
ret = krb5_read_priv_message(context, auth_context, &fd, &data);
|
||||
if(ret)
|
||||
krb5_warn(context, ret, "recv_priv");
|
||||
krb5_warn(context, ret, "krb5_read_priv_message");
|
||||
else
|
||||
krb5_data_free (&data);
|
||||
|
||||
|
@@ -53,11 +53,6 @@ struct prop_data{
|
||||
#define NEVERDATE ((1U << 31) - 1)
|
||||
#endif
|
||||
|
||||
krb5_error_code send_priv(krb5_context, krb5_auth_context, krb5_data*, int);
|
||||
krb5_error_code recv_priv(krb5_context, krb5_auth_context, int, krb5_data*);
|
||||
krb5_error_code send_clear(krb5_context context, int fd, krb5_data data);
|
||||
krb5_error_code recv_clear(krb5_context context, int fd, krb5_data *out);
|
||||
|
||||
krb5_error_code v5_prop(krb5_context, HDB*, hdb_entry*, void*);
|
||||
int mit_prop_dump(void*, const char*);
|
||||
int v4_prop(void*, Principal*);
|
||||
|
10
kdc/hpropd.c
10
kdc/hpropd.c
@@ -352,20 +352,20 @@ main(int argc, char **argv)
|
||||
hdb_entry entry;
|
||||
|
||||
if(from_stdin) {
|
||||
ret = recv_clear(context, fd, &data);
|
||||
ret = krb5_read_message(context, &fd, &data);
|
||||
if(ret)
|
||||
krb5_err(context, 1, ret, "recv_clear");
|
||||
krb5_err(context, 1, ret, "krb5_read_message");
|
||||
} else {
|
||||
ret = recv_priv(context, ac, fd, &data);
|
||||
ret = krb5_read_priv_message(context, ac, &fd, &data);
|
||||
if(ret)
|
||||
krb5_err(context, 1, ret, "recv_priv");
|
||||
krb5_err(context, 1, ret, "krb5_read_priv_message");
|
||||
}
|
||||
|
||||
if(data.length == 0) {
|
||||
if(!from_stdin) {
|
||||
data.data = NULL;
|
||||
data.length = 0;
|
||||
send_priv(context, ac, &data, fd);
|
||||
krb5_write_priv_message(context, ac, &fd, &data);
|
||||
}
|
||||
if(!print_dump) {
|
||||
#ifdef KRB4
|
||||
|
Reference in New Issue
Block a user