remove code that depend on kerberos 4 library
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20456 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
13
kdc/config.c
13
kdc/config.c
@@ -623,16 +623,9 @@ configure(krb5_context context, int argc, char **argv)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(config->v4_realm == NULL && (config->enable_kaserver || config->enable_v4)){
|
if(config->v4_realm == NULL && (config->enable_kaserver || config->enable_v4))
|
||||||
#ifdef KRB4
|
krb5_errx(context, 1, "Kerberos 4 enabled but no realm configured");
|
||||||
config->v4_realm = malloc(40); /* REALM_SZ */
|
|
||||||
if (config->v4_realm == NULL)
|
|
||||||
krb5_errx(context, 1, "out of memory");
|
|
||||||
krb_get_lrealm(config->v4_realm, 1);
|
|
||||||
#else
|
|
||||||
krb5_errx(context, 1, "No Kerberos 4 realm configured");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if(disable_des == -1)
|
if(disable_des == -1)
|
||||||
disable_des = krb5_config_get_bool_default(context, NULL,
|
disable_des = krb5_config_get_bool_default(context, NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
17
kdc/hprop.8
17
kdc/hprop.8
@@ -48,7 +48,7 @@
|
|||||||
.Fl -database= Ns Pa file
|
.Fl -database= Ns Pa file
|
||||||
.Xc
|
.Xc
|
||||||
.Oc
|
.Oc
|
||||||
.Op Fl -source= Ns Ar heimdal|mit-dump|krb4-dump|krb4-db|kaserver
|
.Op Fl -source= Ns Ar heimdal|mit-dump|krb4-dump|kaserver
|
||||||
.Oo Fl r Ar string \*(Ba Xo
|
.Oo Fl r Ar string \*(Ba Xo
|
||||||
.Fl -v4-realm= Ns Ar string
|
.Fl -v4-realm= Ns Ar string
|
||||||
.Xc
|
.Xc
|
||||||
@@ -101,7 +101,7 @@ Where to find the master key to encrypt or decrypt keys with.
|
|||||||
.Xc
|
.Xc
|
||||||
The database to be propagated.
|
The database to be propagated.
|
||||||
.It Xo
|
.It Xo
|
||||||
.Fl -source= Ns Ar heimdal|mit-dump|krb4-dump|krb4-db|kaserver
|
.Fl -source= Ns Ar heimdal|mit-dump|krb4-dump|kaserver
|
||||||
.Xc
|
.Xc
|
||||||
Specifies the type of the source database. Alternatives include:
|
Specifies the type of the source database. Alternatives include:
|
||||||
.Pp
|
.Pp
|
||||||
@@ -110,8 +110,6 @@ Specifies the type of the source database. Alternatives include:
|
|||||||
a Heimdal database
|
a Heimdal database
|
||||||
.It mit-dump
|
.It mit-dump
|
||||||
a MIT Kerberos 5 dump file
|
a MIT Kerberos 5 dump file
|
||||||
.It krb4-db
|
|
||||||
a Kerberos 4 database
|
|
||||||
.It krb4-dump
|
.It krb4-dump
|
||||||
a Kerberos 4 dump file
|
a Kerberos 4 dump file
|
||||||
.It kaserver
|
.It kaserver
|
||||||
@@ -170,12 +168,6 @@ The AFS cell name, used if reading a kaserver database.
|
|||||||
.Xc
|
.Xc
|
||||||
Also dump the principals marked as special in the kaserver database.
|
Also dump the principals marked as special in the kaserver database.
|
||||||
.It Xo
|
.It Xo
|
||||||
.Fl 4 ,
|
|
||||||
.Fl -v4-db
|
|
||||||
.Xc
|
|
||||||
Deprecated, identical to
|
|
||||||
.Sq --source=krb4-db .
|
|
||||||
.It Xo
|
|
||||||
.Fl K ,
|
.Fl K ,
|
||||||
.Fl -ka-db
|
.Fl -ka-db
|
||||||
.Xc
|
.Xc
|
||||||
@@ -190,11 +182,6 @@ should run
|
|||||||
$ hprop slave-1 slave-2
|
$ hprop slave-1 slave-2
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
Copy a Kerberos 4 database to a Kerberos 5 slave:
|
|
||||||
.Bd -literal -offset indent
|
|
||||||
$ hprop --source=krb4-db -E krb5-slave
|
|
||||||
.Ed
|
|
||||||
.Pp
|
|
||||||
Convert a Kerberos 4 dump-file for use with a Heimdal KDC:
|
Convert a Kerberos 4 dump-file for use with a Heimdal KDC:
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
$ hprop -n --source=krb4-dump -d /var/kerberos/principal.dump --master-key=/.k | hpropd -n
|
$ hprop -n --source=krb4-dump -d /var/kerberos/principal.dump --master-key=/.k | hpropd -n
|
||||||
|
82
kdc/hprop.c
82
kdc/hprop.c
@@ -33,13 +33,6 @@
|
|||||||
|
|
||||||
#include "hprop.h"
|
#include "hprop.h"
|
||||||
|
|
||||||
#ifdef KRB4
|
|
||||||
#include <krb.h>
|
|
||||||
#include <prot.h>
|
|
||||||
#define Principal Principal4
|
|
||||||
#include <krb_db.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
|
|
||||||
static int version_flag;
|
static int version_flag;
|
||||||
@@ -136,42 +129,6 @@ v5_prop(krb5_context context, HDB *db, hdb_entry_ex *entry, void *appdata)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KRB4
|
|
||||||
|
|
||||||
static char realm_buf[REALM_SZ];
|
|
||||||
|
|
||||||
static int
|
|
||||||
kdb_prop(void *arg, Principal *p)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
struct v4_principal pr;
|
|
||||||
|
|
||||||
memset(&pr, 0, sizeof(pr));
|
|
||||||
|
|
||||||
if(p->attributes != 0) {
|
|
||||||
warnx("%s.%s has non-zero attributes - skipping",
|
|
||||||
p->name, p->instance);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
strlcpy(pr.name, p->name, sizeof(pr.name));
|
|
||||||
strlcpy(pr.instance, p->instance, sizeof(pr.instance));
|
|
||||||
|
|
||||||
copy_to_key(&p->key_low, &p->key_high, pr.key);
|
|
||||||
pr.exp_date = p->exp_date;
|
|
||||||
pr.mod_date = p->mod_date;
|
|
||||||
strlcpy(pr.mod_name, p->mod_name, sizeof(pr.mod_name));
|
|
||||||
strlcpy(pr.mod_instance, p->mod_instance, sizeof(pr.mod_instance));
|
|
||||||
pr.max_life = p->max_life;
|
|
||||||
pr.mkvno = p->kdc_key_ver;
|
|
||||||
pr.kvno = p->key_version;
|
|
||||||
|
|
||||||
ret = v4_prop(arg, &pr);
|
|
||||||
memset(&pr, 0, sizeof(pr));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* KRB4 */
|
|
||||||
|
|
||||||
int
|
int
|
||||||
v4_prop(void *arg, struct v4_principal *p)
|
v4_prop(void *arg, struct v4_principal *p)
|
||||||
{
|
{
|
||||||
@@ -444,9 +401,6 @@ struct getargs args[] = {
|
|||||||
"heimdal"
|
"heimdal"
|
||||||
"|mit-dump"
|
"|mit-dump"
|
||||||
"|krb4-dump"
|
"|krb4-dump"
|
||||||
#ifdef KRB4
|
|
||||||
"|krb4-db"
|
|
||||||
#endif
|
|
||||||
"|kaserver"
|
"|kaserver"
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -520,13 +474,12 @@ get_creds(krb5_context context, krb5_ccache *cache)
|
|||||||
|
|
||||||
enum hprop_source {
|
enum hprop_source {
|
||||||
HPROP_HEIMDAL = 1,
|
HPROP_HEIMDAL = 1,
|
||||||
HPROP_KRB4_DB,
|
|
||||||
HPROP_KRB4_DUMP,
|
HPROP_KRB4_DUMP,
|
||||||
HPROP_KASERVER,
|
HPROP_KASERVER,
|
||||||
HPROP_MIT_DUMP
|
HPROP_MIT_DUMP
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IS_TYPE_V4(X) ((X) == HPROP_KRB4_DB || (X) == HPROP_KRB4_DUMP || (X) == HPROP_KASERVER)
|
#define IS_TYPE_V4(X) ((X) == HPROP_KRB4_DUMP || (X) == HPROP_KASERVER)
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int type;
|
int type;
|
||||||
@@ -534,9 +487,6 @@ struct {
|
|||||||
} types[] = {
|
} types[] = {
|
||||||
{ HPROP_HEIMDAL, "heimdal" },
|
{ HPROP_HEIMDAL, "heimdal" },
|
||||||
{ HPROP_KRB4_DUMP, "krb4-dump" },
|
{ HPROP_KRB4_DUMP, "krb4-dump" },
|
||||||
#ifdef KRB4
|
|
||||||
{ HPROP_KRB4_DB, "krb4-db" },
|
|
||||||
#endif
|
|
||||||
{ HPROP_KASERVER, "kaserver" },
|
{ HPROP_KASERVER, "kaserver" },
|
||||||
{ HPROP_MIT_DUMP, "mit-dump" }
|
{ HPROP_MIT_DUMP, "mit-dump" }
|
||||||
};
|
};
|
||||||
@@ -568,14 +518,6 @@ iterate (krb5_context context,
|
|||||||
krb5_warnx(context, "v4_prop_dump: %s",
|
krb5_warnx(context, "v4_prop_dump: %s",
|
||||||
krb5_get_err_text(context, ret));
|
krb5_get_err_text(context, ret));
|
||||||
break;
|
break;
|
||||||
#ifdef KRB4
|
|
||||||
case HPROP_KRB4_DB:
|
|
||||||
ret = kerb_db_iterate ((k_iter_proc_t)kdb_prop, pd);
|
|
||||||
if(ret)
|
|
||||||
krb5_warnx(context, "kerb_db_iterate: %s",
|
|
||||||
krb_get_err_text(ret));
|
|
||||||
break;
|
|
||||||
#endif /* KRB4 */
|
|
||||||
case HPROP_KASERVER:
|
case HPROP_KASERVER:
|
||||||
ret = ka_dump(pd, database_name);
|
ret = ka_dump(pd, database_name);
|
||||||
if(ret)
|
if(ret)
|
||||||
@@ -800,27 +742,11 @@ main(int argc, char **argv)
|
|||||||
krb5_errx(context, 1, "No master key file found");
|
krb5_errx(context, 1, "No master key file found");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KRB4
|
if (IS_TYPE_V4(type) && v4_realm == NULL)
|
||||||
if (IS_TYPE_V4(type)) {
|
krb5_errx(context, 1, "Its a Kerberos 4 database "
|
||||||
int e;
|
"but no realm configured");
|
||||||
|
|
||||||
if (v4_realm == NULL) {
|
|
||||||
e = krb_get_lrealm(realm_buf, 1);
|
|
||||||
if(e)
|
|
||||||
krb5_errx(context, 1, "krb_get_lrealm: %s",
|
|
||||||
krb_get_err_text(e));
|
|
||||||
v4_realm = realm_buf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
#ifdef KRB4
|
|
||||||
case HPROP_KRB4_DB:
|
|
||||||
if (database == NULL)
|
|
||||||
krb5_errx(context, 1, "no database specified");
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case HPROP_KASERVER:
|
case HPROP_KASERVER:
|
||||||
if (database == NULL)
|
if (database == NULL)
|
||||||
database = DEFAULT_DATABASE;
|
database = DEFAULT_DATABASE;
|
||||||
|
Reference in New Issue
Block a user