From f6961fb388a563420a7f198117a8a7cf508af474 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 10 Jan 2013 12:43:57 -0500 Subject: [PATCH] Get rid of adm.h adm.h predates the ovsec kadm5 integration. It contains a bunch of obsolete defines and a redundant definition of krb5_realm_params. Get rid of it, and include where we currently include it. --- src/include/adm.h | 225 ---------------------------------------- src/include/adm_proto.h | 8 +- src/kdc/deps | 39 +++++-- src/kdc/do_as_req.c | 2 +- src/kdc/kdc_util.c | 2 +- src/kdc/main.c | 2 +- 6 files changed, 35 insertions(+), 243 deletions(-) delete mode 100644 src/include/adm.h diff --git a/src/include/adm.h b/src/include/adm.h deleted file mode 100644 index 9b05f79d78..0000000000 --- a/src/include/adm.h +++ /dev/null @@ -1,225 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* include/adm.h */ -/* - * Copyright 1995,2001,2009 by the Massachusetts Institute of Technology. - * All Rights Reserved. - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - */ - -#ifndef KRB5_ADM_H__ -#define KRB5_ADM_H__ - -/* - * Kerberos V5 Change Password service name - */ -#define KRB5_ADM_SERVICE_NAME "kpasswd" -#define KRB5_ADM_DEFAULT_PORT 464 - -#define KRB5_ADM_SERVICE_INSTANCE "changepw" - -/* - * Maximum password length. - */ -#define KRB5_ADM_MAX_PASSWORD_LEN 512 - -/* - * Protocol command strings. - */ -#define KRB5_ADM_QUIT_CMD "QUIT" -#define KRB5_ADM_CHECKPW_CMD "CHECKPW" -#define KRB5_ADM_CHANGEPW_CMD "CHANGEPW" -#define KRB5_ADM_MOTD_CMD "MOTD" -#define KRB5_ADM_MIME_CMD "MIME" -#define KRB5_ADM_LANGUAGE_CMD "LANGUAGE" - -#define KRB5_ADM_ADD_PRINC_CMD "ADD-PRINCIPAL" -#define KRB5_ADM_DEL_PRINC_CMD "DELETE-PRINCIPAL" -#define KRB5_ADM_REN_PRINC_CMD "RENAME-PRINCIPAL" -#define KRB5_ADM_MOD_PRINC_CMD "MODIFY-PRINCIPAL" -#define KRB5_ADM_INQ_PRINC_CMD "INQUIRE-PRINCIPAL" -#define KRB5_ADM_EXT_KEY_CMD "EXTRACT-KEY" - -/* - * Protocol command strings for the current version of the admin - * server. (Chris had removed them in the version he was working - * with.) - * - * XXX I'm adding them back so the tree works. We need to take care - * of this eventually. - */ -#define KRB5_ADM_CHG_OPW_CMD "OTHER-CHANGEPW" -#define KRB5_ADM_CHG_ORPW_CMD "OTHER-RANDOM-CHANGEPW" -#define KRB5_ADM_ADD_KEY_CMD "ADD-KEY" -#define KRB5_ADM_DEL_KEY_CMD "DELETE-KEY" - -/* - * Reply status values. - */ -#define KRB5_ADM_SUCCESS 0 -#define KRB5_ADM_CMD_UNKNOWN 1 -#define KRB5_ADM_PW_UNACCEPT 2 -#define KRB5_ADM_BAD_PW 3 -#define KRB5_ADM_NOT_IN_TKT 4 -#define KRB5_ADM_CANT_CHANGE 5 -#define KRB5_ADM_LANG_NOT_SUPPORTED 6 - -#define KRB5_ADM_P_ALREADY_EXISTS 64 -#define KRB5_ADM_P_DOES_NOT_EXIST 65 -#define KRB5_ADM_NOT_AUTHORIZED 66 -#define KRB5_ADM_BAD_OPTION 67 -#define KRB5_ADM_VALUE_REQUIRED 68 -#define KRB5_ADM_SYSTEM_ERROR 69 -#define KRB5_ADM_KEY_DOES_NOT_EXIST 70 -#define KRB5_ADM_KEY_ALREADY_EXISTS 71 - -/* - * Principal flag keywords. - */ -/* Settable only */ -#define KRB5_ADM_KW_PASSWORD "PASSWORD" -#define KRB5_ADM_KW_APASSWORD "APASSWORD" -#define KRB5_ADM_KW_RANDOMKEY "RANDOMKEY" -#define KRB5_ADM_KW_ARANDOMKEY "ARANDOMKEY" -#define KRB5_ADM_KW_SETFLAGS "SETFLAGS" -#define KRB5_ADM_KW_UNSETFLAGS "UNSETFLAGS" -/* Settable and retrievable */ -#define KRB5_ADM_KW_MAXLIFE "MAXLIFE" -#define KRB5_ADM_KW_MAXRENEWLIFE "MAXRENEWLIFE" -#define KRB5_ADM_KW_EXPIRATION "EXPIRATION" -#define KRB5_ADM_KW_PWEXPIRATION "PWEXPIRATION" -#define KRB5_ADM_KW_FLAGS "FLAGS" -#define KRB5_ADM_KW_AUXDATA "AUXDATA" -#define KRB5_ADM_KW_EXTRADATA "EXTRADATA" -/* Retrievable only */ -#define KRB5_ADM_KW_LASTPWCHANGE "LASTPWCHANGE" -#define KRB5_ADM_KW_LASTSUCCESS "LASTSUCCESS" -#define KRB5_ADM_KW_LASTFAILED "LASTFAILED" -#define KRB5_ADM_KW_FAILCOUNT "FAILCOUNT" -#define KRB5_ADM_KW_KEYDATA "KEYDATA" - -/* Valid mask */ -#define KRB5_ADM_M_PASSWORD 0x00000001 -#define KRB5_ADM_M_MAXLIFE 0x00000002 -#define KRB5_ADM_M_MAXRENEWLIFE 0x00000004 -#define KRB5_ADM_M_EXPIRATION 0x00000008 -#define KRB5_ADM_M_PWEXPIRATION 0x00000010 -#define KRB5_ADM_M_RANDOMKEY 0x00000020 -#define KRB5_ADM_M_FLAGS 0x00000040 -#define KRB5_ADM_M_LASTPWCHANGE 0x00000080 -#define KRB5_ADM_M_LASTSUCCESS 0x00000100 -#define KRB5_ADM_M_LASTFAILED 0x00000200 -#define KRB5_ADM_M_FAILCOUNT 0x00000400 -#define KRB5_ADM_M_AUXDATA 0x00000800 -#define KRB5_ADM_M_KEYDATA 0x00001000 -#define KRB5_ADM_M_APASSWORD 0x00002000 -#define KRB5_ADM_M_ARANDOMKEY 0x00004000 -#define KRB5_ADM_M_UNUSED_15 0x00008000 -#define KRB5_ADM_M_UNUSED_16 0x00010000 -#define KRB5_ADM_M_UNUSED_17 0x00020000 -#define KRB5_ADM_M_UNUSED_18 0x00040000 -#define KRB5_ADM_M_UNUSED_19 0x00080000 -#define KRB5_ADM_M_UNUSED_20 0x00100000 -#define KRB5_ADM_M_UNUSED_21 0x00200000 -#define KRB5_ADM_M_UNUSED_22 0x00400000 -#define KRB5_ADM_M_UNUSED_23 0x00800000 -#define KRB5_ADM_M_UNUSED_24 0x01000000 -#define KRB5_ADM_M_UNUSED_25 0x02000000 -#define KRB5_ADM_M_UNUSED_26 0x04000000 -#define KRB5_ADM_M_UNUSED_27 0x08000000 -#define KRB5_ADM_M_UNUSED_28 0x10000000 -#define KRB5_ADM_M_UNUSED_29 0x20000000 -#define KRB5_ADM_M_GET 0x40000000 -#define KRB5_ADM_M_SET 0x80000000 - -#define KRB5_ADM_M_EXTRADATA 0x00000000 /* Hack to get */ - /* libkadm to compile */ - -#define KRB5_ADM_M_SET_VALID (KRB5_ADM_M_SET + \ - KRB5_ADM_M_PASSWORD + \ - KRB5_ADM_M_APASSWORD + \ - KRB5_ADM_M_MAXLIFE + \ - KRB5_ADM_M_MAXRENEWLIFE+ \ - KRB5_ADM_M_EXPIRATION + \ - KRB5_ADM_M_PWEXPIRATION+ \ - KRB5_ADM_M_RANDOMKEY + \ - KRB5_ADM_M_ARANDOMKEY + \ - KRB5_ADM_M_FLAGS + \ - KRB5_ADM_M_AUXDATA) -#define KRB5_ADM_M_GET_VALID (KRB5_ADM_M_GET + \ - KRB5_ADM_M_MAXLIFE + \ - KRB5_ADM_M_MAXRENEWLIFE+ \ - KRB5_ADM_M_EXPIRATION + \ - KRB5_ADM_M_PWEXPIRATION+ \ - KRB5_ADM_M_FLAGS + \ - KRB5_ADM_M_LASTPWCHANGE+ \ - KRB5_ADM_M_LASTSUCCESS + \ - KRB5_ADM_M_LASTFAILED + \ - KRB5_ADM_M_FAILCOUNT + \ - KRB5_ADM_M_AUXDATA + \ - KRB5_ADM_M_KEYDATA) - -/* - * Keytab reply components. - */ -#define KRB5_ADM_KT_PRINCIPAL 0 -#define KRB5_ADM_KT_TIMESTAMP 1 -#define KRB5_ADM_KT_VNO 2 -#define KRB5_ADM_KT_KEY_ENCTYPE 3 -#define KRB5_ADM_KT_KEY_KEY 4 -#define KRB5_ADM_KT_NCOMPS 5 - -/* for krb5_key_salt_tuple */ -#include "kdb.h" - -/* - * Data structure returned by krb5_read_realm_params() - */ -typedef struct __krb5_realm_params { - char * realm_profile; - char * realm_mkey_name; - char * realm_stash_file; - char * realm_kdc_ports; - char * realm_kdc_tcp_ports; - char * realm_acl_file; - char * realm_host_based_services; - char * realm_no_host_referral; - krb5_int32 realm_kadmind_port; - krb5_enctype realm_enctype; - krb5_deltat realm_max_life; - krb5_deltat realm_max_rlife; - krb5_timestamp realm_expiration; - krb5_flags realm_flags; - krb5_key_salt_tuple *realm_keysalts; - unsigned int realm_reject_bad_transit:1; - unsigned int realm_restrict_anon:1; - unsigned int realm_kadmind_port_valid:1; - unsigned int realm_enctype_valid:1; - unsigned int realm_max_life_valid:1; - unsigned int realm_max_rlife_valid:1; - unsigned int realm_expiration_valid:1; - unsigned int realm_flags_valid:1; - unsigned int realm_reject_bad_transit_valid:1; - unsigned int realm_restrict_anon_valid:1; - unsigned int realm_assume_des_crc_sess:1; - unsigned int realm_assume_des_crc_sess_valid:1; - krb5_int32 realm_num_keysalts; -} krb5_realm_params; -#endif /* KRB5_ADM_H__ */ diff --git a/src/include/adm_proto.h b/src/include/adm_proto.h index d79e362941..e9cbab6e8c 100644 --- a/src/include/adm_proto.h +++ b/src/include/adm_proto.h @@ -35,13 +35,9 @@ struct _krb5_db_entry; typedef struct _krb5_db_entry krb5_db_entry; #endif /* KRB5_KDB5__ */ -/* Ditto for adm.h */ +/* Ditto for admin.h */ -/* - * XXXX krb5_realm params is defined in two header files!!!! - * This really needs to be fixed!!! - */ -#if !defined(KRB5_ADM_H__) && !defined(__KADM5_ADMIN_H__) +#if !defined(__KADM5_ADMIN_H__) struct ___krb5_realm_params; typedef struct ___krb5_realm_params krb5_realm_params; #endif /* KRB5_ADM_H__ */ diff --git a/src/kdc/deps b/src/kdc/deps index 90287fe30c..a88ebddeac 100644 --- a/src/kdc/deps +++ b/src/kdc/deps @@ -17,9 +17,16 @@ $(OUTPRE)dispatch.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ $(top_srcdir)/include/socket-utils.h dispatch.c extern.h \ kdc_util.h realm_data.h reqstate.h $(OUTPRE)do_as_req.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(VERTO_DEPS) \ - $(top_srcdir)/include/adm.h $(top_srcdir)/include/adm_proto.h \ + $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \ + $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \ + $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \ + $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \ + $(COM_ERR_DEPS) $(VERTO_DEPS) $(top_srcdir)/include/adm_proto.h \ + $(top_srcdir)/include/gssrpc/auth.h $(top_srcdir)/include/gssrpc/auth_gss.h \ + $(top_srcdir)/include/gssrpc/auth_unix.h $(top_srcdir)/include/gssrpc/clnt.h \ + $(top_srcdir)/include/gssrpc/rename.h $(top_srcdir)/include/gssrpc/rpc.h \ + $(top_srcdir)/include/gssrpc/rpc_msg.h $(top_srcdir)/include/gssrpc/svc.h \ + $(top_srcdir)/include/gssrpc/svc_auth.h $(top_srcdir)/include/gssrpc/xdr.h \ $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ @@ -59,9 +66,16 @@ $(OUTPRE)fast_util.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ extern.h fast_util.c kdc_util.h realm_data.h reqstate.h $(OUTPRE)kdc_util.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(VERTO_DEPS) \ - $(top_srcdir)/include/adm.h $(top_srcdir)/include/adm_proto.h \ + $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \ + $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \ + $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \ + $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \ + $(COM_ERR_DEPS) $(VERTO_DEPS) $(top_srcdir)/include/adm_proto.h \ + $(top_srcdir)/include/gssrpc/auth.h $(top_srcdir)/include/gssrpc/auth_gss.h \ + $(top_srcdir)/include/gssrpc/auth_unix.h $(top_srcdir)/include/gssrpc/clnt.h \ + $(top_srcdir)/include/gssrpc/rename.h $(top_srcdir)/include/gssrpc/rpc.h \ + $(top_srcdir)/include/gssrpc/rpc_msg.h $(top_srcdir)/include/gssrpc/svc.h \ + $(top_srcdir)/include/gssrpc/svc_auth.h $(top_srcdir)/include/gssrpc/xdr.h \ $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ @@ -113,9 +127,16 @@ $(OUTPRE)kdc_preauth_encts.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ kdc_preauth_encts.c kdc_util.h realm_data.h reqstate.h $(OUTPRE)main.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(VERTO_DEPS) \ - $(top_srcdir)/include/adm.h $(top_srcdir)/include/adm_proto.h \ + $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssrpc/types.h \ + $(BUILDTOP)/include/kadm5/admin.h $(BUILDTOP)/include/kadm5/chpass_util_strings.h \ + $(BUILDTOP)/include/kadm5/kadm_err.h $(BUILDTOP)/include/krb5/krb5.h \ + $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \ + $(COM_ERR_DEPS) $(VERTO_DEPS) $(top_srcdir)/include/adm_proto.h \ + $(top_srcdir)/include/gssrpc/auth.h $(top_srcdir)/include/gssrpc/auth_gss.h \ + $(top_srcdir)/include/gssrpc/auth_unix.h $(top_srcdir)/include/gssrpc/clnt.h \ + $(top_srcdir)/include/gssrpc/rename.h $(top_srcdir)/include/gssrpc/rpc.h \ + $(top_srcdir)/include/gssrpc/rpc_msg.h $(top_srcdir)/include/gssrpc/svc.h \ + $(top_srcdir)/include/gssrpc/svc_auth.h $(top_srcdir)/include/gssrpc/xdr.h \ $(top_srcdir)/include/k5-buf.h $(top_srcdir)/include/k5-err.h \ $(top_srcdir)/include/k5-gmt_mktime.h $(top_srcdir)/include/k5-int-pkinit.h \ $(top_srcdir)/include/k5-int.h $(top_srcdir)/include/k5-platform.h \ diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c index 79da300d22..453f319ce1 100644 --- a/src/kdc/do_as_req.c +++ b/src/kdc/do_as_req.c @@ -69,7 +69,7 @@ #include "kdc_util.h" #include "policy.h" -#include "adm.h" +#include #include "adm_proto.h" #include "extern.h" diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index a6a53a1c91..6722d5a8be 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -57,7 +57,7 @@ #include #include #include -#include "adm.h" +#include #include "adm_proto.h" #include "net-server.h" #include diff --git a/src/kdc/main.c b/src/kdc/main.c index f06263e25b..02d7c3372c 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -35,7 +35,7 @@ #include "k5-int.h" #include "com_err.h" -#include "adm.h" +#include #include "adm_proto.h" #include "kdc_util.h" #include "extern.h" -- 2.47.2