[6169] in Athena Bugs
rkinit -help
daemon@ATHENA.MIT.EDU (qjb@ATHENA.MIT.EDU)
Fri Oct 5 20:52:48 1990
From: qjb@ATHENA.MIT.EDU
Date: Fri, 5 Oct 90 20:52:29 -0400
To: bugs@ATHENA.MIT.EDU
Cc: raeburn@ATHENA.MIT.EDU
In-Reply-To: [5997] in bugs discuss meeting
I have fixed the rkinit -help bug reported by Ken Raeburn on
9/11/90.
I enclose a patch here, but since there are other changes to
rkinit since 7.1, I request that whoever is doing this for the
7.2 code cut date contact me about picking up a whole new
rkinit.
---> patch to be applied in rkinit/rkinit:
*** /tmp/,RCSt1029752 Fri Oct 5 20:42:06 1990
--- rkinit.c Fri Oct 5 20:37:24 1990
***************
*** 35,44 ****
static void usage()
#endif /* __STDC__ */
{
! fprintf(stderr,"Usage: rkinit host options\n");
fprintf(stderr,
"Options: [-l username] [-k krb_realm] [-p principal] [-f tktfile]\n");
! fprintf(stderr, " [-t lifetime] [-notimeout]\n");
exit(1);
}
--- 35,46 ----
static void usage()
#endif /* __STDC__ */
{
! fprintf(stderr,"Usage: rkinit [host] options\n");
fprintf(stderr,
"Options: [-l username] [-k krb_realm] [-p principal] [-f tktfile]\n");
! fprintf(stderr, " [-t lifetime] [-h host] [-notimeout]\n");
! fprintf(stderr, "A host must be specified either with the -h option ");
! fprintf(stderr, "or as the first argument.\n");
exit(1);
}
***************
*** 54,60 ****
char *whoami; /* Name of this program */
char principal[MAX_K_NAME_SZ]; /* Principal for which to get tickets */
! char *host; /* Remote host */
char *username = 0; /* Username of owner of ticket */
char r_krealm[REALM_SZ]; /* Kerberos realm of remote host */
char aname[ANAME_SZ]; /* Aname of remote ticket file */
--- 56,62 ----
char *whoami; /* Name of this program */
char principal[MAX_K_NAME_SZ]; /* Principal for which to get tickets */
! char *host = NULL; /* Remote host */
char *username = 0; /* Username of owner of ticket */
char r_krealm[REALM_SZ]; /* Kerberos realm of remote host */
char aname[ANAME_SZ]; /* Aname of remote ticket file */
***************
*** 84,94 ****
if (argc < 2) usage();
! host = argv[1];
! for (i = 2; i < argc; i++) {
! if (strcmp(argv[i], "-l") == NULL) {
if (++i >= argc)
usage();
else
username = argv[i];
}
--- 86,108 ----
if (argc < 2) usage();
! if (argv[1][0] != '-') {
! host = argv[1];
! i = 2;
! }
! else
! i = 1;
!
! for (/* i initialized above */; i < argc; i++) {
! if (strcmp(argv[i], "-h") == NULL) {
if (++i >= argc)
usage();
+ else
+ host = argv[i];
+ }
+ else if (strcmp(argv[i], "-l") == NULL) {
+ if (++i >= argc)
+ usage();
else
username = argv[i];
}
***************
*** 124,129 ****
--- 138,146 ----
else
usage();
}
+
+ if (host == NULL)
+ usage();
/* Initialize the realm of the remote host if necessary */
if (r_krealm[0] == 0) {
---> patch to be applied in rkinit/man:
*** /tmp/,RCSt1029789 Fri Oct 5 20:51:54 1990
--- rkinit.1 Fri Oct 5 20:51:43 1990
***************
*** 9,29 ****
.SH NAME
rkinit \- establish kerberos tickets safely on a remote host
.SH SYNOPSIS
! .B rkinit host
[ -p
.B principal
] [ -l
.B username
] [ -k
! .B kerberos realm
] [ -f
! .B ticket file
] [ -t
! .B ticket lifetime
] [
.B \-notimeout
]
.SH DESCRIPTION
.I rkinit
is a program that allows a user to establish kerberos tickets on
--- 9,35 ----
.SH NAME
rkinit \- establish kerberos tickets safely on a remote host
.SH SYNOPSIS
! .B rkinit [ host ]
[ -p
.B principal
] [ -l
.B username
] [ -k
! .B kerberos_realm
] [ -f
! .B ticket_file
! ] [ -h
! .B remote_host
] [ -t
! .B ticket_lifetime
] [
.B \-notimeout
]
+ A host name must be specified either as the first command line
+ argument or following a \-h flag. If redundant command line
+ arguments are given, the last one to appear takes precedence.
+
.SH DESCRIPTION
.I rkinit
is a program that allows a user to establish kerberos tickets on
***************
*** 124,130 ****
which refers to the realm of the remote tickets.
.TP
! .B \-f \fIticket file\fR
This option is used to specify the name of the ticket file that
should be used on the remote host. Note that if you
specify a location for the ticket file that is other
--- 130,136 ----
which refers to the realm of the remote tickets.
.TP
! .B \-f \fIticket_file\fR
This option is used to specify the name of the ticket file that
should be used on the remote host. Note that if you
specify a location for the ticket file that is other
***************
*** 139,145 ****
<uid> is the user id of the person who owns the remote ticket file.
.TP
! .B \-t \fIticket lifetime\fR
.I ticket lifetime
is the lifetime in minutes of the remote tickets. If it is not
specified, the default ticket life time (as defined in krb.h) is
--- 145,158 ----
<uid> is the user id of the person who owns the remote ticket file.
.TP
! .B \-h \fremote_host\fR
! .I remote host
! is the host on which remote tickets are being obtained. This
! option can be used in place of specifying the host as the first
! command line argument.
!
! .TP
! .B \-t \fIticket_lifetime\fR
.I ticket lifetime
is the lifetime in minutes of the remote tickets. If it is not
specified, the default ticket life time (as defined in krb.h) is