Пример #1
0
static krb5_error_code
locate_kpasswd(krb5_context context, const krb5_data *realm,
               struct serverlist *serverlist, int socktype)
{
    krb5_error_code code;

    code = k5_locate_server(context, realm, serverlist, locate_service_kpasswd,
                            socktype);

    if (code == KRB5_REALM_CANT_RESOLVE || code == KRB5_REALM_UNKNOWN) {
        code = k5_locate_server(context, realm, serverlist,
                                locate_service_kadmin, SOCK_STREAM);
        if (!code) {
            /* Success with admin_server but now we need to change the
               port number to use DEFAULT_KPASSWD_PORT and the socktype.  */
            size_t i;
            for (i = 0; i < serverlist->nservers; i++) {
                struct server_entry *s = &serverlist->servers[i];
                krb5_ui_2 kpasswd_port = htons(DEFAULT_KPASSWD_PORT);
                if (socktype != SOCK_STREAM)
                    s->socktype = socktype;
                if (s->hostname != NULL)
                    s->port = kpasswd_port;
                else if (s->family == AF_INET)
                    ss2sin(&s->addr)->sin_port = kpasswd_port;
                else if (s->family == AF_INET6)
                    ss2sin6(&s->addr)->sin6_port = kpasswd_port;
            }
        }
    }
    return (code);
}
Пример #2
0
krb5_error_code
k5_locate_kdc(krb5_context context, const krb5_data *realm,
              struct serverlist *serverlist, int get_masters, int socktype)
{
    enum locate_service_type stype;

    stype = get_masters ? locate_service_master_kdc : locate_service_kdc;
    return k5_locate_server(context, realm, serverlist, stype, socktype);
}
Пример #3
0
krb5_error_code
k5_locate_kdc(krb5_context context, const krb5_data *realm,
              struct serverlist *serverlist, krb5_boolean get_masters,
              krb5_boolean no_udp)
{
    enum locate_service_type stype;

    stype = get_masters ? locate_service_master_kdc : locate_service_kdc;
    return k5_locate_server(context, realm, serverlist, stype, no_udp);
}