Commit Graph

27733 Commits

Author SHA1 Message Date
Jeffrey Altman
9f2a06a80e Windows: Construct paths for LoadLibrary with backslashes
Mixing forward and backslashes is confusing.  Use the expected
backslashes.

Change-Id: Ia775c73eca430138f677decc1975aad0a401fc53
2013-09-13 22:19:00 -04:00
Jeffrey Altman
a7c9497c5d Windows: remove unnecessary clean rule lib/heimdal
Already deleting *.* no need to delete the library separately

Change-Id: Ibdc4aa2e8c08cc9958ab8ae9e1eb155b3a828369
2013-09-13 22:18:58 -04:00
Tony Acero
b9d7e33a2f Windows: Fix perl string equality for Debug Builds
Use "eq" and not "=~"

Change-Id: Iac38ff9859ab40fc30aba0df90956b6029c04cb6
2013-09-13 22:18:57 -04:00
Jeffrey Altman
559cd780b3 Windows: must use backslash for makefile exist test
Change-Id: Ifb8c7b88be92a856073e1001ace60ac43c69eb6d
2013-09-13 22:18:55 -04:00
Jeffrey Altman
1243f2a0d3 Windows: do not fail if output directories exist
Quote path names in case there are ever spaces

Prepend $(MKDIR) rule is "-" to avoid failures if the output
directories already exist.

Change-Id: I1e5cfb408042617a73edeeae99eb269a061ba61d
2013-09-13 22:18:53 -04:00
Jeffrey Altman
75a47ef142 Windows: Remove unused lib/heimdal/dllmain.c
Change-Id: Ib46aaaf0f437cb45097e106cd714c5ae5b220857
2013-09-13 22:18:46 -04:00
Jeffrey Altman
3c3e2ad5e6 Windows: ktutil.exe requires libkadmsrv and libhdb
Include libkadmsrv.dll and libhdb.dll in the assembly which are
required for ktutil.exe to load.

Change-Id: Ic72d51e72daac71683a7f7000fe084197ee3c94a
2013-09-13 22:17:43 -04:00
Jeffrey Altman
6601c6b044 Windows: Remove Plugin Directory Installer
Heimdal plugins are not safe on windows.  Plugins are bound to a
specific assembly and if the plugin assembly is not the same as
the Heimdal DLL that is loading the plugin heap corruption will
occur.

Change-Id: Icf43a989684c4aacd3c4a225482a9bed9b60e29d
2013-09-13 22:17:42 -04:00
Jeffrey Altman
630c73b225 Windows: Wix3 use ForceDeleteOnUninstall
Patchset 1ad02ec31a removed the
createAndRemoveOnUninistall actions from a number of registry keys.
Get the same behavior with the ForceDeleteOnUninstall Wix 3.x Attribute.

Change-Id: I8c0623fa39055844d10035cbffb3870cc2d39ec6
2013-09-13 22:17:41 -04:00
Jeffrey Altman
9b13216c0e Windows: PLUGINDIR == BINDIR
Plugins must be in the same directory as the DLLs.

Change-Id: I982f8113208dc896d73b155cf0c22184efc1b1c1
2013-09-13 22:17:39 -04:00
Nicolas Williams
72f29bd807 Fix typo in lib/krb5/pcache.c 2013-09-12 13:32:22 -05:00
Nicolas Williams
129b4f3720 Fix warning in ! NO_AFS case 2013-09-12 12:14:42 -05:00
Nicolas Williams
36f22356c5 Add [manual] test of kinit cmd
It's not ready to always be run.  First, it's slow.  Second, it tortures
the system.  Third, it doesn't look for signs of failure.  Fourth, if it
did it'd fail: because something about the racing is causing the KDC to
think that the foo principal doesn't exist.
2013-09-12 12:14:41 -05:00
Nicolas Williams
c9d390acac Don't use "if (!ret)" 2013-09-12 12:14:41 -05:00
Nicolas Williams
8696739102 Add SIGINFO support for kinit cmd
Use SIGUSR1 if there's no SIGINFO, so the code isn't dead.
2013-09-12 12:14:41 -05:00
Nicolas Williams
6d5741d03b kinit cmd: back-off more slowly and warn
Also refactor AFS klog code so we do it only once on renew.
2013-09-12 12:14:41 -05:00
Nicolas Williams
79ca0dfe75 kinit should save cc configs if it krb5_cc_move()s
Also, renew_validate() should krb5_cc_new_unique() and krb5_cc_move() it
into place.
2013-09-12 12:14:41 -05:00
Nicolas Williams
8ce9a1d686 Allow batch mode in kinit with password file 2013-09-12 12:14:41 -05:00
Nicolas Williams
13c8a2c212 Make kinit cmd not exit on transient errors 2013-09-12 12:14:40 -05:00
Nicolas Williams
c5867bde0e Add options to kcpytkt and kdeltkt for exp tix 2013-09-12 12:14:40 -05:00
Nicolas Williams
d03e8cd91d Use krb5_timeofday() in kuser/copy_cred_cache.c 2013-09-12 12:14:40 -05:00
Nicolas Williams
ff0bdc9bc8 Test improved fcc_remove_cred() 2013-09-12 12:14:40 -05:00
Nicolas Williams
be816fadd4 Minor refactoring in fcache of common open flags 2013-09-12 12:14:40 -05:00
Nicolas Williams
8feed14fd0 Only gate the st_uid fcache checks 2013-09-12 12:14:40 -05:00
Nicolas Williams
a9bd3c6e50 Fix racy file ccache corruption in cred_delete()
We *really* need a ccache instance ID tag.  In fact, we should probably
never krb5_cc_initialize() a ccache that doesn't have such a tag.  But
for now cred_delete() is now safe enough.
2013-09-12 12:14:39 -05:00
Nicolas Williams
e3eb1305f5 Make Refuses to open symlinks msg less spurious
If we're racing enough we could complain about symlinks where there were
none.  This was very surprising.  Make it surprise less.

