When PAM is configured to use a user_realm that is different from the
default realm, do likewise in kinit with bare user names or the default
principal computed from the login name.
Similarly, when using a keytab, if no realm is specified find the most
suitable match in the keytab file.
1. in ticket_lifetime() calculate the remaining lifetime
of the ticket rather than the requested lifetime.
2. in renew_func(), attempt to renew if the tickets are
renewable rather than only if --renewable is specified.
3. fix the call to renew_validate() in renew_func() to
specify renewable tickets if the original tickets are
renewable rather than only if --renewable is specified.
4. stop printing constant warnings to the terminal about
how tickets cannot be obtained if they expire, cannot
be renewed and we can't non-interactively obtain fresh
ones. We limit it to a single warning.
5. after the tickets expire, we backoff the requests to
obtain fresh tickets exponentially.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer. Note that we get different
warnings on different machines and so this will be a work in
progress. So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).
Notably, we fixed
1. a lot of missing structure initialisers,
2. unchecked return values for functions that glibc
marks as __attribute__((warn-unused-result)),
3. made minor modifications to slc and asn1_compile
which can generate code which generates warnings,
and
4. a few stragglers here and there.
We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g. rsh, rcp,
popper, ftp and telnet.
Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.
We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
if NO_AFS is not defined include the KAFS library when
building kuser. the KAFS library does not yet build on
Windows but will in the future.
Change-Id: If2a6c7279d6166cc0f4c49d36f3fa54ad7d19d87