Opened 5 years ago

Closed 4 years ago

#5 closed defect (invalid)

kinit does not parse all time string formats

Reported by: Lewis Rosenthal Owned by: Paul Smedley
Priority: minor Milestone: Heimdal - 1.5.2
Component: distribution Version: Heimdal - 1.5.2
Keywords: time Cc:


kinit should recognize time formats for the lifetime parameter such as:

kinit -l 0:05 <principal>


kinit -l 0h5m <principal>

However, our Heimdal complains:

kinit.exe: unparsable time: 0h5m

Yet, seconds seem to work:

kinit -l 300 <principal>

The other formats seem to work for MIT 1.13.1 (and 1.12.2, on openSUSE 13.2).

Change History (9)

comment:1 Changed 4 years ago by Paul Smedley

not an os/2 port issue:

From Ubuntu, using kinit from heimdal-clients:
kinit -l 0:05 <principle>
kinit: unparsable time: 0:05

Manpage suggests:
-l time, --lifetime=time Specifies the lifetime of the ticket. The argument can either be in seconds, or a more human readable string like ‘1h'

On Ubuntu:
kinit -l 5m <principle> works

Last edited 4 years ago by Paul Smedley (previous) (diff)

comment:2 Changed 4 years ago by Lewis Rosenthal

This works fine on openSUSE:

lewis@dp45sg:~> kinit -l 0:05 lewis
Password for lewis@SAMBA.ARCANOAE:
lewis@dp45sg:~> klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: lewis@SAMBA.ARCANOAE

Valid starting       Expires              Service principal
07/23/2016 13:20:42  07/23/2016 13:25:37  krbtgt/SAMBA.ARCANOAE@SAMBA.ARCANOAE

as well as:

lewis@dp45sg:~> kinit -l 5m lewis


lewis@dp45sg:~> kinit -l 0h5m lewis

but we have difficulty with the last case and the first one. As noted, we can also handle seconds without a problem.

Looking at virgin source, I see that roken.dll should be doing this, using parse_time.c. So, what is different for us? The ":" would not account for "0h5m" not working, so i can't think that it's a colon issue.

comment:3 Changed 4 years ago by Lewis Rosenthal


[c:\]kinit -l 5h lewis
lewis@SAMBA.ARCANOAE's Password:
kinit.exe: NOTICE: ticket lifetime is 5 hours

As mentioned, I can't get hours and minutes to work (1h15m).

comment:4 Changed 4 years ago by Paul Smedley

kinit on opensuse is heimdal or MIT?

My kinit on Ubuntu:
psmedley@ThinkPad?-T510:~$ kinit --version
kinit (Heimdal 1.6.99)
Copyright 1995-2014 Kungliga Tekniska Högskolan
Send bug-reports to heimdal-bugs@…

comment:5 Changed 4 years ago by Lewis Rosenthal

Ack... Indeed, MIT got onto this machine, somehow. That must have happened when I upgraded from 13.2 to Leap 42.1.

That's not a fair comparison, now is it?

I'll have to see about switching and will try again. If this is an upstream bug, then it should be reported upstream.

comment:6 Changed 4 years ago by Paul Smedley

Easy enough to workaround I'd suggest - if one really needs 1h15m then just us 75m :)

comment:7 Changed 4 years ago by Lewis Rosenthal

Resolution: wontfix
Status: newclosed

I built Heimdal 1.5.3 on openSUSE Leap 42.1 x64 last night. I can confirm that this is an upstream bug. I'll report there.

Surely, the arithmetic is the easy part. ;-)

comment:8 Changed 4 years ago by Lewis Rosenthal

Resolution: wontfix
Status: closedreopened

This appears to be a documentation issue.

lib/roken/parse_time.3 indicates that the proper syntax for Heimdal's time parser/unparser would be:

kinit -l "1 h 15 m" <principal>

The problem is that I can't find this in the Heimdal docs, though MIT documents it per their standard.

Changing the status to invalid.

comment:9 Changed 4 years ago by Lewis Rosenthal

Resolution: invalid
Status: reopenedclosed
Note: See TracTickets for help on using tickets.