aboutsummaryrefslogtreecommitdiff
path: root/src/kadmin/v4server
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2001-06-07 21:55:47 +0000
committerEzra Peisach <epeisach@mit.edu>2001-06-07 21:55:47 +0000
commitdf3c7942d883ebb31019f62d2c4cee16b6d9dbc3 (patch)
tree416344af986e0da9a262e0b87834d71b228cebb4 /src/kadmin/v4server
parentee24c380dd049623efe2b9377a2e9afefa0f747c (diff)
downloadkrb5-df3c7942d883ebb31019f62d2c4cee16b6d9dbc3.zip
krb5-df3c7942d883ebb31019f62d2c4cee16b6d9dbc3.tar.gz
krb5-df3c7942d883ebb31019f62d2c4cee16b6d9dbc3.tar.bz2
* acl_files.c, admin_server.c, kadm_funcs.c, kadm_ser_wrap.c:
Explicitly declare function return types and cleanup assignments in conditionals. * kadm_server.c: Include kadm_server.h and cleanup assignments in conditionals. * kadm_server.h: Include kadm5/admin.h, kadm.h, krb_db.h for structure defintions so that many prototypes may be added to this file. * kadm_stream.c: Include kadm_server.h for prototypes. Explicitly declare functions as ints. (stream_to_vals) Assumption made that pointer to long the same size as krb5_ui_4 fixed. * kadm_supp.c: Include sys/param.h early so that MAXHOSTNAMELEN is not defined by kadm.h and later redefined. In prin_vals(), key_high and key_low elements of the Kadm_vals structure are longs - use an appropriate format to printf. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13299 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/v4server')
-rw-r--r--src/kadmin/v4server/ChangeLog27
-rw-r--r--src/kadmin/v4server/acl_files.c12
-rw-r--r--src/kadmin/v4server/admin_server.c41
-rw-r--r--src/kadmin/v4server/kadm_funcs.c6
-rw-r--r--src/kadmin/v4server/kadm_ser_wrap.c14
-rw-r--r--src/kadmin/v4server/kadm_server.c26
-rw-r--r--src/kadmin/v4server/kadm_server.h60
-rw-r--r--src/kadmin/v4server/kadm_stream.c27
-rw-r--r--src/kadmin/v4server/kadm_supp.c5
9 files changed, 186 insertions, 32 deletions
diff --git a/src/kadmin/v4server/ChangeLog b/src/kadmin/v4server/ChangeLog
index c7f9b53..7577bc5 100644
--- a/src/kadmin/v4server/ChangeLog
+++ b/src/kadmin/v4server/ChangeLog
@@ -1,3 +1,30 @@
+2001-06-07 Ezra Peisach <epeisach@mit.edu>
+
+ * acl_files.c, admin_server.c, kadm_funcs.c, kadm_ser_wrap.c:
+ Explicitly declare function return types and cleanup assignments
+ in conditionals.
+
+ * kadm_server.c: Include kadm_server.h and cleanup assignments in
+ conditionals.
+
+ * kadm_server.h: Include kadm5/admin.h, kadm.h, krb_db.h for
+ structure defintions so that many prototypes may be added to this
+ file.
+
+ * kadm_stream.c: Include kadm_server.h for prototypes. Explicitly
+ declare functions as ints.
+ (stream_to_vals) Assumption made that pointer to long the same
+ size as krb5_ui_4 fixed.
+
+ * kadm_supp.c: Include sys/param.h early so that MAXHOSTNAMELEN is
+ not defined by kadm.h and later redefined. In prin_vals(),
+ key_high and key_low elements of the Kadm_vals structure are longs
+ - use an appropriate format to printf.
+
+2001-06-04 Ezra Peisach <epeisach@rna.mit.edu>
+
+ * kadm_ser_wrap.c, kadm_server.c: Cleanup assignments in conditionals.
+
2000-10-23 Tom Yu <tlyu@mit.edu>
* kadm_ser_wrap.c (kadm_ser_in): Update call to mk_priv().
diff --git a/src/kadmin/v4server/acl_files.c b/src/kadmin/v4server/acl_files.c
index 3e3bbe6..9a56139 100644
--- a/src/kadmin/v4server/acl_files.c
+++ b/src/kadmin/v4server/acl_files.c
@@ -274,7 +274,7 @@ int perm;
/* Eliminate all whitespace character in buf */
/* Modifies its argument */
-static nuke_whitespace(buf)
+static void nuke_whitespace(buf)
char *buf;
{
register char *pin, *pout;
@@ -307,7 +307,7 @@ int size;
}
/* Destroy a hash table */
-static destroy_hash(h)
+static void destroy_hash(h)
struct hashtbl *h;
{
int i;
@@ -332,7 +332,7 @@ register char *s;
}
/* Add an element to a hash table */
-static add_hash(h, el)
+static void add_hash(h, el)
struct hashtbl *h;
char *el;
{
@@ -365,7 +365,7 @@ char *el;
}
/* Returns nonzero if el is in h */
-static check_hash(h, el)
+static int check_hash(h, el)
struct hashtbl *h;
char *el;
{
@@ -468,6 +468,7 @@ char *name;
/* Returns nonzero if it can be determined that acl contains principal */
/* Principal is not canonicalized, and no wildcarding is done */
+int
acl_exact_match(acl, principal)
char *acl;
char *principal;
@@ -481,6 +482,7 @@ char *principal;
/* Returns nonzero if it can be determined that acl contains principal */
/* Recognizes wildcards in acl of the form
name.*@realm, *.*@realm, and *.*@* */
+int
acl_check(acl, principal)
char *acl;
char *principal;
@@ -513,6 +515,7 @@ char *principal;
/* Adds principal to acl */
/* Wildcards are interpreted literally */
+int
acl_add(acl, principal)
char *acl;
char *principal;
@@ -550,6 +553,7 @@ char *principal;
/* Removes principal from acl */
/* Wildcards are interpreted literally */
+int
acl_delete(acl, principal)
char *acl;
char *principal;
diff --git a/src/kadmin/v4server/admin_server.c b/src/kadmin/v4server/admin_server.c
index cd8742d..b025bbc 100644
--- a/src/kadmin/v4server/admin_server.c
+++ b/src/kadmin/v4server/admin_server.c
@@ -71,6 +71,10 @@ extern Kadm_Server server_parm;
krb5_context kadm_context;
int debug;
+static void cleanexit(int);
+static int kadm_listen(void);
+
+
/* close the system log file */
void close_syslog()
{
@@ -86,6 +90,7 @@ void byebye() /* say goodnight gracie */
** Main does the logical thing, it sets up the database and RPC interface,
** as well as handling the creation and maintenance of the syslog file...
*/
+int
main(argc, argv) /* admin_server main routine */
int argc;
char *argv[];
@@ -168,7 +173,8 @@ char *argv[];
}
if (krbrlm[0] == 0) {
- if (errval = krb5_get_default_realm(kadm_context, &lrealm)) {
+ errval = krb5_get_default_realm(kadm_context, &lrealm);
+ if (errval) {
com_err(argv[0], errval, "while attempting to get local realm");
exit(1);
}
@@ -179,12 +185,15 @@ char *argv[];
paramsin.realm = krbrlm;
paramsin.mask |= KADM5_CONFIG_REALM;
- if (errval = kadm5_get_config_params(kadm_context, NULL, NULL,
- &paramsin, &paramsout)) {
+ errval = kadm5_get_config_params(kadm_context, NULL, NULL,
+ &paramsin, &paramsout);
+ if (errval) {
com_err(argv[0], errval, "while retrieving kadm5 params");
exit(1);
}
- if (errval = krb5_db_set_name(kadm_context, paramsout.dbname)) {
+
+ errval = krb5_db_set_name(kadm_context, paramsout.dbname);
+ if (errval) {
com_err(argv[0], errval, "while setting dbname");
exit(1);
}
@@ -195,8 +204,8 @@ char *argv[];
printf("regular kill instead\n\n");
#ifdef KADM5
- printf("KADM Server starting in the KADM5 mode (%sprocess id %d).\n",
- debug ? "" : "parent ", getpid());
+ printf("KADM Server starting in the KADM5 mode (%sprocess id %ld).\n",
+ debug ? "" : "parent ", (long) getpid());
#else
printf("KADM Server starting in %s mode for the purposes for password changing\n\n", fascist_cpw ? "fascist" : "NON-FASCIST");
#endif
@@ -211,7 +220,9 @@ char *argv[];
byebye();
exit(1);
}
- if (errval = krb5_db_set_lockmode(kadm_context, TRUE)) {
+
+ errval = krb5_db_set_lockmode(kadm_context, TRUE);
+ if (errval) {
com_err(argv[0], errval, "while setting db to nonblocking");
close_syslog();
krb5_db_fini(kadm_context);
@@ -249,7 +260,7 @@ static void clear_secrets()
return;
}
-static exit_now = 0;
+static int exit_now = 0;
krb5_sigtype
doexit(sig)
@@ -267,6 +278,7 @@ int unknown_child = 0;
kadm_listen
listen on the admin servers port for a request
*/
+static int
kadm_listen()
{
extern int errno;
@@ -348,7 +360,7 @@ kadm_listen()
if (debug) {
process_client(peer_fd, &peer);
- } else if (pid = fork()) {
+ } else if ((pid = fork())) {
/* parent */
if (pid < 0) {
syslog(LOG_ERR, "fork: %s", error_message(errno));
@@ -421,7 +433,9 @@ void process_client(fd, who)
cleanexit(1);
}
free(service_name);
- if (retval = krb5_db_set_name(kadm_context, paramsout.dbname)) {
+
+ retval = krb5_db_set_name(kadm_context, paramsout.dbname);
+ if (retval) {
syslog(LOG_ERR, "%s while setting dbname", error_message(retval));
cleanexit(1);
}
@@ -438,7 +452,8 @@ void process_client(fd, who)
server_parm.recv_addr = *who;
- if (retval = krb5_db_init(kadm_context)) { /* Open as client */
+ retval = krb5_db_init(kadm_context);
+ if (retval) { /* Open as client */
syslog(LOG_ERR, "can't open krb db: %s", error_message(retval));
cleanexit(1);
}
@@ -605,7 +620,9 @@ do_child(sig)
SIGNAL_RETURN;
}
-cleanexit(val)
+static
+void cleanexit(val)
+ int val;
{
krb5_db_fini(kadm_context);
clear_secrets();
diff --git a/src/kadmin/v4server/kadm_funcs.c b/src/kadmin/v4server/kadm_funcs.c
index c62ebc6..b1213ab 100644
--- a/src/kadmin/v4server/kadm_funcs.c
+++ b/src/kadmin/v4server/kadm_funcs.c
@@ -277,6 +277,7 @@ err:
#ifndef KADM5
#define faildel(code) { (void) syslog(LOG_ERR, "FAILED deleting '%s.%s' (%s)", valsin->name, valsin->instance, error_message(code)); return code; }
+krb5_error_code
kadm_del_entry (rname, rinstance, rrealm, valsin, valsout)
char *rname; /* requestors name */
char *rinstance; /* requestors instance */
@@ -531,6 +532,7 @@ err:
#ifndef KADM5
#define failchange(code) { syslog(LOG_ERR, "FAILED changing key for '%s.%s@%s' (%s)", rname, rinstance, rrealm, error_message(code)); return code; }
+krb5_error_code
kadm_change (rname, rinstance, rrealm, newpw)
char *rname;
char *rinstance;
@@ -622,6 +624,7 @@ des_cblock newpw;
#undef failchange
#endif /* !KADM5 */
+int
check_pw(newpw, checkstr)
des_cblock newpw;
char *checkstr;
@@ -670,6 +673,7 @@ int lower(str)
return(effect);
}
+int
des_check_gecos(gecos, newpw)
char *gecos;
des_cblock newpw;
@@ -709,6 +713,7 @@ des_check_gecos(gecos, newpw)
return(0);
}
+int
str_check_gecos(gecos, pwstr)
char *gecos;
char *pwstr;
@@ -742,6 +747,7 @@ str_check_gecos(gecos, pwstr)
}
+krb5_error_code
kadm_approve_pw(rname, rinstance, rrealm, newpw, pwstring)
char *rname;
char *rinstance;
diff --git a/src/kadmin/v4server/kadm_ser_wrap.c b/src/kadmin/v4server/kadm_ser_wrap.c
index cac0cbc..ce426e4 100644
--- a/src/kadmin/v4server/kadm_ser_wrap.c
+++ b/src/kadmin/v4server/kadm_ser_wrap.c
@@ -154,6 +154,7 @@ int code;
kadm_ser_in
unwrap the data stored in dat, process, and return it.
*/
+int
kadm_ser_in(dat,dat_len)
u_char **dat;
int *dat_len;
@@ -183,8 +184,9 @@ int *dat_len;
memcpy((char *)authent.dat, (char *)(*dat) + in_len, authent.length);
authent.mbz = 0;
/* service key should be set before here */
- if (retc = krb_rd_req(&authent, server_parm.sname, server_parm.sinst,
- server_parm.recv_addr.sin_addr.s_addr, &ad, (char *)0))
+ retc = krb_rd_req(&authent, server_parm.sname, server_parm.sinst,
+ server_parm.recv_addr.sin_addr.s_addr, &ad, (char *)0);
+ if (retc)
{
errpkt(dat, dat_len,retc + krb_err_base);
return retc + krb_err_base;
@@ -208,9 +210,11 @@ int *dat_len;
#else
des_key_sched(ad.session, sess_sched);
#endif
- if (retc = (int) krb_rd_priv(in_st, r_len, sess_sched, &ad.session,
- &server_parm.recv_addr,
- &server_parm.admin_addr, &msg_st)) {
+
+ retc = (int) krb_rd_priv(in_st, r_len, sess_sched, &ad.session,
+ &server_parm.recv_addr,
+ &server_parm.admin_addr, &msg_st);
+ if (retc) {
clr_cli_secrets();
errpkt(dat, dat_len,retc + krb_err_base);
return retc + krb_err_base;
diff --git a/src/kadmin/v4server/kadm_server.c b/src/kadmin/v4server/kadm_server.c
index 886620f..48e8d73 100644
--- a/src/kadmin/v4server/kadm_server.c
+++ b/src/kadmin/v4server/kadm_server.c
@@ -36,6 +36,7 @@ extern void *kadm5_handle;
#include <kadm.h>
#include <kadm_err.h>
+#include "kadm_server.h"
extern krb5_context kadm_context;
int fascist_cpw = 0; /* Be fascist about insecure passwords? */
@@ -125,6 +126,7 @@ kadm_ser_cpw - the server side of the change_password routine
Replaces the password (i.e. des key) of the caller with that specified in key.
Returns no actual data from the master server, since this is called by a user
*/
+int
kadm_ser_cpw(dat, len, ad, datout, outlen)
u_char *dat;
int len;
@@ -169,8 +171,9 @@ int *outlen;
memcpy((char *)(((krb5_int32 *)newkey) + 1), (char *)&keyhigh, 4);
memcpy((char *)newkey, (char *)&keylow, 4);
- if (retval = kadm_approve_pw(ad->pname, ad->pinst, ad->prealm,
- newkey, no_pword ? 0 : pword)) {
+ retval = kadm_approve_pw(ad->pname, ad->pinst, ad->prealm,
+ newkey, no_pword ? 0 : pword);
+ if (retval) {
if (retval == KADM_PW_MISMATCH) {
/*
* Very strange!!! This means that the cleartext
@@ -183,7 +186,8 @@ int *outlen;
}
if (fascist_cpw) {
*outlen = strlen(bad_pw_err)+strlen(pw_blurb)+1;
- if (*datout = (u_char *) malloc(*outlen)) {
+ *datout = (u_char *) malloc(*outlen);
+ if (*datout) {
strcpy((char *) *datout, bad_pw_err);
strcat((char *) *datout, pw_blurb);
} else
@@ -198,7 +202,8 @@ int *outlen;
return(retval);
} else {
*outlen = strlen(bad_pw_warn) + strlen(pw_blurb)+1;
- if (*datout = (u_char *) malloc(*outlen)) {
+ *datout = (u_char *) malloc(*outlen);
+ if (*datout) {
strcpy((char *) *datout, bad_pw_warn);
strcat((char *) *datout, pw_blurb);
} else
@@ -237,7 +242,8 @@ int *outlen;
*outlen = 0;
- if (retval = krb5_timeofday(kadm_context, &now)) {
+ retval = krb5_timeofday(kadm_context, &now);
+ if (retval) {
msg_ptr = error_message(retval);
goto send_response;
}
@@ -324,7 +330,8 @@ send_response:
/* don't send message on success because kpasswd.v4 will */
/* print "password changed" too */
*outlen = strlen(msg_ptr)+2;
- if (*datout = (u_char *) malloc(*outlen)) {
+ *datout = (u_char *) malloc(*outlen);
+ if (*datout) {
strcpy(*datout, msg_ptr);
strcat(*datout, "\n");
} else
@@ -428,6 +435,7 @@ Modifies all entries corresponding to the first values so they match the
second values.
returns the values for the changed entries
*/
+int
kadm_ser_mod(dat,len,ad, datout, outlen)
u_char *dat;
int len;
@@ -464,6 +472,7 @@ gets the fields requested by flags from all entries matching values
returns this data for each matching recipient, after a count of how many such
matches there were
*/
+int
kadm_ser_get(dat,len,ad, datout, outlen)
u_char *dat;
int len;
@@ -501,6 +510,7 @@ kadm_ser_ckpw - the server side of the check_password routine
Checks to see if the des key passed from the caller is a "secure" password.
*/
+int
kadm_ser_ckpw(dat, len, ad, datout, outlen)
u_char *dat;
int len;
@@ -540,7 +550,8 @@ int *outlen;
memset(newkey, 0, sizeof(newkey));
if (retval) {
*outlen = strlen(check_pw_msg)+strlen(pw_blurb)+1;
- if (*datout = (u_char *) malloc(*outlen)) {
+ *datout = (u_char *) malloc(*outlen);
+ if (*datout) {
strcpy((char *) *datout, check_pw_msg);
strcat((char *) *datout, pw_blurb);
} else
@@ -568,6 +579,7 @@ key, which is sent back to the client. The key version is returned in
the max_life field of the values structure. It's a hack, but it's a
backwards compatible hack....
*/
+int
kadm_ser_stab(dat, len, ad, datout, outlen)
u_char *dat;
int len;
diff --git a/src/kadmin/v4server/kadm_server.h b/src/kadmin/v4server/kadm_server.h
index f293273..cffea97 100644
--- a/src/kadmin/v4server/kadm_server.h
+++ b/src/kadmin/v4server/kadm_server.h
@@ -25,6 +25,11 @@
#include <krb.h>
#include <des.h>
#include "k5-int.h"
+#ifdef KADM5
+#include <kadm5/admin.h>
+#endif
+#include "kadm.h"
+#include "krb_db.h"
typedef struct {
struct sockaddr_in admin_addr;
@@ -54,4 +59,59 @@ typedef struct {
extern krb5_context kadm_context;
+/* kadm_ser_wrap.c */
+#ifdef KADM5
+extern int kadm_ser_init(int, char *, kadm5_config_params *);
+#else
+extern int kadm_ser_init(int, char *);
+#endif
+extern int kadm_ser_in(u_char **, int *);
+
+/* kadm_server.c */
+int kadm_ser_cpw(u_char *, int, AUTH_DAT *, u_char **, int *);
+int kadm_ser_add(u_char *, int, AUTH_DAT *, u_char **, int *);
+int kadm_ser_del(u_char *, int, AUTH_DAT *, u_char **, int *);
+int kadm_ser_mod(u_char *, int, AUTH_DAT *, u_char **, int *);
+int kadm_ser_get(u_char *, int, AUTH_DAT *, u_char **, int *);
+int kadm_ser_ckpw(u_char *, int, AUTH_DAT *, u_char **, int *);
+int kadm_ser_stab(u_char *, int, AUTH_DAT *, u_char **, int *);
+
+/* kadm_funcs.c */
+krb5_error_code kadm_add_entry(char *, char *, char *,
+ Kadm_vals *, Kadm_vals *);
+krb5_error_code kadm_del_entry(char *, char *, char *,
+ Kadm_vals *, Kadm_vals *);
+krb5_error_code kadm_get_entry(char *, char *, char *,
+ Kadm_vals *, u_char *, Kadm_vals *);
+krb5_error_code kadm_mod_entry(char *, char *, char *,
+ Kadm_vals *, Kadm_vals *, Kadm_vals *);
+krb5_error_code kadm_change (char *, char *, char *, des_cblock);
+krb5_error_code kadm_approve_pw(char *, char *, char *, des_cblock, char *);
+krb5_error_code kadm_chg_srvtab(char *, char *, char *, Kadm_vals *);
+
+/* kadm_supp.c */
+void prin_vals(Kadm_vals *);
+void kadm_prin_to_vals(u_char *, Kadm_vals *, Principal *);
+void kadm_vals_to_prin(u_char *, Principal *, Kadm_vals *);
+
+/* kadm_stream.c */
+int stv_char(u_char *, u_char *, int, int);
+int stv_short(u_char *, u_short *, int, int);
+int stv_long(u_char *, krb5_ui_4 *, int, int);
+int stv_string(u_char *, char *, int, int, int);
+int stream_to_vals(u_char *, Kadm_vals *, int);
+int vals_to_stream(Kadm_vals *, u_char **);
+int vts_string(char *, u_char **, int);
+int vts_short(u_short, u_char **, int);
+int vts_long(krb5_ui_4, u_char **, int);
+int vts_char(u_char, u_char **, int);
+
+/* acl_files.c */
+int acl_check(char *, char *);
+
+/* admin_server.c */
+#ifdef KADM5
+krb5_ui_4 convert_kadm5_to_kadm(krb5_ui_4);
+#endif
+
#endif /* KADM_SERVER_DEFS */
diff --git a/src/kadmin/v4server/kadm_stream.c b/src/kadmin/v4server/kadm_stream.c
index 86da6c6..d2a3cdb 100644
--- a/src/kadmin/v4server/kadm_stream.c
+++ b/src/kadmin/v4server/kadm_stream.c
@@ -20,6 +20,10 @@
extern char *malloc(), *calloc(), *realloc();
#endif
+static int check_field_header(u_char *, u_char *, int);
+static int build_field_header(u_char *, u_char **);
+
+
/*
kadm_stream.c
this holds the stream support routines for the kerberos administration server
@@ -33,6 +37,7 @@ extern char *malloc(), *calloc(), *realloc();
*/
#include "kadm.h"
+#include "kadm_server.h"
#define min(a,b) (((a) < (b)) ? (a) : (b))
@@ -43,6 +48,7 @@ vals_to_stream
this function creates a byte-stream representation of the kadm_vals structure
*/
+int
vals_to_stream(dt_in, dt_out)
Kadm_vals *dt_in;
u_char **dt_out;
@@ -79,6 +85,7 @@ u_char **dt_out;
return(stsize);
}
+static int
build_field_header(cont, st)
u_char *cont; /* container for fields data */
u_char **st; /* stream */
@@ -88,6 +95,7 @@ u_char **st; /* stream */
return 4; /* return pointer to current stream location */
}
+int
vts_string(dat, st, loc)
char *dat; /* a string to put on the stream */
u_char **st; /* base pointer to the stream */
@@ -98,6 +106,7 @@ int loc; /* offset into the stream for current data */
return strlen(dat)+1;
}
+int
vts_short(dat, st, loc)
u_short dat; /* the attributes field */
u_char **st; /* a base pointer to the stream */
@@ -111,6 +120,7 @@ int loc; /* offset into the stream for current data */
return sizeof(u_short);
}
+int
vts_long(dat, st, loc)
krb5_ui_4 dat; /* the attributes field */
u_char **st; /* a base pointer to the stream */
@@ -125,6 +135,7 @@ int loc; /* offset into the stream for current data */
}
+int
vts_char(dat, st, loc)
u_char dat; /* the attributes field */
u_char **st; /* a base pointer to the stream */
@@ -142,6 +153,7 @@ stream_to_vals
this decodes a byte stream represntation of a vals struct into kadm_vals
*/
+int
stream_to_vals(dt_in, dt_out, maxlen)
u_char *dt_in;
Kadm_vals *dt_out;
@@ -149,6 +161,7 @@ int maxlen; /* max length to use */
{
register int vsloop, stsize; /* loop counter, stream size */
register int status;
+ krb5_ui_4 l_trans;
memset((char *) dt_out, 0, sizeof(*dt_out));
@@ -171,9 +184,10 @@ int maxlen; /* max length to use */
stsize += status;
break;
case KADM_EXPDATE:
- if ((status = stv_long(dt_in, &dt_out->exp_date, stsize,
+ if ((status = stv_long(dt_in, &l_trans, stsize,
maxlen)) < 0)
return(-1);
+ dt_out->exp_date = l_trans;
stsize += status;
break;
case KADM_ATTR:
@@ -189,13 +203,15 @@ int maxlen; /* max length to use */
stsize += status;
break;
case KADM_DESKEY:
- if ((status = stv_long(dt_in, &dt_out->key_high, stsize,
+ if ((status = stv_long(dt_in, &l_trans, stsize,
maxlen)) < 0)
return(-1);
+ dt_out->key_high = l_trans;
stsize += status;
- if ((status = stv_long(dt_in, &dt_out->key_low, stsize,
+ if ((status = stv_long(dt_in, &l_trans, stsize,
maxlen)) < 0)
return(-1);
+ dt_out->key_low = l_trans;
stsize += status;
break;
default:
@@ -204,6 +220,7 @@ int maxlen; /* max length to use */
return stsize;
}
+static int
check_field_header(st, cont, maxlen)
u_char *st; /* stream */
u_char *cont; /* container for fields data */
@@ -215,6 +232,7 @@ int maxlen;
return 4; /* return pointer to current stream location */
}
+int
stv_string(st, dat, loc, stlen, maxlen)
register u_char *st; /* base pointer to the stream */
char *dat; /* a string to read from the stream */
@@ -233,6 +251,7 @@ int maxlen; /* max length of input stream */
return strlen(dat)+1;
}
+int
stv_short(st, dat, loc, maxlen)
u_char *st; /* a base pointer to the stream */
u_short *dat; /* the attributes field */
@@ -248,6 +267,7 @@ int maxlen;
return sizeof(u_short);
}
+int
stv_long(st, dat, loc, maxlen)
u_char *st; /* a base pointer to the stream */
krb5_ui_4 *dat; /* the attributes field */
@@ -263,6 +283,7 @@ int maxlen; /* maximum length of st */
return sizeof(krb5_ui_4);
}
+int
stv_char(st, dat, loc, maxlen)
u_char *st; /* a base pointer to the stream */
u_char *dat; /* the attributes field */
diff --git a/src/kadmin/v4server/kadm_supp.c b/src/kadmin/v4server/kadm_supp.c
index 9d2f8de..0596698 100644
--- a/src/kadmin/v4server/kadm_supp.c
+++ b/src/kadmin/v4server/kadm_supp.c
@@ -15,6 +15,7 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#include <sys/param.h>
/*
kadm_supp.c
this holds the support routines for the kerberos administration server
@@ -38,7 +39,7 @@ Kadm_vals *vals;
printf("Info in Database for %s.%s:\n", vals->name, vals->instance);
printf(" Max Life: %d Exp Date: %s\n",vals->max_life,
asctime(localtime((long *)&vals->exp_date)));
- printf(" Attribs: %.2x key: %u %u\n",vals->attributes,
+ printf(" Attribs: %.2x key: %ld %ld\n",vals->attributes,
vals->key_low, vals->key_high);
}
@@ -56,6 +57,7 @@ int s;
it copies the fields in Principal specified by fields into Kadm_vals,
i.e from old to new */
+void
kadm_prin_to_vals(fields, new, old)
u_char fields[FLDSZ];
Kadm_vals *new;
@@ -89,6 +91,7 @@ Principal *old;
}
}
+void
kadm_vals_to_prin(fields, new, old)
u_char fields[FLDSZ];
Principal *new;