40 Commits

Author SHA1 Message Date
Nicolas Williams
ea90ca8666 Move some infra bits of lib/krb5/ to lib/base/ (2)
This is the second of two commits in a series that must be picked together.

This series of two commits moves parts of lib/krb5/ infrastructure
functionality to lib/base/, leaving behind wrappers.

Some parts of libkrb5 are entirely generic or easily made so, and could
be useful in various parts of Heimdal that are not specific to the krb5
API, such as:

 - lib/gssapi/  (especially since the integration of NegoEx)
 - lib/hx509/
 - bx509d       (which should really move out of kdc/)

For the above we need to move these bits of lib/krb5/:

 - lib/krb5/config_file.c   (all of it, leaving forwardings behind)
 - lib/krb5/config_reg.c    (all of it)
 - lib/krb5/plugin.c        (all of it, leaving forwardings behind)
 - lib/krb5/log.c           (all of it, ditto)
 - lib/krb5/heim_err.et     (all of it)

And because of those two, these too must also move:

 - lib/krb5/expand_path.c   (all of it, leaving forwardings behind)
 - lib/krb5/warn.c          (just the warning functions, ditto)

The changes to the moved files are mostly quite straightforward and are
best reviewed with --word-diff=color.

We're also creating a heim_context and a heim API to go with it.  But
it's as thin as possible, with as little state as necessary to enable
this move.  Functions for dealing with error messages use callbacks.

Moving plugin.c does have one knock-on effect on all users of the old
krb5 plugin API (which remains), which is that a global search and
replace of struct krb5_plugin_data to struct heim_plugin_data was
needed, though the layout and size of that structure doesn't change, so
the ABI doesn't either.

As well, we now build lib/vers/ and lib/com_err/ before lib/base/ so as
to be able to move lib/krb5/heim_err.et to lib/base/ so that we can make
use of HEIM_ERR_* in lib/base/, specifically in the files that moved.

Once this is all done we'll be able to use config files and plugins in
lib/hx509/, we'll be able to move bx509d out of kdc/, and so on.

Most if not all of the new functions in lib/base/ are Heimdal-private,
thus calling conventions for them are not declared.

Status:

 - builds and passes CIs (Travis, Appveyor)
 - ran make check-valgrind and no new leaks or other memory errors
 - ready for review

HOW TO REVIEW:

     $ # Review file moves:
     $ git log --stat -n1 HEAD^
     $
     $ # Review changes to moved files using --word-diff=color
     $ git log -p -b -w --word-diff=color HEAD^..HEAD   \
               lib/base/config_file.c                   \
               lib/base/config_reg.c                    \
               lib/base/expand_path.c                   \
               lib/base/warn.c                          \
               lib/krb5/config_file.c                   \
               lib/krb5/config_reg.c                    \
               lib/krb5/expand_path.c                   \
               lib/krb5/warn.c
     $
     $ # Review the whole thing, possibly adding -b and/or -w, and
     $ # maybe --word-diff=color:
     $ git log -p origin/master..HEAD
     $ git log -p -b -w origin/master..HEAD
     $ git log -p -b -w --word-diff=color origin/master..HEAD

TBD (future commits):

 - make lib/gssapi use the new heimbase functions
 - move kx509/bx509d common code to lib/hx509/ or other approp. location
 - move bx509d out of kdc/
2020-03-02 10:56:13 -06:00
Nicolas Williams
b2823cbd74 Move some infra bits of lib/krb5/ to lib/base/ (1)
This is the first of two commits in a series that must be picked
together.

This series of two commits moves parts of lib/krb5/ infrastructure
functionality to lib/base/, leaving behind wrappers.

This commit only renames files to enable git log/diff/blame to follow
the renames: to help future code archeology, and to make reviewing these
two commits easier.

The next commit in this series ensures that the moved files have the
correct content (i.e., defining heim APIs instead of krb5 APIs), and
will create files in lib/krb5 with the same names and krb5 API wrappers
around the new heim API functions.

The next commit also explains the motivation, which, briefly, is to:

 - remove krb5 API usage from lib/gssapi/,
 - enable the use of configuration and plugins in lib/hx509/
   (as well as lib/gssapi/ and future projects),

and

 - enable the further disentanglement of bx509d from kdc/.
2020-03-02 10:56:13 -06:00
Jeffrey Altman
7d5b844538 lib/krb5: WIN32 disable warnings
Heimdal declares functions that never return as non-void.  Suppress
the following warnings now that functions are labeled 'noreturn'.

4646 - function declared with __declspec(noreturn) has non-void return type