We should really #ifndef O_NOFOLLOW that code chunk too, for the obvious
reason that we don't need to worry about symlinks if we have and use
O_NOFOLLOW.

Also, since all uses of fcc_open() use O_NOFOLLOW we should move that
into fcc_open().  Ditto O_BINARY and O_CLOEXEC.
2013-09-12 12:14:39 -05:00
Nicolas Williams
0866ee2615 Make fcc_remove_cred() better
Don't use a memory ccache go between, just copy all but the matching
credential(s).
2013-09-12 12:14:39 -05:00
Nicolas Williams
0f1ae2d101 Use KRB5_TC_MATCH_TIMES when looking for creds 2013-09-12 12:14:39 -05:00
Nicolas Williams
ccb148eedb lib/hdb/db3.c:DB_open() needs to DB_close() more
Without this the KDC can trip the assert in DB_open().
2013-09-12 12:14:39 -05:00
Jeffrey Altman
6ae305e7a4 Fix send_to_kdc for Windows sockets
Patchset 58ff480763 calls write() and read()
on rk_socket_t objects which on Windows are SOCKETs not C RTL file
descriptors.  This patchset uses krb5_net_write() and krb5_net_read()
in place of the direct write() and read() operations.

Change-Id: I3f7d4756357d432e4e62910f9a36824eb188b6e4
2013-09-12 12:36:39 -04:00
Jeffrey Altman
649a1f8ff3 krb5_sendto_context potentially uninitialized ret
Change-Id: Ia1f54f90900f78f25bb6e0573f707b4d2a7f6055
2013-09-11 01:42:16 -04:00
Jeffrey Altman
0db822a2f1 test_rfc3961.exe link to comerr.lib
Change-Id: I05941496af744a54380c04f0ecd0a9d608387980
2013-09-11 01:42:09 -04:00
Jeffrey Altman
ce3d2be1c7 _krb5_load_plugins: Windows naming rules
Windows plugins must be loaded from the same directory as the
heimdal.dll in order to ensure that "DLL Hell" is not revisited.
Since plugins cannot be grouped in a directory by "module" name
the plugins must have a name of the form:

  plugin_<module>_<name>.dll

Construct the "plugin_<module>_" prefix string dynamically and
test for both the prefix and the ".dll" extension when building
the list of plugins to load.

Change-Id: I0ff7bf7287f8fb38061c226f0844d7d0f1fb59ec
2013-09-10 22:31:43 -04:00
Jeffrey Altman
5a8da41b38 krb5 plugin fix typo in comment
Change-Id: Ic73d44fa14f38f078dbc97a0aa94d2b0ba1f5028
2013-09-10 22:31:42 -04:00
Jeffrey Altman
cd5cca0cac pcache: rename and fix callback()
rename callback() to cc_plugin_register_to_context() and document
its purpose.

The parameter that is the cc_ops structure is 'plugctx' not 'plug'.
This is critical because 'plug' is the common_plugin_model structure
and casting the wrong object leads to random behavior including
crashes.

The test to exit without action was reversed.

With these changes ccache plugins can be registered on each
krb5_init_context() operation.

Change-Id: I295ea91759f69b36ac13b1bfff87306d40df4a26
2013-09-10 22:31:41 -04:00
Jeffrey Altman
b845424a86 krb5: sync export lists
Sync the Windows and UNIX export lists for lib/krb5

Change-Id: I992921058c463335d0a3037ec035afd7f9d511b0
2013-09-10 22:31:39 -04:00
Jeffrey Altman
31a00d6647 ISPATHSEP and ISTILDE macros; Windows portability
Windows treats '\\' and '/' equivalently but we cannot control
the form that will be used by end users.  Introduce ISPATHSEP()
macro which tests only for '/' on UNIX and both on Windows.
Introduce ISTILDE() macro to test for '~'.   When testing for
'/' with strchr() or strrchr() add conditional checks for '\\' on
Windows.

