shishi-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Support port numbers in realm-kdc.


From: shishi-commit
Subject: Support port numbers in realm-kdc.
Date: Fri, 12 Dec 2003 01:25:53 +0100

Commit from jas 2003-12-12 01:25 CET
Support port numbers in realm-kdc.
Module File name Revision
shishi lib/cfg.c 1.40 >>> 1.41

shishi/lib/cfg.c   1.40 >>> 1.41
Line 264
  struct servent *se;
  char *p;
  int protocol = UDP;
+ int port = -1;
 
  if ((p = strchr (value, '/')))
    {
Line 280
     "Ignoring unknown KDC parameter: %s", p);
    }
 
+ if ((p = strchr (value, ':')))
+   {
+     *p = '\0';
+     p++;
+     port = atoi (p);
+   }
+
  he = gethostbyname (value); /* XXX move to netio.c */
  if (he == NULL ||
      he->h_addr_list[0] == NULL || he->h_addrtype != AF_INET)
Line 302
 
  sinaddr->sin_family = he->h_addrtype;
  memcpy (&sinaddr->sin_addr, he->h_addr_list[0], he->h_length);
- se = getservbyname ("kerberos", NULL);
- if (se)
-   sinaddr->sin_port = se->s_port;
+ if (port == -1)
+   {
+     se = getservbyname ("kerberos", NULL);
+     if (se)
+       sinaddr->sin_port = se->s_port;
+     else
+       sinaddr->sin_port = htons (88);
+   }
  else
-   sinaddr->sin_port = htons (88);
+   sinaddr->sin_port = htons(port);
        }
    if (realm)
      break;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]