4716 - 'function' must return a value

Change-Id: Id85cc435e99688bae7326a723a5a80d828859bf2
2019-01-14 06:12:36 -05:00
Jeffrey Altman
bec4818943 WIN32: hint noreturn functions
apply __declspec(noreturn) compiler hints to functions that
do not return.

Change-Id: I3c6c4703c7235d1df3e21dccad5272ea4cddfd36
2019-01-02 10:23:39 -06:00
Nicolas Williams
6a0f45c4d7 Use __attribute__ ((__name__)) form
Protect against macros named noreturn and so on.
2017-03-13 18:39:41 -04:00
Viktor Dukhovni
3657f23a9e Fix more doxygen bitrot 2016-12-15 04:28:21 -05:00
Nicolas Williams
2ebec2e4ec Fix some Doxygen warnings 2016-12-14 22:05:46 -06:00
Nicolas Williams
40a7d4b62f More fixes for -Werror (GCC 4.6 catches more stuff) 2011-11-02 23:20:55 -05:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Asanka C. Herath
59542f4298 Unreachable code to silence older compilers 2010-11-24 15:33:07 -05:00
Love Hornquist Astrand
077357c848 catch error from as.*printf 2010-05-30 13:37:07 -07:00
Love Hornquist Astrand
687db64c56 Patch from Secure Endpoints/Asanka Herath for windows support 2009-12-21 08:45:28 +01:00
Love Hornquist Astrand
6d9b72d76d simplify 2009-11-03 23:49:58 -08:00
Love Hornquist Astrand
83ed187855 ignore krb5_get_err_text 2009-11-03 22:26:44 -08:00
Love Hornquist Astrand
aaf831a954 spelling 2009-08-18 13:27:07 +02:00
Love Hornquist Astrand
9b710bed81 store is never read again 2009-07-29 22:37:58 +02:00
Love Hörnquist Åstrand
942a821fab remove RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25171 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-04 06:17:40 +00:00
Love Hörnquist Åstrand
4c29ff9e2f doxygen
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24212 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-18 05:00:26 +00:00
Love Hörnquist Åstrand
26629cff5c doxygen
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24211 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-12-18 05:00:17 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
5e654ca82f make compile
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23206 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-05-29 02:13:41 +00:00
Love Hörnquist Åstrand
a4de25665b Free error message with krb5_free_error_message().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23205 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-05-29 02:13:26 +00:00
Love Hörnquist Åstrand
577ff0f5c0 Use krb5_get_error_message.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23204 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-05-29 02:13:11 +00:00
Love Hörnquist Åstrand
9db7608772 (krb5_get_warn_dest): return warn_dest from krb5_context
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19086 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-11-21 08:06:40 +00:00
Love Hörnquist Åstrand
91351971f7 add KRB5_LIB_FUNCTION to all exported functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13863 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-05-25 21:46:46 +00:00
Love Hörnquist Åstrand
6223cf0f22 use strlcat/strlcpy, from openbsd
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12046 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-04-16 16:13:08 +00:00
Assar Westerlund
5618fc25a4 (_warnerr): print error_string in context in preference to error
string derived from error code


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9859 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-05-07 21:04:34 +00:00
Assar Westerlund
7eb8627661 (_warnerr): add printf attributes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9689 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-02-15 04:36:00 +00:00
Assar Westerlund
88dd6a31de (_warnerr): initialize args to make third, purify et al happy
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8945 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-08-16 07:37:41 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Johan Danielsson
6c3f040376 add __attribute__; add *abort functions
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5951 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-04-15 12:55:43 +00:00
Assar Westerlund
97fc1a2bbc (_warnerr): handle the case of an illegal error code
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3714 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-10-29 22:41:54 +00:00
Johan Danielsson
cf839760d3 Allow NULL context.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3305 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-31 15:45:03 +00:00
Assar Westerlund
0becc7408b (_warnerr): leak less memory
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3218 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-28 01:27:49 +00:00
Johan Danielsson
21a93797db Fix format string for *x type.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3017 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-15 22:23:42 +00:00
Johan Danielsson
e69b306b13 Set err log_level to 0.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2783 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-08 03:43:07 +00:00
Johan Danielsson
20016651a1 Generalize and add *err* functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2780 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-08 03:32:37 +00:00
Johan Danielsson
6da738ff96 krb5_vwarn*
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2778 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-08 02:54:06 +00:00
Johan Danielsson
a15b1f15c6 Generic warn functions.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2776 ec53bebd-3082-4978-b11e-865c3cabbd6b
1997-08-08 02:47:39 +00:00