+Thu Apr 20 18:05:00 1995 Mark Eichin <eichin@cygnus.com>
+
+ Changes from Ian Taylor <ian@cygnus.com> to support testsuite.
+ * adm_extern.h: declare admin_port.
+ * adm_extern.c: define admin_port.
+ * adm_server.c (process_args): set admin_port from -p command line
+ argument.
+ (usage): document -p port option.
+ * adm_network.c (setup_network): use admin_port if set.
+
Thu Apr 20 11:47:53 1995 <tytso@rsx-11.mit.edu>
* adm_extern.h: #include adm_defs.h, since that's no longer
#endif /* DEBUG */
service_servent = getservbyname(adm5_tcp_portname, "tcp");
-
- if (service_servent) {
- client_server_info.server_name.sin_port = service_servent->s_port;
+ if (admin_port) {
+ client_server_info.server_name.sin_port = admin_port;
+ } else if (service_servent) {
+ client_server_info.server_name.sin_port = service_servent->s_port;
#ifdef DEBUG
- fprintf(stderr, "Official service name = %s\n", service_servent->s_name);
+ fprintf(stderr, "Official service name = %s\n", service_servent->s_name);
#endif /* DEBUG */
} else {
#ifdef ADM5_DEFAULT_PORT
- client_server_info.server_name.sin_port = htons(ADM5_DEFAULT_PORT);
- com_err("setup_network", 0, "adm_network: using default port %d",
- ADM5_DEFAULT_PORT);
+ client_server_info.server_name.sin_port = htons(ADM5_DEFAULT_PORT);
+ com_err("setup_network", 0, "adm_network: using default port %d",
+ ADM5_DEFAULT_PORT);
#else
- krb5_free_principal(client_server_info.server);
- free(client_server_info.name_of_service);
- com_err("setup_network", 0, "adm_network: %s/tcp service unknown",
- adm5_tcp_portname);
- return(1);
+ krb5_free_principal(client_server_info.server);
+ free(client_server_info.name_of_service);
+ com_err("setup_network", 0, "adm_network: %s/tcp service unknown",
+ adm5_tcp_portname);
+ return(1);
#endif
}
- client_server_info.server_name.sin_port = service_servent->s_port;
if ((client_server_info.server_socket =
socket(AF_INET, SOCK_STREAM, 0)) < 0) {
{
fprintf(stderr, "Usage: %s\t[-a aclfile] [-d dbname] [-k masterkeytype]",
name);
- fprintf(stderr, "\n\t[-h] [-m] [-M masterkeyname] [-r realm]\n");
+ fprintf(stderr, "\n\t[-h] [-m] [-M masterkeyname] [-r realm] [-p port]\n");
return;
}
fclose(startup_file);
}
#endif
- while ((c = getopt(argc, argv, "hmM:a:d:k:r:De:")) != EOF) {
+ while ((c = getopt(argc, argv, "hmM:a:d:k:r:De:p:")) != EOF) {
switch(c) {
case 'a': /* new acl directory */
acl_file_name = optarg;
adm_debug_flag = 1;
break;
+ case 'p':
+ admin_port = atoi(optarg);
+ break;
+
case 'h': /* get help on using adm_server */
default:
usage(argv[0]);