5 * Copyright 1988 by the Massachusetts Institute of Technology.
7 * For copying and distribution information, please see the file
10 * Get a ticket-granting-ticket given a service key file (srvtab)
11 * The lifetime is the shortest allowed [1 five-minute interval]
16 #include <sys/param.h>
27 char realm[REALM_SZ + 1];
29 char srvtab[MAXPATHLEN + 1];
31 bzero(realm, sizeof(realm));
32 bzero(srvtab, sizeof(srvtab));
34 if (argc < 3 || argc > 5) {
35 fprintf(stderr, "Usage: %s name instance [[realm] srvtab]\n",
41 (void) strncpy(srvtab, argv[3], sizeof(srvtab) -1);
44 (void) strncpy(realm, argv[3], sizeof(realm) - 1);
45 (void) strncpy(srvtab, argv[4], sizeof(srvtab) -1);
49 (void) strcpy(srvtab, KEYFILE);
52 if (krb_get_lrealm(realm) != KSUCCESS)
53 (void) strcpy(realm, KRB_REALM);
55 code = krb_get_svc_in_tkt(argv[1], argv[2], realm,
56 "krbtgt", realm, 1, srvtab);
58 fprintf(stderr, "%s\n", krb_err_txt[code]);