kadm_host_srv_names.c revision bd211b8556ef6b18ebf137419bd5555d65271664
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*/
#include "admin.h"
#include <stdio.h>
#include <os-proto.h>
#define KADM5_MASTER "admin_server"
#define KADM5_KPASSWD "kpasswd_server"
/*
* Find the admin server for the given realm. If the realm is null or
* the empty string, find the admin server for the default realm.
* Returns 0 on succsess (KADM5_OK). It is the callers responsibility to
* free the storage allocated to the admin server, master.
*/
{
char *def_realm;
char *delim;
#ifdef KRB5_DNS_LOOKUP
int naddrs;
unsigned short dns_portno;
char dns_host[MAX_DNS_NAMELEN];
#endif /* KRB5_DNS_LOOKUP */
KADM5_MASTER, 0, master);
*delim = '\0';
#ifdef KRB5_DNS_LOOKUP
/*
* Initialize realm info for (possible) DNS lookups.
*/
"_kerberos-adm", "_udp",
dns_host, &dns_portno);
if (dns_ret == 0)
}
#endif /* KRB5_DNS_LOOKUP */
}
/*
* Find the kpasswd server for the given realm. If the realm is null or
* the empty string, find the admin server for the default realm.
* Returns 0 on succsess (KADM5_OK). It is the callers responsibility to
* free the storage allocated to the admin server, master.
*/
{
char *delim;
#ifdef KRB5_DNS_LOOKUP
int naddrs;
unsigned short dns_portno;
char dns_host[MAX_DNS_NAMELEN];
#endif /* KRB5_DNS_LOOKUP */
if (ret != 0)
return (ret);
}
KADM5_KPASSWD, 0, kpasswd);
*delim = '\0';
#ifdef KRB5_DNS_LOOKUP
/*
* Initialize realm info for (possible) DNS lookups.
*/
return (ENOMEM);
}
"_kpasswd", "_tcp",
dns_host, &dns_portno);
if (dns_ret == 0) {
return (ENOMEM);
}
}
}
#endif /* KRB5_DNS_LOOKUP */
}
/*
* Get the host base service name for the admin principal. Returns
* KADM5_OK on success. Caller must free the storage allocated for
* host_service_name.
*/
const char *realm, char **host_service_name)
{
char *name;
char *host;
return (ret);
return (ENOMEM);
}
return (KADM5_OK);
}
/*
* Get the host base service name for the changepw principal. Returns
* KADM5_OK on success. Caller must free the storage allocated for
* host_service_name.
*/
const char *realm, char **host_service_name)
{
char *name;
char *host;
/*
* First try to find the kpasswd server, after all we are about to
* try to change our password. If this fails then try admin_server.
*/
return (ret);
}
return (ENOMEM);
}
return (KADM5_OK);
}
/*
* Get the host base service name for the kiprop principal. Returns
* KADM5_OK on success. Caller must free the storage allocated
* for host_service_name.
*/
const char *realm,
char **host_service_name) {
char *name;
char *host;
return (ret);
return (ENOMEM);
}
return (KADM5_OK);
}
/*
* Solaris Kerberos:
* Try to determine if this is the master KDC for a given realm
*/
char *admin_host = NULL;
if (is_master)
else
return (KADM5_FAILURE);
/* Locate the master KDC */
return (ret);
return (ret);
}
/* Get the local addresses */
return (ret);
}
/* Compare them */
for (; *master_addr; master_addr++) {
break;
}
}
return (KADM5_OK);
}