Change-Id: Ia85e698fc88f15a6a71db649db5417f02ef7e5fe
2013-09-10 22:31:38 -04:00
Jeffrey Altman
800da1a501 roken: prototype dladdr()
Change-Id: Ia21414ca327b6ede44beb53fe96a6adc73119797
2013-09-10 22:31:37 -04:00
Jeffrey Altman
d78fe0c80a roken: windows opendir() initialize path buffer
Change-Id: If6ef39b3a7b256c78ecd7786cc939903f7823931
2013-09-10 22:31:36 -04:00
Jeffrey Altman
235119c23f fcc_open: disable checks on Windows
st_dev and st_ino are not set in a consistent fashion by stat()
and fstat() so disable the symlink test.

disable the open group/other readable test because st_mode
cannot be used to perform such a test on Windows.

Change-Id: I1b68c672f882018def7e6d40d4bc7f7add58df36
2013-09-10 22:31:35 -04:00
Jeffrey Altman
a472904a64 krb5: windows sysplugin_dirs
Do not look for plugin DLLs in either

  $ORIGIN/../lib/plugin/krb5
  $ORIGIN/../lib

Only look for plugin DLLs in $ORIGIN

Change-Id: I432cd81720b172e7451601b56ea7bba3c03d7d47
2013-09-10 22:31:33 -04:00
Jeffrey Altman
64e8cc04c7 krb5 tests on windows
Execute tests that were built on Windows but previously skipped.

Remove the duplicate build rules for test-rfc3961.exe.

Change-Id: Icc84c07a33afbdc6ffa509222a3c81de35168eaf
2013-09-10 22:31:32 -04:00
Jeffrey Altman
543ca2a93e asn1 check-der use roken
Rely on roken to determine which random function should be
used.

Rename parameter "rand" to "randbytes" to avoid collision with
functions named "rand()".

Change-Id: Ic07cf149daef1cd568b58277773fbe27aef04f7b
2013-09-10 22:31:31 -04:00
Jeffrey Altman
6bd12cb399 kpasswd: move roken.h after config.h in kpasswd_local.h
With roken.h at the end of the include list two different versions
of Winsock get imported on Windows.  roken.h should always be
immediately after config.h if included.

Change-Id: Id3f6761028ddaa5b44183fe6648c5ab292ca8865
2013-09-10 22:31:30 -04:00
Nicolas Williams
3e74e2e3bb Fix some DLL hell: use dladdr() to find plugin dir
Normally one would dlopen() a shared object's basename, not its absolute
path.  However, lib/krb5/plugin.c, in an effort to be zero-conf-ish,
wants to readdir() to find plugins to load, and in the process it ends
up defeating the RTLD's search-the-caller's-rpath.

This commit partially addresses this by allowing the use of $ORIGIN in
plugin_dir values and using them for the default (except on OS X).

This allows multiple Heimdal versions installed on the same host, but
with different plugin ABIs, to co-exist.  A step forward for doing make
check on hosts where Heimdal is installed.

For now we hardcode $ORIGIN/../lib/plugin/krb5 (linux, Solaris, *BSD),
or $ORIGIN (Windows; for assemblies objects need to be in the same
directory) and we eval $ORIGIN by using dladdr() (Linux, Solaris) or
GetModuleHandleEx() (Win32, via a dladdr() wrapper in libroken) to find
the path to libkrb5 whose dirname to use as $ORIGIN.  For Windows,
because we need the plugins to be in the same directory as libkrb5, we
require a prefix on plugin DLLs ("plugin_krb5_") to distinguish them
from other objects.

We should add a special token to mean "look in $ORIGIN, sure, but
dlopen() the plugin basenames only (so the RTLD can search the rpath)".
2013-09-06 16:51:53 -05:00
Love Hornquist Astrand
3e0fd6449e /sess-/session-/g since a few extra letter makes it easier to understand 2013-09-03 21:56:04 -07:00
Harald Barth
502b33ca7f kimpersonate sessionkeyoption and afsdes
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-09-03 21:53:31 -07:00
Viktor Dukhovni
23b8ae825a Fix rk_cloexec_socket() prototype 2013-08-19 17:22:43 -05:00
Jeffrey Altman
3f1d795758 roken: introduce rk_cloexec_socket
Accepts type rk_socket_t and is a no-op on Windows

Change-Id: I82755872e86ef36445e60054dd752279aaceb6d1
2013-08-19 10:21:23 -04:00
Rod Widdowson
5930b387de Windows Installer: Build a Command line merge module
Build a merge module which installs all of the Heimdal command
line tools.

Change-Id: I42297ce6fe32eed77bffb1a982d56d7e024789cc
2013-08-14 13:32:22 -04:00