error_message(retval));
(void) sprintf(retbuf, "kadmind error during recvauth: %s\n",
error_message(retval));
- } else {
- /* Check if ticket was issued using password (and not tgt)
- within the last 5 minutes */
+ exit(1);
+ }
+
+ /* Check if ticket was issued using password (and not tgt)
+ * within the last 5 minutes
+ */
- if (!(client_creds->enc_part2->flags & TKT_FLG_INITIAL)) {
- syslog(LOG_ERR,
- "Client ticket not initial");
- close(client_server_info.client_socket);
- exit(0);
- }
+ if (!(client_creds->enc_part2->flags & TKT_FLG_INITIAL)) {
+ syslog(LOG_ERR, "Client ticket not initial");
+ close(client_server_info.client_socket);
+ exit(0);
+ }
- if (retval = krb5_timeofday(&adm_time)) {
- syslog(LOG_ERR,
- "Can't get time of day");
- close(client_server_info.client_socket);
- exit(0);
- }
+ if (retval = krb5_timeofday(&adm_time)) {
+ syslog(LOG_ERR, "Can't get time of day");
+ close(client_server_info.client_socket);
+ exit(0);
+ }
- if ((client_creds->enc_part2->times.authtime - adm_time) > 60*5) {
- syslog(LOG_ERR,
- "Client ticket not recent");
- close(client_server_info.client_socket);
- exit(0);
- }
+ if ((adm_time - client_creds->enc_part2->times.authtime) > 60*5) {
+ syslog(LOG_ERR, "Client ticket not recent");
+ close(client_server_info.client_socket);
+ exit(0);
+ }
- recv_seqno = client_auth_data->seq_number;
+ recv_seqno = client_auth_data->seq_number;
- if ((client_server_info.name_of_client =
- (char *) calloc (1, 3 * 255)) == (char *) 0) {
- syslog(LOG_ERR, "kadmind error: No Memory for name_of_client");
- close(client_server_info.client_socket);
- exit(0);
- }
+ if ((client_server_info.name_of_client =
+ (char *) calloc (1, 3 * 255)) == (char *) 0) {
+ syslog(LOG_ERR, "kadmind error: No Memory for name_of_client");
+ close(client_server_info.client_socket);
+ exit(0);
+ }
- if ((retval = krb5_unparse_name(client_server_info.client,
- &client_server_info.name_of_client))) {
- syslog(LOG_ERR, "kadmind error: unparse failed.",
- error_message(retval));
- goto finish;
- }
+ if ((retval = krb5_unparse_name(client_server_info.client,
+ &client_server_info.name_of_client))) {
+ syslog(LOG_ERR, "kadmind error: unparse failed.",
+ error_message(retval));
+ goto finish;
+ }
- syslog(LOG_AUTH | LOG_INFO,
- "Request for Administrative Service Received from %s at %s.",
- client_server_info.name_of_client,
- inet_ntoa( client_server_info.client_name.sin_addr ));
+ syslog(LOG_AUTH | LOG_INFO,
+ "Request for Administrative Service Received from %s at %s.",
+ client_server_info.name_of_client,
+ inet_ntoa( client_server_info.client_name.sin_addr ));
- /* compose the reply */
- outbuf.data[0] = KADMIND;
- outbuf.data[1] = KADMSAG;
- outbuf.length = 2;
- }
+ /* compose the reply */
+ outbuf.data[0] = KADMIND;
+ outbuf.data[1] = KADMSAG;
+ outbuf.length = 2;
/* write back the response */
if ((retval = krb5_write_message(&client_server_info.client_socket,
otype = 0;
break;
+
default:
retbuf[0] = KUNKNOWNAPPL;
retbuf[1] = '\0';
#include <krb5/kdb_dbm.h>
#include <krb5/adm_defs.h>
-#include "adm_server.h"
#include "adm_extern.h"
+char prog[32];
+char *progname = prog;
+char *acl_file_name = DEFAULT_ADMIN_ACL;
+char *adm5_ver_str = ADM5_VERSTR;
+int adm5_ver_len;
+
+char *adm5_tcp_portname = ADM5_PORTNAME;
+int adm5_tcp_port_fd = -1;
+
+unsigned pidarraysize = 0;
+int *pidarray = (int *) 0;
+
+int exit_now = 0;
+
global_client_server_info client_server_info;
#ifdef SANDIA
fclose(startup_file);
}
#endif
- while ((c = getopt(argc, argv, "hmMa:d:k:r:")) != EOF) {
+ while ((c = getopt(argc, argv, "hmMa:d:k:r:D")) != EOF) {
switch(c) {
case 'a': /* new acl directory */
acl_file_name = optarg;
db_realm = optarg;
break;
+ case 'D':
+ adm_debug_flag = 1;
+ break;
+
case 'h': /* get help on using adm_server */
default:
usage(argv[0]);
+++ /dev/null
-/*
- * $Source$
- * $Author$
- * $Id$
- *
- * Copyright 1990 by the Massachusetts Institute of Technology.
- *
- * 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. 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.
- *
- * Sandia National Laboratories also makes no representations about the
- * suitability of the modifications, or additions to this software for
- * any purpose. It is provided "as is" without express or implied warranty.
- *
- * <<< Description >>>
- */
-
-char prog[32];
-char *progname = prog;
-char *acl_file_name = DEFAULT_ADMIN_ACL;
-char *adm5_ver_str = ADM5_VERSTR;
-int adm5_ver_len;
-
-char *adm5_tcp_portname = ADM5_PORTNAME;
-int adm5_tcp_port_fd = -1;
-
-unsigned pidarraysize = 0;
-int *pidarray = (int *) 0;
-
-int exit_now = 0;