summaryrefslogtreecommitdiffstats
path: root/src/clients
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/kinit/ChangeLog5
-rw-r--r--src/clients/kinit/kinit.M5
-rw-r--r--src/clients/kinit/kinit.c36
3 files changed, 34 insertions, 12 deletions
diff --git a/src/clients/kinit/ChangeLog b/src/clients/kinit/ChangeLog
index 75f9fa852..7fa4f102b 100644
--- a/src/clients/kinit/ChangeLog
+++ b/src/clients/kinit/ChangeLog
@@ -9,6 +9,11 @@ Sun Jul 7 15:21:58 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
and only new tgt is stored.
(main): New option -R to renew tickets.
+Thu Jun 20 20:19:44 1996 Marc Horowitz <marc@mit.edu>
+
+ * kinit.M, kinit.c (main): Add a -s option to kinit which specifies
+ the service name to be used in the TGS_REQ.
+
Fri May 3 00:28:10 1996 Mark Eichin <eichin@cygnus.com>
* kinit.c (krb5_validate_tgt): new function, takes a credential
diff --git a/src/clients/kinit/kinit.M b/src/clients/kinit/kinit.M
index 9d05b2d58..3108a0aad 100644
--- a/src/clients/kinit/kinit.M
+++ b/src/clients/kinit/kinit.M
@@ -94,6 +94,11 @@ option is not used, the default cache is used. Any contents of the
cache are destroyed by
.IR kinit .
.PP
+The
+.B \-s
+option can be used to specify an alternate service name to use when
+getting initial tickets.
+.PP
The default credentials cache may vary between systems; however, if the
.B KRB5CCNAME
environment variable is set, its value is used to name the default
diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c
index 555b1b861..df8d449e4 100644
--- a/src/clients/kinit/kinit.c
+++ b/src/clients/kinit/kinit.c
@@ -60,6 +60,7 @@ main(argc, argv)
krb5_ccache ccache = NULL;
char *cache_name = NULL; /* -f option */
char *keytab_name = NULL; /* -t option */
+ char *service_name = NULL; /* -s option */
krb5_deltat lifetime = KRB5_DEFAULT_LIFE; /* -l option */
krb5_timestamp starttime = 0;
krb5_deltat rlife = 0;
@@ -90,7 +91,7 @@ main(argc, argv)
if (strrchr(argv[0], '/'))
argv[0] = strrchr(argv[0], '/')+1;
- while ((option = getopt(argc, argv, "r:Rfpl:s:c:kt:v")) != EOF) {
+ while ((option = getopt(argc, argv, "r:Rfpl:s:c:kt:vS:")) != EOF) {
switch (option) {
case 'r':
options |= KDC_OPT_RENEWABLE;
@@ -108,6 +109,9 @@ main(argc, argv)
/* validate the ticket */
options |= KDC_OPT_VALIDATE;
break;
+ case 'S':
+ service_name = optarg;
+ break;
case 'p':
options |= KDC_OPT_PROXIABLE;
break;
@@ -186,7 +190,7 @@ main(argc, argv)
}
if (errflg) {
- fprintf(stderr, "Usage: %s [-r time] [-R] [-s time] [-v] [-puf] [-l lifetime] [-c cachename] [-k] [-t keytab] [principal]\n", argv[0]);
+ fprintf(stderr, "Usage: %s [-r time] [-R] [-s time] [-v] [-puf] [-l lifetime] [-c cachename] [-k] [-t keytab] [-S target_service] [principal]\n", argv[0]);
exit(2);
}
@@ -250,17 +254,25 @@ main(argc, argv)
my_creds.client = me;
- if((code = krb5_build_principal_ext(kcontext, &server,
- krb5_princ_realm(kcontext, me)->length,
- krb5_princ_realm(kcontext, me)->data,
- tgtname.length, tgtname.data,
- krb5_princ_realm(kcontext, me)->length,
- krb5_princ_realm(kcontext, me)->data,
- 0))) {
- com_err(argv[0], code, "while building server name");
- exit(1);
+ if (service_name == NULL) {
+ if((code = krb5_build_principal_ext(kcontext, &server,
+ krb5_princ_realm(kcontext, me)->length,
+ krb5_princ_realm(kcontext, me)->data,
+ tgtname.length, tgtname.data,
+ krb5_princ_realm(kcontext, me)->length,
+ krb5_princ_realm(kcontext, me)->data,
+ 0))) {
+ com_err(argv[0], code, "while building server name");
+ exit(1);
+ }
+ } else {
+ if (code = krb5_parse_name(kcontext, service_name, &server)) {
+ com_err(argv[0], code, "while parsing service name %s",
+ service_name);
+ exit(1);
+ }
}
-
+
my_creds.server = server;
if (options & KDC_OPT_POSTDATED) {