context to krb5_getportbyname
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3315 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -564,7 +564,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (port == 0)
|
if (port == 0)
|
||||||
port = krb5_getportbyname ("kpop", "tcp", htons(1109));
|
port = krb5_getportbyname (context, "kpop", "tcp", 1109);
|
||||||
|
|
||||||
parse_pobox (argv[0], argv[1],
|
parse_pobox (argv[0], argv[1],
|
||||||
&host, &user, &filename);
|
&host, &user, &filename);
|
||||||
|
@@ -543,7 +543,7 @@ main(int argc, char **argv)
|
|||||||
if (port)
|
if (port)
|
||||||
tmp_port = port;
|
tmp_port = port;
|
||||||
else
|
else
|
||||||
tmp_port = krb5_getportbyname ("kshell", "tcp", htons(544));
|
tmp_port = krb5_getportbyname (context, "kshell", "tcp", 544);
|
||||||
|
|
||||||
auth_method = AUTH_KRB5;
|
auth_method = AUTH_KRB5;
|
||||||
ret = doit (*argv, user, tmp_port, argc - 1, argv + 1);
|
ret = doit (*argv, user, tmp_port, argc - 1, argv + 1);
|
||||||
@@ -555,9 +555,9 @@ main(int argc, char **argv)
|
|||||||
if (port)
|
if (port)
|
||||||
tmp_port = port;
|
tmp_port = port;
|
||||||
else if (do_encrypt)
|
else if (do_encrypt)
|
||||||
tmp_port = k_getportbyname ("ekshell", "tcp", htons(545));
|
tmp_port = krb5_getportbyname (context, "ekshell", "tcp", 545);
|
||||||
else
|
else
|
||||||
tmp_port = krb5_getportbyname ("kshell", "tcp", htons(544));
|
tmp_port = krb5_getportbyname (context, "kshell", "tcp", 544);
|
||||||
|
|
||||||
auth_method = AUTH_KRB4;
|
auth_method = AUTH_KRB4;
|
||||||
ret = doit (*argv, user, tmp_port, argc - 1, argv + 1);
|
ret = doit (*argv, user, tmp_port, argc - 1, argv + 1);
|
||||||
|
@@ -581,9 +581,9 @@ main(int argc, char **argv)
|
|||||||
if (inetd) {
|
if (inetd) {
|
||||||
if (port == 0)
|
if (port == 0)
|
||||||
if (do_encrypt)
|
if (do_encrypt)
|
||||||
port = krb5_getportbyname ("ekshell", "tcp", htons(545));
|
port = krb5_getportbyname (context, "ekshell", "tcp", 545);
|
||||||
else
|
else
|
||||||
port = krb5_getportbyname ("kshell", "tcp", htons(544));
|
port = krb5_getportbyname (context, "kshell", "tcp", 544);
|
||||||
mini_inetd (port);
|
mini_inetd (port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -346,7 +346,7 @@ int main(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
port = htons(atoi(*argv));
|
port = htons(atoi(*argv));
|
||||||
} else {
|
} else {
|
||||||
port = krb5_getportbyname ("telnet", "tcp", htons(23));
|
port = krb5_getportbyname (NULL, "telnet", "tcp", 23);
|
||||||
}
|
}
|
||||||
mini_inetd (port);
|
mini_inetd (port);
|
||||||
} else if (argc > 0) {
|
} else if (argc > 0) {
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
|
|
||||||
int open_socket(const char *hostname)
|
int open_socket(krb5_context context, const char *hostname)
|
||||||
{
|
{
|
||||||
int s;
|
int s;
|
||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
@@ -63,7 +63,7 @@ int open_socket(const char *hostname)
|
|||||||
}
|
}
|
||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_port = krb5_getportbyname ("hprop", "tcp", htons(HPROP_PORT));
|
sin.sin_port = krb5_getportbyname (context, "hprop", "tcp", HPROP_PORT);
|
||||||
memcpy(&sin.sin_addr, hp->h_addr, hp->h_length);
|
memcpy(&sin.sin_addr, hp->h_addr, hp->h_length);
|
||||||
if(connect(s, (struct sockaddr*)&sin, sizeof(sin)) < 0){
|
if(connect(s, (struct sockaddr*)&sin, sizeof(sin)) < 0){
|
||||||
warn("connect");
|
warn("connect");
|
||||||
@@ -129,7 +129,7 @@ conv_db(void *arg, Principal *p)
|
|||||||
unsigned char *key = ent.keys.val[0].key.keyvalue.data;
|
unsigned char *key = ent.keys.val[0].key.keyvalue.data;
|
||||||
memcpy(key, &p->key_low, 4);
|
memcpy(key, &p->key_low, 4);
|
||||||
memcpy(key + 4, &p->key_high, 4);
|
memcpy(key + 4, &p->key_high, 4);
|
||||||
kdb_encrypt_key(key, key, &mkey, msched, 0);
|
kdb_encrypt_key((des_cblock*)key, (des_cblock*)key, &mkey, msched, 0);
|
||||||
}
|
}
|
||||||
hdb_seal_key(&ent.keys.val[0], msched);
|
hdb_seal_key(&ent.keys.val[0], msched);
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
for(i = optind; i < argc; i++){
|
for(i = optind; i < argc; i++){
|
||||||
fd = open_socket(argv[i]);
|
fd = open_socket(context, argv[i]);
|
||||||
if(fd < 0)
|
if(fd < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@@ -564,5 +564,5 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
signal (SIGINT, sigterm);
|
signal (SIGINT, sigterm);
|
||||||
|
|
||||||
return doit (krb5_getportbyname ("kpasswd", "udp", htons(KPASSWD_PORT)));
|
return doit (krb5_getportbyname (context, "kpasswd", "udp", KPASSWD_PORT));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user