Commit Graph

110 Commits

Author SHA1 Message Date
Jeffrey Altman
ef8e4da010 only perform dir separator normalization for file paths
Commit ad7e54d698 introduced the use
of _krb5_expand_path_tokens() to expand tokens (and on Windows convert
path delimiters) within credential cache names.  This is safe to do
for the path based credential cache types FILE, DIR and SCC but on
Windows is unsafe for the non-path types.

For example on Windows, the API credential cache names are often based
on the principal name and the principal name is parsed from the ccname.
This practice was introduced with the version v2 ccapi when there was
no method of enumerating the caches from the krb5 library.

This change adds a "filepath" boolean parameter to _krb5_expand_path_tokens()
which is set to TRUE (non-zero) when the input is a file path and FALSE
(zero) when the input is not a file path.  _krb5_expand_path_tokens() will
only perform directory separator normalization on Windows when the
"filepath" parameter is TRUE.

This change is not the preferred solution because it requires that the
library be aware of all credential cache types that use path based
residuals.  The preferred solution would require that the credential cache
implementation indicate whether or not it uses a path based residual.

This change has been implemented using a prefix test and not a change to
struct krb5_cc_ops because existing ccache plugins will not know how to
advertise their use of path based residuals and that path expansion is
safe.

Change-Id: I8135991e8ce69fc5273d381ea9c2078bc2bcd19a
2015-01-07 14:43:19 -05: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
5f138a16ef libkrb5: Add missing KRB5_LIB_FUNCTION/KRB5_LIB_CALL
KRB5_LIB_FUNCTION and KRB5_LIB_CALL are necessary even on private
functions that are exported.

Change-Id: Iccd0cfe87ff0a9d851e29890e9cb55b3ae517ce1
2013-06-22 21:17:32 -04:00
Roland C. Dowdeswell
f0f07ff408 Use krb5_enomem() more consistently in lib/krb5. 2013-02-13 16:15:00 +08:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
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.
2012-02-20 19:45:41 +00:00
Nicolas Williams
ad7e54d698 Generalize token expansion to allow for context-specific tokens 2011-12-08 13:33:37 -06:00
Nicolas Williams
6aec02f979 Make krb5_kuserok() pluggable and add features (including MIT config compat) 2011-12-08 13:33:36 -06:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
305596d9ad Rename subsystem_DEPRECATED to subsystem_DEPRECATED_FUNCTION(X)
Start to explain what the replacement function is.
Generate the #define/#undef logic in generated header files.
Use gcc style where the deprecation warning is after the prototype.
2011-05-17 23:12:51 -07:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Asanka C. Herath
e0e746b1ca Revert use of backslash as an escape for double quote in config strings 2010-12-03 01:12:31 -05:00
Asanka C. Herath
f974c34580 Deal with backslash escaped quotes 2010-11-26 00:35:31 -05:00
Asanka C. Herath
5b91a397f8 Increase KBR5_BUFSIZ to 2048 and use it in config_file.c 2010-11-24 15:33:19 -05:00
Asanka C. Herath
0f853405fe Add missing export and calling convention annotations 2010-11-24 15:32:49 -05:00
Asanka C. Herath
f44925e8a6 Deal with quoted strings when reading lists of config strings 2010-11-24 15:32:12 -05:00
Asanka C. Herath
f159cef78a Rename get_entry() -> _krb5_config_get_entry() 2010-11-24 15:32:11 -05:00
Asanka C. Herath
d247242f63 Windows: Registry based configuration
Load configuration data in the registry into a krb5_config_section.
Each registry key corresponds to a krb5_config_section and each
registry value becomes a bound string value.

The set of values contained in the root Heimdal registry key is
treated as if they were defined in the [libdefaults] section.

E.g. the configuration file:

[libdefaults]
foo = bar

[Foo]
x = y
y = {
  baz = quux
}

is equivalent to the registry keys:

[HKEY_CURRENT_USER\Software\Heimdal]
"foo"="bar"

[HKEY_CURRENT_USER\Software\Heimdal\Foo]
"x"="y"

