diff options
author | Alexandra Ellwood <lxs@mit.edu> | 2008-10-09 19:15:27 +0000 |
---|---|---|
committer | Alexandra Ellwood <lxs@mit.edu> | 2008-10-09 19:15:27 +0000 |
commit | 021a991a36f5bd7c83b92672d285bf780fe9d2e3 (patch) | |
tree | e3226a257ac7033b89ecddf48f252f79769ed93d /src | |
parent | a963958bb2579862a367b6523a3f46d53109f8c8 (diff) | |
download | krb5-021a991a36f5bd7c83b92672d285bf780fe9d2e3.tar.gz krb5-021a991a36f5bd7c83b92672d285bf780fe9d2e3.tar.xz krb5-021a991a36f5bd7c83b92672d285bf780fe9d2e3.zip |
prefs should not create empty dictionary for KIM_OPTIONS_DEFAULT
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20855 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/kim/lib/mac/kim_os_preferences.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/kim/lib/mac/kim_os_preferences.c b/src/kim/lib/mac/kim_os_preferences.c index 0b48a7fbb..87700ef89 100644 --- a/src/kim/lib/mac/kim_os_preferences.c +++ b/src/kim/lib/mac/kim_os_preferences.c @@ -226,7 +226,7 @@ static kim_error kim_os_preferences_set_value (kim_preference_key in_key, kim_error err = KIM_NO_ERROR; CFStringRef key = NULL; - if (!err && !in_value) { err = check_error (KIM_NULL_PARAMETER_ERR); } + /* in_value may be NULL if removing the key */ if (!err) { key = kim_os_preferences_cfstring_for_key (in_key); @@ -890,18 +890,19 @@ kim_error kim_os_preferences_set_options_for_key (kim_preference_key in_key, /* in_options may be KIM_OPTIONS_DEFAULT, in which case we empty the dict */ - if (!err) { + if (!err && in_options) { dictionary = CFDictionaryCreateMutable (kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); if (!dictionary) { err = check_error (KIM_OUT_OF_MEMORY_ERR); } - } - - if (!err && in_options) { - err = kim_os_preferences_options_to_dictionary (in_options, dictionary); + + if (!err) { + err = kim_os_preferences_options_to_dictionary (in_options, dictionary); + } } if (!err) { + /* NULL dictioray will remove any entry for this key */ err = kim_os_preferences_set_value (in_key, dictionary); } |