+Sat Sep 16 03:40:41 1995 Theodore Y. Ts'o <tytso@dcl>
+
+ * sclient.c (main): Add an optional third argument which allows
+ the user to set the Kerberos service name to be used.
Fri Jul 7 15:46:11 EDT 1995 Paul Park (pjpark@mit.edu)
* Makefile.in - Remove all explicit library handling and LDFLAGS.
krb5_ap_rep_enc_part *rep_ret;
krb5_auth_context auth_context = 0;
short xmitlen;
+ char *service = 0;
- if (argc != 2 && argc != 3) {
- fprintf(stderr, "usage: %s <hostname> [port]\n",argv[0]);
+ if (argc != 2 && argc != 3 && argc != 4) {
+ fprintf(stderr, "usage: %s <hostname> [port] [service]\n",argv[0]);
exit(1);
}
/* clear out the structure first */
(void) memset((char *)&sin, 0, sizeof(sin));
- if (argc == 3) {
+ if (argc > 2) {
sin.sin_family = AF_INET;
sin.sin_port = htons(atoi(argv[2]));
} else {
sin.sin_port = sp->s_port;
sin.sin_family = AF_INET;
}
+ if (argc > 3) {
+ service = argv[3];
+ }
/* look up the server host */
hp = gethostbyname(argv[1]);
exit(1);
}
- if (retval = krb5_sname_to_principal(context, argv[1], SAMPLE_SERVICE,
+ if (retval = krb5_sname_to_principal(context, argv[1], service,
KRB5_NT_SRV_HST, &server)) {
- com_err(argv[0], retval, "while creating server name for %s",
- argv[1]);
+ com_err(argv[0], retval, "while creating server name for %s/%s",
+ argv[1], service);
exit(1);
}