[HKEY_CURRENT_USER\Software\Heimdal\Foo\y]
"baz"="quux"
2010-11-24 15:32:08 -05:00
Andrew Tridgell
157d60a0eb heimdal: fixed a shadowed variable warning for error_message
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2010-11-08 22:27:32 -08:00
Love Hornquist Astrand
3798647400 Define HAVE_CFPROPERTYLISTCREATEWITHSTREAM if this is 10.6 or newer 2010-09-08 12:22:12 -07:00
Love Hornquist Astrand
788189805c catch error from as.*printf 2010-05-30 13:28:49 -07:00
Asanka Herath
6d132f1d7d Remove spurious slash when expanding path tokens
Path tokens that expand to directories are expected to end in a slash.
2010-05-26 10:38:42 -04:00
Asanka Herath
67c3295fcb KRB5_DEPRECATED should be prefixed to the declaration 2009-11-26 01:41:57 -05:00
Love Hornquist Astrand
86f4c66efd Merge branch 'master' into wip/win32-port2 2009-11-25 05:41:14 -08:00
Asanka Herath
93445a8133 Don't use Windows specific path tokens in lib/krb5/config_file.c 2009-11-24 10:19:49 -08:00
Asanka Herath
77fee77d0e Use path tokens in krb5_config_parse_file_multi() 2009-11-24 10:16:22 -08:00
Asanka Herath
9d42b10027 (krb5_config_parse_file_multi) Don't leak memory when the path tokens can't be expanded 2009-11-24 10:11:15 -08:00
Asanka Herath
b1063ea8fc Initial Windows port 2009-11-24 10:11:14 -08:00
Love Hornquist Astrand
7f628a0733 deprecated warning 2009-11-22 16:11:25 -08:00
Love Hornquist Astrand
a882971606 remove unused vars 2009-11-22 13:58:42 -08:00
Love Hornquist Astrand
afe4f3129b Read configuration plist on macs 2009-11-22 12:31:56 -08:00
Love Hornquist Astrand
4bcc97bd09 doxygen fix vget_time uses args 2009-09-01 12:44:23 -07:00
Love Hornquist Astrand
30f13f0d5b doxygen fix get_strings uses ... 2009-09-01 12:43:50 -07:00
Love Hornquist Astrand
31871b4990 deifne KRB5_DEPRECATED 2009-08-25 14:35:42 -07:00
Love Hornquist Astrand
400cc459fa deprecate krb5_config_parse_string_multi 2009-08-24 20:24:41 -07:00
Love Hornquist Astrand
46b48bc3e7 Document time function, krb5_config_parse_string_multi is not used 2009-08-24 19:52:10 -07:00
Love Hornquist Astrand
850f9be110 fix docxygen errors 2009-08-19 16:35:14 -07:00
Love Hornquist Astrand
bb381aaebf document krb5_config_*_{list,bool} 2009-08-18 18:35:05 +02:00
Love Hornquist Astrand
0c5eeab318 move functions to private space that have no external consumers 2009-08-18 16:29:28 +02:00
Love Hornquist Astrand
d8f6c9208b document krb5_config_*_string 2009-08-18 16:10:21 +02:00
Love Hornquist Astrand
574f8b6a6d document krb5_config_get_string 2009-08-18 16:05:21 +02:00
Love Hornquist Astrand
1aa17ecea6 document krb5_config_file_free 2009-08-18 16:01:32 +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
5c7b810f4f non have netinfo any more
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25136 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-25 16:26:50 +00:00
Love Hörnquist Åstrand
18d83c99de ENOMEM, not ret
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24984 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-29 09:02:08 +00:00
Love Hörnquist Åstrand
f0d769cccb set new filename
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24955 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-26 01:40:44 +00:00
Love Hörnquist Åstrand
27f682668f fix printf
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24954 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-26 01:40:34 +00:00
Love Hörnquist Åstrand
240a220f87 Expand ~ to $HOME or pw_dir.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24935 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-25 15:35:42 +00:00
Love Hörnquist Åstrand
68d3cfe85c return the while list, not just the last entry.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23935 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-18 21:18:19 +00:00
Love Hörnquist Åstrand
d697ba5f85 return an error code
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23932 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-18 21:17:31 +00:00
Love Hörnquist Åstrand
44629d5ce4 make compile
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23931 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-18 21:17:15 +00:00