Hi everyone,
I've been looking at the sssd sources for some test failure investigation and noticed that the DEBUG macro expands to quite a lot of code. I decided to see if it can be reduced and what the impact will be. The result is the patches that follow.
I've noticed that the total size of installed binaries produced by the standard Fedora build with "reconfig && chmake" drops by 20% after applying these patches.
A build on Debian, configured similarly to the one used in the Debian package dropped by 44%.
I've verified that all the patches build and pass the tests run by "chmake", but otherwise haven't tested them.
Sincerely, Nick
Remove extra fflush(3) invocation when outputting debug messages. --- src/util/debug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/util/debug.c b/src/util/debug.c index c2e2571..9588083 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -104,10 +104,14 @@ int debug_convert_old_level(int old_level) return new_level; }
+static void debug_fflush(void) +{ + fflush(debug_file ? debug_file : stderr); +} + static void debug_vprintf(const char *format, va_list ap) { vfprintf(debug_file ? debug_file : stderr, format, ap); - fflush(debug_file ? debug_file : stderr); }
static void debug_printf(const char *format, ...) @@ -157,6 +161,7 @@ void debug_fn(const char *function, int level, const char *format, ...) va_start(ap, format); debug_vprintf(format, ap); va_end(ap); + debug_fflush(); } }
On 10/10/2013 05:03 PM, Nikolai Kondrashov wrote:
I've been looking at the sssd sources for some test failure investigation and noticed that the DEBUG macro expands to quite a lot of code. I decided to see if it can be reduced and what the impact will be. The result is the patches that follow.
Sorry, messed up the "git send-email" arguments, here are all the patches.
Sincerely, Nick
Add files cscope creates for inverted index (when running with -q) to .gitignore. Inverted index enables faster symbol lookup. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/.gitignore b/.gitignore index de6c573..25a197a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ config.rpath config.h config.h.in cscope.out +cscope.in.out +cscope.po.out doxy.config Makefile Makefile.in
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Add files cscope creates for inverted index (when running with -q) to .gitignore. Inverted index enables faster symbol lookup. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/.gitignore b/.gitignore index de6c573..25a197a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ config.rpath config.h config.h.in cscope.out +cscope.in.out +cscope.po.out doxy.config Makefile Makefile.in
Obvious ack.
On (10/10/13 15:47), Stephen Gallagher wrote:
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Add files cscope creates for inverted index (when running with -q) to .gitignore. Inverted index enables faster symbol lookup. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/.gitignore b/.gitignore index de6c573..25a197a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ config.rpath config.h config.h.in cscope.out +cscope.in.out +cscope.po.out doxy.config Makefile Makefile.in
Obvious ack.
Pavel sent more robust patch few months ago. https://lists.fedorahosted.org/pipermail/sssd-devel/2013-July/015795.html
I would rather have only one commit for .gitignore
LS
Move DEBUG macro body to the debug_fn function, adding "function" argument to the latter. Rename "debug_fn" in sssd_krb5_locator_plugin.c to "plugin_debug_fn" to remove conflict with the sssd debug_fn. Replace DEBUG_MSG macro usage with debug_fn function usage. Remove DEBUG_MSG macro along with tests.
The above makes the total size of binaries drop by 20% for the standard Fedora build and by 44% for a build configured according to Debian packaging script. --- src/krb5_plugin/sssd_krb5_locator_plugin.c | 4 +- src/tests/debug-tests.c | 299 +---------------------------- src/tools/selinux.c | 2 +- src/util/debug.c | 52 ++++- src/util/util.h | 78 +------- 5 files changed, 66 insertions(+), 369 deletions(-)
diff --git a/src/krb5_plugin/sssd_krb5_locator_plugin.c b/src/krb5_plugin/sssd_krb5_locator_plugin.c index 725687d..a3a07d6 100644 --- a/src/krb5_plugin/sssd_krb5_locator_plugin.c +++ b/src/krb5_plugin/sssd_krb5_locator_plugin.c @@ -48,7 +48,7 @@ #define DEBUG_KEY "[sssd_krb5_locator] " #define PLUGIN_DEBUG(body) do { \ if (ctx->debug) { \ - debug_fn body; \ + plugin_debug_fn body; \ } \ } while(0)
@@ -61,7 +61,7 @@ struct sssd_ctx { bool debug; };
-void debug_fn(const char *format, ...) +void plugin_debug_fn(const char *format, ...) { va_list ap; char *s = NULL; diff --git a/src/tests/debug-tests.c b/src/tests/debug-tests.c index f73f9bd..0902005 100644 --- a/src/tests/debug-tests.c +++ b/src/tests/debug-tests.c @@ -179,7 +179,7 @@ START_TEST(test_debug_get_level_new_format) } END_TEST
-int test_helper_debug_check_message(int level, int msgmode) +int test_helper_debug_check_message(int level) { TALLOC_CTX *ctx = talloc_new(NULL); char filename[24] = {'\0'}; @@ -221,11 +221,7 @@ int test_helper_debug_check_message(int level, int msgmode) goto done; }
- if (msgmode == 0) { - DEBUG(level, ("%s", body)); - } else { - DEBUG_MSG(level, __FUNCTION__, "some error"); - } + DEBUG(level, ("%s", body));
ret = fseek(file, 0, SEEK_END); if (ret == -1) { @@ -329,7 +325,7 @@ done: return ret; }
-int test_helper_debug_is_empty_message(int level, int msgmode) +int test_helper_debug_is_empty_message(int level) { char filename[24] = {'\0'}; int fd; @@ -362,11 +358,7 @@ int test_helper_debug_is_empty_message(int level, int msgmode) goto done; }
- if (msgmode == 0) { - DEBUG(level, ("some error\n")); - } else { - DEBUG_MSG(level, __FUNCTION__, "some error"); - } + DEBUG(level, ("some error\n"));
ret = fseek(file, 0, SEEK_END); if (ret == -1) { @@ -420,7 +412,7 @@ START_TEST(test_debug_is_set_single_no_timestamp) debug_level = levels[i];
errno = 0; - result = test_helper_debug_check_message(levels[i], 0); + result = test_helper_debug_check_message(levels[i]);
if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno); @@ -462,7 +454,7 @@ START_TEST(test_debug_is_set_single_timestamp) debug_level = levels[i];
errno = 0; - result = test_helper_debug_check_message(levels[i], 0); + result = test_helper_debug_check_message(levels[i]);
if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno); @@ -509,7 +501,7 @@ START_TEST(test_debug_is_set_single_timestamp_microseconds) debug_level = levels[i];
errno = 0; - result = test_helper_debug_check_message(levels[i], 0); + result = test_helper_debug_check_message(levels[i]);
if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno); @@ -557,7 +549,7 @@ START_TEST(test_debug_is_notset_no_timestamp) debug_level = all_set & ~levels[i];
errno = 0; - result = test_helper_debug_is_empty_message(levels[i], 0); + result = test_helper_debug_is_empty_message(levels[i]);
if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno); @@ -602,7 +594,7 @@ START_TEST(test_debug_is_notset_timestamp) debug_level = all_set & ~levels[i];
errno = 0; - result = test_helper_debug_is_empty_message(levels[i], 0); + result = test_helper_debug_is_empty_message(levels[i]);
if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno); @@ -647,7 +639,7 @@ START_TEST(test_debug_is_notset_timestamp_microseconds) debug_level = all_set & ~levels[i];
errno = 0; - result = test_helper_debug_is_empty_message(levels[i], 0); + result = test_helper_debug_is_empty_message(levels[i]);
if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno); @@ -664,271 +656,6 @@ START_TEST(test_debug_is_notset_timestamp_microseconds) } END_TEST
-START_TEST(test_debug_msg_is_set_single_no_timestamp) -{ - int i; - int result; - int levels[] = { - SSSDBG_FATAL_FAILURE, - SSSDBG_CRIT_FAILURE, - SSSDBG_OP_FAILURE, - SSSDBG_MINOR_FAILURE, - SSSDBG_CONF_SETTINGS, - SSSDBG_FUNC_DATA, - SSSDBG_TRACE_FUNC, - SSSDBG_TRACE_LIBS, - SSSDBG_TRACE_INTERNAL, - SSSDBG_TRACE_ALL - }; - char *error_msg; - - debug_timestamps = 0; - debug_microseconds = 0; - debug_to_file = 1; - debug_prg_name = "sssd"; - - for (i = 0; i <= 9; i++) { - debug_level = levels[i]; - - errno = 0; - result = test_helper_debug_check_message(levels[i], 1); - - if (result == DEBUG_TEST_ERROR) { - error_msg = strerror(errno); - fail(error_msg); - } - - char *msg = NULL; - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message don't match", levels[i]); - fail_unless(result == EOK, msg); - talloc_free(msg); - } -} -END_TEST - -START_TEST(test_debug_msg_is_set_single_timestamp) -{ - int i; - int result; - int levels[] = { - SSSDBG_FATAL_FAILURE, - SSSDBG_CRIT_FAILURE, - SSSDBG_OP_FAILURE, - SSSDBG_MINOR_FAILURE, - SSSDBG_CONF_SETTINGS, - SSSDBG_FUNC_DATA, - SSSDBG_TRACE_FUNC, - SSSDBG_TRACE_LIBS, - SSSDBG_TRACE_INTERNAL, - SSSDBG_TRACE_ALL - }; - char *error_msg; - - debug_timestamps = 1; - debug_microseconds = 0; - debug_to_file = 1; - debug_prg_name = "sssd"; - - for (i = 0; i <= 9; i++) { - debug_level = levels[i]; - - errno = 0; - result = test_helper_debug_check_message(levels[i], 1); - - if (result == DEBUG_TEST_ERROR) { - error_msg = strerror(errno); - fail(error_msg); - } - - char *msg = NULL; - - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - invalid timestamp", levels[i]); - fail_if(result == DEBUG_TEST_NOK_TS, msg); - talloc_free(msg); - - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message don't match", levels[i]); - fail_unless(result == EOK, msg); - talloc_free(msg); - } -} -END_TEST - -START_TEST(test_debug_msg_is_set_single_timestamp_microseconds) -{ - int i; - int result; - int levels[] = { - SSSDBG_FATAL_FAILURE, - SSSDBG_CRIT_FAILURE, - SSSDBG_OP_FAILURE, - SSSDBG_MINOR_FAILURE, - SSSDBG_CONF_SETTINGS, - SSSDBG_FUNC_DATA, - SSSDBG_TRACE_FUNC, - SSSDBG_TRACE_LIBS, - SSSDBG_TRACE_INTERNAL, - SSSDBG_TRACE_ALL - }; - char *error_msg; - - debug_timestamps = 1; - debug_microseconds = 1; - debug_to_file = 1; - debug_prg_name = "sssd"; - - for (i = 0; i <= 9; i++) { - debug_level = levels[i]; - - errno = 0; - result = test_helper_debug_check_message(levels[i], 1); - - if (result == DEBUG_TEST_ERROR) { - error_msg = strerror(errno); - fail(error_msg); - } - - char *msg = NULL; - - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - invalid timestamp", levels[i]); - fail_if(result == DEBUG_TEST_NOK_TS, msg); - talloc_free(msg); - - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message don't match", levels[i]); - fail_unless(result == EOK, msg); - talloc_free(msg); - } -} -END_TEST - -START_TEST(test_debug_msg_is_notset_no_timestamp) -{ - int i; - int result; - int all_set = SSSDBG_MASK_ALL; - int levels[] = { - SSSDBG_FATAL_FAILURE, - SSSDBG_CRIT_FAILURE, - SSSDBG_OP_FAILURE, - SSSDBG_MINOR_FAILURE, - SSSDBG_CONF_SETTINGS, - SSSDBG_FUNC_DATA, - SSSDBG_TRACE_FUNC, - SSSDBG_TRACE_LIBS, - SSSDBG_TRACE_INTERNAL, - SSSDBG_TRACE_ALL - }; - char *error_msg; - - debug_timestamps = 0; - debug_microseconds = 0; - debug_to_file = 1; - debug_prg_name = "sssd"; - - for (i = 0; i <= 9; i++) { - debug_level = all_set & ~levels[i]; - - errno = 0; - result = test_helper_debug_is_empty_message(levels[i], 1); - - if (result == DEBUG_TEST_ERROR) { - error_msg = strerror(errno); - fail(error_msg); - } - - char *msg = NULL; - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message has been written", levels[i]); - fail_unless(result == EOK, msg); - talloc_free(msg); - } -} -END_TEST - -START_TEST(test_debug_msg_is_notset_timestamp) -{ - int i; - int result; - int all_set = SSSDBG_MASK_ALL; - int levels[] = { - SSSDBG_FATAL_FAILURE, - SSSDBG_CRIT_FAILURE, - SSSDBG_OP_FAILURE, - SSSDBG_MINOR_FAILURE, - SSSDBG_CONF_SETTINGS, - SSSDBG_FUNC_DATA, - SSSDBG_TRACE_FUNC, - SSSDBG_TRACE_LIBS, - SSSDBG_TRACE_INTERNAL, - SSSDBG_TRACE_ALL - }; - char *error_msg; - - debug_timestamps = 0; - debug_microseconds = 0; - debug_to_file = 1; - debug_prg_name = "sssd"; - - for (i = 0; i <= 9; i++) { - debug_level = all_set & ~levels[i]; - - errno = 0; - result = test_helper_debug_is_empty_message(levels[i], 1); - - if (result == DEBUG_TEST_ERROR) { - error_msg = strerror(errno); - fail(error_msg); - } - - char *msg = NULL; - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message has been written", levels[i]); - fail_unless(result == EOK, msg); - talloc_free(msg); - } -} -END_TEST - -START_TEST(test_debug_msg_is_notset_timestamp_microseconds) -{ - int i; - int result; - int all_set = SSSDBG_MASK_ALL; - int levels[] = { - SSSDBG_FATAL_FAILURE, - SSSDBG_CRIT_FAILURE, - SSSDBG_OP_FAILURE, - SSSDBG_MINOR_FAILURE, - SSSDBG_CONF_SETTINGS, - SSSDBG_FUNC_DATA, - SSSDBG_TRACE_FUNC, - SSSDBG_TRACE_LIBS, - SSSDBG_TRACE_INTERNAL, - SSSDBG_TRACE_ALL - }; - char *error_msg; - - debug_timestamps = 0; - debug_microseconds = 1; - debug_to_file = 1; - debug_prg_name = "sssd"; - - for (i = 0; i <= 9; i++) { - debug_level = all_set & ~levels[i]; - - errno = 0; - result = test_helper_debug_is_empty_message(levels[i], 1); - - if (result == DEBUG_TEST_ERROR) { - error_msg = strerror(errno); - fail(error_msg); - } - - char *msg = NULL; - msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message has been written", levels[i]); - fail_unless(result == EOK, msg); - talloc_free(msg); - } -} -END_TEST - START_TEST(test_debug_is_set_true) { int i; @@ -1004,12 +731,6 @@ Suite *debug_suite(void) tcase_add_test(tc_debug, test_debug_is_notset_no_timestamp); tcase_add_test(tc_debug, test_debug_is_notset_timestamp); tcase_add_test(tc_debug, test_debug_is_notset_timestamp_microseconds); - tcase_add_test(tc_debug, test_debug_msg_is_set_single_no_timestamp); - tcase_add_test(tc_debug, test_debug_msg_is_set_single_timestamp); - tcase_add_test(tc_debug, test_debug_msg_is_set_single_timestamp_microseconds); - tcase_add_test(tc_debug, test_debug_msg_is_notset_no_timestamp); - tcase_add_test(tc_debug, test_debug_msg_is_notset_timestamp); - tcase_add_test(tc_debug, test_debug_msg_is_notset_timestamp_microseconds); tcase_add_test(tc_debug, test_debug_is_set_true); tcase_add_test(tc_debug, test_debug_is_set_false); tcase_set_timeout(tc_debug, 60); diff --git a/src/tools/selinux.c b/src/tools/selinux.c index e4a3078..e82e586 100644 --- a/src/tools/selinux.c +++ b/src/tools/selinux.c @@ -121,7 +121,7 @@ static void sss_semanage_error_callback(void *varg, return; }
- DEBUG_MSG(level, "libsemanage", message); + debug_fn("libsemanage", level, "%s\n", message); free(message); }
diff --git a/src/util/debug.c b/src/util/debug.c index 324f0da..9f87468 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -104,18 +104,62 @@ int debug_convert_old_level(int old_level) return new_level; }
-void debug_fn(const char *format, ...) +static void debug_vprintf(const char *format, va_list ap) +{ + vfprintf(debug_file ? debug_file : stderr, format, ap); + fflush(debug_file ? debug_file : stderr); +} + +static void debug_printf(const char *format, ...) + SSS_ATTRIBUTE_PRINTF(1, 2); + +static void debug_printf(const char *format, ...) { va_list ap;
va_start(ap, format);
- vfprintf(debug_file ? debug_file : stderr, format, ap); - fflush(debug_file ? debug_file : stderr); + debug_vprintf(format, ap);
va_end(ap); }
+void debug_fn(const char *function, int level, const char *format, ...) +{ + level = debug_get_level(level); + if (DEBUG_IS_SET(level)) { + va_list ap; + if (debug_timestamps) { + struct timeval tv; + struct tm *tm; + char datetime[20]; + int year; + gettimeofday(&tv, NULL); + tm = localtime(&tv.tv_sec); + year = tm->tm_year + 1900; + /* get date time without year */ + memcpy(datetime, ctime(&tv.tv_sec), 19); + datetime[19] = '\0'; + if (debug_microseconds) { + debug_printf("(%s:%.6ld %d) [%s] [%s] (%#.4x): ", + datetime, tv.tv_usec, + year, debug_prg_name, + function, level); + } else { + debug_printf("(%s %d) [%s] [%s] (%#.4x): ", + datetime, year, + debug_prg_name, function, level); + } + } else { + debug_printf("[%s] [%s] (%#.4x): ", + debug_prg_name, function, level); + } + va_start(ap, format); + debug_vprintf(format, ap); + va_end(ap); + } +} + int debug_get_level(int old_level) { if ((old_level != 0) && !(old_level & 0x000F)) @@ -168,7 +212,7 @@ void ldb_debug_messages(void *context, enum ldb_debug_level level, return; }
- DEBUG_MSG(loglevel, "ldb", message); + debug_fn("ldb", loglevel, "%s\n", message);
free(message); } diff --git a/src/util/util.h b/src/util/util.h index 98b86e9..f3ab836 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -67,7 +67,8 @@ extern int debug_timestamps; extern int debug_microseconds; extern int debug_to_file; extern const char *debug_log_file; -void debug_fn(const char *format, ...) SSS_ATTRIBUTE_PRINTF(1, 2); +void debug_fn(const char *function, int level, const char *format, ...) + SSS_ATTRIBUTE_PRINTF(3, 4); int debug_get_level(int old_level); int debug_convert_old_level(int old_level); errno_t set_debug_file_from_fd(const int fd); @@ -107,6 +108,8 @@ errno_t set_debug_file_from_fd(const int fd); {"debug-microseconds", 0, POPT_ARG_INT, &debug_microseconds, 0, \ _("Show timestamps with microseconds"), NULL},
+#define DEBUG_UNWRAP(...) __VA_ARGS__ + /** \def DEBUG(level, body) \brief macro to generate debug messages
@@ -122,78 +125,7 @@ errno_t set_debug_file_from_fd(const int fd);
\param body the debug message you want to send, should end with \n */ -#define DEBUG(level, body) do { \ - int __debug_macro_newlevel = debug_get_level(level); \ - if (DEBUG_IS_SET(__debug_macro_newlevel)) { \ - if (debug_timestamps) { \ - struct timeval __debug_macro_tv; \ - struct tm *__debug_macro_tm; \ - char __debug_macro_datetime[20]; \ - int __debug_macro_year; \ - gettimeofday(&__debug_macro_tv, NULL); \ - __debug_macro_tm = localtime(&__debug_macro_tv.tv_sec); \ - __debug_macro_year = __debug_macro_tm->tm_year + 1900; \ - /* get date time without year */ \ - memcpy(__debug_macro_datetime, ctime(&__debug_macro_tv.tv_sec), 19); \ - __debug_macro_datetime[19] = '\0'; \ - if (debug_microseconds) { \ - debug_fn("(%s:%.6ld %d) [%s] [%s] (%#.4x): ", \ - __debug_macro_datetime, __debug_macro_tv.tv_usec, \ - __debug_macro_year, debug_prg_name, \ - __FUNCTION__, __debug_macro_newlevel); \ - } else { \ - debug_fn("(%s %d) [%s] [%s] (%#.4x): ", \ - __debug_macro_datetime, __debug_macro_year, \ - debug_prg_name, __FUNCTION__, __debug_macro_newlevel); \ - } \ - } else { \ - debug_fn("[%s] [%s] (%#.4x): ", \ - debug_prg_name, __FUNCTION__, __debug_macro_newlevel); \ - } \ - debug_fn body; \ - } \ -} while(0) - -/** \def DEBUG_MSG(level, function, message) - \brief macro to generate debug messages with message from variable - - \param level the debug level, please use one of the SSSDBG_* macros - - \param function name of the function where DEBUG_MSG is called - - \param message message to be send (should not end with \n) -*/ -#define DEBUG_MSG(level, function, message) do { \ - int __debug_macro_newlevel = debug_get_level(level); \ - if (DEBUG_IS_SET(__debug_macro_newlevel)) { \ - if (debug_timestamps) { \ - struct timeval __debug_macro_tv; \ - struct tm *__debug_macro_tm; \ - char __debug_macro_datetime[20]; \ - int __debug_macro_year; \ - gettimeofday(&__debug_macro_tv, NULL); \ - __debug_macro_tm = localtime(&__debug_macro_tv.tv_sec); \ - __debug_macro_year = __debug_macro_tm->tm_year + 1900; \ - /* get date time without year */ \ - memcpy(__debug_macro_datetime, ctime(&__debug_macro_tv.tv_sec), 19); \ - __debug_macro_datetime[19] = '\0'; \ - if (debug_microseconds) { \ - debug_fn("(%s:%.6ld %d) [%s] [%s] (%#.4x): %s\n", \ - __debug_macro_datetime, __debug_macro_tv.tv_usec, \ - __debug_macro_year, debug_prg_name, \ - function, __debug_macro_newlevel, message); \ - } else { \ - debug_fn("(%s %d) [%s] [%s] (%#.4x): %s\n", \ - __debug_macro_datetime, __debug_macro_year, \ - debug_prg_name, function, __debug_macro_newlevel, \ - message); \ - } \ - } else { \ - debug_fn("[%s] [%s] (%#.4x): %s\n", \ - debug_prg_name, function, __debug_macro_newlevel, message); \ - } \ - } \ -} while(0) +#define DEBUG(level, body) debug_fn(__FUNCTION__, level, DEBUG_UNWRAP body)
/** \def DEBUG_IS_SET(level) \brief checks whether level (must be in new format) is set in debug_level
On Thu, 2013-10-10 at 17:07 +0300, Nikolai Kondrashov wrote:
Move DEBUG macro body to the debug_fn function, adding "function" argument to the latter. Rename "debug_fn" in sssd_krb5_locator_plugin.c to "plugin_debug_fn" to remove conflict with the sssd debug_fn. Replace DEBUG_MSG macro usage with debug_fn function usage. Remove DEBUG_MSG macro along with tests.
The above makes the total size of binaries drop by 20% for the standard Fedora build and by 44% for a build configured according to Debian packaging script.
src/krb5_plugin/sssd_krb5_locator_plugin.c | 4 +- src/tests/debug-tests.c | 299 +---------------------------- src/tools/selinux.c | 2 +- src/util/debug.c | 52 ++++- src/util/util.h | 78 +------- 5 files changed, 66 insertions(+), 369 deletions(-)
diff --git a/src/krb5_plugin/sssd_krb5_locator_plugin.c b/src/krb5_plugin/sssd_krb5_locator_plugin.c index 725687d..a3a07d6 100644 --- a/src/krb5_plugin/sssd_krb5_locator_plugin.c +++ b/src/krb5_plugin/sssd_krb5_locator_plugin.c @@ -48,7 +48,7 @@ #define DEBUG_KEY "[sssd_krb5_locator] " #define PLUGIN_DEBUG(body) do { \ if (ctx->debug) { \
debug_fn body; \
} \plugin_debug_fn body; \} while(0)
@@ -61,7 +61,7 @@ struct sssd_ctx { bool debug; };
-void debug_fn(const char *format, ...) +void plugin_debug_fn(const char *format, ...) { va_list ap; char *s = NULL; diff --git a/src/tests/debug-tests.c b/src/tests/debug-tests.c index f73f9bd..0902005 100644 --- a/src/tests/debug-tests.c +++ b/src/tests/debug-tests.c @@ -179,7 +179,7 @@ START_TEST(test_debug_get_level_new_format) } END_TEST
-int test_helper_debug_check_message(int level, int msgmode) +int test_helper_debug_check_message(int level) { TALLOC_CTX *ctx = talloc_new(NULL); char filename[24] = {'\0'}; @@ -221,11 +221,7 @@ int test_helper_debug_check_message(int level, int msgmode) goto done; }
- if (msgmode == 0) {
DEBUG(level, ("%s", body));- } else {
DEBUG_MSG(level, __FUNCTION__, "some error");- }
DEBUG(level, ("%s", body));
ret = fseek(file, 0, SEEK_END); if (ret == -1) {
@@ -329,7 +325,7 @@ done: return ret; }
-int test_helper_debug_is_empty_message(int level, int msgmode) +int test_helper_debug_is_empty_message(int level) { char filename[24] = {'\0'}; int fd; @@ -362,11 +358,7 @@ int test_helper_debug_is_empty_message(int level, int msgmode) goto done; }
- if (msgmode == 0) {
DEBUG(level, ("some error\n"));- } else {
DEBUG_MSG(level, __FUNCTION__, "some error");- }
DEBUG(level, ("some error\n"));
ret = fseek(file, 0, SEEK_END); if (ret == -1) {
@@ -420,7 +412,7 @@ START_TEST(test_debug_is_set_single_no_timestamp) debug_level = levels[i];
errno = 0;
result = test_helper_debug_check_message(levels[i], 0);
result = test_helper_debug_check_message(levels[i]); if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno);@@ -462,7 +454,7 @@ START_TEST(test_debug_is_set_single_timestamp) debug_level = levels[i];
errno = 0;
result = test_helper_debug_check_message(levels[i], 0);
result = test_helper_debug_check_message(levels[i]); if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno);@@ -509,7 +501,7 @@ START_TEST(test_debug_is_set_single_timestamp_microseconds) debug_level = levels[i];
errno = 0;
result = test_helper_debug_check_message(levels[i], 0);
result = test_helper_debug_check_message(levels[i]); if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno);@@ -557,7 +549,7 @@ START_TEST(test_debug_is_notset_no_timestamp) debug_level = all_set & ~levels[i];
errno = 0;
result = test_helper_debug_is_empty_message(levels[i], 0);
result = test_helper_debug_is_empty_message(levels[i]); if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno);@@ -602,7 +594,7 @@ START_TEST(test_debug_is_notset_timestamp) debug_level = all_set & ~levels[i];
errno = 0;
result = test_helper_debug_is_empty_message(levels[i], 0);
result = test_helper_debug_is_empty_message(levels[i]); if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno);@@ -647,7 +639,7 @@ START_TEST(test_debug_is_notset_timestamp_microseconds) debug_level = all_set & ~levels[i];
errno = 0;
result = test_helper_debug_is_empty_message(levels[i], 0);
result = test_helper_debug_is_empty_message(levels[i]); if (result == DEBUG_TEST_ERROR) { error_msg = strerror(errno);@@ -664,271 +656,6 @@ START_TEST(test_debug_is_notset_timestamp_microseconds) } END_TEST
-START_TEST(test_debug_msg_is_set_single_no_timestamp) -{
- int i;
- int result;
- int levels[] = {
SSSDBG_FATAL_FAILURE,SSSDBG_CRIT_FAILURE,SSSDBG_OP_FAILURE,SSSDBG_MINOR_FAILURE,SSSDBG_CONF_SETTINGS,SSSDBG_FUNC_DATA,SSSDBG_TRACE_FUNC,SSSDBG_TRACE_LIBS,SSSDBG_TRACE_INTERNAL,SSSDBG_TRACE_ALL- };
- char *error_msg;
- debug_timestamps = 0;
- debug_microseconds = 0;
- debug_to_file = 1;
- debug_prg_name = "sssd";
- for (i = 0; i <= 9; i++) {
debug_level = levels[i];errno = 0;result = test_helper_debug_check_message(levels[i], 1);if (result == DEBUG_TEST_ERROR) {error_msg = strerror(errno);fail(error_msg);}char *msg = NULL;msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message don't match", levels[i]);fail_unless(result == EOK, msg);talloc_free(msg);- }
-} -END_TEST
-START_TEST(test_debug_msg_is_set_single_timestamp) -{
- int i;
- int result;
- int levels[] = {
SSSDBG_FATAL_FAILURE,SSSDBG_CRIT_FAILURE,SSSDBG_OP_FAILURE,SSSDBG_MINOR_FAILURE,SSSDBG_CONF_SETTINGS,SSSDBG_FUNC_DATA,SSSDBG_TRACE_FUNC,SSSDBG_TRACE_LIBS,SSSDBG_TRACE_INTERNAL,SSSDBG_TRACE_ALL- };
- char *error_msg;
- debug_timestamps = 1;
- debug_microseconds = 0;
- debug_to_file = 1;
- debug_prg_name = "sssd";
- for (i = 0; i <= 9; i++) {
debug_level = levels[i];errno = 0;result = test_helper_debug_check_message(levels[i], 1);if (result == DEBUG_TEST_ERROR) {error_msg = strerror(errno);fail(error_msg);}char *msg = NULL;msg = talloc_asprintf(NULL, "Test of level %#.4x failed - invalid timestamp", levels[i]);fail_if(result == DEBUG_TEST_NOK_TS, msg);talloc_free(msg);msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message don't match", levels[i]);fail_unless(result == EOK, msg);talloc_free(msg);- }
-} -END_TEST
-START_TEST(test_debug_msg_is_set_single_timestamp_microseconds) -{
- int i;
- int result;
- int levels[] = {
SSSDBG_FATAL_FAILURE,SSSDBG_CRIT_FAILURE,SSSDBG_OP_FAILURE,SSSDBG_MINOR_FAILURE,SSSDBG_CONF_SETTINGS,SSSDBG_FUNC_DATA,SSSDBG_TRACE_FUNC,SSSDBG_TRACE_LIBS,SSSDBG_TRACE_INTERNAL,SSSDBG_TRACE_ALL- };
- char *error_msg;
- debug_timestamps = 1;
- debug_microseconds = 1;
- debug_to_file = 1;
- debug_prg_name = "sssd";
- for (i = 0; i <= 9; i++) {
debug_level = levels[i];errno = 0;result = test_helper_debug_check_message(levels[i], 1);if (result == DEBUG_TEST_ERROR) {error_msg = strerror(errno);fail(error_msg);}char *msg = NULL;msg = talloc_asprintf(NULL, "Test of level %#.4x failed - invalid timestamp", levels[i]);fail_if(result == DEBUG_TEST_NOK_TS, msg);talloc_free(msg);msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message don't match", levels[i]);fail_unless(result == EOK, msg);talloc_free(msg);- }
-} -END_TEST
-START_TEST(test_debug_msg_is_notset_no_timestamp) -{
- int i;
- int result;
- int all_set = SSSDBG_MASK_ALL;
- int levels[] = {
SSSDBG_FATAL_FAILURE,SSSDBG_CRIT_FAILURE,SSSDBG_OP_FAILURE,SSSDBG_MINOR_FAILURE,SSSDBG_CONF_SETTINGS,SSSDBG_FUNC_DATA,SSSDBG_TRACE_FUNC,SSSDBG_TRACE_LIBS,SSSDBG_TRACE_INTERNAL,SSSDBG_TRACE_ALL- };
- char *error_msg;
- debug_timestamps = 0;
- debug_microseconds = 0;
- debug_to_file = 1;
- debug_prg_name = "sssd";
- for (i = 0; i <= 9; i++) {
debug_level = all_set & ~levels[i];errno = 0;result = test_helper_debug_is_empty_message(levels[i], 1);if (result == DEBUG_TEST_ERROR) {error_msg = strerror(errno);fail(error_msg);}char *msg = NULL;msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message has been written", levels[i]);fail_unless(result == EOK, msg);talloc_free(msg);- }
-} -END_TEST
-START_TEST(test_debug_msg_is_notset_timestamp) -{
- int i;
- int result;
- int all_set = SSSDBG_MASK_ALL;
- int levels[] = {
SSSDBG_FATAL_FAILURE,SSSDBG_CRIT_FAILURE,SSSDBG_OP_FAILURE,SSSDBG_MINOR_FAILURE,SSSDBG_CONF_SETTINGS,SSSDBG_FUNC_DATA,SSSDBG_TRACE_FUNC,SSSDBG_TRACE_LIBS,SSSDBG_TRACE_INTERNAL,SSSDBG_TRACE_ALL- };
- char *error_msg;
- debug_timestamps = 0;
- debug_microseconds = 0;
- debug_to_file = 1;
- debug_prg_name = "sssd";
- for (i = 0; i <= 9; i++) {
debug_level = all_set & ~levels[i];errno = 0;result = test_helper_debug_is_empty_message(levels[i], 1);if (result == DEBUG_TEST_ERROR) {error_msg = strerror(errno);fail(error_msg);}char *msg = NULL;msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message has been written", levels[i]);fail_unless(result == EOK, msg);talloc_free(msg);- }
-} -END_TEST
-START_TEST(test_debug_msg_is_notset_timestamp_microseconds) -{
- int i;
- int result;
- int all_set = SSSDBG_MASK_ALL;
- int levels[] = {
SSSDBG_FATAL_FAILURE,SSSDBG_CRIT_FAILURE,SSSDBG_OP_FAILURE,SSSDBG_MINOR_FAILURE,SSSDBG_CONF_SETTINGS,SSSDBG_FUNC_DATA,SSSDBG_TRACE_FUNC,SSSDBG_TRACE_LIBS,SSSDBG_TRACE_INTERNAL,SSSDBG_TRACE_ALL- };
- char *error_msg;
- debug_timestamps = 0;
- debug_microseconds = 1;
- debug_to_file = 1;
- debug_prg_name = "sssd";
- for (i = 0; i <= 9; i++) {
debug_level = all_set & ~levels[i];errno = 0;result = test_helper_debug_is_empty_message(levels[i], 1);if (result == DEBUG_TEST_ERROR) {error_msg = strerror(errno);fail(error_msg);}char *msg = NULL;msg = talloc_asprintf(NULL, "Test of level %#.4x failed - message has been written", levels[i]);fail_unless(result == EOK, msg);talloc_free(msg);- }
-} -END_TEST
START_TEST(test_debug_is_set_true) { int i; @@ -1004,12 +731,6 @@ Suite *debug_suite(void) tcase_add_test(tc_debug, test_debug_is_notset_no_timestamp); tcase_add_test(tc_debug, test_debug_is_notset_timestamp); tcase_add_test(tc_debug, test_debug_is_notset_timestamp_microseconds);
- tcase_add_test(tc_debug, test_debug_msg_is_set_single_no_timestamp);
- tcase_add_test(tc_debug, test_debug_msg_is_set_single_timestamp);
- tcase_add_test(tc_debug, test_debug_msg_is_set_single_timestamp_microseconds);
- tcase_add_test(tc_debug, test_debug_msg_is_notset_no_timestamp);
- tcase_add_test(tc_debug, test_debug_msg_is_notset_timestamp);
- tcase_add_test(tc_debug, test_debug_msg_is_notset_timestamp_microseconds); tcase_add_test(tc_debug, test_debug_is_set_true); tcase_add_test(tc_debug, test_debug_is_set_false); tcase_set_timeout(tc_debug, 60);
diff --git a/src/tools/selinux.c b/src/tools/selinux.c index e4a3078..e82e586 100644 --- a/src/tools/selinux.c +++ b/src/tools/selinux.c @@ -121,7 +121,7 @@ static void sss_semanage_error_callback(void *varg, return; }
- DEBUG_MSG(level, "libsemanage", message);
- debug_fn("libsemanage", level, "%s\n", message); free(message);
}
diff --git a/src/util/debug.c b/src/util/debug.c index 324f0da..9f87468 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -104,18 +104,62 @@ int debug_convert_old_level(int old_level) return new_level; }
-void debug_fn(const char *format, ...) +static void debug_vprintf(const char *format, va_list ap) +{
- vfprintf(debug_file ? debug_file : stderr, format, ap);
- fflush(debug_file ? debug_file : stderr);
+}
+static void debug_printf(const char *format, ...)
SSS_ATTRIBUTE_PRINTF(1, 2);+static void debug_printf(const char *format, ...) { va_list ap;
va_start(ap, format);
- vfprintf(debug_file ? debug_file : stderr, format, ap);
- fflush(debug_file ? debug_file : stderr);
debug_vprintf(format, ap);
va_end(ap);
}
+void debug_fn(const char *function, int level, const char *format, ...) +{
- level = debug_get_level(level);
- if (DEBUG_IS_SET(level)) {
va_list ap;if (debug_timestamps) {struct timeval tv;struct tm *tm;char datetime[20];int year;gettimeofday(&tv, NULL);tm = localtime(&tv.tv_sec);year = tm->tm_year + 1900;/* get date time without year */memcpy(datetime, ctime(&tv.tv_sec), 19);datetime[19] = '\0';if (debug_microseconds) {debug_printf("(%s:%.6ld %d) [%s] [%s] (%#.4x): ",datetime, tv.tv_usec,year, debug_prg_name,function, level);} else {debug_printf("(%s %d) [%s] [%s] (%#.4x): ",datetime, year,debug_prg_name, function, level);}} else {debug_printf("[%s] [%s] (%#.4x): ",debug_prg_name, function, level);}va_start(ap, format);debug_vprintf(format, ap);va_end(ap);- }
+}
int debug_get_level(int old_level) { if ((old_level != 0) && !(old_level & 0x000F)) @@ -168,7 +212,7 @@ void ldb_debug_messages(void *context, enum ldb_debug_level level, return; }
- DEBUG_MSG(loglevel, "ldb", message);
debug_fn("ldb", loglevel, "%s\n", message);
free(message);
} diff --git a/src/util/util.h b/src/util/util.h index 98b86e9..f3ab836 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -67,7 +67,8 @@ extern int debug_timestamps; extern int debug_microseconds; extern int debug_to_file; extern const char *debug_log_file; -void debug_fn(const char *format, ...) SSS_ATTRIBUTE_PRINTF(1, 2); +void debug_fn(const char *function, int level, const char *format, ...)
SSS_ATTRIBUTE_PRINTF(3, 4);int debug_get_level(int old_level); int debug_convert_old_level(int old_level); errno_t set_debug_file_from_fd(const int fd); @@ -107,6 +108,8 @@ errno_t set_debug_file_from_fd(const int fd); {"debug-microseconds", 0, POPT_ARG_INT, &debug_microseconds, 0, \ _("Show timestamps with microseconds"), NULL},
+#define DEBUG_UNWRAP(...) __VA_ARGS__
/** \def DEBUG(level, body) \brief macro to generate debug messages
@@ -122,78 +125,7 @@ errno_t set_debug_file_from_fd(const int fd);
\param body the debug message you want to send, should end with \n*/ -#define DEBUG(level, body) do { \
- int __debug_macro_newlevel = debug_get_level(level); \
- if (DEBUG_IS_SET(__debug_macro_newlevel)) { \
if (debug_timestamps) { \struct timeval __debug_macro_tv; \struct tm *__debug_macro_tm; \char __debug_macro_datetime[20]; \int __debug_macro_year; \gettimeofday(&__debug_macro_tv, NULL); \__debug_macro_tm = localtime(&__debug_macro_tv.tv_sec); \__debug_macro_year = __debug_macro_tm->tm_year + 1900; \/* get date time without year */ \memcpy(__debug_macro_datetime, ctime(&__debug_macro_tv.tv_sec), 19); \__debug_macro_datetime[19] = '\0'; \if (debug_microseconds) { \debug_fn("(%s:%.6ld %d) [%s] [%s] (%#.4x): ", \__debug_macro_datetime, __debug_macro_tv.tv_usec, \__debug_macro_year, debug_prg_name, \__FUNCTION__, __debug_macro_newlevel); \} else { \debug_fn("(%s %d) [%s] [%s] (%#.4x): ", \__debug_macro_datetime, __debug_macro_year, \debug_prg_name, __FUNCTION__, __debug_macro_newlevel); \} \} else { \debug_fn("[%s] [%s] (%#.4x): ", \debug_prg_name, __FUNCTION__, __debug_macro_newlevel); \} \debug_fn body; \- } \
-} while(0)
-/** \def DEBUG_MSG(level, function, message)
- \brief macro to generate debug messages with message from variable
- \param level the debug level, please use one of the SSSDBG_* macros
- \param function name of the function where DEBUG_MSG is called
- \param message message to be send (should not end with \n)
-*/ -#define DEBUG_MSG(level, function, message) do { \
- int __debug_macro_newlevel = debug_get_level(level); \
- if (DEBUG_IS_SET(__debug_macro_newlevel)) { \
if (debug_timestamps) { \struct timeval __debug_macro_tv; \struct tm *__debug_macro_tm; \char __debug_macro_datetime[20]; \int __debug_macro_year; \gettimeofday(&__debug_macro_tv, NULL); \__debug_macro_tm = localtime(&__debug_macro_tv.tv_sec); \__debug_macro_year = __debug_macro_tm->tm_year + 1900; \/* get date time without year */ \memcpy(__debug_macro_datetime, ctime(&__debug_macro_tv.tv_sec), 19); \__debug_macro_datetime[19] = '\0'; \if (debug_microseconds) { \debug_fn("(%s:%.6ld %d) [%s] [%s] (%#.4x): %s\n", \__debug_macro_datetime, __debug_macro_tv.tv_usec, \__debug_macro_year, debug_prg_name, \function, __debug_macro_newlevel, message); \} else { \debug_fn("(%s %d) [%s] [%s] (%#.4x): %s\n", \__debug_macro_datetime, __debug_macro_year, \debug_prg_name, function, __debug_macro_newlevel, \message); \} \} else { \debug_fn("[%s] [%s] (%#.4x): %s\n", \debug_prg_name, function, __debug_macro_newlevel, message); \} \- } \
-} while(0) +#define DEBUG(level, body) debug_fn(__FUNCTION__, level, DEBUG_UNWRAP body)
/** \def DEBUG_IS_SET(level) \brief checks whether level (must be in new format) is set in debug_level
Hi Nikolai, nice work.
The code size reduction looks appealing, however please check the level before calling the function, directly in the DEBUG() macro. This way we completely avoid the function call when we are not going to debug anything.
Also please squash the fflush patch into this one, I do not really see a good reason to have 2 patches given, afaics, you introduced the issue with this patch in the first place.
Simo.
On Thu, 2013-10-10 at 16:25 -0400, Simo Sorce wrote:
The code size reduction looks appealing, however please check the level before calling the function, directly in the DEBUG() macro. This way we completely avoid the function call when we are not going to debug anything.
We could even go as far as wrapping the level test into unlikely() so that the compiler can help branch prediction by not calling the function by default.
Simo.
On 10/10/2013 11:29 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 16:25 -0400, Simo Sorce wrote:
The code size reduction looks appealing, however please check the level before calling the function, directly in the DEBUG() macro. This way we completely avoid the function call when we are not going to debug anything.
We could even go as far as wrapping the level test into unlikely() so that the compiler can help branch prediction by not calling the function by default.
You don't seem to have the "unlikely" macro defined and I would hesitate to introduce it just for this case, but I would gladly use it if it was there.
Sincerely, Nick
On Fri, 2013-10-11 at 11:34 +0300, Nikolai Kondrashov wrote:
On 10/10/2013 11:29 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 16:25 -0400, Simo Sorce wrote:
The code size reduction looks appealing, however please check the level before calling the function, directly in the DEBUG() macro. This way we completely avoid the function call when we are not going to debug anything.
We could even go as far as wrapping the level test into unlikely() so that the compiler can help branch prediction by not calling the function by default.
You don't seem to have the "unlikely" macro defined and I would hesitate to introduce it just for this case, but I would gladly use it if it was there.
Ok, not a big deal.
Simo.
Hi Simo,
On 10/10/2013 11:25 PM, Simo Sorce wrote:
Hi Nikolai, nice work.
Thanks :)
The code size reduction looks appealing, however please check the level before calling the function, directly in the DEBUG() macro. This way we completely avoid the function call when we are not going to debug anything.
Yes, that might help with the cache.
Also please squash the fflush patch into this one, I do not really see a good reason to have 2 patches given, afaics, you introduced the issue with this patch in the first place.
Sorry, no, it was there before my changes, so I will keep it separate for the next round. Please respond if you would like it otherwise.
Sincerely, Nick
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation. --- src/confdb/confdb.c | 142 +++--- src/confdb/confdb_setup.c | 58 +-- src/db/sysdb.c | 100 ++-- src/db/sysdb_autofs.c | 78 +-- src/db/sysdb_idmap.c | 44 +- src/db/sysdb_ops.c | 294 ++++++------ src/db/sysdb_ranges.c | 38 +- src/db/sysdb_search.c | 20 +- src/db/sysdb_selinux.c | 28 +- src/db/sysdb_services.c | 74 +-- src/db/sysdb_ssh.c | 46 +- src/db/sysdb_subdomains.c | 44 +- src/db/sysdb_sudo.c | 60 +-- src/db/sysdb_upgrade.c | 128 ++--- src/monitor/monitor.c | 330 ++++++------- src/monitor/monitor_netlink.c | 114 ++--- src/monitor/monitor_sbus.c | 30 +- src/providers/ad/ad_access.c | 2 +- src/providers/ad/ad_common.c | 142 +++--- src/providers/ad/ad_domain_info.c | 50 +- src/providers/ad/ad_dyndns.c | 52 +- src/providers/ad/ad_id.c | 26 +- src/providers/ad/ad_init.c | 42 +- src/providers/ad/ad_srv.c | 66 +-- src/providers/ad/ad_subdomains.c | 72 +-- src/providers/data_provider_be.c | 426 ++++++++--------- src/providers/data_provider_callbacks.c | 26 +- src/providers/data_provider_fo.c | 78 +-- src/providers/data_provider_opts.c | 104 ++-- src/providers/dp_auth_util.c | 50 +- src/providers/dp_dyndns.c | 124 ++--- src/providers/dp_pam_data_util.c | 30 +- src/providers/dp_ptask.c | 70 +-- src/providers/dp_refresh.c | 12 +- src/providers/fail_over.c | 120 ++--- src/providers/fail_over_srv.c | 28 +- src/providers/ipa/ipa_access.c | 70 +-- src/providers/ipa/ipa_auth.c | 66 +-- src/providers/ipa/ipa_autofs.c | 4 +- src/providers/ipa/ipa_common.c | 174 +++---- src/providers/ipa/ipa_config.c | 8 +- src/providers/ipa/ipa_dyndns.c | 36 +- src/providers/ipa/ipa_hbac_common.c | 88 ++-- src/providers/ipa/ipa_hbac_hosts.c | 42 +- src/providers/ipa/ipa_hbac_rules.c | 18 +- src/providers/ipa/ipa_hbac_services.c | 56 +-- src/providers/ipa/ipa_hbac_users.c | 34 +- src/providers/ipa/ipa_hostid.c | 8 +- src/providers/ipa/ipa_hosts.c | 22 +- src/providers/ipa/ipa_id.c | 10 +- src/providers/ipa/ipa_idmap.c | 38 +- src/providers/ipa/ipa_init.c | 94 ++-- src/providers/ipa/ipa_netgroups.c | 56 +-- src/providers/ipa/ipa_s2n_exop.c | 120 ++--- src/providers/ipa/ipa_selinux.c | 98 ++-- src/providers/ipa/ipa_selinux_common.c | 12 +- src/providers/ipa/ipa_selinux_maps.c | 8 +- src/providers/ipa/ipa_srv.c | 10 +- src/providers/ipa/ipa_subdomains.c | 160 +++---- src/providers/ipa/ipa_subdomains_ext_groups.c | 162 +++---- src/providers/ipa/ipa_subdomains_id.c | 24 +- src/providers/ipa/ipa_sudo.c | 6 +- src/providers/krb5/krb5_access.c | 26 +- src/providers/krb5/krb5_auth.c | 210 ++++---- src/providers/krb5/krb5_become_user.c | 30 +- src/providers/krb5/krb5_child.c | 334 ++++++------- src/providers/krb5/krb5_child_handler.c | 60 +-- src/providers/krb5/krb5_common.c | 212 ++++----- .../krb5/krb5_delayed_online_authentication.c | 88 ++-- src/providers/krb5/krb5_init.c | 28 +- src/providers/krb5/krb5_init_shared.c | 18 +- src/providers/krb5/krb5_renew_tgt.c | 136 +++--- src/providers/krb5/krb5_utils.c | 186 ++++---- src/providers/krb5/krb5_wait_queue.c | 32 +- src/providers/ldap/ldap_access.c | 4 +- src/providers/ldap/ldap_auth.c | 124 ++--- src/providers/ldap/ldap_child.c | 124 ++--- src/providers/ldap/ldap_common.c | 254 +++++----- src/providers/ldap/ldap_id.c | 58 +-- src/providers/ldap/ldap_id_cleanup.c | 54 +-- src/providers/ldap/ldap_id_enum.c | 6 +- src/providers/ldap/ldap_id_netgroup.c | 8 +- src/providers/ldap/ldap_id_services.c | 8 +- src/providers/ldap/ldap_init.c | 90 ++-- src/providers/ldap/sdap.c | 180 +++---- src/providers/ldap/sdap_access.c | 188 ++++---- src/providers/ldap/sdap_async.c | 254 +++++----- src/providers/ldap/sdap_async_autofs.c | 108 ++--- src/providers/ldap/sdap_async_connection.c | 264 +++++------ src/providers/ldap/sdap_async_enum.c | 52 +- src/providers/ldap/sdap_async_groups.c | 282 +++++------ src/providers/ldap/sdap_async_groups_ad.c | 26 +- src/providers/ldap/sdap_async_initgroups.c | 316 ++++++------ src/providers/ldap/sdap_async_initgroups_ad.c | 94 ++-- src/providers/ldap/sdap_async_nested_groups.c | 172 +++---- src/providers/ldap/sdap_async_netgroups.c | 88 ++-- src/providers/ldap/sdap_async_services.c | 70 +-- src/providers/ldap/sdap_async_sudo.c | 44 +- src/providers/ldap/sdap_async_sudo_hostinfo.c | 68 +-- src/providers/ldap/sdap_async_sudo_timer.c | 14 +- src/providers/ldap/sdap_async_users.c | 102 ++-- src/providers/ldap/sdap_autofs.c | 20 +- src/providers/ldap/sdap_child_helpers.c | 48 +- src/providers/ldap/sdap_dyndns.c | 84 ++-- src/providers/ldap/sdap_fd_events.c | 56 +-- src/providers/ldap/sdap_id_op.c | 80 ++-- src/providers/ldap/sdap_idmap.c | 84 ++-- src/providers/ldap/sdap_range.c | 26 +- src/providers/ldap/sdap_refresh.c | 14 +- src/providers/ldap/sdap_reinit.c | 36 +- src/providers/ldap/sdap_sudo.c | 176 +++---- src/providers/ldap/sdap_sudo_cache.c | 30 +- src/providers/proxy/proxy_auth.c | 134 +++--- src/providers/proxy/proxy_child.c | 100 ++-- src/providers/proxy/proxy_id.c | 240 +++++----- src/providers/proxy/proxy_init.c | 98 ++-- src/providers/proxy/proxy_netgroup.c | 40 +- src/providers/proxy/proxy_services.c | 32 +- src/providers/simple/simple_access.c | 24 +- src/providers/simple/simple_access_check.c | 118 ++--- src/resolv/async_resolv.c | 136 +++--- src/resolv/async_resolv_utils.c | 24 +- src/responder/autofs/autofssrv.c | 30 +- src/responder/autofs/autofssrv_cmd.c | 202 ++++---- src/responder/autofs/autofssrv_dp.c | 14 +- src/responder/common/negcache.c | 62 +-- src/responder/common/responder_cmd.c | 10 +- src/responder/common/responder_common.c | 196 ++++---- src/responder/common/responder_dp.c | 80 ++-- src/responder/common/responder_get_domains.c | 40 +- src/responder/nss/nsssrv.c | 68 +-- src/responder/nss/nsssrv_cmd.c | 528 ++++++++++----------- src/responder/nss/nsssrv_mmap_cache.c | 88 ++-- src/responder/nss/nsssrv_netgroup.c | 122 ++--- src/responder/nss/nsssrv_private.h | 4 +- src/responder/nss/nsssrv_services.c | 140 +++--- src/responder/pac/pacsrv.c | 26 +- src/responder/pac/pacsrv_cmd.c | 182 +++---- src/responder/pac/pacsrv_utils.c | 80 ++-- src/responder/pam/pam_LOCAL_domain.c | 36 +- src/responder/pam/pam_helpers.c | 16 +- src/responder/pam/pamsrv.c | 22 +- src/responder/pam/pamsrv_cmd.c | 136 +++--- src/responder/pam/pamsrv_dp.c | 24 +- src/responder/ssh/sshsrv.c | 30 +- src/responder/ssh/sshsrv_cmd.c | 94 ++-- src/responder/ssh/sshsrv_dp.c | 14 +- src/responder/sudo/sudosrv.c | 24 +- src/responder/sudo/sudosrv_cmd.c | 50 +- src/responder/sudo/sudosrv_dp.c | 16 +- src/responder/sudo/sudosrv_get_sudorules.c | 134 +++--- src/responder/sudo/sudosrv_query.c | 40 +- src/sbus/sbus_client.c | 4 +- src/sbus/sssd_dbus_common.c | 28 +- src/sbus/sssd_dbus_connection.c | 64 +-- src/sbus/sssd_dbus_server.c | 68 +-- src/sss_client/ssh/sss_ssh_authorizedkeys.c | 8 +- src/sss_client/ssh/sss_ssh_knownhostsproxy.c | 46 +- src/tests/auth-tests.c | 2 +- src/tests/cmocka/test_dyndns.c | 18 +- src/tests/cmocka/test_fqnames.c | 12 +- src/tests/common_dom.c | 36 +- src/tests/common_tev.c | 4 +- src/tests/debug-tests.c | 4 +- src/tests/files-tests.c | 12 +- src/tests/krb5_child-test.c | 44 +- src/tests/resolv-tests.c | 44 +- src/tests/simple_access-tests.c | 10 +- src/tests/sysdb-tests.c | 4 +- src/tests/sysdb_ssh-tests.c | 2 +- src/tools/files.c | 112 ++--- src/tools/selinux.c | 60 +-- src/tools/sss_cache.c | 60 +-- src/tools/sss_debuglevel.c | 28 +- src/tools/sss_groupadd.c | 12 +- src/tools/sss_groupdel.c | 6 +- src/tools/sss_groupmod.c | 20 +- src/tools/sss_groupshow.c | 50 +- src/tools/sss_seed.c | 126 ++--- src/tools/sss_sync_ops.c | 36 +- src/tools/sss_useradd.c | 22 +- src/tools/sss_userdel.c | 12 +- src/tools/sss_usermod.c | 18 +- src/tools/tools_mc_util.c | 52 +- src/tools/tools_util.c | 112 ++--- src/tools/tools_util.h | 2 +- src/util/authtok.c | 2 +- src/util/backup_file.c | 24 +- src/util/check_and_open.c | 26 +- src/util/child_common.c | 106 ++--- src/util/crypto/libcrypto/crypto_base64.c | 2 +- src/util/crypto/libcrypto/crypto_obfuscate.c | 18 +- src/util/crypto/nss/nss_obfuscate.c | 66 +-- src/util/crypto/nss/nss_util.c | 8 +- src/util/debug.c | 4 +- src/util/domain_info_utils.c | 84 ++-- src/util/find_uid.c | 56 +-- src/util/nscd.c | 18 +- src/util/server.c | 80 ++-- src/util/signal.c | 2 +- src/util/sss_ini.c | 26 +- src/util/sss_krb5.c | 110 ++--- src/util/sss_krb5.h | 2 +- src/util/sss_ldap.c | 72 +-- src/util/sss_nss.c | 42 +- src/util/sss_selinux.c | 26 +- src/util/sss_ssh.c | 2 +- src/util/user_info_msg.c | 4 +- src/util/usertools.c | 70 +-- src/util/util.c | 10 +- src/util/util.h | 11 +- src/util/util_lock.c | 10 +- 212 files changed, 7556 insertions(+), 7555 deletions(-)
diff --git a/src/confdb/confdb.c b/src/confdb/confdb.c index 6527ede..dbccaea 100644 --- a/src/confdb/confdb.c +++ b/src/confdb/confdb.c @@ -206,8 +206,8 @@ int confdb_add_param(struct confdb_ctx *cdb, done: talloc_free(tmp_ctx); if (ret != EOK) { - DEBUG(1, ("Failed to add [%s] to [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + DEBUG(1, "Failed to add [%s] to [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); } return ret; } @@ -282,8 +282,8 @@ int confdb_get_param(struct confdb_ctx *cdb, done: talloc_free(tmp_ctx); if (ret != EOK) { - DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + DEBUG(1, "Failed to get [%s] from [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); } return ret; } @@ -325,7 +325,7 @@ int confdb_set_bool(struct confdb_ctx *cdb, lret = ldb_msg_add_empty(msg, attribute, LDB_FLAG_MOD_REPLACE, NULL); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldb_msg_add_empty failed: [%s]\n", ldb_strerror(lret))); + "ldb_msg_add_empty failed: [%s]\n", ldb_strerror(lret)); ret = EIO; goto done; } @@ -337,7 +337,7 @@ int confdb_set_bool(struct confdb_ctx *cdb, } if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldb_msg_add_string failed: [%s]\n", ldb_strerror(lret))); + "ldb_msg_add_string failed: [%s]\n", ldb_strerror(lret)); ret = EIO; goto done; } @@ -346,7 +346,7 @@ int confdb_set_bool(struct confdb_ctx *cdb, lret = ldb_modify(cdb->ldb, msg); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldb_modify failed: [%s]\n", ldb_strerror(lret))); + "ldb_modify failed: [%s]\n", ldb_strerror(lret)); ret = EIO; goto done; } @@ -357,8 +357,8 @@ done: talloc_free(tmp_ctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to set [%s] from [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + "Failed to set [%s] from [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); } return ret; } @@ -407,8 +407,8 @@ int confdb_get_string(struct confdb_ctx *cdb, TALLOC_CTX *ctx,
failed: talloc_free(values); - DEBUG(1, ("Failed to get [%s] from [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + DEBUG(1, "Failed to get [%s] from [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); return ret; }
@@ -462,8 +462,8 @@ int confdb_get_int(struct confdb_ctx *cdb,
failed: talloc_free(tmp_ctx); - DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + DEBUG(1, "Failed to read [%s] from [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); return ret; }
@@ -512,8 +512,8 @@ long confdb_get_long(struct confdb_ctx *cdb,
failed: talloc_free(tmp_ctx); - DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + DEBUG(1, "Failed to read [%s] from [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); return ret; }
@@ -552,7 +552,7 @@ int confdb_get_bool(struct confdb_ctx *cdb,
} else {
- DEBUG(2, ("Value is not a boolean!\n")); + DEBUG(2, "Value is not a boolean!\n"); ret = EINVAL; goto failed; } @@ -568,8 +568,8 @@ int confdb_get_bool(struct confdb_ctx *cdb,
failed: talloc_free(tmp_ctx); - DEBUG(1, ("Failed to read [%s] from [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + DEBUG(1, "Failed to read [%s] from [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); return ret; }
@@ -604,8 +604,8 @@ int confdb_get_string_as_list(struct confdb_ctx *cdb, TALLOC_CTX *ctx, done: talloc_free(values); if (ret != EOK && ret != ENOENT) { - DEBUG(2, ("Failed to get [%s] from [%s], error [%d] (%s)\n", - attribute, section, ret, strerror(ret))); + DEBUG(2, "Failed to get [%s] from [%s], error [%d] (%s)\n", + attribute, section, ret, strerror(ret)); } return ret; } @@ -643,7 +643,7 @@ int confdb_init(TALLOC_CTX *mem_ctx,
ret = ldb_set_debug(cdb->ldb, ldb_debug_messages, NULL); if (ret != LDB_SUCCESS) { - DEBUG(0,("Could not set up debug fn.\n")); + DEBUG(0,"Could not set up debug fn.\n"); talloc_free(cdb); return EIO; } @@ -653,8 +653,8 @@ int confdb_init(TALLOC_CTX *mem_ctx, ret = ldb_connect(cdb->ldb, confdb_location, 0, NULL); umask(old_umask); if (ret != LDB_SUCCESS) { - DEBUG(0, ("Unable to open config database [%s]\n", - confdb_location)); + DEBUG(0, "Unable to open config database [%s]\n", + confdb_location); talloc_free(cdb); return EIO; } @@ -780,7 +780,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, }
if (res->count != 1) { - DEBUG(0, ("Unknown domain [%s]\n", name)); + DEBUG(0, "Unknown domain [%s]\n", name); ret = ENOENT; goto done; } @@ -793,7 +793,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb,
tmp = ldb_msg_find_attr_as_string(res->msgs[0], "cn", NULL); if (!tmp) { - DEBUG(0, ("Invalid configuration entry, fatal error!\n")); + DEBUG(0, "Invalid configuration entry, fatal error!\n"); ret = EINVAL; goto done; } @@ -815,15 +815,15 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, } } else { - DEBUG(0, ("Domain [%s] does not specify an ID provider, disabling!\n", - domain->name)); + DEBUG(0, "Domain [%s] does not specify an ID provider, disabling!\n", + domain->name); ret = EINVAL; goto done; }
if (strcasecmp(domain->provider, "files") == 0) { /* The files provider is not valid anymore */ - DEBUG(0, ("The "files" provider is invalid\n")); + DEBUG(0, "The "files" provider is invalid\n"); ret = EINVAL; goto done; } @@ -837,7 +837,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, CONFDB_DOMAIN_AUTH_PROVIDER, NULL); if (tmp && strcasecmp(tmp, "local") != 0) { - DEBUG(0, ("Local ID provider does not support [%s] as an AUTH provider.\n", tmp)); + DEBUG(0, "Local ID provider does not support [%s] as an AUTH provider.\n", tmp); ret = EINVAL; goto done; } @@ -846,7 +846,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, CONFDB_DOMAIN_ACCESS_PROVIDER, NULL); if (tmp && strcasecmp(tmp, "permit") != 0) { - DEBUG(0, ("Local ID provider does not support [%s] as an ACCESS provider.\n", tmp)); + DEBUG(0, "Local ID provider does not support [%s] as an ACCESS provider.\n", tmp); ret = EINVAL; goto done; } @@ -855,7 +855,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, CONFDB_DOMAIN_CHPASS_PROVIDER, NULL); if (tmp && strcasecmp(tmp, "local") != 0) { - DEBUG(0, ("Local ID provider does not support [%s] as a CHPASS provider.\n", tmp)); + DEBUG(0, "Local ID provider does not support [%s] as a CHPASS provider.\n", tmp); ret = EINVAL; goto done; } @@ -873,27 +873,27 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, * superceeded. */ val = ldb_msg_find_attr_as_int(res->msgs[0], CONFDB_DOMAIN_ENUMERATE, 0); if (val > 0) { /* ok there was a number in here */ - DEBUG(0, ("Warning: enumeration parameter in %s still uses integers! " + DEBUG(0, "Warning: enumeration parameter in %s still uses integers! " "Enumeration is now a boolean and takes true/false values. " - "Interpreting as true\n", domain->name)); + "Interpreting as true\n", domain->name); domain->enumerate = true; } else { /* assume the new format */ ret = get_entry_as_bool(res->msgs[0], &domain->enumerate, CONFDB_DOMAIN_ENUMERATE, 0); if(ret != EOK) { - DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_ENUMERATE)); + DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_ENUMERATE); goto done; } } if (!domain->enumerate) { - DEBUG(SSSDBG_TRACE_FUNC, ("No enumeration for [%s]!\n", domain->name)); + DEBUG(SSSDBG_TRACE_FUNC, "No enumeration for [%s]!\n", domain->name); }
/* Determine if user/group names will be Fully Qualified * in NSS interfaces */ ret = get_entry_as_bool(res->msgs[0], &domain->fqnames, CONFDB_DOMAIN_FQ, 0); if(ret != EOK) { - DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_FQ)); + DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_FQ); goto done; }
@@ -901,8 +901,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS, 0); if(ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for %s\n", - CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS)); + "Invalid value for %s\n", + CONFDB_DOMAIN_IGNORE_GROUP_MEMBERS); goto done; }
@@ -910,7 +910,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, CONFDB_DOMAIN_MINID, confdb_get_min_id(domain)); if (ret != EOK) { - DEBUG(0, ("Invalid value for minId\n")); + DEBUG(0, "Invalid value for minId\n"); ret = EINVAL; goto done; } @@ -918,13 +918,13 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, ret = get_entry_as_uint32(res->msgs[0], &domain->id_max, CONFDB_DOMAIN_MAXID, 0); if (ret != EOK) { - DEBUG(0, ("Invalid value for maxId\n")); + DEBUG(0, "Invalid value for maxId\n"); ret = EINVAL; goto done; }
if (domain->id_max && (domain->id_max < domain->id_min)) { - DEBUG(0, ("Invalid domain range\n")); + DEBUG(0, "Invalid domain range\n"); ret = EINVAL; goto done; } @@ -933,14 +933,14 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, ret = get_entry_as_bool(res->msgs[0], &domain->cache_credentials, CONFDB_DOMAIN_CACHE_CREDS, 0); if(ret != EOK) { - DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_CACHE_CREDS)); + DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_CACHE_CREDS); goto done; }
ret = get_entry_as_bool(res->msgs[0], &domain->legacy_passwords, CONFDB_DOMAIN_LEGACY_PASS, 0); if(ret != EOK) { - DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_LEGACY_PASS)); + DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_LEGACY_PASS); goto done; }
@@ -949,8 +949,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, CONFDB_DOMAIN_ENTRY_CACHE_TIMEOUT, 5400); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_ENTRY_CACHE_TIMEOUT)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_ENTRY_CACHE_TIMEOUT); goto done; }
@@ -960,8 +960,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, entry_cache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_USER_CACHE_TIMEOUT)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_USER_CACHE_TIMEOUT); goto done; }
@@ -971,8 +971,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, entry_cache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_GROUP_CACHE_TIMEOUT)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_GROUP_CACHE_TIMEOUT); goto done; }
@@ -982,8 +982,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, entry_cache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_NETGROUP_CACHE_TIMEOUT)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_NETGROUP_CACHE_TIMEOUT); goto done; }
@@ -993,8 +993,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, entry_cache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_SERVICE_CACHE_TIMEOUT)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_SERVICE_CACHE_TIMEOUT); goto done; }
@@ -1004,8 +1004,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, entry_cache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_AUTOFS_CACHE_TIMEOUT)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_AUTOFS_CACHE_TIMEOUT); goto done; }
@@ -1015,8 +1015,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, entry_cache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_SUDO_CACHE_TIMEOUT)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_SUDO_CACHE_TIMEOUT); goto done; }
@@ -1026,8 +1026,8 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, 0); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid value for [%s]\n", - CONFDB_DOMAIN_REFRESH_EXPIRED_INTERVAL)); + "Invalid value for [%s]\n", + CONFDB_DOMAIN_REFRESH_EXPIRED_INTERVAL); goto done; }
@@ -1044,15 +1044,15 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, CONFDB_PAM_PWD_EXPIRATION_WARNING, -1, &val); if (ret != EOK) { - DEBUG(1, ("Failed to read PAM expiration warning, not fatal.\n")); + DEBUG(1, "Failed to read PAM expiration warning, not fatal.\n"); val = -1; } }
- DEBUG(SSSDBG_TRACE_LIBS, ("pwd_expiration_warning is %d\n", val)); + DEBUG(SSSDBG_TRACE_LIBS, "pwd_expiration_warning is %d\n", val); if (val >= 0) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Setting domain password expiration warning to %d days\n", val)); + "Setting domain password expiration warning to %d days\n", val); /* The value is in days, transform it to seconds */ domain->pwd_expiration_warning = val * 24 * 3600; } @@ -1060,7 +1060,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, ret = get_entry_as_uint32(res->msgs[0], &domain->override_gid, CONFDB_DOMAIN_OVERRIDE_GID, 0); if (ret != EOK) { - DEBUG(0, ("Invalid value for [%s]\n", CONFDB_DOMAIN_OVERRIDE_GID)); + DEBUG(0, "Invalid value for [%s]\n", CONFDB_DOMAIN_OVERRIDE_GID); goto done; }
@@ -1118,13 +1118,13 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, ret = get_entry_as_bool(res->msgs[0], &domain->case_sensitive, CONFDB_DOMAIN_CASE_SENSITIVE, true); if(ret != EOK) { - DEBUG(0, ("Invalid value for %s\n", CONFDB_DOMAIN_CASE_SENSITIVE)); + DEBUG(0, "Invalid value for %s\n", CONFDB_DOMAIN_CASE_SENSITIVE); goto done; } if (domain->case_sensitive == false && strcasecmp(domain->provider, "local") == 0) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Local ID provider does not support the case insensitive flag\n")); + "Local ID provider does not support the case insensitive flag\n"); ret = EINVAL; goto done; } @@ -1137,7 +1137,7 @@ static int confdb_get_domain_internal(struct confdb_ctx *cdb, &domain->sd_enumerate, NULL); if (ret != 0) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Cannot parse %s\n", CONFDB_SUBDOMAIN_ENUMERATE)); + "Cannot parse %s\n", CONFDB_SUBDOMAIN_ENUMERATE); goto done; } } @@ -1170,19 +1170,19 @@ int confdb_get_domains(struct confdb_ctx *cdb, CONFDB_MONITOR_ACTIVE_DOMAINS, &domlist); if (ret == ENOENT) { - DEBUG(0, ("No domains configured, fatal error!\n")); + DEBUG(0, "No domains configured, fatal error!\n"); goto done; } if (ret != EOK ) { - DEBUG(0, ("Fatal error retrieving domains list!\n")); + DEBUG(0, "Fatal error retrieving domains list!\n"); goto done; }
for (i = 0; domlist[i]; i++) { ret = confdb_get_domain_internal(cdb, cdb, domlist[i], &domain); if (ret) { - DEBUG(0, ("Error (%d [%s]) retrieving domain [%s], skipping!\n", - ret, strerror(ret), domlist[i])); + DEBUG(0, "Error (%d [%s]) retrieving domain [%s], skipping!\n", + ret, strerror(ret), domlist[i]); continue; }
@@ -1190,7 +1190,7 @@ int confdb_get_domains(struct confdb_ctx *cdb, }
if (cdb->doms == NULL) { - DEBUG(0, ("No properly configured domains, fatal error!\n")); + DEBUG(0, "No properly configured domains, fatal error!\n"); ret = ENOENT; goto done; } diff --git a/src/confdb/confdb_setup.c b/src/confdb/confdb_setup.c index b13553e..01c9c7e 100644 --- a/src/confdb/confdb_setup.c +++ b/src/confdb/confdb_setup.c @@ -56,8 +56,8 @@ int confdb_test(struct confdb_ctx *cdb)
if (strcmp(values[0], CONFDB_VERSION) != 0) { /* Existing version does not match executable version */ - DEBUG(1, ("Upgrading confdb version from %s to %s\n", - values[0], CONFDB_VERSION)); + DEBUG(1, "Upgrading confdb version from %s to %s\n", + values[0], CONFDB_VERSION);
/* This is recoverable, since we purge the confdb file * when we re-initialize it. @@ -114,8 +114,8 @@ int confdb_create_base(struct confdb_ctx *cdb) while ((ldif = ldb_ldif_read_string(cdb->ldb, &base_ldif))) { ret = ldb_add(cdb->ldb, ldif->msg); if (ret != LDB_SUCCESS) { - DEBUG(0, ("Failed to initialize DB (%d,[%s]), aborting!\n", - ret, ldb_errstring(cdb->ldb))); + DEBUG(0, "Failed to initialize DB (%d,[%s]), aborting!\n", + ret, ldb_errstring(cdb->ldb)); return EIO; } ldb_ldif_read_free(cdb->ldb, ldif); @@ -141,13 +141,13 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb)
tmp_ctx = talloc_new(cdb); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory.\n"); return ENOMEM; }
init_data = sss_ini_initdata_init(tmp_ctx); if (!init_data) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory.\n"); ret = ENOMEM; goto done; } @@ -155,7 +155,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) /* Open config file */ ret = sss_ini_config_file_open(init_data, config_file); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to open configuration file.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to open configuration file.\n"); ret = EIO; goto done; } @@ -163,7 +163,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_config_access_check(init_data); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Permission check on config file failed.\n")); + "Permission check on config file failed.\n"); ret = EPERM; goto done; } @@ -174,7 +174,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_get_stat(init_data); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Status check on config file failed.\n")); + "Status check on config file failed.\n"); ret = errno; goto done; } @@ -184,7 +184,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_get_mtime(init_data, sizeof(timestr), timestr); if (ret <= 0 || ret >= sizeof(timestr)) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to convert time_t to string ??\n")); + "Failed to convert time_t to string ??\n"); ret = errno ? errno : EFAULT; } ret = confdb_get_string(cdb, tmp_ctx, "config", "lastUpdate", @@ -198,13 +198,13 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) goto done; } } else { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to get lastUpdate attribute.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to get lastUpdate attribute.\n"); goto done; }
ret = sss_ini_get_config(init_data, config_file); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to load configuration\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to load configuration\n"); goto done; }
@@ -212,7 +212,7 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = sss_ini_get_cfgobj(init_data, "sssd", "config_file_version"); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Internal error determining config_file_version\n")); + "Internal error determining config_file_version\n"); goto done; }
@@ -220,8 +220,8 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) if (ret != EOK) { /* No known version. Assumed to be version 1 */ DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file is an old version. " - "Please run configuration upgrade script.\n")); + "Config file is an old version. " + "Please run configuration upgrade script.\n"); ret = EINVAL; goto done; } @@ -229,17 +229,17 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) version = sss_ini_get_int_config_value(init_data, 1, -1, &ret); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file version could not be determined\n")); + "Config file version could not be determined\n"); goto done; } else if (version < CONFDB_VERSION_INT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file is an old version. " - "Please run configuration upgrade script.\n")); + "Config file is an old version. " + "Please run configuration upgrade script.\n"); ret = EINVAL; goto done; } else if (version > CONFDB_VERSION_INT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Config file version is newer than confdb\n")); + "Config file version is newer than confdb\n"); ret = EINVAL; goto done; } @@ -248,8 +248,8 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = ldb_transaction_start(cdb->ldb); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to start a transaction for " - "updating the configuration\n")); + "Failed to start a transaction for " + "updating the configuration\n"); ret = sysdb_error_to_errno(ret); goto done; } @@ -259,24 +259,24 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = confdb_purge(cdb); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not purge existing configuration\n")); + "Could not purge existing configuration\n"); goto done; }
ret = sss_confdb_create_ldif(tmp_ctx, init_data, &config_ldif); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not create LDIF for confdb\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not create LDIF for confdb\n"); goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("LDIF file to import: \n%s", config_ldif)); + DEBUG(SSSDBG_TRACE_LIBS, "LDIF file to import: \n%s", config_ldif);
while ((ldif = ldb_ldif_read_string(cdb->ldb, &config_ldif))) { ret = ldb_add(cdb->ldb, ldif->msg); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to initialize DB (%d,[%s]), aborting!\n", - ret, ldb_errstring(cdb->ldb))); + "Failed to initialize DB (%d,[%s]), aborting!\n", + ret, ldb_errstring(cdb->ldb)); ret = EIO; goto done; } @@ -289,13 +289,13 @@ int confdb_init_db(const char *config_file, struct confdb_ctx *cdb) ret = confdb_add_param(cdb, true, "config", "lastUpdate", vals); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set last update time on db!\n")); + "Failed to set last update time on db!\n"); goto done; }
ret = ldb_transaction_commit(cdb->ldb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -306,7 +306,7 @@ done: if (in_transaction) { sret = ldb_transaction_cancel(cdb->ldb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } }
diff --git a/src/db/sysdb.c b/src/db/sysdb.c index da5dbe8..80b6297 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -52,7 +52,7 @@ errno_t sysdb_ldb_connect(TALLOC_CTX *mem_ctx, const char *filename,
mod_path = getenv(LDB_MODULES_PATH); if (mod_path != NULL) { - DEBUG(9, ("Setting ldb module path to [%s].\n", mod_path)); + DEBUG(9, "Setting ldb module path to [%s].\n", mod_path); ldb_set_modules_dir(ldb, mod_path); }
@@ -667,21 +667,21 @@ int sysdb_attrs_users_from_str_list(struct sysdb_attrs *attrs, } el->values = vals;
- DEBUG(9, ("Adding %d members to existing %d ones\n", - num, el->num_values)); + DEBUG(9, "Adding %d members to existing %d ones\n", + num, el->num_values);
for (i = 0, j = el->num_values; i < num; i++) {
member = sysdb_user_strdn(el->values, domain, list[i]); if (!member) { - DEBUG(4, ("Failed to get user dn for [%s]\n", list[i])); + DEBUG(4, "Failed to get user dn for [%s]\n", list[i]); continue; } el->values[j].data = (uint8_t *)member; el->values[j].length = strlen(member); j++;
- DEBUG(7, (" member #%d: [%s]\n", i, member)); + DEBUG(7, " member #%d: [%s]\n", i, member); } el->num_values = j;
@@ -755,8 +755,8 @@ int sysdb_error_to_errno(int ldberr) return EINVAL; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("LDB returned unexpected error: [%s]\n", - ldb_strerror(ldberr))); + "LDB returned unexpected error: [%s]\n", + ldb_strerror(ldberr)); return EFAULT; } } @@ -769,7 +769,7 @@ int sysdb_transaction_start(struct sysdb_ctx *sysdb)
ret = ldb_transaction_start(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to start ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to start ldb transaction! (%d)\n", ret); } return sysdb_error_to_errno(ret); } @@ -780,7 +780,7 @@ int sysdb_transaction_commit(struct sysdb_ctx *sysdb)
ret = ldb_transaction_commit(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to commit ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to commit ldb transaction! (%d)\n", ret); } return sysdb_error_to_errno(ret); } @@ -791,7 +791,7 @@ int sysdb_transaction_cancel(struct sysdb_ctx *sysdb)
ret = ldb_transaction_cancel(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to cancel ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to cancel ldb transaction! (%d)\n", ret); } return sysdb_error_to_errno(ret); } @@ -852,10 +852,10 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name) /* do a synchronous add */ ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to initialize DB (%d, [%s]) " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) " "for domain %s!\n", ret, ldb_errstring(sysdb->ldb), - domain_name)); + domain_name); ret = EIO; goto done; } @@ -882,10 +882,10 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name) /* do a synchronous add */ ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to initialize DB (%d, [%s]) " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) " "for domain %s!\n", ret, ldb_errstring(sysdb->ldb), - domain_name)); + domain_name); ret = EIO; goto done; } @@ -912,10 +912,10 @@ errno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name) /* do a synchronous add */ ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to initialize DB (%d, [%s]) for " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to initialize DB (%d, [%s]) for " "domain %s!\n", ret, ldb_errstring(sysdb->ldb), - domain_name)); + domain_name); ret = EIO; goto done; } @@ -987,11 +987,11 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, if (ret != EOK) { goto done; } - DEBUG(5, ("DB File for %s: %s\n", domain->name, sysdb->ldb_file)); + DEBUG(5, "DB File for %s: %s\n", domain->name, sysdb->ldb_file);
ret = sysdb_ldb_connect(sysdb, sysdb->ldb_file, &sysdb->ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); goto done; }
@@ -1046,14 +1046,14 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx,
if (!allow_upgrade) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Wrong DB version (got %s expected %s)\n", - version, SYSDB_VERSION)); + "Wrong DB version (got %s expected %s)\n", + version, SYSDB_VERSION); ret = sysdb_version_check(SYSDB_VERSION, version); goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Upgrading DB [%s] from version: %s\n", - domain->name, version)); + DEBUG(SSSDBG_CONF_SETTINGS, "Upgrading DB [%s] from version: %s\n", + domain->name, version);
if (strcmp(version, SYSDB_VERSION_0_3) == 0) { ret = sysdb_upgrade_03(sysdb, &version); @@ -1153,13 +1153,13 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, talloc_zfree(sysdb->ldb); ret = sysdb_ldb_connect(sysdb, sysdb->ldb_file, &sysdb->ldb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_ldb_connect failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_ldb_connect failed.\n"); } goto done; }
- DEBUG(0,("Unknown DB version [%s], expected [%s] for domain %s!\n", - version?version:"not found", SYSDB_VERSION, domain->name)); + DEBUG(0,"Unknown DB version [%s], expected [%s] for domain %s!\n", + version?version:"not found", SYSDB_VERSION, domain->name); ret = sysdb_version_check(SYSDB_VERSION, version); goto done; } @@ -1170,8 +1170,8 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, while ((ldif = ldb_ldif_read_string(sysdb->ldb, &base_ldif))) { ret = ldb_add(sysdb->ldb, ldif->msg); if (ret != LDB_SUCCESS) { - DEBUG(0, ("Failed to initialize DB (%d, [%s]) for domain %s!\n", - ret, ldb_errstring(sysdb->ldb), domain->name)); + DEBUG(0, "Failed to initialize DB (%d, [%s]) for domain %s!\n", + ret, ldb_errstring(sysdb->ldb), domain->name); ret = EIO; goto done; } @@ -1192,7 +1192,7 @@ int sysdb_domain_init_internal(TALLOC_CTX *mem_ctx, talloc_zfree(sysdb->ldb); ret = sysdb_ldb_connect(sysdb, sysdb->ldb_file, &sysdb->ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); }
done: @@ -1269,7 +1269,7 @@ int sysdb_attrs_replace_name(struct sysdb_attrs *attrs, const char *oldname, e = &(attrs->a[i]); } if (strcasecmp(newname, attrs->a[i].name) == 0) { - DEBUG(3, ("New attribute name [%s] already exists.\n", newname)); + DEBUG(3, "New attribute name [%s] already exists.\n", newname); return EEXIST; } } @@ -1277,7 +1277,7 @@ int sysdb_attrs_replace_name(struct sysdb_attrs *attrs, const char *oldname, if (e != NULL) { dummy = talloc_strdup(attrs, newname); if (dummy == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); return ENOMEM; }
@@ -1399,7 +1399,7 @@ errno_t sysdb_get_bool(struct sysdb_ctx *sysdb, goto done; } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } @@ -1456,7 +1456,7 @@ errno_t sysdb_set_bool(struct sysdb_ctx *sysdb, } } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } else { @@ -1582,7 +1582,7 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb, goto done; } if (orig_dn_el->num_values == 0) { - DEBUG(1, ("Original DN is not available.\n")); + DEBUG(1, "Original DN is not available.\n"); ret = EINVAL; goto done; } else if (orig_dn_el->num_values == 1) { @@ -1591,26 +1591,26 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb, &rdn_attr, &rdn_val); if (ret != EOK) { - DEBUG(1, ("Could not get rdn from [%s]\n", - (const char *) orig_dn_el->values[0].data)); + DEBUG(1, "Could not get rdn from [%s]\n", + (const char *) orig_dn_el->values[0].data); goto done; } } else { - DEBUG(1, ("Should not have more than one origDN\n")); + DEBUG(1, "Should not have more than one origDN\n"); ret = EINVAL; goto done; }
/* First check whether the attribute name matches */ - DEBUG(8, ("Comparing attribute names [%s] and [%s]\n", - rdn_attr, ldap_attr)); + DEBUG(8, "Comparing attribute names [%s] and [%s]\n", + rdn_attr, ldap_attr); if (strcasecmp(rdn_attr, ldap_attr) != 0) { /* Multiple entries, and the RDN attribute doesn't match. * We have no way of resolving this deterministically, * so we'll use the first value as a fallback. */ - DEBUG(3, ("The entry has multiple names and the RDN attribute does " - "not match. Will use the first value as fallback.\n")); + DEBUG(3, "The entry has multiple names and the RDN attribute does " + "not match. Will use the first value as fallback.\n"); *_primary = (const char *)sysdb_name_el->values[0].data; ret = EOK; goto done; @@ -1631,7 +1631,7 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb, * throw up our hands. There's no deterministic way to * decide which name is correct. */ - DEBUG(1, ("Cannot save entry. Unable to determine groupname\n")); + DEBUG(1, "Cannot save entry. Unable to determine groupname\n"); ret = EINVAL; goto done; } @@ -1640,8 +1640,8 @@ errno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb,
done: if (ret != EOK) { - DEBUG(1, ("Could not determine primary name: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Could not determine primary name: [%d][%s]\n", + ret, strerror(ret)); } talloc_free(tmp_ctx); return ret; @@ -1694,7 +1694,7 @@ errno_t sysdb_attrs_get_aliases(TALLOC_CTX *mem_ctx,
if (lowercase) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Domain is case-insensitive; will add lowercased aliases\n")); + "Domain is case-insensitive; will add lowercased aliases\n"); }
ai = 0; @@ -1772,7 +1772,7 @@ errno_t sysdb_attrs_primary_name_list(struct sysdb_ctx *sysdb, ldap_attr, &name); if (ret != EOK) { - DEBUG(1, ("Could not determine primary name\n")); + DEBUG(1, "Could not determine primary name\n"); /* Skip and continue. Don't advance 'j' */ continue; } @@ -1818,7 +1818,7 @@ errno_t sysdb_get_real_name(TALLOC_CTX *mem_ctx,
ret = sysdb_getpwnam(tmp_ctx, sysdb, domain, name, &res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot canonicalize username\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot canonicalize username\n"); goto done; }
@@ -1828,14 +1828,14 @@ errno_t sysdb_get_real_name(TALLOC_CTX *mem_ctx, goto done; } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sysdb_getpwnam returned count: [%d]\n", res->count)); + "sysdb_getpwnam returned count: [%d]\n", res->count); ret = EIO; goto done; }
cname = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_NAME, NULL); if (!cname) { - DEBUG(SSSDBG_CRIT_FAILURE, ("A user with no name?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "A user with no name?\n"); ret = ENOENT; goto done; } @@ -1856,14 +1856,14 @@ errno_t sysdb_msg2attrs(TALLOC_CTX *mem_ctx, size_t count,
a = talloc_array(mem_ctx, struct sysdb_attrs *, count); if (a == NULL) { - DEBUG(1, ("talloc_array failed.\n")); + DEBUG(1, "talloc_array failed.\n"); return ENOMEM; }
for (i = 0; i < count; i++) { a[i] = talloc(a, struct sysdb_attrs); if (a[i] == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); talloc_free(a); return ENOMEM; } diff --git a/src/db/sysdb_autofs.c b/src/db/sysdb_autofs.c index cb96856..ce21487 100644 --- a/src/db/sysdb_autofs.c +++ b/src/db/sysdb_autofs.c @@ -110,7 +110,7 @@ sysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx, errno_t ret; TALLOC_CTX *tmp_ctx;
- DEBUG(SSSDBG_TRACE_FUNC, ("Adding autofs map %s\n", autofsmapname)); + DEBUG(SSSDBG_TRACE_FUNC, "Adding autofs map %s\n", autofsmapname);
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -128,29 +128,29 @@ sysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx, ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_AUTOFS_MAP_OC); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set map object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set map object class [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_MAP_NAME, autofsmapname); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set map name [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set map name [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set name attribute [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_attrs_add_time_t(attrs, SYSDB_LAST_UPDATE, now); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set sysdb lastUpdate [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb lastUpdate [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -158,15 +158,15 @@ sysdb_save_autofsmap(struct sysdb_ctx *sysdb_ctx, ((cache_timeout) ? (now + cache_timeout) : 0)); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set sysdb cache expire [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb cache expire [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_store_custom(sysdb_ctx, domain, name, AUTOFS_MAP_SUBDIR, attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_store_custom failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_custom failed [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -181,7 +181,7 @@ sysdb_delete_autofsmap(struct sysdb_ctx *sysdb_ctx, struct sss_domain_info *domain, const char *name) { - DEBUG(SSSDBG_TRACE_FUNC, ("Deleting autofs map %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Deleting autofs map %s\n", name); return sysdb_delete_custom(sysdb_ctx, domain, name, AUTOFS_MAP_SUBDIR); }
@@ -211,8 +211,8 @@ sysdb_get_map_byname(TALLOC_CTX *mem_ctx, ret = sss_filter_sanitize(tmp_ctx, map_name, &safe_map_name); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot sanitize map [%s] error [%d]: %s\n", - map_name, ret, strerror(ret))); + "Cannot sanitize map [%s] error [%d]: %s\n", + map_name, ret, strerror(ret)); goto done; }
@@ -228,17 +228,17 @@ sysdb_get_map_byname(TALLOC_CTX *mem_ctx, &count, &msgs); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error looking up autofs map [%s]", safe_map_name)); + "Error looking up autofs map [%s]", safe_map_name); goto done; } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such map\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such map\n"); *_map = NULL; goto done; }
if (count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("More than one map named %s\n", safe_map_name)); + "More than one map named %s\n", safe_map_name); goto done; }
@@ -264,7 +264,7 @@ sysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx, const char *name;
DEBUG(SSSDBG_TRACE_FUNC, - ("Adding autofs entry [%s] - [%s]\n", key, value)); + "Adding autofs entry [%s] - [%s]\n", key, value);
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -282,22 +282,22 @@ sysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx, ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_AUTOFS_ENTRY_OC); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set entry object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set entry object class [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_ENTRY_KEY, key); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set entry key [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set entry key [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_AUTOFS_ENTRY_VALUE, value); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set entry key [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set entry key [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -309,8 +309,8 @@ sysdb_save_autofsentry(struct sysdb_ctx *sysdb_ctx,
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set name attribute [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -372,7 +372,7 @@ sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, struct ldb_message **msgs; struct ldb_dn *mapdn;
- DEBUG(SSSDBG_TRACE_FUNC, ("Getting entries for map %s\n", mapname)); + DEBUG(SSSDBG_TRACE_FUNC, "Getting entries for map %s\n", mapname);
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -395,10 +395,10 @@ sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, ret = sysdb_search_entry(tmp_ctx, sysdb, mapdn, LDB_SCOPE_ONELEVEL, filter, attrs, &count, &msgs); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb search failed: %d\n", ret)); + DEBUG(SSSDBG_OP_FAILURE, "sysdb search failed: %d\n", ret); goto done; } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No entries for the map\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No entries for the map\n"); *_count = 0; *_entries = NULL; goto done; @@ -407,8 +407,8 @@ sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx, *_count = count; *_entries = talloc_steal(mem_ctx, msgs); ret = EOK; - DEBUG(SSSDBG_TRACE_INTERNAL, ("found %zu entries for map %s\n", - count, mapname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "found %zu entries for map %s\n", + count, mapname); done: talloc_free(tmp_ctx); return ret; @@ -477,7 +477,7 @@ sysdb_invalidate_autofs_maps(struct sysdb_ctx *sysdb, &count, &msgs); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error looking up autofs maps")); + "Error looking up autofs maps"); goto done; } else if (ret == ENOENT) { ret = EOK; @@ -497,7 +497,7 @@ sysdb_invalidate_autofs_maps(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -505,21 +505,21 @@ sysdb_invalidate_autofs_maps(struct sysdb_ctx *sysdb, for (i = 0; i < count; i++) { name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (!name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("A map with no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "A map with no name?\n"); continue; }
ret = sysdb_set_autofsmap_attr(sysdb, domain, name, sys_attrs, SYSDB_MOD_REP); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not expire map %s\n", name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not expire map %s\n", name); continue; } }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not commit transaction\n"); goto done; } in_transaction = false; @@ -529,7 +529,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); diff --git a/src/db/sysdb_idmap.c b/src/db/sysdb_idmap.c index 7b46ae6..1b8f484 100644 --- a/src/db/sysdb_idmap.c +++ b/src/db/sysdb_idmap.c @@ -37,7 +37,7 @@ sysdb_idmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, return NULL; }
- DEBUG(SSSDBG_TRACE_ALL, (SYSDB_TMPL_IDMAP"\n", clean_sid, domain->name)); + DEBUG(SSSDBG_TRACE_ALL, SYSDB_TMPL_IDMAP"\n", clean_sid, domain->name);
dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_IDMAP, clean_sid, domain->name); @@ -83,7 +83,7 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }
@@ -102,8 +102,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, } else if (ret == ENOENT) { /* Create a new mapping */ DEBUG(SSSDBG_CONF_SETTINGS, - ("Adding new ID mapping [%s][%s][%lu]\n", - dom_name, dom_sid, (unsigned long)slice_num)); + "Adding new ID mapping [%s][%s][%lu]\n", + dom_name, dom_sid, (unsigned long)slice_num);
/* Add the objectClass */ lret = ldb_msg_add_empty(update_msg, SYSDB_OBJECTCLASS, @@ -170,8 +170,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, lret = ldb_add(sysdb->ldb, update_msg); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add mapping: [%s]\n", - ldb_strerror(lret))); + "Failed to add mapping: [%s]\n", + ldb_strerror(lret)); ret = sysdb_error_to_errno(lret); goto done; } @@ -187,17 +187,17 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, -1); if (old_slice == -1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not identify original slice for SID [%s]\n", - dom_sid)); + "Could not identify original slice for SID [%s]\n", + dom_sid); ret = ENOENT; goto done; }
if (slice_num != old_slice) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Detected attempt to change slice value for sid [%s] " + "Detected attempt to change slice value for sid [%s] " "This will break existing users. Refusing to perform.\n", - dom_sid)); + dom_sid); ret = EINVAL; goto done; } @@ -209,8 +209,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, old_name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (!old_name) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not identify original domain name of SID [%s]\n", - dom_sid)); + "Could not identify original domain name of SID [%s]\n", + dom_sid); ret = ENOENT; goto done; } @@ -220,14 +220,14 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, * make any changes here. Just return success. */ DEBUG(SSSDBG_TRACE_LIBS, - ("No changes needed, canceling transaction\n")); + "No changes needed, canceling transaction\n"); ret = EOK; goto done; } else { /* The name has changed. Replace it */ DEBUG(SSSDBG_CONF_SETTINGS, - ("Changing domain name of SID [%s] from [%s] to [%s]\n", - dom_sid, old_name, dom_name)); + "Changing domain name of SID [%s] from [%s] to [%s]\n", + dom_sid, old_name, dom_name);
/* Set the new name */ lret = ldb_msg_add_empty(update_msg, SYSDB_NAME, @@ -248,8 +248,8 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, lret = ldb_modify(sysdb->ldb, update_msg); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to update mapping: [%s]\n", - ldb_strerror(lret))); + "Failed to update mapping: [%s]\n", + ldb_strerror(lret)); ret = sysdb_error_to_errno(lret); goto done; } @@ -258,7 +258,7 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not commit transaction: [%s]\n", strerror(ret))); + "Could not commit transaction: [%s]\n", strerror(ret)); goto done; } in_transaction = false; @@ -268,7 +268,7 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction\n")); + "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -291,7 +291,7 @@ sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(NULL); if (!tmp_ctx) return ENOMEM;
- DEBUG(SSSDBG_TRACE_ALL, (SYSDB_TMPL_IDMAP_BASE"\n", domain->name)); + DEBUG(SSSDBG_TRACE_ALL, SYSDB_TMPL_IDMAP_BASE"\n", domain->name);
base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_IDMAP_BASE, domain->name); @@ -304,8 +304,8 @@ sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx, LDB_SCOPE_SUBTREE, attrs, SYSDB_IDMAP_FILTER); if (lret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not locate ID mappings: [%s]\n", - ldb_strerror(lret))); + "Could not locate ID mappings: [%s]\n", + ldb_strerror(lret)); ret = sysdb_error_to_errno(lret); goto done; } diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index ca23fad..a6abdce 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -132,8 +132,8 @@ int sysdb_delete_entry(struct sysdb_ctx *sysdb, } /* fall through */ default: - DEBUG(1, ("LDB Error: %s(%d)\nError Message: [%s]\n", - ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb))); + DEBUG(1, "LDB Error: %s(%d)\nError Message: [%s]\n", + ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)); return sysdb_error_to_errno(ret); } } @@ -170,19 +170,19 @@ int sysdb_delete_recursive(struct sysdb_ctx *sysdb, ret = EOK; } if (ret) { - DEBUG(6, ("Search error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Search error: %d (%s)\n", ret, strerror(ret)); } goto done; }
- DEBUG(SSSDBG_TRACE_ALL, ("Found [%zu] items to delete.\n", msgs_count)); + DEBUG(SSSDBG_TRACE_ALL, "Found [%zu] items to delete.\n", msgs_count);
qsort(msgs, msgs_count, sizeof(struct ldb_message *), compare_ldb_dn_comp_num);
for (i = 0; i < msgs_count; i++) { - DEBUG(9 ,("Trying to delete [%s].\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(9 ,"Trying to delete [%s].\n", + ldb_dn_get_linearized(msgs[i]->dn));
ret = sysdb_delete_entry(sysdb, msgs[i]->dn, false); if (ret) { @@ -280,10 +280,10 @@ int sysdb_search_entry_by_sid_str(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); }
talloc_zfree(tmp_ctx); @@ -342,10 +342,10 @@ int sysdb_search_user_by_name(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -398,10 +398,10 @@ int sysdb_search_user_by_uid(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); }
talloc_zfree(tmp_ctx); @@ -459,10 +459,10 @@ int sysdb_search_group_by_name(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -515,10 +515,10 @@ int sysdb_search_group_by_gid(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); }
talloc_zfree(tmp_ctx); @@ -576,10 +576,10 @@ int sysdb_search_netgroup_by_name(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -631,17 +631,17 @@ int sysdb_set_entry_attr(struct sysdb_ctx *sysdb, lret = ldb_modify(sysdb->ldb, msg); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldb_modify failed: [%s]\n", ldb_strerror(lret))); + "ldb_modify failed: [%s]\n", ldb_strerror(lret)); }
ret = sysdb_error_to_errno(lret);
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -791,7 +791,7 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, case EOK: new_id = get_attr_as_uint32(msgs[0], SYSDB_NEXTID); if (new_id == (uint32_t)(-1)) { - DEBUG(1, ("Invalid Next ID in domain %s\n", domain->name)); + DEBUG(1, "Invalid Next ID in domain %s\n", domain->name); ret = ERANGE; goto done; } @@ -801,8 +801,8 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, }
if ((domain->id_max != 0) && (new_id > domain->id_max)) { - DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n", - new_id, domain->id_max)); + DEBUG(0, "Failed to allocate new id, out of range (%u/%u)\n", + new_id, domain->id_max); ret = ERANGE; goto done; } @@ -836,7 +836,7 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, SYSDB_GIDNUM, new_id); } if (!filter) { - DEBUG(6, ("Error: Out of memory\n")); + DEBUG(6, "Error: Out of memory\n"); ret = ENOMEM; goto done; } @@ -861,8 +861,8 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb,
/* check again we are not falling out of range */ if ((domain->id_max != 0) && (new_id > domain->id_max)) { - DEBUG(0, ("Failed to allocate new id, out of range (%u/%u)\n", - new_id, domain->id_max)); + DEBUG(0, "Failed to allocate new id, out of range (%u/%u)\n", + new_id, domain->id_max); ret = ERANGE; goto done; } @@ -881,7 +881,7 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, /* finally store the new next id */ msg = ldb_msg_new(tmp_ctx); if (!msg) { - DEBUG(6, ("Error: Out of memory\n")); + DEBUG(6, "Error: Out of memory\n"); ret = ENOMEM; goto done; } @@ -906,7 +906,7 @@ done: ldb_transaction_cancel(sysdb->ldb); } if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -987,7 +987,7 @@ int sysdb_add_basic_user(struct sysdb_ctx *sysdb,
done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1190,7 +1190,7 @@ int sysdb_add_user(struct sysdb_ctx *sysdb,
if (domain->mpg) { if (gid != 0) { - DEBUG(0, ("Cannot add user with arbitrary GID in MPG domain!\n")); + DEBUG(0, "Cannot add user with arbitrary GID in MPG domain!\n"); return EINVAL; } gid = uid; @@ -1199,16 +1199,16 @@ int sysdb_add_user(struct sysdb_ctx *sysdb, if (domain->id_max != 0 && uid != 0 && (uid < domain->id_min || uid > domain->id_max)) { DEBUG(SSSDBG_OP_FAILURE, - ("Supplied uid [%"SPRIuid"] is not in the allowed range " - "[%d-%d].\n", uid, domain->id_min, domain->id_max)); + "Supplied uid [%"SPRIuid"] is not in the allowed range " + "[%d-%d].\n", uid, domain->id_min, domain->id_max); return ERANGE; }
if (domain->id_max != 0 && gid != 0 && (gid < domain->id_min || gid > domain->id_max)) { DEBUG(SSSDBG_OP_FAILURE, - ("Supplied gid [%"SPRIgid"] is not in the allowed range " - "[%d-%d].\n", gid, domain->id_min, domain->id_max)); + "Supplied gid [%"SPRIgid"] is not in the allowed range " + "[%d-%d].\n", gid, domain->id_min, domain->id_max); return ERANGE; }
@@ -1315,7 +1315,7 @@ done: ret = ldb_transaction_commit(sysdb->ldb); ret = sysdb_error_to_errno(ret); } else { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1368,7 +1368,7 @@ int sysdb_add_basic_group(struct sysdb_ctx *sysdb,
done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1393,8 +1393,8 @@ int sysdb_add_group(struct sysdb_ctx *sysdb, if (domain->id_max != 0 && gid != 0 && (gid < domain->id_min || gid > domain->id_max)) { DEBUG(SSSDBG_OP_FAILURE, - ("Supplied gid [%"SPRIgid"] is not in the allowed range " - "[%d-%d].\n", gid, domain->id_min, domain->id_max)); + "Supplied gid [%"SPRIgid"] is not in the allowed range " + "[%d-%d].\n", gid, domain->id_min, domain->id_max); return ERANGE; }
@@ -1482,7 +1482,7 @@ done: ret = ldb_transaction_commit(sysdb->ldb); ret = sysdb_error_to_errno(ret); } else { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1545,7 +1545,7 @@ int sysdb_add_incomplete_group(struct sysdb_ctx *sysdb,
done: if (ret != EOK) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1589,7 +1589,7 @@ int sysdb_mod_group_member(struct sysdb_ctx *sysdb,
fail: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(msg); return ret; @@ -1638,7 +1638,7 @@ int sysdb_add_basic_netgroup(struct sysdb_ctx *sysdb,
done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(msg); return ret; @@ -1702,7 +1702,7 @@ int sysdb_add_netgroup(struct sysdb_ctx *sysdb, SYSDB_MEMBER_NETGROUP, missing); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not remove missing attributes\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not remove missing attributes\n"); } }
@@ -1713,7 +1713,7 @@ done: }
if (ret != EOK) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } talloc_zfree(tmp_ctx); @@ -1765,7 +1765,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; }
@@ -1800,8 +1800,8 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, goto fail; } DEBUG(SSSDBG_MINOR_FAILURE, - ("A user with the same UID [%llu] was removed from the " - "cache\n", (unsigned long long) uid)); + "A user with the same UID [%llu] was removed from the " + "cache\n", (unsigned long long) uid); ret = sysdb_add_user(sysdb, domain, name, uid, gid, gecos, homedir, shell, orig_dn, attrs, cache_timeout, now); } @@ -1810,7 +1810,7 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, if (ret == EOK) { goto done; } else { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add user\n"); goto fail; } } @@ -1862,14 +1862,14 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, SYSDB_MEMBER_USER, remove_attrs); if (ret != EOK) { - DEBUG(4, ("Could not remove missing attributes\n")); + DEBUG(4, "Could not remove missing attributes\n"); } }
done: ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; }
@@ -1879,12 +1879,12 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } }
if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -1957,8 +1957,8 @@ int sysdb_store_group(struct sysdb_ctx *sysdb, goto done; } DEBUG(SSSDBG_MINOR_FAILURE, - ("A group with the same GID [%llu] was removed from the " - "cache\n", (unsigned long long) gid)); + "A group with the same GID [%llu] was removed from the " + "cache\n", (unsigned long long) gid); ret = sysdb_add_group(sysdb, domain, name, gid, attrs, cache_timeout, now); } @@ -1983,7 +1983,7 @@ int sysdb_store_group(struct sysdb_ctx *sysdb,
done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2086,13 +2086,13 @@ int sysdb_cache_password(struct sysdb_ctx *sysdb,
ret = s3crypt_gen_salt(tmp_ctx, &salt); if (ret) { - DEBUG(4, ("Failed to generate random salt.\n")); + DEBUG(4, "Failed to generate random salt.\n"); goto fail; }
ret = s3crypt_sha512(tmp_ctx, password, salt, &hash); if (ret) { - DEBUG(4, ("Failed to create password hash.\n")); + DEBUG(4, "Failed to create password hash.\n"); goto fail; }
@@ -2123,7 +2123,7 @@ int sysdb_cache_password(struct sysdb_ctx *sysdb,
fail: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2149,11 +2149,11 @@ int sysdb_search_custom(TALLOC_CTX *mem_ctx,
basedn = sysdb_custom_subtree_dn(sysdb, mem_ctx, domain, subtree_name); if (basedn == NULL) { - DEBUG(1, ("sysdb_custom_subtree_dn failed.\n")); + DEBUG(1, "sysdb_custom_subtree_dn failed.\n"); return ENOMEM; } if (!ldb_dn_validate(basedn)) { - DEBUG(1, ("Failed to create DN.\n")); + DEBUG(1, "Failed to create DN.\n"); return EINVAL; }
@@ -2190,12 +2190,12 @@ int sysdb_search_custom_by_name(TALLOC_CTX *mem_ctx, basedn = sysdb_custom_dn(sysdb, tmp_ctx, domain, object_name, subtree_name); if (basedn == NULL) { - DEBUG(1, ("sysdb_custom_dn failed.\n")); + DEBUG(1, "sysdb_custom_dn failed.\n"); ret = ENOMEM; goto done; } if (!ldb_dn_validate(basedn)) { - DEBUG(1, ("Failed to create DN.\n")); + DEBUG(1, "Failed to create DN.\n"); ret = EINVAL; goto done; } @@ -2207,7 +2207,7 @@ int sysdb_search_custom_by_name(TALLOC_CTX *mem_ctx, }
if (count > 1) { - DEBUG(1, ("More than one result found.\n")); + DEBUG(1, "More than one result found.\n"); ret = EFAULT; goto done; } @@ -2274,7 +2274,7 @@ int sysdb_store_custom(struct sysdb_ctx *sysdb, msg->dn = sysdb_custom_dn(sysdb, tmp_ctx, domain, object_name, subtree_name); if (!msg->dn) { - DEBUG(1, ("sysdb_custom_dn failed.\n")); + DEBUG(1, "sysdb_custom_dn failed.\n"); ret = ENOMEM; goto done; } @@ -2306,14 +2306,14 @@ int sysdb_store_custom(struct sysdb_ctx *sysdb, ret = ldb_modify(sysdb->ldb, msg); } if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to store custom entry: %s(%d)[%s]\n", - ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb))); + DEBUG(1, "Failed to store custom entry: %s(%d)[%s]\n", + ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)); ret = sysdb_error_to_errno(ret); }
done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); ldb_transaction_cancel(sysdb->ldb); } else { ret = ldb_transaction_commit(sysdb->ldb); @@ -2346,7 +2346,7 @@ int sysdb_delete_custom(struct sysdb_ctx *sysdb, dn = sysdb_custom_dn(sysdb, tmp_ctx, domain, object_name, subtree_name); if (dn == NULL) { - DEBUG(1, ("sysdb_custom_dn failed.\n")); + DEBUG(1, "sysdb_custom_dn failed.\n"); ret = ENOMEM; goto done; } @@ -2360,8 +2360,8 @@ int sysdb_delete_custom(struct sysdb_ctx *sysdb, break;
default: - DEBUG(1, ("LDB Error: %s(%d)\nError Message: [%s]\n", - ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb))); + DEBUG(1, "LDB Error: %s(%d)\nError Message: [%s]\n", + ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)); ret = sysdb_error_to_errno(ret); break; } @@ -2457,10 +2457,10 @@ int sysdb_asq_search(TALLOC_CTX *mem_ctx,
fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2489,20 +2489,20 @@ int sysdb_search_users(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_USER_BASE, domain->name); if (!basedn) { - DEBUG(2, ("Failed to build base dn\n")); + DEBUG(2, "Failed to build base dn\n"); ret = ENOMEM; goto fail; }
filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_UC, sub_filter); if (!filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Search users with filter: %s\n", filter)); + "Search users with filter: %s\n", filter);
ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2516,10 +2516,10 @@ int sysdb_search_users(TALLOC_CTX *mem_ctx,
fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2561,7 +2561,7 @@ int sysdb_delete_user(struct sysdb_ctx *sysdb, c_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); c_uid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); if (c_name == NULL || c_uid == 0) { - DEBUG(2, ("Attribute is missing but this should never happen!\n")); + DEBUG(2, "Attribute is missing but this should never happen!\n"); ret = EFAULT; goto fail; } @@ -2618,7 +2618,7 @@ int sysdb_delete_user(struct sysdb_ctx *sysdb, return EOK;
fail: - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); talloc_zfree(tmp_ctx); return ret; } @@ -2647,20 +2647,20 @@ int sysdb_search_groups(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_GROUP_BASE, domain->name); if (!basedn) { - DEBUG(2, ("Failed to build base dn\n")); + DEBUG(2, "Failed to build base dn\n"); ret = ENOMEM; goto fail; }
filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_GC, sub_filter); if (!filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Search groups with filter: %s\n", filter)); + "Search groups with filter: %s\n", filter);
ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2674,10 +2674,10 @@ int sysdb_search_groups(TALLOC_CTX *mem_ctx,
fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2717,7 +2717,7 @@ int sysdb_delete_group(struct sysdb_ctx *sysdb, c_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); c_gid = ldb_msg_find_attr_as_uint64(msg, SYSDB_GIDNUM, 0); if (c_name == NULL || c_gid == 0) { - DEBUG(2, ("Attribute is missing but this should never happen!\n")); + DEBUG(2, "Attribute is missing but this should never happen!\n"); ret = EFAULT; goto fail; } @@ -2737,7 +2737,7 @@ int sysdb_delete_group(struct sysdb_ctx *sysdb, return EOK;
fail: - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); talloc_zfree(tmp_ctx); return ret; } @@ -2765,19 +2765,19 @@ int sysdb_search_netgroups(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_NETGROUP_BASE, domain->name); if (!basedn) { - DEBUG(2, ("Failed to build base dn\n")); + DEBUG(2, "Failed to build base dn\n"); ret = ENOMEM; goto fail; }
filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_NC, sub_filter); if (!filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; }
- DEBUG(6, ("Search netgroups with filter: %s\n", filter)); + DEBUG(6, "Search netgroups with filter: %s\n", filter);
ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -2791,9 +2791,9 @@ int sysdb_search_netgroups(TALLOC_CTX *mem_ctx,
fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("Entry not found\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Entry not found\n"); } else { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -2819,11 +2819,11 @@ int sysdb_delete_netgroup(struct sysdb_ctx *sysdb, ret = sysdb_search_netgroup_by_name(tmp_ctx, sysdb, domain, name, NULL, &msg); if (ret != EOK && ret != ENOENT) { - DEBUG(6, ("sysdb_search_netgroup_by_name failed: %d (%s)\n", - ret, strerror(ret))); + DEBUG(6, "sysdb_search_netgroup_by_name failed: %d (%s)\n", + ret, strerror(ret)); goto done; } else if (ret == ENOENT) { - DEBUG(6, ("Netgroup does not exist, nothing to delete\n")); + DEBUG(6, "Netgroup does not exist, nothing to delete\n"); ret = EOK; goto done; } @@ -2835,7 +2835,7 @@ int sysdb_delete_netgroup(struct sysdb_ctx *sysdb,
done: if (ret != EOK) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(tmp_ctx); return ret; @@ -2871,8 +2871,8 @@ errno_t check_failed_login_attempts(struct confdb_ctx *cdb, CONFDB_DEFAULT_PAM_FAILED_LOGIN_ATTEMPTS, &allowed_failed_login_attempts); if (ret != EOK) { - DEBUG(1, ("Failed to read the number of allowed failed login " - "attempts.\n")); + DEBUG(1, "Failed to read the number of allowed failed login " + "attempts.\n"); ret = ERR_INTERNAL; goto done; } @@ -2881,30 +2881,30 @@ errno_t check_failed_login_attempts(struct confdb_ctx *cdb, CONFDB_DEFAULT_PAM_FAILED_LOGIN_DELAY, &failed_login_delay); if (ret != EOK) { - DEBUG(1, ("Failed to read the failed login delay.\n")); + DEBUG(1, "Failed to read the failed login delay.\n"); ret = ERR_INTERNAL; goto done; } - DEBUG(9, ("Failed login attempts [%d], allowed failed login attempts [%d], " + DEBUG(9, "Failed login attempts [%d], allowed failed login attempts [%d], " "failed login delay [%d].\n", *failed_login_attempts, - allowed_failed_login_attempts, failed_login_delay)); + allowed_failed_login_attempts, failed_login_delay);
if (allowed_failed_login_attempts) { if (*failed_login_attempts >= allowed_failed_login_attempts) { if (failed_login_delay) { end = last_failed_login + (failed_login_delay * 60); if (end < time(NULL)) { - DEBUG(7, ("failed_login_delay has passed, " - "resetting failed_login_attempts.\n")); + DEBUG(7, "failed_login_delay has passed, " + "resetting failed_login_attempts.\n"); *failed_login_attempts = 0; } else { - DEBUG(7, ("login delayed until %lld.\n", (long long) end)); + DEBUG(7, "login delayed until %lld.\n", (long long) end); *delayed_until = end; ret = ERR_AUTH_DENIED; goto done; } } else { - DEBUG(4, ("Too many failed logins.\n")); + DEBUG(4, "Too many failed logins.\n"); ret = ERR_AUTH_DENIED; goto done; } @@ -2945,22 +2945,22 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, int ret;
if (name == NULL || *name == '\0') { - DEBUG(1, ("Missing user name.\n")); + DEBUG(1, "Missing user name.\n"); return EINVAL; }
if (cdb == NULL) { - DEBUG(1, ("Missing config db context.\n")); + DEBUG(1, "Missing config db context.\n"); return EINVAL; }
if (sysdb == NULL) { - DEBUG(1, ("Missing sysdb db context.\n")); + DEBUG(1, "Missing sysdb db context.\n"); return EINVAL; }
if (!domain->cache_credentials) { - DEBUG(3, ("Cached credentials not available.\n")); + DEBUG(3, "Cached credentials not available.\n"); return EINVAL; }
@@ -2979,8 +2979,8 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain, name, attrs, &ldb_msg); if (ret != EOK) { - DEBUG(1, ("sysdb_search_user_by_name failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_search_user_by_name failed [%d][%s].\n", + ret, strerror(ret)); if (ret == ENOENT) ret = ERR_ACCOUNT_UNKNOWN; goto done; } @@ -2993,16 +2993,16 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = confdb_get_int(cdb, CONFDB_PAM_CONF_ENTRY, CONFDB_PAM_CRED_TIMEOUT, 0, &cred_expiration); if (ret != EOK) { - DEBUG(1, ("Failed to read expiration time of offline credentials.\n")); + DEBUG(1, "Failed to read expiration time of offline credentials.\n"); goto done; } - DEBUG(9, ("Offline credentials expiration is [%d] days.\n", - cred_expiration)); + DEBUG(9, "Offline credentials expiration is [%d] days.\n", + cred_expiration);
if (cred_expiration) { expire_date = lastLogin + (cred_expiration * 86400); if (expire_date < time(NULL)) { - DEBUG(4, ("Cached user entry is too old.\n")); + DEBUG(4, "Cached user entry is too old.\n"); expire_date = 0; ret = ERR_CACHED_CREDS_EXPIRED; goto done; @@ -3014,7 +3014,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = check_failed_login_attempts(cdb, ldb_msg, &failed_login_attempts, &delayed_until); if (ret != EOK) { - DEBUG(1, ("Failed to check login attempts\n")); + DEBUG(1, "Failed to check login attempts\n"); goto done; }
@@ -3022,28 +3022,28 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb,
userhash = ldb_msg_find_attr_as_string(ldb_msg, SYSDB_CACHEDPWD, NULL); if (userhash == NULL || *userhash == '\0') { - DEBUG(4, ("Cached credentials not available.\n")); + DEBUG(4, "Cached credentials not available.\n"); ret = ERR_NO_CACHED_CREDS; goto done; }
ret = s3crypt_sha512(tmp_ctx, password, userhash, &comphash); if (ret) { - DEBUG(4, ("Failed to create password hash.\n")); + DEBUG(4, "Failed to create password hash.\n"); ret = ERR_INTERNAL; goto done; }
update_attrs = sysdb_new_attrs(tmp_ctx); if (update_attrs == NULL) { - DEBUG(1, ("sysdb_new_attrs failed.\n")); + DEBUG(1, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; }
if (strcmp(userhash, comphash) == 0) { /* TODO: probable good point for audit logging */ - DEBUG(4, ("Hashes do match!\n")); + DEBUG(4, "Hashes do match!\n"); authentication_successful = true;
if (just_check) { @@ -3054,8 +3054,8 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_time_t(update_attrs, SYSDB_LAST_LOGIN, time(NULL)); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_time_t failed, " - "but authentication is successful.\n")); + DEBUG(3, "sysdb_attrs_add_time_t failed, " + "but authentication is successful.\n"); ret = EOK; goto done; } @@ -3063,22 +3063,22 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_uint32(update_attrs, SYSDB_FAILED_LOGIN_ATTEMPTS, 0U); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_uint32 failed, " - "but authentication is successful.\n")); + DEBUG(3, "sysdb_attrs_add_uint32 failed, " + "but authentication is successful.\n"); ret = EOK; goto done; }
} else { - DEBUG(4, ("Authentication failed.\n")); + DEBUG(4, "Authentication failed.\n"); authentication_successful = false;
ret = sysdb_attrs_add_time_t(update_attrs, SYSDB_LAST_FAILED_LOGIN, time(NULL)); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_time_t failed\n.")); + DEBUG(3, "sysdb_attrs_add_time_t failed\n."); goto done; }
@@ -3086,7 +3086,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, SYSDB_FAILED_LOGIN_ATTEMPTS, ++failed_login_attempts); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_add_uint32 failed.\n")); + DEBUG(3, "sysdb_attrs_add_uint32 failed.\n"); goto done; } } @@ -3094,7 +3094,7 @@ int sysdb_cache_auth(struct sysdb_ctx *sysdb, ret = sysdb_set_user_attr(sysdb, domain, name, update_attrs, LDB_FLAG_MOD_REPLACE); if (ret) { - DEBUG(1, ("Failed to update Login attempt information!\n")); + DEBUG(1, "Failed to update Login attempt information!\n"); }
done: @@ -3110,7 +3110,7 @@ done: ret = ldb_transaction_commit(sysdb->ldb); ret = sysdb_error_to_errno(ret); if (ret) { - DEBUG(2, ("Failed to commit transaction!\n")); + DEBUG(2, "Failed to commit transaction!\n"); } } if (authentication_successful) { @@ -3144,7 +3144,7 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(0, ("Failed to start update transaction\n")); + DEBUG(0, "Failed to start update transaction\n"); goto done; }
@@ -3156,8 +3156,8 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb, ret = sysdb_add_group_member(sysdb, domain, add_groups[i], member, type, is_dn); if (ret != EOK) { - DEBUG(1, ("Could not add member [%s] to group [%s]. " - "Skipping.\n", member, add_groups[i])); + DEBUG(1, "Could not add member [%s] to group [%s]. " + "Skipping.\n", member, add_groups[i]); /* Continue on, we should try to finish the rest */ } } @@ -3169,8 +3169,8 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb, ret = sysdb_remove_group_member(sysdb, domain, del_groups[i], member, type, is_dn); if (ret != EOK) { - DEBUG(1, ("Could not remove member [%s] from group [%s]. " - "Skipping\n", member, del_groups[i])); + DEBUG(1, "Could not remove member [%s] from group [%s]. " + "Skipping\n", member, del_groups[i]); /* Continue on, we should try to finish the rest */ } } @@ -3178,7 +3178,7 @@ static errno_t sysdb_update_members_ex(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; }
@@ -3188,7 +3188,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -3257,7 +3257,7 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }
@@ -3268,8 +3268,8 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb, if (strcasecmp(remove_attrs[i], SYSDB_MEMBEROF) == 0) { continue; } - DEBUG(8, ("Removing attribute [%s] from [%s]\n", - remove_attrs[i], name)); + DEBUG(8, "Removing attribute [%s] from [%s]\n", + remove_attrs[i], name); lret = ldb_msg_add_empty(msg, remove_attrs[i], LDB_FLAG_MOD_DELETE, NULL); if (lret != LDB_SUCCESS) { @@ -3294,7 +3294,7 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; }
@@ -3305,7 +3305,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(msg); @@ -3333,7 +3333,7 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx,
basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE, domain->name); if (basedn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_dn_new_fmt failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_dn_new_fmt failed.\n"); ret = ENOMEM; goto done; } @@ -3342,13 +3342,13 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx, basedn, LDB_SCOPE_SUBTREE, attrs?attrs:def_attrs, SYSDB_SID_FILTER, sid_str); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_search failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_search failed.\n"); goto done; }
if (res->count > 1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Search for SID [%s] returned more than " \ - "one object.\n", sid_str)); + DEBUG(SSSDBG_CRIT_FAILURE, "Search for SID [%s] returned more than " \ + "one object.\n", sid_str); ret = EINVAL; goto done; } @@ -3357,9 +3357,9 @@ errno_t sysdb_search_object_by_sid(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry.\n"); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); }
talloc_zfree(tmp_ctx); diff --git a/src/db/sysdb_ranges.c b/src/db/sysdb_ranges.c index 5b444ea..19597ec 100644 --- a/src/db/sysdb_ranges.c +++ b/src/db/sysdb_ranges.c @@ -92,8 +92,8 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, } tmp_str = ldb_msg_find_attr_as_string(res->msgs[c], SYSDB_NAME, NULL); if (tmp_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("The object [%s] doesn't have a name.\n", - ldb_dn_get_linearized(res->msgs[c]->dn))); + DEBUG(SSSDBG_MINOR_FAILURE, "The object [%s] doesn't have a name.\n", + ldb_dn_get_linearized(res->msgs[c]->dn)); ret = EINVAL; goto done; } @@ -117,28 +117,28 @@ errno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_BASE_ID, &list[c]->base_id); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; }
ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_ID_RANGE_SIZE, &list[c]->id_range_size); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; }
ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_BASE_RID, &list[c]->base_rid); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; }
ret = find_attr_as_uint32_t(res->msgs[c], SYSDB_SECONDARY_BASE_RID, &list[c]->secondary_base_rid); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("find_attr_as_uint32_t failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "find_attr_as_uint32_t failed.\n"); goto done; }
@@ -174,9 +174,9 @@ errno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range) if ((range->trusted_dom_sid == NULL && range->secondary_base_rid == 0) || (range->trusted_dom_sid != NULL && range->secondary_base_rid != 0)) {
- DEBUG(SSSDBG_OP_FAILURE, ("Invalid range, skipping. Expected that " + DEBUG(SSSDBG_OP_FAILURE, "Invalid range, skipping. Expected that " "either the secondary base RID or the SID of the trusted " - "domain is set, but not both or none of them.\n")); + "domain is set, but not both or none of them.\n"); return EOK; }
@@ -251,7 +251,7 @@ errno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range)
done: if (ret) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -281,20 +281,20 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, ret = sysdb_get_ranges(tmp_ctx, sysdb, &cur_range_count, &cur_ranges); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_get_ranges failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_get_ranges failed.\n"); goto done; }
keep_range = talloc_zero_array(tmp_ctx, bool, cur_range_count); if (keep_range == NULL) { ret = ENOMEM; - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero_array failed.\n"); goto done; }
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_transaction_start failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_transaction_start failed.\n"); goto done; } in_transaction = true; @@ -313,10 +313,10 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, }
if (d == cur_range_count) { - DEBUG(SSSDBG_TRACE_FUNC, ("Adding range [%s].\n", ranges[c]->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Adding range [%s].\n", ranges[c]->name); ret = sysdb_range_create(sysdb, ranges[c]); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_range_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_range_create failed.\n"); goto done; } } @@ -328,8 +328,8 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb, */ for (d = 0; d < cur_range_count; d++) { if (!keep_range[d]) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removing range [%s].\n", - cur_ranges[d]->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Removing range [%s].\n", + cur_ranges[d]->name); dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_RANGE, cur_ranges[d]->name); if (dn == NULL) { @@ -339,7 +339,7 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb,
ret = sysdb_delete_entry(sysdb, dn, true); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_delete_entry failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_delete_entry failed.\n"); goto done; } } @@ -347,7 +347,7 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not commit transaction\n"); goto done; } in_transaction = false; @@ -356,7 +356,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); diff --git a/src/db/sysdb_search.c b/src/db/sysdb_search.c index 8dfaf1f..66dcc84 100644 --- a/src/db/sysdb_search.c +++ b/src/db/sysdb_search.c @@ -392,8 +392,8 @@ int sysdb_initgroups(TALLOC_CTX *mem_ctx,
ret = sysdb_getpwnam(tmp_ctx, sysdb, domain, name, &res); if (ret != EOK) { - DEBUG(1, ("sysdb_getpwnam failed: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_getpwnam failed: [%d][%s]\n", + ret, strerror(ret)); goto done; }
@@ -405,7 +405,7 @@ int sysdb_initgroups(TALLOC_CTX *mem_ctx,
} else if (res->count != 1) { ret = EIO; - DEBUG(1, ("sysdb_getpwnam returned count: [%d]\n", res->count)); + DEBUG(1, "sysdb_getpwnam returned count: [%d]\n", res->count); goto done; }
@@ -902,7 +902,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, } else if (mtype == SYSDB_MEMBER_GROUP) { dn = sysdb_group_strdn(tmp_ctx, dom->name, name); } else { - DEBUG(1, ("Unknown member type\n")); + DEBUG(1, "Unknown member type\n"); ret = EINVAL; goto done; } @@ -932,7 +932,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, goto done; }
- DEBUG(8, ("searching sysdb with filter [%s]\n", member_filter)); + DEBUG(8, "searching sysdb with filter [%s]\n", member_filter);
ret = sysdb_search_entry(tmp_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, member_filter, group_attrs, @@ -940,8 +940,8 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, if (ret == ENOENT) { direct_sysdb_count = 0; } else if (ret != EOK && ret != ENOENT) { - DEBUG(2, ("sysdb_search_entry failed: [%d]: %s\n", - ret, strerror(ret))); + DEBUG(2, "sysdb_search_entry failed: [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -964,7 +964,7 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx,
direct_parents[pi] = talloc_strdup(direct_parents, tmp_str); if (!direct_parents[pi]) { - DEBUG(1, ("A group with no name?\n")); + DEBUG(1, "A group with no name?\n"); ret = EIO; goto done; } @@ -972,8 +972,8 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, } direct_parents[pi] = NULL;
- DEBUG(SSSDBG_TRACE_LIBS, ("%s is a member of %zu sysdb groups\n", - name, direct_sysdb_count)); + DEBUG(SSSDBG_TRACE_LIBS, "%s is a member of %zu sysdb groups\n", + name, direct_sysdb_count); *_direct_parents = talloc_steal(mem_ctx, direct_parents); ret = EOK; done: diff --git a/src/db/sysdb_selinux.c b/src/db/sysdb_selinux.c index 80cfe53..f9cbf4e 100644 --- a/src/db/sysdb_selinux.c +++ b/src/db/sysdb_selinux.c @@ -49,8 +49,8 @@ sysdb_add_selinux_entity(struct sysdb_ctx *sysdb,
ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, objectclass); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set map object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set map object class [%d]: %s\n", + ret, strerror(ret)); return ret; }
@@ -70,7 +70,7 @@ sysdb_add_selinux_entity(struct sysdb_ctx *sysdb,
done: if (ret) { - DEBUG(SSSDBG_TRACE_LIBS, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_LIBS, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -120,7 +120,7 @@ static errno_t sysdb_store_selinux_entity(struct sysdb_ctx *sysdb, }
if (type != SELINUX_CONFIG && type != SELINUX_USER_MAP) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Bad SELinux entity type: [%d]\n", type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Bad SELinux entity type: [%d]\n", type); ret = EINVAL; goto done; } @@ -132,7 +132,7 @@ static errno_t sysdb_store_selinux_entity(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }
@@ -154,7 +154,7 @@ static errno_t sysdb_store_selinux_entity(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -163,12 +163,12 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } }
if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -195,7 +195,7 @@ errno_t sysdb_store_selinux_config(struct sysdb_ctx *sysdb, }
if (!order) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The SELinux order is missing\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The SELinux order is missing\n"); return EINVAL; }
@@ -232,7 +232,7 @@ errno_t sysdb_delete_usermaps(struct sysdb_ctx *sysdb, ret = sysdb_delete_recursive(sysdb, dn, true); talloc_free(dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_delete_recursive failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_delete_recursive failed.\n"); return ret; }
@@ -288,10 +288,10 @@ errno_t sysdb_search_selinux_usermap_by_mapname(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -373,9 +373,9 @@ errno_t sysdb_search_selinux_config(TALLOC_CTX *mem_ctx,
done: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No SELinux root entry found\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No SELinux root entry found\n"); } else if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Error: %d (%s)\n", ret, strerror(ret)); }
talloc_free(tmp_ctx); diff --git a/src/db/sysdb_services.c b/src/db/sysdb_services.c index b8ac9ef..19351a2 100644 --- a/src/db/sysdb_services.c +++ b/src/db/sysdb_services.c @@ -188,7 +188,7 @@ sysdb_store_service(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }
@@ -212,16 +212,16 @@ sysdb_store_service(struct sysdb_ctx *sysdb, */ for (i = 0; i < res->count; i++) { DEBUG(SSSDBG_TRACE_FUNC, - ("Corrupt cache entry [%s] detected. Deleting\n", + "Corrupt cache entry [%s] detected. Deleting\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn));
ret = sysdb_delete_entry(sysdb, res->msgs[i]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete corrupt cache entry [%s]\n", + "Could not delete corrupt cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); goto done; } } @@ -236,7 +236,7 @@ sysdb_store_service(struct sysdb_ctx *sysdb,
if (!name) { DEBUG(SSSDBG_CRIT_FAILURE, - ("A service with no name?\n")); + "A service with no name?\n"); /* Corrupted */ }
@@ -245,17 +245,17 @@ sysdb_store_service(struct sysdb_ctx *sysdb, * for port reassignments, we need to delete the old entry. */ DEBUG(SSSDBG_TRACE_FUNC, - ("Corrupt or replaced cache entry [%s] detected. " + "Corrupt or replaced cache entry [%s] detected. " "Deleting\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[0]->dn))); + res->msgs[0]->dn));
ret = sysdb_delete_entry(sysdb, res->msgs[0]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete cache entry [%s]\n", + "Could not delete cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[0]->dn))); + res->msgs[0]->dn)); } } } @@ -282,18 +282,18 @@ sysdb_store_service(struct sysdb_ctx *sysdb,
/* Corrupted */ DEBUG(SSSDBG_CRIT_FAILURE, - ("A service with no name?\n")); + "A service with no name?\n"); DEBUG(SSSDBG_TRACE_FUNC, - ("Corrupt cache entry [%s] detected. Deleting\n", + "Corrupt cache entry [%s] detected. Deleting\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn));
ret = sysdb_delete_entry(sysdb, res->msgs[i]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete corrupt cache entry [%s]\n", + "Could not delete corrupt cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); goto done; } } else if (strcmp(name, primary_name) == 0) { @@ -303,17 +303,17 @@ sysdb_store_service(struct sysdb_ctx *sysdb, */ if(update_dn) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Two existing services with the same name: [%s]? " + "Two existing services with the same name: [%s]? " "Deleting both.\n", - primary_name)); + primary_name);
/* Delete the entry from the previous pass */ ret = sysdb_delete_entry(sysdb, update_dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete cache entry [%s]\n", + "Could not delete cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - update_dn))); + update_dn)); goto done; }
@@ -321,9 +321,9 @@ sysdb_store_service(struct sysdb_ctx *sysdb, ret = sysdb_delete_entry(sysdb, res->msgs[i]->dn, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not delete cache entry [%s]\n", + "Could not delete cache entry [%s]\n", ldb_dn_canonical_string(tmp_ctx, - res->msgs[i]->dn))); + res->msgs[i]->dn)); goto done; }
@@ -384,15 +384,15 @@ sysdb_store_service(struct sysdb_ctx *sysdb, remove_attrs); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not remove missing attributes: [%s]\n", - strerror(ret))); + "Could not remove missing attributes: [%s]\n", + strerror(ret)); goto done; } }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -401,7 +401,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -523,7 +523,7 @@ sysdb_svc_add(TALLOC_CTX *mem_ctx, done: if (ret) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(tmp_ctx); return ret; @@ -596,7 +596,7 @@ sysdb_svc_update(struct sysdb_ctx *sysdb, done: if (ret) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_free(msg); return ret; @@ -629,7 +629,7 @@ sysdb_svc_remove_alias(struct sysdb_ctx *sysdb, done: if (ret) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(msg); return ret; @@ -655,7 +655,7 @@ sysdb_svc_delete(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }
@@ -690,7 +690,7 @@ sysdb_svc_delete(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -700,13 +700,13 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction\n")); + "Could not cancel transaction\n"); } }
if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Error: %d (%s)\n", ret, strerror(ret))); + "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; @@ -800,20 +800,20 @@ errno_t sysdb_search_services(TALLOC_CTX *mem_ctx, basedn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_SVC_BASE, domain->name); if (!basedn) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = ENOMEM; goto fail; }
filter = talloc_asprintf(tmp_ctx, "(&(%s)%s)", SYSDB_SC, sub_filter); if (!filter) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build filter\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build filter\n"); ret = ENOMEM; goto fail; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Search services with filter: %s\n", filter)); + "Search services with filter: %s\n", filter);
ret = sysdb_search_entry(mem_ctx, sysdb, basedn, LDB_SCOPE_SUBTREE, filter, attrs, @@ -827,10 +827,10 @@ errno_t sysdb_search_services(TALLOC_CTX *mem_ctx,
fail: if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("No such entry\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No such entry\n"); } else if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Error: %d (%s)\n", ret, strerror(ret)); } talloc_zfree(tmp_ctx); return ret; diff --git a/src/db/sysdb_ssh.c b/src/db/sysdb_ssh.c index 469425f..1e436d7 100644 --- a/src/db/sysdb_ssh.c +++ b/src/db/sysdb_ssh.c @@ -34,7 +34,7 @@ sysdb_update_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_store_custom(sysdb, domain, name, SSH_HOSTS_SUBDIR, attrs); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error storing host %s [%d]: %s\n", name, ret, strerror(ret))); + "Error storing host %s [%d]: %s\n", name, ret, strerror(ret)); return ret; }
@@ -58,7 +58,7 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, struct ldb_message_element *el; unsigned int i;
- DEBUG(SSSDBG_TRACE_FUNC, ("Storing host %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Storing host %s\n", name);
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -67,7 +67,7 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }
@@ -81,14 +81,14 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_SSH_HOST_OC); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set object class [%d]: %s\n", ret, strerror(ret))); + "Could not set object class [%d]: %s\n", ret, strerror(ret)); goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set name attribute [%d]: %s\n", ret, strerror(ret))); + "Could not set name attribute [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -109,8 +109,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, SYSDB_NAME_ALIAS, &el->values[i]); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not add name alias %s [%d]: %s\n", - el->values[i].data, ret, strerror(ret))); + "Could not add name alias %s [%d]: %s\n", + el->values[i].data, ret, strerror(ret)); goto done; } } @@ -122,8 +122,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, alias); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not add name alias %s [%d]: %s\n", - alias, ret, strerror(ret))); + "Could not add name alias %s [%d]: %s\n", + alias, ret, strerror(ret)); goto done; } } @@ -134,8 +134,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_get_el(attrs, SYSDB_SSH_PUBKEY, &el); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get sysdb sshPublicKey [%d]: %s\n", - ret, strerror(ret))); + "Could not get sysdb sshPublicKey [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -143,8 +143,8 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb, ret = sysdb_attrs_add_time_t(attrs, SYSDB_LAST_UPDATE, now); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set sysdb lastUpdate [%d]: %s\n", - ret, strerror(ret))); + "Could not set sysdb lastUpdate [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -155,7 +155,7 @@ sysdb_store_ssh_host(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; }
@@ -167,7 +167,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } }
@@ -188,7 +188,7 @@ sysdb_update_ssh_known_host_expire(struct sysdb_ctx *sysdb, struct sysdb_attrs *attrs;
DEBUG(SSSDBG_TRACE_FUNC, - ("Updating known_hosts expire time of host %s\n", name)); + "Updating known_hosts expire time of host %s\n", name);
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -205,8 +205,8 @@ sysdb_update_ssh_known_host_expire(struct sysdb_ctx *sysdb, now + known_hosts_timeout); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set known_hosts expire time [%d]: %s\n", - ret, strerror(ret))); + "Could not set known_hosts expire time [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -228,7 +228,7 @@ sysdb_delete_ssh_host(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, const char *name) { - DEBUG(SSSDBG_TRACE_FUNC, ("Deleting host %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Deleting host %s\n", name); return sysdb_delete_custom(sysdb, domain, name, SSH_HOSTS_SUBDIR); }
@@ -256,11 +256,11 @@ sysdb_search_ssh_hosts(TALLOC_CTX *mem_ctx, &num_results, &results); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error looking up host [%d]: %s\n", - ret, strerror(ret))); + "Error looking up host [%d]: %s\n", + ret, strerror(ret)); goto done; } if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No such host\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No such host\n"); *hosts = NULL; *num_hosts = 0; goto done; @@ -310,7 +310,7 @@ sysdb_get_ssh_host(TALLOC_CTX *mem_ctx, if (num_hosts > 1) { ret = EINVAL; DEBUG(SSSDBG_CRIT_FAILURE, - ("Found more than one host with name %s\n", name)); + "Found more than one host with name %s\n", name); goto done; }
diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c index 43c7579..9932dc8 100644 --- a/src/db/sysdb_subdomains.c +++ b/src/db/sysdb_subdomains.c @@ -82,8 +82,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) name = ldb_msg_find_attr_as_string(res->msgs[i], "cn", NULL); if (name == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The object [%s] doesn't have a name\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "The object [%s] doesn't have a name\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = EINVAL; goto done; } @@ -113,8 +113,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) /* in theory these may change, but it should never happen */ if (strcasecmp(dom->realm, realm) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Realm name changed from [%s] to [%s]!\n", - dom->realm, realm)); + "Realm name changed from [%s] to [%s]!\n", + dom->realm, realm); talloc_zfree(dom->realm); dom->realm = talloc_strdup(dom, realm); if (dom->realm == NULL) { @@ -124,8 +124,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) } if (strcasecmp(dom->flat_name, flat) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Flat name changed from [%s] to [%s]!\n", - dom->flat_name, flat)); + "Flat name changed from [%s] to [%s]!\n", + dom->flat_name, flat); talloc_zfree(dom->flat_name); dom->flat_name = talloc_strdup(dom, flat); if (dom->flat_name == NULL) { @@ -135,8 +135,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) } if (strcasecmp(dom->domain_id, id) != 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Domain changed from [%s] to [%s]!\n", - dom->domain_id, id)); + "Domain changed from [%s] to [%s]!\n", + dom->domain_id, id); talloc_zfree(dom->domain_id); dom->domain_id = talloc_strdup(dom, id); if (dom->domain_id == NULL) { @@ -147,17 +147,17 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain)
if (dom->mpg != mpg) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("MPG state change from [%s] to [%s]!\n", + "MPG state change from [%s] to [%s]!\n", dom->mpg ? "true" : "false", - mpg ? "true" : "false")); + mpg ? "true" : "false"); dom->mpg = mpg; }
if (dom->enumerate != enumerate) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("MPG state change from [%s] to [%s]!\n", + "MPG state change from [%s] to [%s]!\n", dom->enumerate ? "true" : "false", - enumerate ? "true" : "false")); + enumerate ? "true" : "false"); dom->enumerate = enumerate; }
@@ -165,8 +165,8 @@ errno_t sysdb_update_subdomains(struct sss_domain_info *domain) || (dom->forest != NULL && forest != NULL && strcasecmp(dom->forest, forest) != 0)) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Forest changed from [%s] to [%s]!\n", - dom->forest, forest)); + "Forest changed from [%s] to [%s]!\n", + dom->forest, forest); talloc_zfree(dom->forest); dom->forest = talloc_strdup(dom, forest); if (dom->forest == NULL) { @@ -234,8 +234,8 @@ errno_t sysdb_master_domain_update(struct sss_domain_info *domain) }
if (res->count > 1) { - DEBUG(SSSDBG_OP_FAILURE, ("Base search returned [%d] results, " - "expected 1.\n", res->count)); + DEBUG(SSSDBG_OP_FAILURE, "Base search returned [%d] results, " + "expected 1.\n", res->count); ret = EINVAL; goto done; } @@ -352,9 +352,9 @@ errno_t sysdb_master_domain_add_info(struct sss_domain_info *domain,
ret = ldb_modify(domain->sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add subdomain attributes to " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add subdomain attributes to " "[%s]: [%d][%s]!\n", domain->name, ret, - ldb_errstring(domain->sysdb->ldb))); + ldb_errstring(domain->sysdb->ldb)); ret = sysdb_error_to_errno(ret); goto done; } @@ -591,9 +591,9 @@ errno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb,
ret = ldb_modify(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add subdomain attributes to " + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add subdomain attributes to " "[%s]: [%d][%s]!\n", name, ret, - ldb_errstring(sysdb->ldb))); + ldb_errstring(sysdb->ldb)); ret = sysdb_error_to_errno(ret); goto done; } @@ -618,7 +618,7 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Removing sub-domain [%s] from db.\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Removing sub-domain [%s] from db.\n", name); dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_DOM_BASE, name); if (dn == NULL) { ret = ENOMEM; @@ -627,7 +627,7 @@ errno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name)
ret = sysdb_delete_recursive(sysdb, dn, true); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_delete_recursive failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_delete_recursive failed.\n"); goto done; }
diff --git a/src/db/sysdb_sudo.c b/src/db/sysdb_sudo.c index 4e98b5b..751df55 100644 --- a/src/db/sysdb_sudo.c +++ b/src/db/sysdb_sudo.c @@ -110,8 +110,8 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule, for (i=0; values[i] ; i++) { ret = sysdb_sudo_convert_time(values[i], &converted); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Invalid time format in rule [%s]!\n", - name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Invalid time format in rule [%s]!\n", + name); goto done; }
@@ -133,8 +133,8 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule, for (i=0; values[i] ; i++) { ret = sysdb_sudo_convert_time(values[i], &converted); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Invalid time format in rule [%s]!\n", - name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Invalid time format in rule [%s]!\n", + name); goto done; }
@@ -155,11 +155,11 @@ static errno_t sysdb_sudo_check_time(struct sysdb_attrs *rule, }
if (*result) { - DEBUG(SSSDBG_TRACE_ALL, ("Rule [%s] matches time restrictions\n", - name)); + DEBUG(SSSDBG_TRACE_ALL, "Rule [%s] matches time restrictions\n", + name); } else { - DEBUG(SSSDBG_TRACE_ALL, ("Rule [%s] does not match time " - "restrictions\n", name)); + DEBUG(SSSDBG_TRACE_ALL, "Rule [%s] does not match time " + "restrictions\n", name); }
ret = EOK; @@ -331,14 +331,14 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain, username, attrs, &msg); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up user %s\n", username)); + DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up user %s\n", username); goto done; }
if (_uid != NULL) { uid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); if (!uid) { - DEBUG(SSSDBG_CRIT_FAILURE, ("A user with no UID?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "A user with no UID?\n"); ret = EIO; goto done; } @@ -395,8 +395,8 @@ sysdb_get_sudo_user_info(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
sysdb_groupnames[num_groups] = NULL; } else if (ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up group [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up group [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -423,27 +423,27 @@ sysdb_save_sudorule(struct sysdb_ctx *sysdb, { errno_t ret;
- DEBUG(SSSDBG_TRACE_FUNC, ("Adding sudo rule %s\n", rule_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Adding sudo rule %s\n", rule_name);
ret = sysdb_attrs_add_string(attrs, SYSDB_OBJECTCLASS, SYSDB_SUDO_CACHE_OC); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set rule object class [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set rule object class [%d]: %s\n", + ret, strerror(ret)); return ret; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME, rule_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set name attribute [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set name attribute [%d]: %s\n", + ret, strerror(ret)); return ret; }
ret = sysdb_store_custom(sysdb, domain, rule_name, SUDORULE_SUBDIR, attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_store_custom failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_custom failed [%d]: %s\n", + ret, strerror(ret)); return ret; }
@@ -497,7 +497,7 @@ static errno_t sysdb_sudo_set_refresh_time(struct sysdb_ctx *sysdb, } } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } else { @@ -569,7 +569,7 @@ static errno_t sysdb_sudo_get_refresh_time(struct sysdb_ctx *sysdb, goto done; } else if (res->count != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Got more than one reply for base search!\n")); + "Got more than one reply for base search!\n"); ret = EIO; goto done; } @@ -616,7 +616,7 @@ static errno_t sysdb_sudo_purge_all(struct sysdb_ctx *sysdb,
ret = sysdb_delete_recursive(sysdb, base_dn, true); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_delete_recursive failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_delete_recursive failed.\n"); goto done; }
@@ -630,7 +630,7 @@ errno_t sysdb_sudo_purge_byname(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, const char *name) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Deleting sudo rule %s\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Deleting sudo rule %s\n", name); return sysdb_delete_custom(sysdb, domain, name, SUDORULE_SUBDIR); }
@@ -664,17 +664,17 @@ errno_t sysdb_sudo_purge_byfilter(struct sysdb_ctx *sysdb, SUDORULE_SUBDIR, attrs, &count, &msgs); if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("No rules matched\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No rules matched\n"); ret = EOK; goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up SUDO rules")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up SUDO rules"); goto done; }
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -682,21 +682,21 @@ errno_t sysdb_sudo_purge_byfilter(struct sysdb_ctx *sysdb, for (i = 0; i < count; i++) { name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("A rule without a name?\n")); + DEBUG(SSSDBG_OP_FAILURE, "A rule without a name?\n"); /* skip this one but still delete other entries */ continue; }
ret = sysdb_sudo_purge_byname(sysdb, domain, name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not delete rule %s\n", name)); + DEBUG(SSSDBG_OP_FAILURE, "Could not delete rule %s\n", name); goto done; } }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -705,7 +705,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } }
diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c index 3c23bab..b7bdc17 100644 --- a/src/db/sysdb_upgrade.c +++ b/src/db/sysdb_upgrade.c @@ -37,7 +37,7 @@ static errno_t commence_upgrade(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct upgrade_ctx *ctx; int ret;
- DEBUG(SSSDBG_CRIT_FAILURE, ("UPGRADING DB TO VERSION %s\n", new_ver)); + DEBUG(SSSDBG_CRIT_FAILURE, "UPGRADING DB TO VERSION %s\n", new_ver);
ctx = talloc(mem_ctx, struct upgrade_ctx); if (!ctx) { @@ -121,8 +121,8 @@ static int finish_upgrade(int ret, struct upgrade_ctx **ctx, const char **ver) lret = ldb_transaction_cancel((*ctx)->ldb); if (lret != LDB_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction! [%s]\n", - ldb_strerror(lret))); + "Could not cancel transaction! [%s]\n", + ldb_strerror(lret)); /* Do not overwrite ret here, we want to return * the original failure, not the failure of the * transaction cancellation. @@ -185,8 +185,8 @@ int sysdb_upgrade_01(struct ldb_context *ldb, const char **ver) for (i = 0; i < res->count; i++) { el = ldb_msg_find_element(res->msgs[i], "memberUid"); if (!el) { - DEBUG(1, ("memberUid is missing from message [%s], skipping\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + DEBUG(1, "memberUid is missing from message [%s], skipping\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); continue; }
@@ -290,7 +290,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
ret = sysdb_ldb_connect(tmp_ctx, ldb_file, &ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); return ret; }
@@ -333,7 +333,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, goto exit; }
- DEBUG(4, ("Upgrading DB from version: %s\n", version)); + DEBUG(4, "Upgrading DB from version: %s\n", version);
if (strcmp(version, SYSDB_VERSION_0_1) == 0) { /* convert database */ @@ -358,7 +358,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
/* == V2->V3 UPGRADE == */
- DEBUG(0, ("UPGRADING DB TO VERSION %s\n", SYSDB_VERSION_0_3)); + DEBUG(0, "UPGRADING DB TO VERSION %s\n", SYSDB_VERSION_0_3);
/* ldb uses posix locks, * posix is stupid and kills all locks when you close *any* file @@ -379,14 +379,14 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, /* reopen */ ret = sysdb_ldb_connect(tmp_ctx, ldb_file, &ldb); if (ret != EOK) { - DEBUG(1, ("sysdb_ldb_connect failed.\n")); + DEBUG(1, "sysdb_ldb_connect failed.\n"); return ret; }
/* open a transaction */ ret = ldb_transaction_start(ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to start ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to start ldb transaction! (%d)\n", ret); ret = EIO; goto exit; } @@ -413,7 +413,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
ret = ldb_transaction_start(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to start ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to start ldb transaction! (%d)\n", ret); ret = EIO; goto done; } @@ -477,18 +477,18 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { - DEBUG(0, ("WARNING: Could not add entry %s," + DEBUG(0, "WARNING: Could not add entry %s," " to new ldb file! (%d [%s])\n", ldb_dn_get_linearized(msg->dn), - ret, ldb_errstring(sysdb->ldb))); + ret, ldb_errstring(sysdb->ldb)); }
ret = ldb_delete(ldb, orig_dn); if (ret != LDB_SUCCESS) { - DEBUG(0, ("WARNING: Could not remove entry %s," + DEBUG(0, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(orig_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); } }
@@ -497,29 +497,29 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains, * of failure just for tracing */ ret = ldb_delete(ldb, groups_dn); if (ret != LDB_SUCCESS) { - DEBUG(9, ("WARNING: Could not remove entry %s," + DEBUG(9, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(groups_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); } ret = ldb_delete(ldb, users_dn); if (ret != LDB_SUCCESS) { - DEBUG(9, ("WARNING: Could not remove entry %s," + DEBUG(9, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(users_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); } ret = ldb_delete(ldb, domain_dn); if (ret != LDB_SUCCESS) { - DEBUG(9, ("WARNING: Could not remove entry %s," + DEBUG(9, "WARNING: Could not remove entry %s," " from old ldb file! (%d [%s])\n", ldb_dn_get_linearized(domain_dn), - ret, ldb_errstring(ldb))); + ret, ldb_errstring(ldb)); }
ret = ldb_transaction_commit(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to commit ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to commit ldb transaction! (%d)\n", ret); ret = EIO; goto done; } @@ -562,7 +562,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
ret = ldb_transaction_commit(ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to commit ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to commit ldb transaction! (%d)\n", ret); ret = EIO; goto exit; } @@ -574,12 +574,12 @@ done: if (ctx_trans) { ret = ldb_transaction_cancel(sysdb->ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to cancel ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to cancel ldb transaction! (%d)\n", ret); } } ret = ldb_transaction_cancel(ldb); if (ret != LDB_SUCCESS) { - DEBUG(1, ("Failed to cancel ldb transaction! (%d)\n", ret)); + DEBUG(1, "Failed to cancel ldb transaction! (%d)\n", ret); } }
@@ -1060,8 +1060,8 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("User [%s] is a member of %d groups\n", - name, memberof_el->num_values)); + DEBUG(SSSDBG_TRACE_LIBS, "User [%s] is a member of %d groups\n", + name, memberof_el->num_values);
for (j = 0; j < memberof_el->num_values; j++) { msg = ldb_msg_new(tmp_ctx); @@ -1077,9 +1077,9 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, }
if (!ldb_dn_validate(msg->dn)) { - DEBUG(SSSDBG_MINOR_FAILURE, ("DN validation failed during " + DEBUG(SSSDBG_MINOR_FAILURE, "DN validation failed during " "upgrade: [%s]\n", - memberof_el->values[j].data)); + memberof_el->values[j].data); talloc_zfree(msg); continue; } @@ -1095,8 +1095,8 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Adding ghost [%s] to entry [%s]\n", - name, ldb_dn_get_linearized(msg->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Adding ghost [%s] to entry [%s]\n", + name, ldb_dn_get_linearized(msg->dn));
ret = sss_ldb_modify_permissive(sysdb->ldb, msg); talloc_zfree(msg); @@ -1140,8 +1140,8 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, } }
- DEBUG(SSSDBG_TRACE_FUNC, ("Removing fake user [%s]\n", - ldb_dn_get_linearized(user->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Removing fake user [%s]\n", + ldb_dn_get_linearized(user->dn));
ret = ldb_delete(sysdb->ldb, user->dn); if (ret != LDB_SUCCESS) { @@ -1203,7 +1203,7 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Found %d autofs entries\n", res->count)); + DEBUG(SSSDBG_TRACE_LIBS, "Found %d autofs entries\n", res->count);
for (i = 0; i < res->count; i++) { entry = res->msgs[i]; @@ -1218,13 +1218,13 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, memberof_dn = ldb_dn_from_ldb_val(tmp_ctx, sysdb->ldb, &(memberof_el->values[j])); if (!memberof_dn) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot convert memberof into DN, skipping\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot convert memberof into DN, skipping\n"); continue; }
val = ldb_dn_get_rdn_val(memberof_dn); if (!val) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get map name from map DN\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get map name from map DN\n"); continue; }
@@ -1233,8 +1233,8 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, key, value, NULL); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save autofs entry [%s]-[%s] into map %s\n", - key, value, val->data)); + "Cannot save autofs entry [%s]-[%s] into map %s\n", + key, value, val->data); continue; } } @@ -1242,13 +1242,13 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, }
/* Delete the old entry if it was either processed or incomplete */ - DEBUG(SSSDBG_TRACE_LIBS, ("Deleting [%s]\n", - ldb_dn_get_linearized(entry->dn))); + DEBUG(SSSDBG_TRACE_LIBS, "Deleting [%s]\n", + ldb_dn_get_linearized(entry->dn));
ret = ldb_delete(sysdb->ldb, entry->dn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot delete old autofs entry %s\n", - ldb_dn_get_linearized(entry->dn))); + DEBUG(SSSDBG_OP_FAILURE, "Cannot delete old autofs entry %s\n", + ldb_dn_get_linearized(entry->dn)); continue; } } @@ -1337,7 +1337,7 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver)
basedn = ldb_dn_new(ctx, sysdb->ldb, SYSDB_BASE); if (!basedn) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = EIO; goto done; } @@ -1346,7 +1346,7 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) basedn, LDB_SCOPE_ONELEVEL, attrs, "objectclass=%s", SYSDB_SUBDOMAIN_CLASS); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to search subdomains\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to search subdomains\n"); ret = EIO; goto done; } @@ -1356,15 +1356,15 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) tmp_str = ldb_msg_find_attr_as_string(dom_res->msgs[i], "cn", NULL); if (tmp_str == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The object [%s] doesn't have a name\n", - ldb_dn_get_linearized(dom_res->msgs[i]->dn))); + "The object [%s] doesn't have a name\n", + ldb_dn_get_linearized(dom_res->msgs[i]->dn)); continue; }
basedn = ldb_dn_new_fmt(ctx, sysdb->ldb, SYSDB_DOM_BASE, tmp_str); if (!basedn) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to build base dn for subdomain %s\n", tmp_str)); + "Failed to build base dn for subdomain %s\n", tmp_str); continue; }
@@ -1372,7 +1372,7 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) basedn, LDB_SCOPE_SUBTREE, attrs, NULL); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to search subdomain %s\n", tmp_str)); + "Failed to search subdomain %s\n", tmp_str); talloc_free(basedn); continue; } @@ -1387,8 +1387,8 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver) ret = ldb_delete(sysdb->ldb, res->msgs[j]->dn); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to delete %s\n", - ldb_dn_get_linearized(res->msgs[j]->dn))); + "Failed to delete %s\n", + ldb_dn_get_linearized(res->msgs[j]->dn)); continue; } } @@ -1426,7 +1426,7 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver)
basedn = ldb_dn_new(ctx, sysdb->ldb, SYSDB_BASE); if (!basedn) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = EIO; goto done; } @@ -1451,8 +1451,8 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) ret = ldb_add(sysdb->ldb, msg); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to upgrade DB (%d, [%s])!\n", - ret, ldb_errstring(sysdb->ldb))); + "Failed to upgrade DB (%d, [%s])!\n", + ret, ldb_errstring(sysdb->ldb)); ret = EIO; goto done; } @@ -1462,7 +1462,7 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) basedn, LDB_SCOPE_SUBTREE, attrs, "objectclass=%s", SYSDB_ID_RANGE_CLASS); if (ret != LDB_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to search range objects\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to search range objects\n"); ret = EIO; goto done; } @@ -1474,13 +1474,13 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) tmp_str = ldb_msg_find_attr_as_string(res->msgs[i], SYSDB_NAME, NULL); if (tmp_str == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("The object [%s] doesn't have a name\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "The object [%s] doesn't have a name\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = ldb_delete(sysdb->ldb, res->msgs[i]->dn); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to delete %s\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to delete %s\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = EIO; goto done; } @@ -1490,22 +1490,22 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver) newdn = ldb_dn_new_fmt(ctx, sysdb->ldb, SYSDB_TMPL_RANGE, tmp_str); if (!newdn) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to create new DN to move [%s]\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to create new DN to move [%s]\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = ENOMEM; goto done; } ret = ldb_rename(sysdb->ldb, res->msgs[i]->dn, newdn); if (ret != LDB_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to move [%s] to [%s]\n", + "Failed to move [%s] to [%s]\n", ldb_dn_get_linearized(res->msgs[i]->dn), - ldb_dn_get_linearized(newdn))); + ldb_dn_get_linearized(newdn)); ret = ldb_delete(sysdb->ldb, res->msgs[i]->dn); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to delete %s\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to delete %s\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); ret = EIO; goto done; } diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 3d8ba26..36480e2 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -202,8 +202,8 @@ static void network_status_change_cb(void *cb_data) struct mt_svc *iter; struct mt_ctx *ctx = (struct mt_ctx *) cb_data;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("A networking status change detected " - "signaling providers to reset offline status\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "A networking status change detected " + "signaling providers to reset offline status\n"); for (iter = ctx->svc_list; iter; iter = iter->next) { /* Don't signal services, only providers */ if (iter->provider) { @@ -265,7 +265,7 @@ static int client_registration(DBusMessage *message, data = sbus_conn_get_private_data(conn); mini = talloc_get_type(data, struct mon_init_conn); if (!mini) { - DEBUG(0, ("Connection holds no valid init data\n")); + DEBUG(0, "Connection holds no valid init data\n"); return EINVAL; }
@@ -279,14 +279,14 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT16, &svc_ver, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(1, ("Failed to parse message, killing connection\n")); + DEBUG(1, "Failed to parse message, killing connection\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); sbus_disconnect(conn); /* FIXME: should we just talloc_zfree(conn) ? */ goto done; }
- DEBUG(4, ("Received ID registration: (%s,%d)\n", svc_name, svc_ver)); + DEBUG(4, "Received ID registration: (%s,%d)\n", svc_name, svc_ver);
/* search this service in the list */ svc = mini->ctx->svc_list; @@ -298,8 +298,8 @@ static int client_registration(DBusMessage *message, svc = svc->next; } if (!svc) { - DEBUG(0, ("Unable to find peer [%s] in list of services," - " killing connection!\n", svc_name)); + DEBUG(0, "Unable to find peer [%s] in list of services," + " killing connection!\n", svc_name); sbus_disconnect(conn); /* FIXME: should we just talloc_zfree(conn) ? */ goto done; @@ -310,7 +310,7 @@ static int client_registration(DBusMessage *message,
ret = mark_service_as_started(svc); if (ret) { - DEBUG(1, ("Failed to mark service [%s]!\n", svc_name)); + DEBUG(1, "Failed to mark service [%s]!\n", svc_name); goto done; }
@@ -408,7 +408,7 @@ static int mark_service_as_started(struct mt_svc *svc) int ret; int i;
- DEBUG(5, ("Marking %s as started.\n", svc->name)); + DEBUG(5, "Marking %s as started.\n", svc->name); svc->svc_started = true;
/* we need to attach a spy to the connection structure so that if some code @@ -416,7 +416,7 @@ static int mark_service_as_started(struct mt_svc *svc) * try to access or even free, freed memory. */ ret = add_svc_conn_spy(svc); if (ret) { - DEBUG(0, ("Failed to attch spy\n")); + DEBUG(0, "Failed to attch spy\n"); goto done; }
@@ -425,7 +425,7 @@ static int mark_service_as_started(struct mt_svc *svc) /* check if all providers are up */ for (iter = ctx->svc_list; iter; iter = iter->next) { if (iter->provider && !iter->svc_started) { - DEBUG(5, ("Still waiting on %s provider.\n", iter->name)); + DEBUG(5, "Still waiting on %s provider.\n", iter->name); break; } } @@ -437,7 +437,7 @@ static int mark_service_as_started(struct mt_svc *svc)
ctx->services_started = true;
- DEBUG(4, ("Now starting services!\n")); + DEBUG(4, "Now starting services!\n"); /* then start all services */ for (i = 0; ctx->services[i]; i++) { add_new_service(ctx, ctx->services[i], 0); @@ -454,20 +454,20 @@ static int mark_service_as_started(struct mt_svc *svc) if (ctx->is_daemon) { if (ctx->parent_pid <= 1 || ctx->parent_pid != getppid()) { /* the parent process was already terminated */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Invalid parent pid: %d\n", - ctx->parent_pid)); + DEBUG(SSSDBG_MINOR_FAILURE, "Invalid parent pid: %d\n", + ctx->parent_pid); goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("SSSD is initialized, " - "terminating parent process\n")); + DEBUG(SSSDBG_TRACE_FUNC, "SSSD is initialized, " + "terminating parent process\n");
errno = 0; ret = kill(ctx->parent_pid, SIGTERM); if (ret != 0) { ret = errno; - DEBUG(SSSDBG_FATAL_FAILURE, ("Unable to terminate parent " - "process [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Unable to terminate parent " + "process [%d]: %s\n", ret, strerror(ret)); } } } @@ -483,16 +483,16 @@ static void services_startup_timeout(struct tevent_context *ev, struct mt_ctx *ctx = talloc_get_type(ptr, struct mt_ctx); int i;
- DEBUG(6, ("Handling timeout\n")); + DEBUG(6, "Handling timeout\n");
if (!ctx->services_started) {
- DEBUG(1, ("Providers did not start in time, " - "forcing services startup!\n")); + DEBUG(1, "Providers did not start in time, " + "forcing services startup!\n");
ctx->services_started = true;
- DEBUG(4, ("Now starting services!\n")); + DEBUG(4, "Now starting services!\n"); /* then start all services */ for (i = 0; ctx->services[i]; i++) { add_new_service(ctx, ctx->services[i], 0); @@ -509,7 +509,7 @@ static int add_services_startup_timeout(struct mt_ctx *ctx) tv = tevent_timeval_current_ofs(5, 0); to = tevent_add_timer(ctx->ev, ctx, tv, services_startup_timeout, ctx); if (!to) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); return ENOMEM; }
@@ -565,20 +565,20 @@ static void tasks_check_handler(struct tevent_context *ev, break;
case ENXIO: - DEBUG(1,("Child (%s) not responding! (yet)\n", svc->name)); + DEBUG(1,"Child (%s) not responding! (yet)\n", svc->name); break;
default: /* TODO: should we tear it down ? */ - DEBUG(1,("Sending a message to service (%s) failed!!\n", svc->name)); + DEBUG(1,"Sending a message to service (%s) failed!!\n", svc->name); break; }
if (svc->failed_pongs >= 3) { /* too long since we last heard of this process */ DEBUG(SSSDBG_CRIT_FAILURE, - ("Killing service [%s], not responding to pings!\n", - svc->name)); + "Killing service [%s], not responding to pings!\n", + svc->name);
/* Kill the service. The SIGCHLD handler will restart it */ monitor_kill_service(svc); @@ -599,8 +599,8 @@ static void set_tasks_checker(struct mt_svc *svc) tv.tv_usec = 0; te = tevent_add_timer(svc->mt_ctx->ev, svc, tv, tasks_check_handler, svc); if (te == NULL) { - DEBUG(0, ("failed to add event, monitor offline for [%s]!\n", - svc->name)); + DEBUG(0, "failed to add event, monitor offline for [%s]!\n", + svc->name); /* FIXME: shutdown ? */ } svc->ping_ev = te; @@ -617,9 +617,9 @@ static int monitor_kill_service (struct mt_svc *svc) ret = kill(svc->pid, SIGTERM); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Sending signal to child (%s:%d) failed! " + "Sending signal to child (%s:%d) failed! " "Ignore and pretend child is dead.\n", - svc->name, svc->pid)); + svc->name, svc->pid); talloc_free(svc); }
@@ -641,15 +641,15 @@ static void mt_svc_sigkill(struct tevent_context *ev, struct mt_svc *svc = talloc_get_type(ptr, struct mt_svc);
DEBUG(SSSDBG_FATAL_FAILURE, - ("[%s][%d] is not responding to SIGTERM. Sending SIGKILL.\n", - svc->name, svc->pid)); + "[%s][%d] is not responding to SIGTERM. Sending SIGKILL.\n", + svc->name, svc->pid);
ret = kill(svc->pid, SIGKILL); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Sending signal to child (%s:%d) failed! " + "Sending signal to child (%s:%d) failed! " "Ignore and pretend child is dead.\n", - svc->name, svc->pid)); + svc->name, svc->pid); talloc_free(svc); } } @@ -665,8 +665,8 @@ static void reload_reply(DBusPendingCall *pending, void *data) * until reply is valid or timeout has occurred. If reply is NULL * here, something is seriously wrong and we should bail out. */ - DEBUG(0, ("A reply callback was called but no reply was received" - " and no timeout occurred\n")); + DEBUG(0, "A reply callback was called but no reply was received" + " and no timeout occurred\n"); /* Destroy this connection */ sbus_disconnect(svc->conn); dbus_pending_call_unref(pending); @@ -687,7 +687,7 @@ static int monitor_update_resolv(struct config_file_ctx *file_ctx, { int ret; struct mt_svc *cur_svc; - DEBUG(2, ("Resolv.conf has been updated. Reloading.\n")); + DEBUG(2, "Resolv.conf has been updated. Reloading.\n");
ret = res_init(); if(ret != 0) { @@ -716,7 +716,7 @@ static int service_signal(struct mt_svc *svc, const char *svc_signal) * order a service to reload that hasn't started * yet. */ - DEBUG(1,("Could not signal service [%s].\n", svc->name)); + DEBUG(1,"Could not signal service [%s].\n", svc->name); return EIO; }
@@ -725,7 +725,7 @@ static int service_signal(struct mt_svc *svc, const char *svc_signal) MONITOR_INTERFACE, svc_signal); if (!msg) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); monitor_kill_service(svc); talloc_free(svc); return ENOMEM; @@ -773,7 +773,7 @@ static int check_domain_ranges(struct sss_domain_info *domains) other = get_next_domain(dom, false); if (dom->id_max && dom->id_min > dom->id_max) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Domain '%s' does not have a valid ID range\n", dom->name)); + "Domain '%s' does not have a valid ID range\n", dom->name); return EINVAL; }
@@ -783,8 +783,8 @@ static int check_domain_ranges(struct sss_domain_info *domains) (other->id_max ? other->id_max : UINT32_MAX)); if (id_min <= id_max) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Domains '%s' and '%s' overlap in range %u - %u\n", - dom->name, other->name, id_min, id_max)); + "Domains '%s' and '%s' overlap in range %u - %u\n", + dom->name, other->name, id_min, id_max); } other = get_next_domain(other, false); } @@ -832,7 +832,7 @@ static errno_t add_implicit_services(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -841,7 +841,7 @@ static errno_t add_implicit_services(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx CONFDB_MONITOR_ACTIVE_DOMAINS, &domain_names); if (ret == ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("No domains configured!\n")); + DEBUG(SSSDBG_OP_FAILURE, "No domains configured!\n"); goto done; }
@@ -849,7 +849,7 @@ static errno_t add_implicit_services(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx conf_path = talloc_asprintf(tmp_ctx, CONFDB_DOMAIN_PATH_TMPL, domain_names[c]); if (conf_path == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -858,8 +858,8 @@ static errno_t add_implicit_services(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx CONFDB_DOMAIN_ID_PROVIDER, NULL, &id_provider); if (ret == EOK) { if (id_provider == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("id_provider is not set for " - "domain [%s], trying next domain.\n", domain_names[c])); + DEBUG(SSSDBG_OP_FAILURE, "id_provider is not set for " + "domain [%s], trying next domain.\n", domain_names[c]); continue; }
@@ -867,9 +867,9 @@ static errno_t add_implicit_services(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx add_pac = true; } } else { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get id_provider for " \ + DEBUG(SSSDBG_OP_FAILURE, "Failed to get id_provider for " \ "domain [%s], trying next domain.\n", - domain_names[c])); + domain_names[c]); } }
@@ -877,7 +877,7 @@ static errno_t add_implicit_services(struct confdb_ctx *cdb, TALLOC_CTX *mem_ctx !string_in_list("pac", *_services, false)) { ret = add_string_to_list(mem_ctx, "pac", _services); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("add_string_to_list failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "add_string_to_list failed.\n"); goto done; } } @@ -939,20 +939,20 @@ int get_monitor_config(struct mt_ctx *ctx) CONFDB_MONITOR_ACTIVE_SERVICES, &ctx->services); if (ret != EOK) { - DEBUG(0, ("No services configured!\n")); + DEBUG(0, "No services configured!\n"); return EINVAL; }
ret = add_implicit_services(ctx->cdb, ctx->service_ctx, &ctx->services); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to add implicit configured " \ + DEBUG(SSSDBG_OP_FAILURE, "Failed to add implicit configured " \ "services. Some functionality might " \ - "be missing")); + "be missing"); }
badsrv = check_services(ctx->services); if (badsrv != NULL) { - DEBUG(0, ("Invalid service %s\n", badsrv)); + DEBUG(0, "Invalid service %s\n", badsrv); return EINVAL; }
@@ -968,13 +968,13 @@ int get_monitor_config(struct mt_ctx *ctx) } ret = confdb_get_domains(ctx->cdb, &ctx->domains); if (ret != EOK) { - DEBUG(0, ("No domains configured.\n")); + DEBUG(0, "No domains configured.\n"); return ret; }
ret = check_local_domain_unique(ctx->domains); if (ret != EOK) { - DEBUG(0, ("More than one local domain configured.\n")); + DEBUG(0, "More than one local domain configured.\n"); return ret; }
@@ -997,7 +997,7 @@ static errno_t get_ping_config(struct mt_ctx *ctx, const char *path, MONITOR_DEF_PING_TIME, &svc->ping_time); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get ping timeout for '%s'\n", svc->name)); + "Failed to get ping timeout for '%s'\n", svc->name); return ret; }
@@ -1007,15 +1007,15 @@ static errno_t get_ping_config(struct mt_ctx *ctx, const char *path, }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Time between service pings for [%s]: [%d]\n", - svc->name, svc->ping_time)); + "Time between service pings for [%s]: [%d]\n", + svc->name, svc->ping_time);
ret = confdb_get_int(ctx->cdb, path, CONFDB_SERVICE_FORCE_TIMEOUT, MONITOR_DEF_FORCE_TIME, &svc->kill_time); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get kill timeout for %s\n", svc->name)); + "Failed to get kill timeout for %s\n", svc->name); return ret; }
@@ -1025,8 +1025,8 @@ static errno_t get_ping_config(struct mt_ctx *ctx, const char *path, }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Time between SIGTERM and SIGKILL for [%s]: [%d]\n", - svc->name, svc->kill_time)); + "Time between SIGTERM and SIGKILL for [%s]: [%d]\n", + svc->name, svc->kill_time);
return EOK; } @@ -1072,7 +1072,7 @@ static int get_service_config(struct mt_ctx *ctx, const char *name, CONFDB_SERVICE_COMMAND, NULL, &svc->command); if (ret != EOK) { - DEBUG(0,("Failed to start service '%s'\n", svc->name)); + DEBUG(0,"Failed to start service '%s'\n", svc->name); talloc_free(svc); return ret; } @@ -1131,7 +1131,7 @@ static int get_service_config(struct mt_ctx *ctx, const char *name, ret = get_ping_config(ctx, path, svc); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get ping timeouts for %s\n", svc->name)); + "Failed to get ping timeouts for %s\n", svc->name); talloc_free(svc); return ret; } @@ -1159,7 +1159,7 @@ static int add_new_service(struct mt_ctx *ctx,
ret = start_service(svc); if (ret != EOK) { - DEBUG(0,("Failed to start service '%s'\n", svc->name)); + DEBUG(0,"Failed to start service '%s'\n", svc->name); talloc_free(svc); }
@@ -1207,7 +1207,7 @@ static int get_provider_config(struct mt_ctx *ctx, const char *name, CONFDB_DOMAIN_ID_PROVIDER, NULL, &svc->provider); if (ret != EOK) { - DEBUG(0, ("Failed to find ID provider from [%s] configuration\n", name)); + DEBUG(0, "Failed to find ID provider from [%s] configuration\n", name); talloc_free(svc); return ret; } @@ -1216,7 +1216,7 @@ static int get_provider_config(struct mt_ctx *ctx, const char *name, CONFDB_DOMAIN_COMMAND, NULL, &svc->command); if (ret != EOK) { - DEBUG(0, ("Failed to find command from [%s] configuration\n", name)); + DEBUG(0, "Failed to find command from [%s] configuration\n", name); talloc_free(svc); return ret; } @@ -1224,7 +1224,7 @@ static int get_provider_config(struct mt_ctx *ctx, const char *name, ret = get_ping_config(ctx, path, svc); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get ping timeouts for %s\n", svc->name)); + "Failed to get ping timeouts for %s\n", svc->name); talloc_free(svc); return ret; } @@ -1304,8 +1304,8 @@ static int add_new_provider(struct mt_ctx *ctx,
ret = get_provider_config(ctx, name, &svc); if (ret != EOK) { - DEBUG(0, ("Could not get provider configuration for [%s]\n", - name)); + DEBUG(0, "Could not get provider configuration for [%s]\n", + name); return ret; } svc->restarts = restarts; @@ -1322,7 +1322,7 @@ static int add_new_provider(struct mt_ctx *ctx,
ret = start_service(svc); if (ret != EOK) { - DEBUG(0,("Failed to start service '%s'\n", svc->name)); + DEBUG(0,"Failed to start service '%s'\n", svc->name); talloc_free(svc); }
@@ -1339,7 +1339,7 @@ static void monitor_hup(struct tevent_context *ev, struct mt_ctx *ctx = talloc_get_type(private_data, struct mt_ctx); struct mt_svc *cur_svc;
- DEBUG(1, ("Received SIGHUP.\n")); + DEBUG(1, "Received SIGHUP.\n");
/* Send D-Bus message to other services to rotate their logs. * NSS service receives also message to clear memory caches. */ @@ -1366,7 +1366,7 @@ static int monitor_cleanup(void) if (ret == -1) { ret = errno; DEBUG(SSSDBG_FATAL_FAILURE, - ("Error removing pidfile! (%d [%s])\n", ret, strerror(ret))); + "Error removing pidfile! (%d [%s])\n", ret, strerror(ret)); return ret; }
@@ -1382,7 +1382,7 @@ static void monitor_quit(struct mt_ctx *mt_ctx, int ret) int kret; bool killed;
- DEBUG(SSSDBG_IMPORTANT_INFO, ("Returned with: %d\n", ret)); + DEBUG(SSSDBG_IMPORTANT_INFO, "Returned with: %d\n", ret);
/* Kill all of our known children manually */ DLIST_FOR_EACH(svc, mt_ctx->svc_list) { @@ -1392,14 +1392,14 @@ static void monitor_quit(struct mt_ctx *mt_ctx, int ret) }
killed = false; - DEBUG(1, ("Terminating [%s][%d]\n", svc->name, svc->pid)); + DEBUG(1, "Terminating [%s][%d]\n", svc->name, svc->pid); do { errno = 0; kret = kill(svc->pid, SIGTERM); if (kret < 0) { error = errno; - DEBUG(1, ("Couldn't kill [%s][%d]: [%s]\n", - svc->name, svc->pid, strerror(error))); + DEBUG(1, "Couldn't kill [%s][%d]: [%s]\n", + svc->name, svc->pid, strerror(error)); }
error = 0; @@ -1412,8 +1412,8 @@ static void monitor_quit(struct mt_ctx *mt_ctx, int ret) if (error == ECHILD) { killed = true; } else if (error != EINTR) { - DEBUG(0, ("[%d][%s] while waiting for [%s]\n", - error, strerror(error), svc->name)); + DEBUG(0, "[%d][%s] while waiting for [%s]\n", + error, strerror(error), svc->name); /* Forcibly kill this child */ kill(svc->pid, SIGKILL); break; @@ -1421,11 +1421,11 @@ static void monitor_quit(struct mt_ctx *mt_ctx, int ret) } else if (pid != 0) { error = 0; if (WIFEXITED(status)) { - DEBUG(1, ("Child [%s] exited gracefully\n", svc->name)); + DEBUG(1, "Child [%s] exited gracefully\n", svc->name); } else if (WIFSIGNALED(status)) { - DEBUG(1, ("Child [%s] terminated with a signal\n", svc->name)); + DEBUG(1, "Child [%s] terminated with a signal\n", svc->name); } else { - DEBUG(0, ("Child [%s] did not exit cleanly\n", svc->name)); + DEBUG(0, "Child [%s] did not exit cleanly\n", svc->name); /* Forcibly kill this child */ kill(svc->pid, SIGKILL); } @@ -1471,10 +1471,10 @@ static void monitor_quit_signal(struct tevent_context *ev, { struct mt_ctx *mt_ctx = talloc_get_type(private_data, struct mt_ctx);
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Received shutdown command\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Received shutdown command\n");
- DEBUG(SSSDBG_IMPORTANT_INFO, ("Monitor received %s: terminating " - "children\n", strsignal(signum))); + DEBUG(SSSDBG_IMPORTANT_INFO, "Monitor received %s: terminating " + "children\n", strsignal(signum));
monitor_quit(mt_ctx, 0); } @@ -1483,7 +1483,7 @@ static void signal_res_init(struct mt_ctx *monitor) { struct mt_svc *cur_svc; int ret; - DEBUG(SSSDBG_OP_FAILURE, ("Reloading Resolv.conf.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Reloading Resolv.conf.\n");
ret = res_init(); if (ret == 0) { @@ -1506,7 +1506,7 @@ static void signal_offline(struct tevent_context *ev, monitor = talloc_get_type(private_data, struct mt_ctx);
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Signaling providers to go offline immediately.\n")); + "Signaling providers to go offline immediately.\n");
/* Signal all providers to immediately go offline */ for(cur_svc = monitor->svc_list; cur_svc; cur_svc = cur_svc->next) { @@ -1530,7 +1530,7 @@ static void signal_offline_reset(struct tevent_context *ev, monitor = talloc_get_type(private_data, struct mt_ctx);
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Signaling providers to reset offline immediately.\n")); + "Signaling providers to reset offline immediately.\n");
for(cur_svc = monitor->svc_list; cur_svc; cur_svc = cur_svc->next) { if (cur_svc->provider) { @@ -1571,14 +1571,14 @@ static errno_t load_configuration(TALLOC_CTX *mem_ctx,
cdb_file = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE); if (cdb_file == NULL) { - DEBUG(0,("Out of memory, aborting!\n")); + DEBUG(0,"Out of memory, aborting!\n"); ret = ENOMEM; goto done; }
ret = confdb_init(ctx, &ctx->cdb, cdb_file); if (ret != EOK) { - DEBUG(0,("The confdb initialization failed\n")); + DEBUG(0,"The confdb initialization failed\n"); goto done; }
@@ -1595,26 +1595,26 @@ static errno_t load_configuration(TALLOC_CTX *mem_ctx,
ret = confdb_init(ctx, &ctx->cdb, cdb_file); if (ret != EOK) { - DEBUG(0,("The confdb initialization failed\n")); + DEBUG(0,"The confdb initialization failed\n"); goto done; }
/* Load special entries */ ret = confdb_create_base(ctx->cdb); if (ret != EOK) { - DEBUG(0, ("Unable to load special entries into confdb\n")); + DEBUG(0, "Unable to load special entries into confdb\n"); goto done; } } else if (ret != EOK) { - DEBUG(0, ("Fatal error initializing confdb\n")); + DEBUG(0, "Fatal error initializing confdb\n"); goto done; } talloc_zfree(cdb_file);
ret = confdb_init_db(config_file, ctx->cdb); if (ret != EOK) { - DEBUG(0, ("ConfDB initialization has failed [%s]\n", - strerror(ret))); + DEBUG(0, "ConfDB initialization has failed [%s]\n", + strerror(ret)); goto done; }
@@ -1672,7 +1672,7 @@ static void config_file_changed(struct tevent_context *ev,
te = tevent_add_timer(ev, ev, tv, process_config_file, file_ctx); if (!te) { - DEBUG(0, ("Unable to queue config file update! Exiting.\n")); + DEBUG(0, "Unable to queue config file update! Exiting.\n"); kill(getpid(), SIGTERM); return; } @@ -1704,7 +1704,7 @@ static void process_config_file(struct tevent_context *ev, event_size = sizeof(struct inotify_event); file_ctx = talloc_get_type(ptr, struct config_file_ctx);
- DEBUG(1, ("Processing config file changes\n")); + DEBUG(1, "Processing config file changes\n");
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) return; @@ -1719,8 +1719,8 @@ static void process_config_file(struct tevent_context *ev, if (len == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Critical error reading inotify file descriptor [%d]: %s\n", - ret, strerror(ret))); + "Critical error reading inotify file descriptor [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -1740,8 +1740,8 @@ static void process_config_file(struct tevent_context *ev, if (len == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Critical error reading inotify file descriptor [%d]: %s\n", - ret, strerror(ret))); + "Critical error reading inotify file descriptor [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -1752,7 +1752,7 @@ static void process_config_file(struct tevent_context *ev, } } if (!cb) { - DEBUG(0, ("Unknown watch descriptor\n")); + DEBUG(0, "Unknown watch descriptor\n"); goto done; }
@@ -1767,12 +1767,12 @@ static void process_config_file(struct tevent_context *ev, struct tevent_timer *tev; tv.tv_sec = t.tv_sec+5; tv.tv_usec = t.tv_usec; - DEBUG(5, ("Restoring inotify watch.\n")); + DEBUG(5, "Restoring inotify watch.\n");
cb->retries = 0; rw_ctx = talloc(file_ctx, struct rewatch_ctx); if(!rw_ctx) { - DEBUG(0, ("Could not restore inotify watch. Quitting!\n")); + DEBUG(0, "Could not restore inotify watch. Quitting!\n"); close(file_ctx->mt_ctx->inotify_fd); kill(getpid(), SIGTERM); goto done; @@ -1782,7 +1782,7 @@ static void process_config_file(struct tevent_context *ev,
tev = tevent_add_timer(ev, rw_ctx, tv, rewatch_config_file, rw_ctx); if (tev == NULL) { - DEBUG(0, ("Could not restore inotify watch. Quitting!\n")); + DEBUG(0, "Could not restore inotify watch. Quitting!\n"); close(file_ctx->mt_ctx->inotify_fd); kill(getpid(), SIGTERM); } @@ -1818,7 +1818,7 @@ static void rewatch_config_file(struct tevent_context *ev, cb->retries++; if (cb->retries > 6) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not restore inotify watch. Switching to polling!\n")); + "Could not restore inotify watch. Switching to polling!\n"); close(file_ctx->mt_ctx->inotify_fd); err = monitor_config_file_fallback(file_ctx->parent_ctx, file_ctx->mt_ctx, @@ -1846,13 +1846,13 @@ static void rewatch_config_file(struct tevent_context *ev, tv.tv_usec = t.tv_usec;
DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add inotify watch for file [%s]. Error [%d:%s]\n", - cb->filename, err, strerror(err))); + "Could not add inotify watch for file [%s]. Error [%d:%s]\n", + cb->filename, err, strerror(err));
tev = tevent_add_timer(ev, ev, tv, rewatch_config_file, rw_ctx); if (tev == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not restore inotify watch. Quitting!\n")); + "Could not restore inotify watch. Quitting!\n"); close(file_ctx->mt_ctx->inotify_fd); kill(getpid(), SIGTERM); } @@ -1885,8 +1885,8 @@ static void poll_config_file(struct tevent_context *ev, ret = stat(cb->filename, &file_stat); if (ret < 0) { err = errno; - DEBUG(0, ("Could not stat file [%s]. Error [%d:%s]\n", - cb->filename, err, strerror(err))); + DEBUG(0, "Could not stat file [%s]. Error [%d:%s]\n", + cb->filename, err, strerror(err)); /* TODO: If the config file is missing, should we shut down? */ return; } @@ -1896,7 +1896,7 @@ static void poll_config_file(struct tevent_context *ev, /* Note: this will fire if the modification time changes into the past * as well as the future. */ - DEBUG(1, ("Config file changed\n")); + DEBUG(1, "Config file changed\n"); cb->modified = file_stat.st_mtime;
/* Tell the monitor to signal the children */ @@ -1910,7 +1910,7 @@ static void poll_config_file(struct tevent_context *ev, file_ctx->timer = tevent_add_timer(ev, file_ctx->parent_ctx, tv, poll_config_file, file_ctx); if (!file_ctx->timer) { - DEBUG(0, ("Error: Config file no longer monitored for changes!\n")); + DEBUG(0, "Error: Config file no longer monitored for changes!\n"); } }
@@ -1928,8 +1928,8 @@ static int try_inotify(struct config_file_ctx *file_ctx, const char *filename, file_ctx->mt_ctx->inotify_fd = inotify_init(); if (file_ctx->mt_ctx->inotify_fd < 0) { err = errno; - DEBUG(0, ("Could not initialize inotify, error [%d:%s]\n", - err, strerror(err))); + DEBUG(0, "Could not initialize inotify, error [%d:%s]\n", + err, strerror(err)); return err; }
@@ -1974,8 +1974,8 @@ static int try_inotify(struct config_file_ctx *file_ctx, const char *filename, cb->filename, IN_MODIFY); if (cb->wd < 0) { err = errno; - DEBUG(0, ("Could not add inotify watch for file [%s]. Error [%d:%s]\n", - cb->filename, err, strerror(err))); + DEBUG(0, "Could not add inotify watch for file [%s]. Error [%d:%s]\n", + cb->filename, err, strerror(err)); close(file_ctx->mt_ctx->inotify_fd); return err; } @@ -2004,13 +2004,13 @@ static int monitor_config_file(TALLOC_CTX *mem_ctx, err = errno; if (err == ENOENT && ignore_missing) { DEBUG(SSSDBG_MINOR_FAILURE, - ("file [%s] is missing. Will not update online status " - "based on watching the file\n", file)); + "file [%s] is missing. Will not update online status " + "based on watching the file\n", file); return EOK; } else { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not stat file [%s]. Error [%d:%s]\n", - file, err, strerror(err))); + "Could not stat file [%s]. Error [%d:%s]\n", + file, err, strerror(err));
return err; } @@ -2063,14 +2063,14 @@ errno_t monitor_config_file_fallback(TALLOC_CTX *mem_ctx, err = errno; if (err == ENOENT && ignore_missing) { DEBUG(SSSDBG_MINOR_FAILURE, - ("file [%s] is missing. Will not update online status " - "based on watching the file\n", file)); + "file [%s] is missing. Will not update online status " + "based on watching the file\n", file); return EOK;
} else { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not stat file [%s]. Error [%d:%s]\n", - file, err, strerror(err))); + "Could not stat file [%s]. Error [%d:%s]\n", + file, err, strerror(err));
return err; } @@ -2134,9 +2134,9 @@ int monitor_process_init(struct mt_ctx *ctx, if (ret < 0) { error = errno; DEBUG(1, - ("Unable to set KRB5RCACHEDIR: %s." + "Unable to set KRB5RCACHEDIR: %s." "Will attempt to use libkrb5 defaults\n", - strerror(error))); + strerror(error)); } talloc_zfree(rcachedir); } @@ -2229,7 +2229,7 @@ int monitor_process_init(struct mt_ctx *ctx, ret = setup_netlink(ctx, ctx->ev, network_status_change_cb, ctx, &ctx->nlctx); if (ret != EOK) { - DEBUG(2, ("Cannot set up listening for network notifications\n")); + DEBUG(2, "Cannot set up listening for network notifications\n"); return ret; }
@@ -2275,7 +2275,7 @@ static void init_timeout(struct tevent_context *ev, { struct mon_init_conn *mini;
- DEBUG(2, ("Client timed out before Identification!\n")); + DEBUG(2, "Client timed out before Identification!\n");
mini = talloc_get_type(ptr, struct mon_init_conn);
@@ -2295,13 +2295,13 @@ static int monitor_service_init(struct sbus_connection *conn, void *data) struct mon_init_conn *mini; struct timeval tv;
- DEBUG(SSSDBG_TRACE_FUNC, ("Initializing D-BUS Service\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Initializing D-BUS Service\n");
ctx = talloc_get_type(data, struct mt_ctx);
mini = talloc(conn, struct mon_init_conn); if (!mini) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -2313,7 +2313,7 @@ static int monitor_service_init(struct sbus_connection *conn, void *data)
mini->timeout = tevent_add_timer(ctx->ev, mini, tv, init_timeout, mini); if (!mini->timeout) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -2335,11 +2335,11 @@ static int service_send_ping(struct mt_svc *svc) int ret;
if (!svc->conn) { - DEBUG(8, ("Service not yet initialized\n")); + DEBUG(8, "Service not yet initialized\n"); return ENXIO; }
- DEBUG(4,("Pinging %s\n", svc->name)); + DEBUG(4,"Pinging %s\n", svc->name);
/* * Set up identity request @@ -2351,7 +2351,7 @@ static int service_send_ping(struct mt_svc *svc) MONITOR_INTERFACE, MON_CLI_METHOD_PING); if (!msg) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(svc->conn); return ENOMEM; } @@ -2375,7 +2375,7 @@ static void ping_check(DBusPendingCall *pending, void *data) if (!svc) { /* The connection probably went down before the callback fired. * Not much we can do. */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid service pointer.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid service pointer.\n"); return; } svc->pending = NULL; @@ -2386,8 +2386,8 @@ static void ping_check(DBusPendingCall *pending, void *data) * until reply is valid or timeout has occurred. If reply is NULL * here, something is seriously wrong and we should bail out. */ - DEBUG(0, ("A reply callback was called but no reply was received" - " and no timeout occurred\n")); + DEBUG(0, "A reply callback was called but no reply was received" + " and no timeout occurred\n");
/* Destroy this connection */ sbus_disconnect(svc->conn); @@ -2400,7 +2400,7 @@ static void ping_check(DBusPendingCall *pending, void *data) /* ok peer replied, * make sure we reset the failure counter in the service structure */
- DEBUG(4,("Service %s replied to ping\n", svc->name)); + DEBUG(4,"Service %s replied to ping\n", svc->name);
svc->failed_pongs = 0; break; @@ -2418,16 +2418,16 @@ static void ping_check(DBusPendingCall *pending, void *data) if (strnlen(dbus_error_name, len + 1) == len && strncmp(dbus_error_name, DBUS_ERROR_NO_REPLY, len) == 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("A service PING timed out on [%s]. " + "A service PING timed out on [%s]. " "Attempt [%d]\n", - svc->name, svc->failed_pongs)); + svc->name, svc->failed_pongs); svc->failed_pongs++; break; }
DEBUG(SSSDBG_FATAL_FAILURE, - ("A service PING returned an error [%s], closing connection.\n", - dbus_error_name)); + "A service PING returned an error [%s], closing connection.\n", + dbus_error_name); /* Falling through to default intentionally*/ default: /* @@ -2454,7 +2454,7 @@ static int start_service(struct mt_svc *svc) struct tevent_timer *te; struct timeval tv;
- DEBUG(4,("Queueing service %s for startup\n", svc->name)); + DEBUG(4,"Queueing service %s for startup\n", svc->name);
tv = tevent_timeval_current();
@@ -2467,7 +2467,7 @@ static int start_service(struct mt_svc *svc) te = tevent_add_timer(svc->mt_ctx->ev, svc, tv, service_startup_handler, svc); if (te == NULL) { - DEBUG(0, ("Unable to queue service %s for startup\n", svc->name)); + DEBUG(0, "Unable to queue service %s for startup\n", svc->name); return ENOMEM; } return EOK; @@ -2490,8 +2490,8 @@ static void service_startup_handler(struct tevent_context *ev, mt_svc->pid = fork(); if (mt_svc->pid != 0) { if (mt_svc->pid == -1) { - DEBUG(0, ("Could not fork child to start service [%s]. " - "Continuing.\n", mt_svc->name)); + DEBUG(0, "Could not fork child to start service [%s]. " + "Continuing.\n", mt_svc->name); return; }
@@ -2508,7 +2508,7 @@ static void service_startup_handler(struct tevent_context *ev, &mt_svc->child_ctx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not register sigchld handler.\n")); + "Could not register sigchld handler.\n"); /* Should we exit here? For now, we'll hope this * child never dies, because we can't restart it. */ @@ -2527,7 +2527,7 @@ static void service_startup_handler(struct tevent_context *ev,
/* If we are here, exec() has failed * Print errno and abort quickly */ - DEBUG(0,("Could not exec %s, reason: %s\n", mt_svc->command, strerror(errno))); + DEBUG(0,"Could not exec %s, reason: %s\n", mt_svc->command, strerror(errno));
/* We have to call _exit() instead of exit() here * because a bug in D-BUS will cause the server to @@ -2546,8 +2546,8 @@ static void mt_svc_restart(struct tevent_context *ev, return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Scheduling service %s for restart %d\n", - svc->name, svc->restarts+1)); + DEBUG(SSSDBG_TRACE_FUNC, "Scheduling service %s for restart %d\n", + svc->name, svc->restarts+1);
if (svc->type == MT_SVC_SERVICE) { add_new_service(svc->mt_ctx, svc->name, svc->restarts + 1); @@ -2556,7 +2556,7 @@ static void mt_svc_restart(struct tevent_context *ev, } else { /* Invalid type? */ DEBUG(SSSDBG_CRIT_FAILURE, - ("BUG: Invalid child process type [%d]\n", svc->type)); + "BUG: Invalid child process type [%d]\n", svc->type); }
/* Free the old service (which will also remove it @@ -2576,14 +2576,14 @@ static void mt_svc_exit_handler(int pid, int wait_status, void *pvt)
if (WIFEXITED(wait_status)) { DEBUG(SSSDBG_OP_FAILURE, - ("Child [%s] exited with code [%d]\n", - svc->name, WEXITSTATUS(wait_status))); + "Child [%s] exited with code [%d]\n", + svc->name, WEXITSTATUS(wait_status)); } else if (WIFSIGNALED(wait_status)) { DEBUG(SSSDBG_OP_FAILURE, - ("Child [%s] terminated with signal [%d]\n", - svc->name, WTERMSIG(wait_status))); + "Child [%s] terminated with signal [%d]\n", + svc->name, WTERMSIG(wait_status)); } else { - DEBUG(0, ("Child [%s] did not exit cleanly\n", svc->name)); + DEBUG(0, "Child [%s] did not exit cleanly\n", svc->name); /* Forcibly kill this child, just in case */ kill(svc->pid, SIGKILL);
@@ -2600,7 +2600,7 @@ static void mt_svc_exit_handler(int pid, int wait_status, void *pvt) /* Restart the service */ if (svc->restarts > MONITOR_MAX_SVC_RESTARTS) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Process [%s], definitely stopped!\n", svc->name)); + "Process [%s], definitely stopped!\n", svc->name); talloc_free(svc);
/* exit with error */ @@ -2618,7 +2618,7 @@ static void mt_svc_exit_handler(int pid, int wait_status, void *pvt) te = tevent_add_timer(svc->mt_ctx->ev, svc, tv, mt_svc_restart, svc); if (!te) { /* Nothing much we can do */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return; } } @@ -2696,7 +2696,7 @@ int main(int argc, const char *argv[]) uid = getuid(); if (uid != 0) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Running under %"SPRIuid", must be root\n", uid)); + "Running under %"SPRIuid", must be root\n", uid); sss_log(SSS_LOG_ALERT, "sssd must be run as root"); return 8; } @@ -2779,9 +2779,9 @@ int main(int argc, const char *argv[]) break;
case EOK: - DEBUG(SSSDBG_TRACE_FUNC, ("NSCD socket was detected and it " + DEBUG(SSSDBG_TRACE_FUNC, "NSCD socket was detected and it " "seems to be configured not to interfere with " - "SSSD's caching capabilities\n")); + "SSSD's caching capabilities\n"); } }
@@ -2792,11 +2792,11 @@ int main(int argc, const char *argv[]) case EPERM: case EACCES: DEBUG(SSSDBG_CRIT_FAILURE, - ("Insufficient permissions to read configuration file.\n")); + "Insufficient permissions to read configuration file.\n"); break; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("SSSD couldn't load the configuration database.\n")); + "SSSD couldn't load the configuration database.\n"); sss_log(SSS_LOG_ALERT, "SSSD couldn't load the configuration database [%d]: %s.\n", ret, strerror(ret)); diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c index 6baf136..24fbed5 100644 --- a/src/monitor/monitor_netlink.c +++ b/src/monitor/monitor_netlink.c @@ -155,7 +155,7 @@ static bool has_wireless_extension(const char *ifname) s = socket(PF_INET, SOCK_DGRAM, 0); if (s == -1) { ret = errno; - DEBUG(2, ("Could not open socket: [%d] %s\n", ret, strerror(ret))); + DEBUG(2, "Could not open socket: [%d] %s\n", ret, strerror(ret)); return false; }
@@ -178,10 +178,10 @@ static bool has_ethernet_encapsulation(const char *sysfs_path) ret = snprintf(type_path, SYSFS_TYPE_PATH_MAX, "%s/%s", sysfs_path, TYPE_FILE); if (ret < 0) { - DEBUG(SSSDBG_OP_FAILURE, ("snprintf failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "snprintf failed\n"); return false; } else if (ret >= SYSFS_TYPE_PATH_MAX) { - DEBUG(SSSDBG_OP_FAILURE, ("path too long?!?!\n")); + DEBUG(SSSDBG_OP_FAILURE, "path too long?!?!\n"); return false; }
@@ -189,8 +189,8 @@ static bool has_ethernet_encapsulation(const char *sysfs_path) fd = open(type_path, O_RDONLY); if (fd == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("Could not open sysfs file %s: [%d] %s\n", - type_path, ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not open sysfs file %s: [%d] %s\n", + type_path, ret, strerror(ret)); return false; }
@@ -200,7 +200,7 @@ static bool has_ethernet_encapsulation(const char *sysfs_path) if (ret == -1) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("read failed [%d][%s].\n", ret, strerror(ret))); + "read failed [%d][%s].\n", ret, strerror(ret)); close(fd); return false; } @@ -219,10 +219,10 @@ static bool has_phy_80211_subdir(const char *sysfs_path) ret = snprintf(phy80211_path, SYSFS_SUBDIR_PATH_MAX, "%s/%s", sysfs_path, PHY_80211_SUBDIR); if (ret < 0) { - DEBUG(SSSDBG_OP_FAILURE, ("snprintf failed")); + DEBUG(SSSDBG_OP_FAILURE, "snprintf failed"); return false; } else if (ret >= SYSFS_SUBDIR_PATH_MAX) { - DEBUG(SSSDBG_OP_FAILURE, ("path too long?!?!\n")); + DEBUG(SSSDBG_OP_FAILURE, "path too long?!?!\n"); return false; }
@@ -231,18 +231,18 @@ static bool has_phy_80211_subdir(const char *sysfs_path) if (ret == -1) { ret = errno; if (ret == ENOENT || ret == ENOTDIR) { - DEBUG(SSSDBG_TRACE_LIBS, ("No %s directory in sysfs, probably " - "not a wireless interface\n", PHY_80211_SUBDIR)); + DEBUG(SSSDBG_TRACE_LIBS, "No %s directory in sysfs, probably " + "not a wireless interface\n", PHY_80211_SUBDIR); } else { - DEBUG(SSSDBG_OP_FAILURE, ("stat failed: [%d] %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "stat failed: [%d] %s\n", + ret, strerror(ret)); } return false; }
if (statbuf.st_mode & S_IFDIR) { - DEBUG(SSSDBG_TRACE_LIBS, ("Directory %s found in sysfs, looks like " - "a wireless iface\n", PHY_80211_SUBDIR)); + DEBUG(SSSDBG_TRACE_LIBS, "Directory %s found in sysfs, looks like " + "a wireless iface\n", PHY_80211_SUBDIR); return true; }
@@ -256,32 +256,32 @@ static bool discard_iff_up(const char *ifname)
/* This catches most of the new 80211 drivers */ if (has_wireless_extension(ifname)) { - DEBUG(SSSDBG_TRACE_FUNC, ("%s has a wireless extension\n", ifname)); + DEBUG(SSSDBG_TRACE_FUNC, "%s has a wireless extension\n", ifname); return true; }
ret = snprintf(path, SYSFS_IFACE_PATH_MAX, SYSFS_IFACE_TEMPLATE, ifname); if (ret < 0) { - DEBUG(SSSDBG_OP_FAILURE, ("snprintf failed")); + DEBUG(SSSDBG_OP_FAILURE, "snprintf failed"); return false; } else if (ret >= SYSFS_IFACE_PATH_MAX) { - DEBUG(SSSDBG_OP_FAILURE, ("path too long?!?!\n")); + DEBUG(SSSDBG_OP_FAILURE, "path too long?!?!\n"); return false; }
/* This will filter PPP and such. Both wired and wireless * interfaces have the encapsulation. */ if (!has_ethernet_encapsulation(path)) { - DEBUG(SSSDBG_TRACE_FUNC, ("%s does not have ethernet encapsulation, " - "filtering out\n", ifname)); + DEBUG(SSSDBG_TRACE_FUNC, "%s does not have ethernet encapsulation, " + "filtering out\n", ifname); return true; }
/* This captures old WEXT drivers, the new mac8011 would * be caught by the ioctl check */ if (has_phy_80211_subdir(path)) { - DEBUG(SSSDBG_TRACE_FUNC, ("%s has a 802_11 subdir, filtering out\n", - ifname)); + DEBUG(SSSDBG_TRACE_FUNC, "%s has a 802_11 subdir, filtering out\n", + ifname); return true; }
@@ -303,7 +303,7 @@ static void nladdr_to_string(struct nl_addr *nl, char *buf, size_t bufsize) if (!addr) return;
if (inet_ntop(addr_family, addr, buf, bufsize) == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("inet_ntop failed\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "inet_ntop failed\n"); snprintf(buf, bufsize, "unknown"); } } @@ -320,7 +320,7 @@ static bool nlw_accept_message(struct nlw_handle *nlp, uint32_t local_port;
if (snl == NULL) { - DEBUG(3, ("Malformed message, skipping\n")); + DEBUG(3, "Malformed message, skipping\n"); return false; }
@@ -338,8 +338,8 @@ static bool nlw_accept_message(struct nlw_handle *nlp, }
if (accept_msg == false) { - DEBUG(9, ("ignoring netlink message from PID %d", - hdr->nlmsg_pid)); + DEBUG(9, "ignoring netlink message from PID %d", + hdr->nlmsg_pid); }
return accept_msg; @@ -352,13 +352,13 @@ static bool nlw_is_addr_object(struct nl_object *obj)
filter = rtnl_addr_alloc(); if (!filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error!\n"); is_addr_object = false; }
/* Ensure it's an addr object */ if (!nl_object_match_filter(obj, OBJ_CAST(filter))) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Not an addr object\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Not an addr object\n"); is_addr_object = false; }
@@ -373,13 +373,13 @@ static bool nlw_is_route_object(struct nl_object *obj)
filter = rtnl_route_alloc(); if (!filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error!\n"); is_route_object = false; }
/* Ensure it's a route object */ if (!nl_object_match_filter(obj, OBJ_CAST(filter))) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Not a route object\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Not a route object\n"); is_route_object = false; }
@@ -394,13 +394,13 @@ static bool nlw_is_link_object(struct nl_object *obj)
filter = rtnl_link_alloc(); if (!filter) { - DEBUG(0, ("Allocation error!\n")); + DEBUG(0, "Allocation error!\n"); is_link_object = false; }
/* Ensure it's a link object */ if (!nl_object_match_filter(obj, OBJ_CAST(filter))) { - DEBUG(2, ("Not a link object\n")); + DEBUG(2, "Not a link object\n"); is_link_object = false; }
@@ -427,7 +427,7 @@ static int nlw_group_subscribe(struct nlw_handle *nlp, int group) ret = nl_socket_add_membership(nlp, group); if (ret != 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to add membership: %s\n", nlw_geterror(ret))); + "Unable to add membership: %s\n", nlw_geterror(ret)); return ret; } #else @@ -438,7 +438,7 @@ static int nlw_group_subscribe(struct nlw_handle *nlp, int group) &group, sizeof(group)); if (ret < 0) { ret = errno; - DEBUG(1, ("setsockopt failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "setsockopt failed (%d): %s\n", ret, strerror(ret)); return ret; } #endif @@ -473,8 +473,8 @@ static int event_msg_recv(struct nl_msg *msg, void *arg) creds = nlmsg_get_creds(msg); if (!creds || creds->uid != 0) { DEBUG(SSSDBG_TRACE_ALL, - ("Ignoring netlink message from UID %"SPRIuid, - creds ? creds->uid : (uid_t)-1)); + "Ignoring netlink message from UID %"SPRIuid, + creds ? creds->uid : (uid_t)-1); return NL_SKIP; }
@@ -494,7 +494,7 @@ static void addr_msg_handler(struct nl_object *obj, void *arg);
static enum nlw_msg_type message_type(struct nlmsghdr *hdr) { - DEBUG(SSSDBG_FUNC_DATA, ("netlink Message type: %d\n", hdr->nlmsg_type)); + DEBUG(SSSDBG_FUNC_DATA, "netlink Message type: %d\n", hdr->nlmsg_type); switch (hdr->nlmsg_type) { /* network interface added */ case RTM_NEWLINK: @@ -548,7 +548,7 @@ static int nlw_set_callbacks(struct nlw_handle *nlp, void *data) ret = nl_cb_set(cb, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, data); #endif if (ret != 0) { - DEBUG(1, ("Unable to set validation callback\n")); + DEBUG(1, "Unable to set validation callback\n"); return ret; }
@@ -559,7 +559,7 @@ static int nlw_set_callbacks(struct nlw_handle *nlp, void *data) ret = nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, event_msg_ready, data); #endif if (ret != 0) { - DEBUG(1, ("Unable to set receive callback\n")); + DEBUG(1, "Unable to set receive callback\n"); return ret; }
@@ -581,9 +581,9 @@ static void route_msg_debug_print(struct rtnl_route *route_obj) prefixlen = 0; }
- DEBUG(SSSDBG_TRACE_LIBS, ("route idx %d flags %#X family %d addr %s/%d\n", + DEBUG(SSSDBG_TRACE_LIBS, "route idx %d flags %#X family %d addr %s/%d\n", rtnlw_route_get_oif(route_obj), rtnl_route_get_flags(route_obj), - rtnl_route_get_family(route_obj), buf, prefixlen)); + rtnl_route_get_family(route_obj), buf, prefixlen);
}
@@ -600,7 +600,7 @@ static bool route_is_multicast(struct rtnl_route *route_obj)
nl = rtnl_route_get_dst(route_obj); if (!nl) { - DEBUG(SSSDBG_MINOR_FAILURE, ("A route with no destination?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "A route with no destination?\n"); return false; }
@@ -620,7 +620,7 @@ static bool route_is_multicast(struct rtnl_route *route_obj) return IN6_IS_ADDR_MULTICAST(addr6); }
- DEBUG(SSSDBG_MINOR_FAILURE, ("Unknown route address family\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Unknown route address family\n"); return false; }
@@ -635,7 +635,7 @@ static void route_msg_handler(struct nl_object *obj, void *arg)
if (route_is_multicast(route_obj)) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Discarding multicast route message\n")); + "Discarding multicast route message\n"); return; }
@@ -661,8 +661,8 @@ static void addr_msg_debug_print(struct rtnl_addr *addr_obj) rtnl_addr_flags2str(flags, str_flags, 512); nladdr_to_string(local_addr, buf, INET6_ADDRSTRLEN);
- DEBUG(SSSDBG_TRACE_LIBS, ("netlink addr message: iface idx %u " - "addr %s flags 0x%X (%s)\n", ifidx, buf, flags, str_flags)); + DEBUG(SSSDBG_TRACE_LIBS, "netlink addr message: iface idx %u " + "addr %s flags 0x%X (%s)\n", ifidx, buf, flags, str_flags); }
static void addr_msg_handler(struct nl_object *obj, void *arg) @@ -698,8 +698,8 @@ static void link_msg_handler(struct nl_object *obj, void *arg) rtnl_link_flags2str(flags, str_flags, 512);
ifname = rtnl_link_get_name(link_obj); - DEBUG(SSSDBG_TRACE_LIBS, ("netlink link message: iface idx %u (%s) " - "flags 0x%X (%s)\n", ifidx, ifname, flags, str_flags)); + DEBUG(SSSDBG_TRACE_LIBS, "netlink link message: iface idx %u (%s) " + "flags 0x%X (%s)\n", ifidx, ifname, flags, str_flags);
/* IFF_LOWER_UP is the indicator of carrier status */ if ((flags & IFF_RUNNING) && (flags & IFF_LOWER_UP) && @@ -715,13 +715,13 @@ static void netlink_fd_handler(struct tevent_context *ev, struct tevent_fd *fde, int ret;
if (!nlctx || !nlctx->nlp) { - DEBUG(1, ("Invalid netlink handle, this is most likely a bug!\n")); + DEBUG(1, "Invalid netlink handle, this is most likely a bug!\n"); return; }
ret = nl_recvmsgs_default(nlctx->nlp); if (ret != EOK) { - DEBUG(1, ("Error while reading from netlink fd\n")); + DEBUG(1, "Error while reading from netlink fd\n"); return; } } @@ -751,8 +751,8 @@ int setup_netlink(TALLOC_CTX *mem_ctx, struct tevent_context *ev, /* allocate the libnl handle/socket and register the default filter set */ nlctx->nlp = nlw_alloc(); if (!nlctx->nlp) { - DEBUG(SSSDBG_CRIT_FAILURE, (("unable to allocate netlink handle: %s"), - nlw_geterror(ENOMEM))); + DEBUG(SSSDBG_CRIT_FAILURE, ("unable to allocate netlink handle: %s"), + nlw_geterror(ENOMEM)); ret = ENOMEM; goto fail; } @@ -760,7 +760,7 @@ int setup_netlink(TALLOC_CTX *mem_ctx, struct tevent_context *ev, /* Register our custom message validation filter */ ret = nlw_set_callbacks(nlctx->nlp, nlctx); if (ret != 0) { - DEBUG(1, ("Unable to set callbacks\n")); + DEBUG(1, "Unable to set callbacks\n"); ret = EIO; goto fail; } @@ -769,7 +769,7 @@ int setup_netlink(TALLOC_CTX *mem_ctx, struct tevent_context *ev, ret = nl_connect(nlctx->nlp, NETLINK_ROUTE); if (ret != 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to connect to netlink: %s\n", nlw_geterror(ret))); + "Unable to connect to netlink: %s\n", nlw_geterror(ret)); ret = EIO; goto fail; } @@ -777,7 +777,7 @@ int setup_netlink(TALLOC_CTX *mem_ctx, struct tevent_context *ev, ret = nlw_enable_passcred(nlctx->nlp); if (ret != 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot enable credential passing: %s\n", nlw_geterror(ret))); + "Cannot enable credential passing: %s\n", nlw_geterror(ret)); ret = EIO; goto fail; } @@ -785,7 +785,7 @@ int setup_netlink(TALLOC_CTX *mem_ctx, struct tevent_context *ev, /* Subscribe to the LINK group for internal carrier signals */ ret = nlw_groups_subscribe(nlctx->nlp, groups); if (ret != 0) { - DEBUG(1, ("Unable to subscribe to netlink monitor\n")); + DEBUG(1, "Unable to subscribe to netlink monitor\n"); ret = EIO; goto fail; } @@ -799,14 +799,14 @@ int setup_netlink(TALLOC_CTX *mem_ctx, struct tevent_context *ev, ret = fcntl(nlfd, F_SETFL, flags | O_NONBLOCK); if (ret < 0) { ret = errno; - DEBUG(1, ("Cannot set the netlink fd to nonblocking\n")); + DEBUG(1, "Cannot set the netlink fd to nonblocking\n"); goto fail; }
nlctx->tefd = tevent_add_fd(ev, nlctx, nlfd, TEVENT_FD_READ, netlink_fd_handler, nlctx); if (nlctx->tefd == NULL) { - DEBUG(1, ("tevent_add_fd() failed\n")); + DEBUG(1, "tevent_add_fd() failed\n"); ret = EIO; goto fail; } diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c index 66270a7..d94116e 100644 --- a/src/monitor/monitor_sbus.c +++ b/src/monitor/monitor_sbus.c @@ -61,8 +61,8 @@ static void id_callback(DBusPendingCall *pending, void *ptr) * until reply is valid or timeout has occurred. If reply is NULL * here, something is seriously wrong and we should bail out. */ - DEBUG(0, ("Severe error. A reply callback was called but no" - " reply was received and no timeout occurred\n")); + DEBUG(0, "Severe error. A reply callback was called but no" + " reply was received and no timeout occurred\n");
/* FIXME: Destroy this connection ? */ goto done; @@ -75,19 +75,19 @@ static void id_callback(DBusPendingCall *pending, void *ptr) DBUS_TYPE_UINT16, &mon_ver, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1, ("Failed to parse message\n")); + DEBUG(1, "Failed to parse message\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); /* FIXME: Destroy this connection ? */ goto done; }
- DEBUG(4, ("Got id ack and version (%d) from Monitor\n", mon_ver)); + DEBUG(4, "Got id ack and version (%d) from Monitor\n", mon_ver);
break;
case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0,("The Monitor returned an error [%s]\n", - dbus_message_get_error_name(reply))); + DEBUG(0,"The Monitor returned an error [%s]\n", + dbus_message_get_error_name(reply)); /* Falling through to default intentionally*/ default: /* @@ -120,18 +120,18 @@ int monitor_common_send_id(struct sbus_connection *conn, MON_SRV_INTERFACE, MON_SRV_METHOD_REGISTER); if (msg == NULL) { - DEBUG(0, ("Out of memory?!\n")); + DEBUG(0, "Out of memory?!\n"); return ENOMEM; }
- DEBUG(4, ("Sending ID: (%s,%d)\n", name, version)); + DEBUG(4, "Sending ID: (%s,%d)\n", name, version);
ret = dbus_message_append_args(msg, DBUS_TYPE_STRING, &name, DBUS_TYPE_UINT16, &version, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1, ("Failed to build message\n")); + DEBUG(1, "Failed to build message\n"); return EIO; }
@@ -197,14 +197,14 @@ errno_t monitor_common_rotate_logs(struct confdb_ctx *confdb, old_debug_level, &debug_level); if (ret != EOK) { - DEBUG(0, ("Error reading from confdb (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(0, "Error reading from confdb (%d) [%s]\n", + ret, strerror(ret)); /* Try to proceed with the old value */ debug_level = old_debug_level; }
if (debug_level != old_debug_level) { - DEBUG(0, ("Debug level changed to %#.4x\n", debug_level)); + DEBUG(0, "Debug level changed to %#.4x\n", debug_level); debug_level = debug_convert_old_level(debug_level); }
@@ -226,7 +226,7 @@ errno_t sss_monitor_init(TALLOC_CTX *mem_ctx, /* Set up SBUS connection to the monitor */ ret = monitor_get_sbus_address(NULL, &sbus_address); if (ret != EOK) { - DEBUG(0, ("Could not locate monitor address.\n")); + DEBUG(0, "Could not locate monitor address.\n"); return ret; }
@@ -234,7 +234,7 @@ errno_t sss_monitor_init(TALLOC_CTX *mem_ctx, intf, &conn, NULL, pvt); if (ret != EOK) { - DEBUG(0, ("Failed to connect to monitor services.\n")); + DEBUG(0, "Failed to connect to monitor services.\n"); talloc_free(sbus_address); return ret; } @@ -243,7 +243,7 @@ errno_t sss_monitor_init(TALLOC_CTX *mem_ctx, /* Identify ourselves to the monitor */ ret = monitor_common_send_id(conn, svc_name, svc_version); if (ret != EOK) { - DEBUG(0, ("Failed to identify to the monitor!\n")); + DEBUG(0, "Failed to identify to the monitor!\n"); return ret; }
diff --git a/src/providers/ad/ad_access.c b/src/providers/ad/ad_access.c index 746017d..0ac417a 100644 --- a/src/providers/ad/ad_access.c +++ b/src/providers/ad/ad_access.c @@ -46,7 +46,7 @@ ad_access_handler(struct be_req *breq) if (strcasecmp(pd->domain, be_ctx->domain->name) != 0) { domain = find_subdomain_by_name(be_ctx->domain, pd->domain, true); if (domain == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("find_subdomain_by_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_subdomain_by_name failed.\n"); be_req_terminate(breq, DP_ERR_FATAL, PAM_SYSTEM_ERR, NULL); return; } diff --git a/src/providers/ad/ad_common.c b/src/providers/ad/ad_common.c index ab62d64..ab247a4 100644 --- a/src/providers/ad/ad_common.c +++ b/src/providers/ad/ad_common.c @@ -128,21 +128,21 @@ ad_create_default_options(TALLOC_CTX *mem_ctx,
ad_options->id = ad_create_default_sdap_options(ad_options); if (ad_options->id == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot initialize AD LDAP options\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize AD LDAP options\n"); talloc_free(ad_options); return NULL; }
ret = dp_opt_set_string(ad_options->basic, AD_KRB5_REALM, realm); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set AD domain\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set AD domain\n"); talloc_free(ad_options); return NULL; }
ret = dp_opt_set_string(ad_options->basic, AD_HOSTNAME, hostname); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set AD domain\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set AD domain\n"); talloc_free(ad_options); return NULL; } @@ -280,7 +280,7 @@ ad_get_common_options(TALLOC_CTX *mem_ctx, server = dp_opt_get_string(opts->basic, AD_SERVER); if (!server) { DEBUG(SSSDBG_CONF_SETTINGS, - ("No AD server set, will use service discovery!\n")); + "No AD server set, will use service discovery!\n"); }
/* Set the machine's hostname to the local host name if it @@ -292,18 +292,18 @@ ad_get_common_options(TALLOC_CTX *mem_ctx, if (gret != 0) { ret = errno; DEBUG(SSSDBG_FATAL_FAILURE, - ("gethostname failed [%s].\n", - strerror(ret))); + "gethostname failed [%s].\n", + strerror(ret)); goto done; } hostname[HOST_NAME_MAX] = '\0'; DEBUG(SSSDBG_CONF_SETTINGS, - ("Setting ad_hostname to [%s].\n", hostname)); + "Setting ad_hostname to [%s].\n", hostname); ret = dp_opt_set_string(opts->basic, AD_HOSTNAME, hostname); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Setting ad_hostname failed [%s].\n", - strerror(ret))); + "Setting ad_hostname failed [%s].\n", + strerror(ret)); goto done; } } @@ -331,13 +331,13 @@ ad_get_common_options(TALLOC_CTX *mem_ctx, dom->case_sensitive); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not set domain case-sensitive: [%s]\n", - strerror(ret))); + "Could not set domain case-sensitive: [%s]\n", + strerror(ret)); goto done; }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Setting domain case-insensitive\n")); + "Setting domain case-insensitive\n");
ret = EOK; *_opts = opts; @@ -374,7 +374,7 @@ _ad_servers_init(TALLOC_CTX *mem_ctx, /* Split the server list */ ret = split_on_separator(tmp_ctx, servers, ',', true, true, &list, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to parse server list!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to parse server list!\n"); goto done; }
@@ -383,9 +383,9 @@ _ad_servers_init(TALLOC_CTX *mem_ctx, if (be_fo_is_srv_identifier(list[i])) { if (!primary) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add server [%s] to failover service: " + "Failed to add server [%s] to failover service: " "SRV resolution only allowed for primary servers!\n", - list[i])); + list[i]); continue; }
@@ -401,8 +401,8 @@ _ad_servers_init(TALLOC_CTX *mem_ctx, false, sdata); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to add service discovery to failover: [%s]", - strerror(ret))); + "Failed to add service discovery to failover: [%s]", + strerror(ret)); goto done; }
@@ -418,12 +418,12 @@ _ad_servers_init(TALLOC_CTX *mem_ctx, false, sdata); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to add service discovery to failover: [%s]", - strerror(ret))); + "Failed to add service discovery to failover: [%s]", + strerror(ret)); goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Added service discovery for AD\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "Added service discovery for AD\n"); continue; }
@@ -443,7 +443,7 @@ _ad_servers_init(TALLOC_CTX *mem_ctx,
ret = be_fo_add_server(bectx, fo_gc_service, list[i], 0, sdata, primary); if (ret && ret != EEXIST) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add server\n"); goto done; }
@@ -456,11 +456,11 @@ _ad_servers_init(TALLOC_CTX *mem_ctx,
ret = be_fo_add_server(bectx, fo_service, list[i], 0, sdata, primary); if (ret && ret != EEXIST) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add server\n"); goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Added failover server %s\n", list[i])); + DEBUG(SSSDBG_CONF_SETTINGS, "Added failover server %s\n", list[i]); } done: talloc_free(tmp_ctx); @@ -494,13 +494,13 @@ static int ad_user_data_cmp(void *ud1, void *ud2) sd1 = talloc_get_type(ud1, struct ad_server_data); sd2 = talloc_get_type(ud2, struct ad_server_data); if (sd1 == NULL || sd2 == NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("No user data\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No user data\n"); return sd1 == sd2 ? 0 : 1; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Comparing %s with %s\n", + DEBUG(SSSDBG_TRACE_LIBS, "Comparing %s with %s\n", sd1->gc ? "GC" : "LDAP", - sd2->gc ? "GC" : "LDAP")); + sd2->gc ? "GC" : "LDAP");
if (sd1->gc == sd2->gc) { return 0; @@ -514,11 +514,11 @@ static void ad_online_cb(void *pvt) struct ad_service *service = talloc_get_type(pvt, struct ad_service);
if (service == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid private pointer\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid private pointer\n"); return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("The AD provider is online\n")); + DEBUG(SSSDBG_TRACE_FUNC, "The AD provider is online\n"); }
errno_t @@ -566,13 +566,13 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
ret = be_fo_add_service(bectx, ad_service, ad_user_data_cmp); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to create failover service!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to create failover service!\n"); goto done; }
ret = be_fo_add_service(bectx, ad_gc_service, ad_user_data_cmp); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to create GC failover service!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to create GC failover service!\n"); goto done; }
@@ -586,7 +586,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx, service->gc->kinit_service_name = service->krb5_service->name;
if (!krb5_realm) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No Kerberos realm set\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No Kerberos realm set\n"); ret = EINVAL; goto done; } @@ -599,7 +599,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
if (!primary_servers) { DEBUG(SSSDBG_CONF_SETTINGS, - ("No primary servers defined, using service discovery\n")); + "No primary servers defined, using service discovery\n"); primary_servers = BE_SRV_IDENTIFIER; }
@@ -621,7 +621,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx,
ret = be_add_online_cb(bectx, bectx, ad_online_cb, service, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set up AD online callback\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not set up AD online callback\n"); return ret; }
@@ -629,7 +629,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx, ad_resolve_callback, service); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to add failover callback! [%s]\n", strerror(ret))); + "Failed to add failover callback! [%s]\n", strerror(ret)); goto done; }
@@ -637,7 +637,7 @@ ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *bectx, ad_resolve_callback, service); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to add failover callback! [%s]\n", strerror(ret))); + "Failed to add failover callback! [%s]\n", strerror(ret)); goto done; }
@@ -666,13 +666,13 @@ ad_resolve_callback(void *private_data, struct fo_server *server)
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); return; }
sdata = fo_get_server_user_data(server); if (fo_is_srv_lookup(server) == false && sdata == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No user data?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No user data?\n"); return; }
@@ -685,37 +685,37 @@ ad_resolve_callback(void *private_data, struct fo_server *server) srvaddr = fo_get_server_hostent(server); if (!srvaddr) { DEBUG(SSSDBG_CRIT_FAILURE, - ("No hostent available for server (%s)\n", - fo_get_server_str_name(server))); + "No hostent available for server (%s)\n", + fo_get_server_str_name(server)); ret = EINVAL; goto done; }
address = resolv_get_string_address(tmp_ctx, srvaddr); if (address == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("resolv_get_string_address failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "resolv_get_string_address failed.\n"); ret = EIO; goto done; }
srv_name = fo_get_server_name(server); if (srv_name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get server host name\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not get server host name\n"); ret = EINVAL; goto done; }
new_uri = talloc_asprintf(service->sdap, "ldap://%s", srv_name); if (!new_uri) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to copy URI\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to copy URI\n"); ret = ENOMEM; goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Constructed uri '%s'\n", new_uri)); + DEBUG(SSSDBG_CONF_SETTINGS, "Constructed uri '%s'\n", new_uri);
sockaddr = resolv_get_sockaddr_address(tmp_ctx, srvaddr, LDAP_PORT); if (sockaddr == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("resolv_get_sockaddr_address failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "resolv_get_sockaddr_address failed.\n"); ret = EIO; goto done; } @@ -746,15 +746,15 @@ ad_resolve_callback(void *private_data, struct fo_server *server) }
if (!service->gc->uri) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to append to URI\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to append to URI\n"); ret = ENOMEM; goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Constructed GC uri '%s'\n", service->gc->uri)); + DEBUG(SSSDBG_CONF_SETTINGS, "Constructed GC uri '%s'\n", service->gc->uri);
if (service->gc->sockaddr == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("resolv_get_sockaddr_address failed.\n")); + "resolv_get_sockaddr_address failed.\n"); ret = EIO; goto done; } @@ -767,7 +767,7 @@ ad_resolve_callback(void *private_data, struct fo_server *server) srvaddr->family, address); if (safe_address == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_escape_ip_address failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_escape_ip_address failed.\n"); ret = ENOMEM; goto done; } @@ -776,7 +776,7 @@ ad_resolve_callback(void *private_data, struct fo_server *server) SSS_KRB5KDC_FO_SRV); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("write_krb5info_file failed, authentication might fail.\n")); + "write_krb5info_file failed, authentication might fail.\n"); } }
@@ -784,7 +784,7 @@ ad_resolve_callback(void *private_data, struct fo_server *server) done: if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error: [%s]\n", strerror(ret))); + "Error: [%s]\n", strerror(ret)); } talloc_free(tmp_ctx); return; @@ -805,7 +805,7 @@ ad_set_ad_id_options(struct ad_options *ad_opts, SDAP_PWD_POLICY, PWD_POL_OPT_MIT); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not set password policy\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not set password policy\n"); goto done; }
@@ -813,7 +813,7 @@ ad_set_ad_id_options(struct ad_options *ad_opts, krb5_realm = dp_opt_get_string(ad_opts->basic, AD_KRB5_REALM); if (!krb5_realm) { /* Should be impossible, this is set in ad_get_common_options() */ - DEBUG(SSSDBG_FATAL_FAILURE, ("No Kerberos realm\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "No Kerberos realm\n"); ret = EINVAL; goto done; } @@ -821,9 +821,9 @@ ad_set_ad_id_options(struct ad_options *ad_opts, ret = dp_opt_set_string(id_opts->basic, SDAP_KRB5_REALM, krb5_realm); if (ret != EOK) goto done; DEBUG(SSSDBG_CONF_SETTINGS, - ("Option %s set to %s\n", + "Option %s set to %s\n", id_opts->basic[SDAP_KRB5_REALM].opt_name, - krb5_realm)); + krb5_realm);
keytab_path = dp_opt_get_string(ad_opts->basic, AD_KEYTAB); if (keytab_path) { @@ -831,9 +831,9 @@ ad_set_ad_id_options(struct ad_options *ad_opts, keytab_path); if (ret != EOK) goto done; DEBUG(SSSDBG_CONF_SETTINGS, - ("Option %s set to %s\n", + "Option %s set to %s\n", id_opts->basic[SDAP_KRB5_KEYTAB].opt_name, - keytab_path)); + keytab_path); }
ret = sdap_set_sasl_options(id_opts, @@ -843,7 +843,7 @@ ad_set_ad_id_options(struct ad_options *ad_opts, AD_KRB5_REALM), keytab_path); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the SASL-related options\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set the SASL-related options\n"); goto done; }
@@ -927,16 +927,16 @@ ad_set_search_bases(struct sdap_options *id_opts) goto done; } DEBUG(SSSDBG_CONF_SETTINGS, - ("Option %s set to %s\n", + "Option %s set to %s\n", id_opts->basic[search_base_options[o]].opt_name, dp_opt_get_string(id_opts->basic, - search_base_options[o]))); + search_base_options[o])); } } } else { DEBUG(SSSDBG_CONF_SETTINGS, - ("Search base not set. SSSD will attempt to discover it later, " - "when connecting to the LDAP server.\n")); + "Search base not set. SSSD will attempt to discover it later, " + "when connecting to the LDAP server.\n"); }
/* Default search */ @@ -994,7 +994,7 @@ ad_get_auth_options(TALLOC_CTX *mem_ctx, &krb5_options); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not read Kerberos options from the configuration\n")); + "Could not read Kerberos options from the configuration\n"); goto done; }
@@ -1004,16 +1004,16 @@ ad_get_auth_options(TALLOC_CTX *mem_ctx, ret = dp_opt_set_string(krb5_options, KRB5_KDC, ad_servers); if (ret != EOK) goto done; DEBUG(SSSDBG_CONF_SETTINGS, - ("Option %s set to %s\n", + "Option %s set to %s\n", krb5_options[KRB5_KDC].opt_name, - ad_servers)); + ad_servers);
/* Set krb5 realm */ /* Set the Kerberos Realm for GSSAPI */ krb5_realm = dp_opt_get_string(ad_opts->basic, AD_KRB5_REALM); if (!krb5_realm) { /* Should be impossible, this is set in ad_get_common_options() */ - DEBUG(SSSDBG_FATAL_FAILURE, ("No Kerberos realm\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "No Kerberos realm\n"); ret = EINVAL; goto done; } @@ -1024,18 +1024,18 @@ ad_get_auth_options(TALLOC_CTX *mem_ctx, ret = dp_opt_set_string(krb5_options, KRB5_REALM, krb5_realm); if (ret != EOK) goto done; DEBUG(SSSDBG_CONF_SETTINGS, - ("Option %s set to %s\n", + "Option %s set to %s\n", krb5_options[KRB5_REALM].opt_name, - krb5_realm)); + krb5_realm);
/* Set flag that controls whether we want to write the * kdcinfo files at all */ ad_opts->service->krb5_service->write_kdcinfo = \ dp_opt_get_bool(krb5_options, KRB5_USE_KDCINFO); - DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", krb5_options[KRB5_USE_KDCINFO].opt_name, - ad_opts->service->krb5_service->write_kdcinfo ? "true" : "false")); + ad_opts->service->krb5_service->write_kdcinfo ? "true" : "false");
*_opts = talloc_steal(mem_ctx, krb5_options);
@@ -1055,8 +1055,8 @@ errno_t ad_get_dyndns_options(struct be_ctx *be_ctx, &ad_opts->dyndns_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot initialize AD dyndns opts [%d]: %s\n", - ret, sss_strerror(ret))); + "Cannot initialize AD dyndns opts [%d]: %s\n", + ret, sss_strerror(ret)); return ret; }
diff --git a/src/providers/ad/ad_domain_info.c b/src/providers/ad/ad_domain_info.c index c24da93..7e418f3 100644 --- a/src/providers/ad/ad_domain_info.c +++ b/src/providers/ad/ad_domain_info.c @@ -56,15 +56,15 @@ netlogon_get_flat_name(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_get_el(reply, AD_AT_NETLOGON, &el); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_el() failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_el() failed\n"); return ret; }
if (el->num_values == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("netlogon has no value\n")); + DEBUG(SSSDBG_OP_FAILURE, "netlogon has no value\n"); return ENOENT; } else if (el->num_values > 1) { - DEBUG(SSSDBG_OP_FAILURE, ("More than one netlogon value?\n")); + DEBUG(SSSDBG_OP_FAILURE, "More than one netlogon value?\n"); return EIO; }
@@ -73,22 +73,22 @@ netlogon_get_flat_name(TALLOC_CTX *mem_ctx,
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); if (ndr_pull == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ndr_pull_init_blob() failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ndr_pull_init_blob() failed.\n"); return ENOMEM; }
ndr_err = ndr_pull_netlogon_samlogon_response(ndr_pull, NDR_SCALARS, &response); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - DEBUG(SSSDBG_OP_FAILURE, ("ndr_pull_netlogon_samlogon_response() " - "failed [%d]\n", ndr_err)); + DEBUG(SSSDBG_OP_FAILURE, "ndr_pull_netlogon_samlogon_response() " + "failed [%d]\n", ndr_err); ret = EBADMSG; goto done; }
if (!(response.ntver & NETLOGON_NT_VERSION_5EX)) { - DEBUG(SSSDBG_OP_FAILURE, ("Wrong version returned [%x]\n", - response.ntver)); + DEBUG(SSSDBG_OP_FAILURE, "Wrong version returned [%x]\n", + response.ntver); ret = EBADMSG; goto done; } @@ -97,14 +97,14 @@ netlogon_get_flat_name(TALLOC_CTX *mem_ctx, *response.data.nt5_ex.domain_name != '\0') { flat_name = response.data.nt5_ex.domain_name; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("No netlogon data available\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No netlogon data available\n"); ret = ENOENT; goto done; }
*_flat_name = talloc_strdup(mem_ctx, flat_name); if (*_flat_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -195,7 +195,7 @@ ad_master_domain_next(struct tevent_req *req) SDAP_SEARCH_TIMEOUT), false); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send failed.\n"); return ENOMEM; } tevent_req_set_callback(subreq, ad_master_domain_next_done, req); @@ -224,7 +224,7 @@ ad_master_domain_next_done(struct tevent_req *subreq) ret = sdap_get_generic_recv(subreq, state, &reply_count, &reply); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send request failed.\n"); goto done; }
@@ -244,7 +244,7 @@ ad_master_domain_next_done(struct tevent_req *subreq) } else if (reply_count == 1) { ret = sysdb_attrs_get_el(reply[0], AD_AT_OBJECT_SID, &el); if (ret != EOK || el->num_values != 1) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_attrs_get_el failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_attrs_get_el failed.\n"); goto done; }
@@ -254,7 +254,7 @@ ad_master_domain_next_done(struct tevent_req *subreq) &sid_str); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert SID: [%s].\n", idmap_error_string(err))); + "Could not convert SID: [%s].\n", idmap_error_string(err)); ret = EFAULT; goto done; } @@ -262,17 +262,17 @@ ad_master_domain_next_done(struct tevent_req *subreq) state->sid = talloc_steal(state, sid_str); } else { DEBUG(SSSDBG_OP_FAILURE, - ("More than one result for domain SID found.\n")); + "More than one result for domain SID found.\n"); ret = EINVAL; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Found SID [%s].\n", state->sid)); + DEBUG(SSSDBG_TRACE_FUNC, "Found SID [%s].\n", state->sid);
ntver = sss_ldap_encode_ndr_uint32(state, NETLOGON_NT_VERSION_5EX | NETLOGON_NT_VERSION_WITH_CLOSEST_SITE); if (ntver == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_ldap_encode_ndr_uint32 failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_ldap_encode_ndr_uint32 failed.\n"); ret = ENOMEM; goto done; } @@ -281,7 +281,7 @@ ad_master_domain_next_done(struct tevent_req *subreq) AD_AT_DNS_DOMAIN, state->dom_name, AD_AT_NT_VERSION, ntver); if (filter == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -294,7 +294,7 @@ ad_master_domain_next_done(struct tevent_req *subreq) SDAP_SEARCH_TIMEOUT), false); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send failed.\n"); ret = ENOMEM; goto done; } @@ -321,19 +321,19 @@ ad_master_domain_netlogon_done(struct tevent_req *subreq) ret = sdap_get_generic_recv(subreq, state, &reply_count, &reply); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send request failed.\n"); tevent_req_error(req, ret); return; }
/* Failure to get the flat name is not fatal. Just quit. */ if (reply_count == 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No netlogon data available. Flat name " \ - "might not be usable\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No netlogon data available. Flat name " \ + "might not be usable\n"); goto done; } else if (reply_count > 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("More than one netlogon info returned.\n")); + "More than one netlogon info returned.\n"); goto done; }
@@ -341,12 +341,12 @@ ad_master_domain_netlogon_done(struct tevent_req *subreq)
ret = netlogon_get_flat_name(state, reply[0], &state->flat); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not get the flat name\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not get the flat name\n"); /* Not fatal. Just quit. */ goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Found flat name [%s].\n", state->flat)); + DEBUG(SSSDBG_TRACE_FUNC, "Found flat name [%s].\n", state->flat); done: tevent_req_done(req); return; diff --git a/src/providers/ad/ad_dyndns.c b/src/providers/ad/ad_dyndns.c index da01426..7e9fd2a 100644 --- a/src/providers/ad/ad_dyndns.c +++ b/src/providers/ad/ad_dyndns.c @@ -41,39 +41,39 @@ errno_t ad_dyndns_init(struct be_ctx *be_ctx, */ ret = ad_get_dyndns_options(be_ctx, ad_opts); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set AD options\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not set AD options\n"); return ret; }
if (dp_opt_get_bool(ad_opts->dyndns_ctx->opts, DP_OPT_DYNDNS_UPDATE) == false) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Dynamic DNS updates not set\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "Dynamic DNS updates not set\n"); return EOK; }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Dynamic DNS updates are on. Checking for nsupdate..\n")); + "Dynamic DNS updates are on. Checking for nsupdate..\n"); ret = be_nsupdate_check(); if (ret == ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("DNS updates requested but nsupdate not available\n")); + "DNS updates requested but nsupdate not available\n"); return EOK; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not check for nsupdate\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not check for nsupdate\n"); return ret; }
ad_opts->be_res = be_ctx->be_res; if (ad_opts->be_res == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Resolver must be initialized in order " - "to use the AD dynamic DNS updates\n")); + DEBUG(SSSDBG_OP_FAILURE, "Resolver must be initialized in order " + "to use the AD dynamic DNS updates\n"); return EINVAL; }
ret = be_nsupdate_init_timer(ad_opts->dyndns_ctx, be_ctx->ev, ad_dyndns_timer, ad_opts); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set up periodic update\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not set up periodic update\n"); return ret; }
@@ -81,7 +81,7 @@ errno_t ad_dyndns_init(struct be_ctx *be_ctx, ad_dyndns_update, ad_opts, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set up online callback\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not set up online callback\n"); return ret; }
@@ -99,7 +99,7 @@ void ad_dyndns_timer(void *pvt) req = sdap_dyndns_timer_conn_send(ctx, sdap_ctx->be->ev, sdap_ctx, ctx->dyndns_ctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); /* Not much we can do. Just attempt to reschedule */ be_nsupdate_timer_schedule(sdap_ctx->be->ev, ctx->dyndns_ctx); return; @@ -116,7 +116,7 @@ static void ad_dyndns_timer_connected(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to AD: [%d](%s)\n", ret, sss_strerror(ret))); + "Failed to connect to AD: [%d](%s)\n", ret, sss_strerror(ret)); return; }
@@ -138,7 +138,7 @@ void ad_dyndns_update(void *pvt)
req = ad_dyndns_update_send(ctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not update DNS\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not update DNS\n"); return; } tevent_req_set_callback(req, ad_dyndns_nsupdate_done, NULL); @@ -149,12 +149,12 @@ static void ad_dyndns_nsupdate_done(struct tevent_req *req) int ret = ad_dyndns_update_recv(req); talloc_free(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Updating DNS entry failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Updating DNS entry failed [%d]: %s\n", + ret, sss_strerror(ret)); return; }
- DEBUG(SSSDBG_OP_FAILURE, ("DNS update finished\n")); + DEBUG(SSSDBG_OP_FAILURE, "DNS update finished\n"); }
struct ad_dyndns_update_state { @@ -173,7 +173,7 @@ ad_dyndns_update_send(struct ad_options *ctx) struct sdap_id_ctx *sdap_ctx = ctx->id_ctx->sdap_id_ctx; LDAPURLDesc *lud;
- DEBUG(SSSDBG_TRACE_FUNC, ("Performing update\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Performing update\n");
req = tevent_req_create(ctx, &state, struct ad_dyndns_update_state); if (req == NULL) { @@ -183,8 +183,8 @@ ad_dyndns_update_send(struct ad_options *ctx)
if (ctx->dyndns_ctx->last_refresh + 60 > time(NULL) || ctx->dyndns_ctx->timer_in_progress) { - DEBUG(SSSDBG_FUNC_DATA, ("Last periodic update ran recently or timer" - "in progress, not scheduling another update\n")); + DEBUG(SSSDBG_FUNC_DATA, "Last periodic update ran recently or timer" + "in progress, not scheduling another update\n"); tevent_req_done(req); tevent_req_post(req, sdap_ctx->be->ev); return req; @@ -194,7 +194,7 @@ ad_dyndns_update_send(struct ad_options *ctx) ret = ldap_url_parse(ctx->service->sdap->uri, &lud); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to parse ldap URI (%s)!\n", ctx->service->sdap->uri)); + "Failed to parse ldap URI (%s)!\n", ctx->service->sdap->uri); ret = EINVAL; goto done; } @@ -202,7 +202,7 @@ ad_dyndns_update_send(struct ad_options *ctx) if (lud->lud_scheme != NULL && strcasecmp(lud->lud_scheme, "ldapi") == 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("The LDAP scheme is ldapi://, cannot proceed with update\n")); + "The LDAP scheme is ldapi://, cannot proceed with update\n"); ldap_free_urldesc(lud); ret = EINVAL; goto done; @@ -210,8 +210,8 @@ ad_dyndns_update_send(struct ad_options *ctx)
if (lud->lud_host == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("The LDAP URI (%s) did not contain a host name\n", - ctx->service->sdap->uri)); + "The LDAP URI (%s) did not contain a host name\n", + ctx->service->sdap->uri); ldap_free_urldesc(lud); ret = EINVAL; goto done; @@ -243,8 +243,8 @@ ad_dyndns_update_send(struct ad_options *ctx) if (!subreq) { ret = EIO; DEBUG(SSSDBG_OP_FAILURE, - ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); goto done; } tevent_req_set_callback(subreq, ad_dyndns_sdap_update_done, req); @@ -268,8 +268,8 @@ static void ad_dyndns_sdap_update_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Dynamic DNS update failed [%d]: %s\n", - ret, sss_strerror(ret))); + "Dynamic DNS update failed [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c index f09b9c6..bc54bcc 100644 --- a/src/providers/ad/ad_id.c +++ b/src/providers/ad/ad_id.c @@ -290,7 +290,7 @@ ad_account_info_complete(struct tevent_req *req) error_text = NULL; } else { DEBUG(SSSDBG_FATAL_FAILURE, - ("Bug: dp_error is OK on failed request")); + "Bug: dp_error is OK on failed request"); dp_error = DP_ERR_FATAL; error_text = req_error_text; } @@ -357,15 +357,15 @@ ad_enumeration_send(TALLOC_CTX *mem_ctx,
state->sdap_op = sdap_id_op_create(state, ectx->conn->conn_cache); if (state->sdap_op == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed.\n"); ret = ENOMEM; goto fail; }
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: %d(%s).\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n", + ret, strerror(ret)); goto fail; } tevent_req_set_callback(subreq, ad_enumeration_conn_done, req); @@ -392,12 +392,12 @@ ad_enumeration_conn_done(struct tevent_req *subreq) if (ret != EOK) { if (dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_TRACE_FUNC, - ("Backend is marked offline, retry later!\n")); + "Backend is marked offline, retry later!\n"); tevent_req_done(req); } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("Domain enumeration failed to connect to " \ - "LDAP server: (%d)[%s]\n", ret, strerror(ret))); + "Domain enumeration failed to connect to " \ + "LDAP server: (%d)[%s]\n", ret, strerror(ret)); tevent_req_error(req, ret); } return; @@ -408,7 +408,7 @@ ad_enumeration_conn_done(struct tevent_req *subreq) state->sdap_op, state->sdom->dom->name); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ad_master_domain_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ad_master_domain_send failed.\n"); tevent_req_error(req, ret); return; } @@ -430,7 +430,7 @@ ad_enumeration_master_done(struct tevent_req *subreq) &flat_name, &master_sid); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot retrieve master domain info\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot retrieve master domain info\n"); tevent_req_error(req, ret); return; } @@ -438,7 +438,7 @@ ad_enumeration_master_done(struct tevent_req *subreq) ret = sysdb_master_domain_add_info(state->sdom->dom, flat_name, master_sid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot save master domain info\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot save master domain info\n"); tevent_req_error(req, ret); return; } @@ -449,7 +449,7 @@ ad_enumeration_master_done(struct tevent_req *subreq) /* The ptask API will reschedule the enumeration on its own on * failure */ DEBUG(SSSDBG_OP_FAILURE, - ("Failed to schedule enumeration, retrying later!\n")); + "Failed to schedule enumeration, retrying later!\n"); tevent_req_error(req, ENOMEM); return; } @@ -469,7 +469,7 @@ ad_enumeration_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not enumerate domain %s\n", state->sdom->dom->name)); + "Could not enumerate domain %s\n", state->sdom->dom->name); tevent_req_error(req, ret); return; } @@ -483,7 +483,7 @@ ad_enumeration_done(struct tevent_req *subreq) state->sdom->dom, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not mark domain as having enumerated.\n")); + "Could not mark domain as having enumerated.\n"); /* This error is non-fatal, so continue */ }
diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c index c829cc8..fb4b4aa 100644 --- a/src/providers/ad/ad_init.c +++ b/src/providers/ad/ad_init.c @@ -124,8 +124,8 @@ common_ad_init(struct be_ctx *bectx) &ad_options); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not parse common options: [%s]\n", - strerror(ret))); + "Could not parse common options: [%s]\n", + strerror(ret)); goto done; }
@@ -140,8 +140,8 @@ common_ad_init(struct be_ctx *bectx) &ad_options->service); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to init AD failover service: [%s]\n", - strerror(ret))); + "Failed to init AD failover service: [%s]\n", + strerror(ret)); goto done; }
@@ -185,15 +185,15 @@ sssm_ad_id_init(struct be_ctx *bectx, ret = ad_dyndns_init(ad_ctx->sdap_id_ctx->be, ad_options); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failure setting up automatic DNS update\n")); + "Failure setting up automatic DNS update\n"); /* Continue without DNS updates */ }
ret = sdap_setup_child(); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("setup_child failed [%d][%s].\n", - ret, strerror(ret))); + "setup_child failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
@@ -222,7 +222,7 @@ sssm_ad_id_init(struct be_ctx *bectx, ret = setup_tls_config(ad_ctx->sdap_id_ctx->opts->basic); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("setup_tls_config failed [%s]\n", strerror(ret))); + "setup_tls_config failed [%s]\n", strerror(ret)); goto done; }
@@ -235,7 +235,7 @@ sssm_ad_id_init(struct be_ctx *bectx, default_host_dbs, ad_options->id, hostname, ad_domain); if (srv_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n"); ret = ENOMEM; goto done; } @@ -246,8 +246,8 @@ sssm_ad_id_init(struct be_ctx *bectx, /* fall back to standard plugin */ ret = be_fo_set_dns_srv_lookup_plugin(bectx, hostname); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to set SRV lookup plugin " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin " + "[%d]: %s\n", ret, strerror(ret)); goto done; } } @@ -258,8 +258,8 @@ sssm_ad_id_init(struct be_ctx *bectx, sdap_refresh_netgroups_recv, ad_ctx->sdap_id_ctx); if (ret != EOK && ret != EEXIST) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Periodical refresh of netgroups " - "will not work [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups " + "will not work [%d]: %s\n", ret, strerror(ret)); }
*ops = &ad_id_ops; @@ -308,15 +308,15 @@ sssm_ad_auth_init(struct be_ctx *bectx, &krb5_auth_ctx->opts); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not determine Kerberos options\n")); + "Could not determine Kerberos options\n"); goto done; }
ret = krb5_child_init(krb5_auth_ctx, bectx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not initialize krb5_child settings: [%s]\n", - strerror(ret))); + "Could not initialize krb5_child settings: [%s]\n", + strerror(ret)); goto done; }
@@ -380,8 +380,8 @@ sssm_ad_access_init(struct be_ctx *bectx, &access_ctx->ad_options); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not initialize access provider options: [%s]\n", - strerror(ret))); + "Could not initialize access provider options: [%s]\n", + strerror(ret)); goto fail; }
@@ -424,12 +424,12 @@ int sssm_ad_subdomains_init(struct be_ctx *bectx,
ret = sssm_ad_id_init(bectx, ops, (void **) &id_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ad_id_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sssm_ad_id_init failed.\n"); return ret; }
if (ad_options == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Global AD options not available.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Global AD options not available.\n"); return EINVAL; }
@@ -437,7 +437,7 @@ int sssm_ad_subdomains_init(struct be_ctx *bectx,
ret = ad_subdom_init(bectx, id_ctx, ad_domain, ops, pvt_data); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("ad_subdom_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ad_subdom_init failed.\n"); return ret; }
diff --git a/src/providers/ad/ad_srv.c b/src/providers/ad/ad_srv.c index 89186dd..192f1ce 100644 --- a/src/providers/ad/ad_srv.c +++ b/src/providers/ad/ad_srv.c @@ -131,7 +131,7 @@ static struct tevent_req *ad_get_dc_servers_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct ad_get_dc_servers_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -147,8 +147,8 @@ static struct tevent_req *ad_get_dc_servers_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Looking up domain controllers in domain %s\n", - domain)); + DEBUG(SSSDBG_TRACE_FUNC, "Looking up domain controllers in domain %s\n", + domain);
subreq = fo_discover_srv_send(state, ev, resolv_ctx, "ldap", FO_PROTO_TCP, domains); @@ -185,8 +185,8 @@ static void ad_get_dc_servers_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Found %zu domain controllers in domain %s\n", - state->num_servers, domain)); + DEBUG(SSSDBG_TRACE_FUNC, "Found %zu domain controllers in domain %s\n", + state->num_servers, domain);
done: if (ret != EOK) { @@ -249,7 +249,7 @@ struct tevent_req *ad_get_client_site_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct ad_get_client_site_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -337,8 +337,8 @@ static void ad_get_client_site_connect_done(struct tevent_req *subreq) ret = sdap_connect_host_recv(state, subreq, &state->sh); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to connect to domain controller " - "[%s:%d]\n", state->dc.host, state->dc.port)); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to connect to domain controller " + "[%s:%d]\n", state->dc.host, state->dc.port);
ret = ad_get_client_site_next_dc(req); if (ret == EOK) { @@ -405,7 +405,7 @@ static errno_t ad_get_client_site_parse_ndr(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -414,7 +414,7 @@ static errno_t ad_get_client_site_parse_ndr(TALLOC_CTX *mem_ctx,
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); if (ndr_pull == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ndr_pull_init_blob() failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ndr_pull_init_blob() failed.\n"); ret = ENOMEM; goto done; } @@ -422,15 +422,15 @@ static errno_t ad_get_client_site_parse_ndr(TALLOC_CTX *mem_ctx, ndr_err = ndr_pull_netlogon_samlogon_response(ndr_pull, NDR_SCALARS, &response); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - DEBUG(SSSDBG_OP_FAILURE, ("ndr_pull_netlogon_samlogon_response() " - "failed [%d]\n", ndr_err)); + DEBUG(SSSDBG_OP_FAILURE, "ndr_pull_netlogon_samlogon_response() " + "failed [%d]\n", ndr_err); ret = EBADMSG; goto done; }
if (!(response.ntver & NETLOGON_NT_VERSION_5EX)) { - DEBUG(SSSDBG_OP_FAILURE, ("This NT version does not provide site " - "information [%x]\n", response.ntver)); + DEBUG(SSSDBG_OP_FAILURE, "This NT version does not provide site " + "information [%x]\n", response.ntver); ret = EBADMSG; goto done; } @@ -488,7 +488,7 @@ static void ad_get_client_site_done(struct tevent_req *subreq) /* we're done with this LDAP, close connection */ talloc_zfree(state->sh); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to get netlogon information\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to get netlogon information\n");
ret = ad_get_client_site_next_dc(req); if (ret == EOK) { @@ -498,23 +498,23 @@ static void ad_get_client_site_done(struct tevent_req *subreq) }
if (reply_count == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("No netlogon information retrieved\n")); + DEBUG(SSSDBG_OP_FAILURE, "No netlogon information retrieved\n"); ret = ENOENT; goto done; }
ret = sysdb_attrs_get_el(reply[0], AD_AT_NETLOGON, &el); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_el() failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_el() failed\n"); goto done; }
if (el->num_values == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("netlogon has no value\n")); + DEBUG(SSSDBG_OP_FAILURE, "netlogon has no value\n"); ret = ENOENT; goto done; } else if (el->num_values > 1) { - DEBUG(SSSDBG_OP_FAILURE, ("More than one netlogon value?\n")); + DEBUG(SSSDBG_OP_FAILURE, "More than one netlogon value?\n"); ret = EIO; goto done; } @@ -523,13 +523,13 @@ static void ad_get_client_site_done(struct tevent_req *subreq) el->values[0].length, &state->site, &state->forest); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to retrieve site name [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Unable to retrieve site name [%d]: %s\n", + ret, strerror(ret)); ret = ENOENT; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Found site: %s\n", state->site)); + DEBUG(SSSDBG_TRACE_FUNC, "Found site: %s\n", state->site);
done: if (ret != EOK) { @@ -646,7 +646,7 @@ struct tevent_req *ad_srv_plugin_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct ad_srv_plugin_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -681,7 +681,7 @@ struct tevent_req *ad_srv_plugin_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_FUNC, ("About to find domain controllers\n")); + DEBUG(SSSDBG_TRACE_FUNC, "About to find domain controllers\n");
subreq = ad_get_dc_servers_send(state, ev, ctx->be_res->resolv, state->discovery_domain); @@ -718,7 +718,7 @@ static void ad_srv_plugin_dcs_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("About to locate suitable site\n")); + DEBUG(SSSDBG_TRACE_FUNC, "About to locate suitable site\n");
subreq = ad_get_client_site_send(state, state->ev, state->ctx->be_res, @@ -785,8 +785,8 @@ static void ad_srv_plugin_site_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("About to discover primary and " - "backup servers\n")); + DEBUG(SSSDBG_TRACE_FUNC, "About to discover primary and " + "backup servers\n");
subreq = fo_discover_servers_send(state, state->ev, state->ctx->be_res->resolv, @@ -831,15 +831,15 @@ static void ad_srv_plugin_servers_done(struct tevent_req *subreq) return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Got %zu primary and %zu backup servers\n", - state->num_primary_servers, state->num_backup_servers)); + DEBUG(SSSDBG_TRACE_FUNC, "Got %zu primary and %zu backup servers\n", + state->num_primary_servers, state->num_backup_servers);
ret = ad_sort_servers_by_dns(state, state->discovery_domain, &state->primary_servers, state->num_primary_servers); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to sort primary servers by DNS" - "[%d]: %s\n", ret, sss_strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to sort primary servers by DNS" + "[%d]: %s\n", ret, sss_strerror(ret)); /* continue */ }
@@ -847,8 +847,8 @@ static void ad_srv_plugin_servers_done(struct tevent_req *subreq) &state->backup_servers, state->num_backup_servers); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to sort backup servers by DNS" - "[%d]: %s\n", ret, sss_strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to sort backup servers by DNS" + "[%d]: %s\n", ret, sss_strerror(ret)); /* continue */ }
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c index d8e9b26..b2d3223 100644 --- a/src/providers/ad/ad_subdomains.c +++ b/src/providers/ad/ad_subdomains.c @@ -120,13 +120,13 @@ ad_subdom_store(struct ad_subdomains_ctx *ctx, ret = sysdb_attrs_get_uint32_t(subdom_attrs, AD_AT_TRUST_TYPE, &trust_type); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_uint32_t failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_uint32_t failed.\n"); goto done; }
ret = sysdb_attrs_get_string(subdom_attrs, AD_AT_TRUST_PARTNER, &name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to get subdomain name\n")); + DEBUG(SSSDBG_OP_FAILURE, "failed to get subdomain name\n"); goto done; }
@@ -138,14 +138,14 @@ ad_subdom_store(struct ad_subdomains_ctx *ctx,
ret = sysdb_attrs_get_string(subdom_attrs, AD_AT_FLATNAME, &flat); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to get flat name of subdomain %s\n", - name)); + DEBUG(SSSDBG_OP_FAILURE, "failed to get flat name of subdomain %s\n", + name); goto done; }
ret = sysdb_attrs_get_el(subdom_attrs, AD_AT_SID, &el); if (ret != EOK || el->num_values != 1) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_attrs_get_el failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_attrs_get_el failed.\n"); goto done; }
@@ -155,7 +155,7 @@ ad_subdom_store(struct ad_subdomains_ctx *ctx, &sid_str); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert SID: [%s].\n", idmap_error_string(err))); + "Could not convert SID: [%s].\n", idmap_error_string(err)); ret = EFAULT; goto done; } @@ -168,7 +168,7 @@ ad_subdom_store(struct ad_subdomains_ctx *ctx, ret = sysdb_subdomain_store(domain->sysdb, name, realm, flat, sid_str, mpg, false, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_subdomain_store failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_subdomain_store failed.\n"); goto done; }
@@ -202,7 +202,7 @@ static errno_t ad_subdomains_refresh(struct ad_subdomains_ctx *ctx, } ret = sysdb_attrs_get_string(reply[c], AD_AT_TRUST_PARTNER, &value); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; } if (strcmp(value, dom->name) == 0) { @@ -227,8 +227,8 @@ static errno_t ad_subdomains_refresh(struct ad_subdomains_ctx *ctx, /* Nothing we can do about the error. Let's at least try * to reuse the existing domains */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to parse subdom data, " - "will try to use cached subdomain\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to parse subdom data, " + "will try to use cached subdomain\n"); } handled[c] = true; h++; @@ -253,8 +253,8 @@ static errno_t ad_subdomains_refresh(struct ad_subdomains_ctx *ctx, */ ret = ad_subdom_store(ctx, domain, reply[c]); if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to parse subdom data, " - "will try to use cached subdomain\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to parse subdom data, " + "will try to use cached subdomain\n"); } }
@@ -298,15 +298,15 @@ static void ad_subdomains_retrieve(struct ad_subdomains_ctx *ctx, req_ctx->sdap_op = sdap_id_op_create(req_ctx, ctx->ldap_ctx->conn_cache); if (req_ctx->sdap_op == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed.\n"); ret = ENOMEM; goto done; }
req = sdap_id_op_connect_send(req_ctx->sdap_op, req_ctx, &ret); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: %d(%s).\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n", + ret, strerror(ret)); goto done; }
@@ -335,12 +335,12 @@ static void ad_subdomains_get_conn_done(struct tevent_req *req) if (ret) { if (dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No AD server is available, cannot get the " - "subdomain list while offline\n")); + "No AD server is available, cannot get the " + "subdomain list while offline\n"); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to AD server: [%d](%s)\n", - ret, strerror(ret))); + "Failed to connect to AD server: [%d](%s)\n", + ret, strerror(ret)); }
goto fail; @@ -351,7 +351,7 @@ static void ad_subdomains_get_conn_done(struct tevent_req *req) ctx->sdap_op, ctx->sd_ctx->domain_name); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ad_master_domain_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ad_master_domain_send failed.\n"); ret = ENOMEM; goto fail; } @@ -373,14 +373,14 @@ static void ad_subdomains_master_dom_done(struct tevent_req *req) &ctx->flat_name, &ctx->master_sid); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot retrieve master domain info\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot retrieve master domain info\n"); goto done; }
ret = sysdb_master_domain_add_info(ctx->sd_ctx->be_ctx->domain, ctx->flat_name, ctx->master_sid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot save master domain info\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot save master domain info\n"); goto done; }
@@ -421,7 +421,7 @@ static errno_t ad_subdomains_get_slave(struct ad_subdomains_req_ctx *ctx) false);
if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send failed.\n"); return ENOMEM; }
@@ -443,7 +443,7 @@ static void ad_subdomains_get_slave_domain_done(struct tevent_req *req) ret = sdap_get_generic_recv(req, ctx, &reply_count, &reply); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send request failed.\n"); goto done; }
@@ -471,27 +471,27 @@ static void ad_subdomains_get_slave_domain_done(struct tevent_req *req) ret = ad_subdomains_refresh(ctx->sd_ctx, ctx->reply_count, ctx->reply, &refresh_has_changes); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to refresh subdomains.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to refresh subdomains.\n"); goto done; }
if (refresh_has_changes) { ret = sysdb_update_subdomains(ctx->sd_ctx->be_ctx->domain); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_update_subdomains failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_update_subdomains failed.\n"); goto done; }
ret = ads_store_sdap_subdom(ctx->sd_ctx, ctx->sd_ctx->be_ctx->domain); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ads_store_sdap_subdom failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ads_store_sdap_subdom failed.\n"); goto done; }
ret = sss_write_domain_mappings(ctx->sd_ctx->be_ctx->domain, false); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("sss_krb5_write_mappings failed.\n")); + "sss_krb5_write_mappings failed.\n"); /* Just continue */ } } @@ -530,14 +530,14 @@ static void ad_subdom_online_cb(void *pvt)
ctx = talloc_get_type(pvt, struct ad_subdomains_ctx); if (!ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Bad private pointer\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Bad private pointer\n"); return; }
be_req = be_req_create(ctx, NULL, ctx->be_ctx, ad_subdom_be_req_callback, NULL); if (be_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_req_create() failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "be_req_create() failed.\n"); return; }
@@ -547,7 +547,7 @@ static void ad_subdom_online_cb(void *pvt) ctx->timer_event = tevent_add_timer(ctx->be_ctx->ev, ctx, tv, ad_subdom_timer_refresh, ctx); if (!ctx->timer_event) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom timer event\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to add subdom timer event\n"); } }
@@ -602,7 +602,7 @@ int ad_subdom_init(struct be_ctx *be_ctx,
ctx = talloc_zero(id_ctx, struct ad_subdomains_ctx); if (ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; }
@@ -612,7 +612,7 @@ int ad_subdom_init(struct be_ctx *be_ctx, ctx->sdap_id_ctx = id_ctx->sdap_id_ctx; ctx->domain_name = talloc_strdup(ctx, ad_domain); if (ctx->domain_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); return ENOMEM; } *ops = &ad_subdomains_ops; @@ -620,18 +620,18 @@ int ad_subdom_init(struct be_ctx *be_ctx,
ret = be_add_online_cb(ctx, be_ctx, ad_subdom_online_cb, ctx, NULL); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom online callback")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to add subdom online callback"); }
ret = be_add_offline_cb(ctx, be_ctx, ad_subdom_offline_cb, ctx, NULL); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom offline callback")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to add subdom offline callback"); }
err = sss_idmap_init(sss_idmap_talloc, ctx, sss_idmap_talloc_free, &ctx->idmap_ctx); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to initialize idmap context.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to initialize idmap context.\n"); return EFAULT; }
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 6b58d88..b5ed641 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -313,21 +313,21 @@ static errno_t be_queue_request(TALLOC_CTX *queue_mem_ctx, int ret;
if (*req_queue == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("Queue is empty, " \ - "running request immediately.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Queue is empty, " \ + "running request immediately.\n"); ret = be_file_request(req_mem_ctx, be_req, fn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("be_file_request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "be_file_request failed.\n"); return ret; } }
item = talloc_zero(queue_mem_ctx, struct bet_queue_item); if (item == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed, cannot add item to " \ - "request queue.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed, cannot add item to " \ + "request queue.\n"); } else { - DEBUG(SSSDBG_TRACE_ALL, ("Adding request to queue.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Adding request to queue.\n"); item->mem_ctx = req_mem_ctx; item->be_req = be_req; item->fn = fn; @@ -355,7 +355,7 @@ static void be_queue_next_request(struct be_req *be_req, enum bet_type type) req_queue = &be_req->becli->bectx->bet_info[type].req_queue;
if (*req_queue == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("Queue is empty, nothing to do.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Queue is empty, nothing to do.\n"); return; }
@@ -371,7 +371,7 @@ static void be_queue_next_request(struct be_req *be_req, enum bet_type type) }
if (*req_queue == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("Request queue is empty.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Request queue is empty.\n"); return; }
@@ -379,11 +379,11 @@ static void be_queue_next_request(struct be_req *be_req, enum bet_type type)
ret = be_file_request((*req_queue)->mem_ctx, next_be_req, (*req_queue)->fn); if (ret == EOK) { - DEBUG(SSSDBG_TRACE_ALL, ("Queued request filed successfully.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Queued request filed successfully.\n"); return; }
- DEBUG(SSSDBG_OP_FAILURE, ("be_file_request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "be_file_request failed.\n");
be_queue_next_request(next_be_req, type);
@@ -404,14 +404,14 @@ static void be_queue_next_request(struct be_req *be_req, enum bet_type type) DBUS_TYPE_INVALID);
if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to generate dbus reply\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to generate dbus reply\n"); dbus_message_unref(reply); goto done; }
dbus_conn = sbus_get_connection(next_be_req->becli->conn); if (dbus_conn == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "D-BUS not connected\n"); goto done; } dbus_connection_send(dbus_conn, reply, NULL); @@ -437,7 +437,7 @@ bool be_is_offline(struct be_ctx *ctx)
void be_mark_offline(struct be_ctx *ctx) { - DEBUG(8, ("Going offline!\n")); + DEBUG(8, "Going offline!\n");
ctx->offstat.went_offline = time(NULL); ctx->offstat.offline = true; @@ -494,9 +494,9 @@ static void get_subdomains_callback(struct be_req *req, dbus_uint32_t err_min = 0; const char *err_msg = NULL;
- DEBUG(SSSDBG_TRACE_FUNC, ("Backend returned: (%d, %d, %s) [%s]\n", + DEBUG(SSSDBG_TRACE_FUNC, "Backend returned: (%d, %d, %s) [%s]\n", dp_err_type, errnum, errstr?errstr:"<NULL>", - dp_pam_err_to_string(req, dp_err_type, errnum))); + dp_pam_err_to_string(req, dp_err_type, errnum));
be_queue_next_request(req, BET_SUBDOMAINS);
@@ -516,7 +516,7 @@ static void get_subdomains_callback(struct be_req *req, } if (!err_msg) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to set err_msg, Out of memory?\n")); + "Failed to set err_msg, Out of memory?\n"); err_msg = "OOM"; }
@@ -527,14 +527,14 @@ static void get_subdomains_callback(struct be_req *req, DBUS_TYPE_INVALID);
if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to generate dbus reply\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to generate dbus reply\n"); dbus_message_unref(reply); goto done; }
dbus_conn = sbus_get_connection(req->becli->conn); if (dbus_conn == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "D-BUS not connected\n"); goto done; } dbus_connection_send(dbus_conn, reply, NULL); @@ -573,7 +573,7 @@ static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn) DBUS_TYPE_STRING, &domain_hint, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(SSSDBG_CRIT_FAILURE,("Failed, to parse message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE,"Failed, to parse message!\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); return EIO; } @@ -583,7 +583,7 @@ static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn)
/* return an error if corresponding backend target is not configured */ if (becli->bectx->bet_info[BET_SUBDOMAINS].bet_ops == NULL) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Undefined backend target.\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Undefined backend target.\n"); err_maj = DP_ERR_FATAL; err_min = ENODEV; err_msg = "Subdomains back end target is not configured"; @@ -591,13 +591,13 @@ static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Got get subdomains [%sforced][%s]\n", force ? "" : "not ", - domain_hint == NULL ? "no hint": domain_hint )); + "Got get subdomains [%sforced][%s]\n", force ? "" : "not ", + domain_hint == NULL ? "no hint": domain_hint );
/* If we are offline return immediately */ if (becli->bectx->offstat.offline) { - DEBUG(SSSDBG_TRACE_FUNC, ("Cannot proceed, provider is offline.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Cannot proceed, provider is offline.\n"); err_maj = DP_ERR_OFFLINE; err_min = EAGAIN; err_msg = "Provider is offline"; @@ -659,14 +659,14 @@ immediate: DBUS_TYPE_STRING, &err_msg, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to generate dbus reply\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to generate dbus reply\n"); dbus_message_unref(reply); return EIO; }
if (!(err_maj == DP_ERR_FATAL && err_min == ENODEV)) { - DEBUG(SSSDBG_TRACE_LIBS, ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + DEBUG(SSSDBG_TRACE_LIBS, "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg); }
/* send reply back */ @@ -705,7 +705,7 @@ static void acctinfo_callback(struct be_req *req, err_msg = dp_pam_err_to_string(req, dp_err_type, errnum); } if (!err_msg) { - DEBUG(1, ("Failed to set err_msg, Out of memory?\n")); + DEBUG(1, "Failed to set err_msg, Out of memory?\n"); err_msg = "OOM"; }
@@ -715,21 +715,21 @@ static void acctinfo_callback(struct be_req *req, DBUS_TYPE_STRING, &err_msg, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(1, ("Failed to generate dbus reply\n")); + DEBUG(1, "Failed to generate dbus reply\n"); return; }
dbus_conn = sbus_get_connection(req->becli->conn); if (!dbus_conn) { - DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "D-BUS not connected\n"); return; }
dbus_connection_send(dbus_conn, reply, NULL); dbus_message_unref(reply);
- DEBUG(4, ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + DEBUG(4, "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg); }
/* finally free the request */ @@ -783,7 +783,7 @@ static void acctinfo_initgroups_callback(struct be_req *be_req, pr->orig_errstr = errstr;
if (!be_req->be_ctx->nss_cli || !be_req->be_ctx->nss_cli->conn) { - DEBUG(SSSDBG_MINOR_FAILURE, ("NSS Service not conected\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "NSS Service not conected\n"); ret = EACCES; goto done; } @@ -794,7 +794,7 @@ static void acctinfo_initgroups_callback(struct be_req *be_req, DP_INTERFACE, DP_REV_METHOD_INITGR_CHECK); if (!msg) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); ret = ENOMEM; goto done; } @@ -806,7 +806,7 @@ static void acctinfo_initgroups_callback(struct be_req *be_req, &pr->groups, pr->gnum, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); ret = ENOMEM; goto done; } @@ -816,8 +816,8 @@ static void acctinfo_initgroups_callback(struct be_req *be_req, acctinfo_callback_initgr_sbus, be_req, NULL); if (ret != EOK) { DEBUG(SSSDBG_TRACE_FUNC, - ("Error contacting NSS responder: %d [%s]\n", - ret, strerror(ret))); + "Error contacting NSS responder: %d [%s]\n", + ret, strerror(ret)); }
done: @@ -904,7 +904,7 @@ be_file_account_request(struct be_req *be_req, struct be_acct_req *ar) if ((ar->entry_type & 0xFF) == BE_REQ_INITGROUPS) { ret = be_initgroups_prereq(be_req); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Prerequest failed")); + DEBUG(SSSDBG_CRIT_FAILURE, "Prerequest failed"); return ret; } } @@ -913,7 +913,7 @@ be_file_account_request(struct be_req *be_req, struct be_acct_req *ar) ret = be_file_request(be_ctx, be_req, be_ctx->bet_info[BET_ID].bet_ops->handler); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to file request")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to file request"); return ret; }
@@ -1080,12 +1080,12 @@ static int be_get_account_info(DBusMessage *message, struct sbus_connection *con DBUS_TYPE_STRING, &domain, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1,("Failed, to parse message!\n")); + DEBUG(1,"Failed, to parse message!\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); return EIO; }
- DEBUG(4, ("Got request for [%u][%d][%s]\n", type, attr_type, filter)); + DEBUG(4, "Got request for [%u][%d][%s]\n", type, attr_type, filter);
reply = dbus_message_new_method_return(message); if (!reply) return ENOMEM; @@ -1106,8 +1106,8 @@ static int be_get_account_info(DBusMessage *message, struct sbus_connection *con DBUS_TYPE_INVALID); if (!dbret) return EIO;
- DEBUG(4, ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + DEBUG(4, "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg);
sbus_conn_send_reply(conn, reply); dbus_message_unref(reply); @@ -1220,8 +1220,8 @@ done: DBUS_TYPE_INVALID); if (!dbret) return EIO;
- DEBUG(4, ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + DEBUG(4, "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg);
/* send reply back */ sbus_conn_send_reply(conn, reply); @@ -1243,9 +1243,9 @@ static void be_pam_handler_callback(struct be_req *req, dbus_bool_t dbret; errno_t ret;
- DEBUG(4, ("Backend returned: (%d, %d, %s) [%s]\n", + DEBUG(4, "Backend returned: (%d, %d, %s) [%s]\n", dp_err_type, errnum, errstr?errstr:"<NULL>", - dp_pam_err_to_string(req, dp_err_type, errnum))); + dp_pam_err_to_string(req, dp_err_type, errnum));
pd = talloc_get_type(be_req_get_data(req), struct pam_data);
@@ -1255,8 +1255,8 @@ static void be_pam_handler_callback(struct be_req *req, dp_err_type == DP_ERR_OK) { if (!becli->bectx->bet_info[BET_SELINUX].bet_ops) { DEBUG(SSSDBG_TRACE_FUNC, - ("SELinux provider doesn't exist, " - "not sending the request to it.\n")); + "SELinux provider doesn't exist, " + "not sending the request to it.\n"); } else { req->phase = REQ_PHASE_SELINUX;
@@ -1265,32 +1265,32 @@ static void be_pam_handler_callback(struct be_req *req, req, becli->bectx->bet_info[BET_SELINUX].bet_ops->handler); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("be_file_request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "be_file_request failed.\n"); goto done; } return; } }
- DEBUG(4, ("Sending result [%d][%s]\n", pd->pam_status, pd->domain)); + DEBUG(4, "Sending result [%d][%s]\n", pd->pam_status, pd->domain); reply = (DBusMessage *)req->pvt; dbret = dp_pack_pam_response(reply, pd); if (!dbret) { - DEBUG(1, ("Failed to generate dbus reply\n")); + DEBUG(1, "Failed to generate dbus reply\n"); dbus_message_unref(reply); goto done; }
dbus_conn = sbus_get_connection(req->becli->conn); if (!dbus_conn) { - DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "D-BUS not connected\n"); goto done; }
dbus_connection_send(dbus_conn, reply, NULL); dbus_message_unref(reply);
- DEBUG(4, ("Sent result [%d][%s]\n", pd->pam_status, pd->domain)); + DEBUG(4, "Sent result [%d][%s]\n", pd->pam_status, pd->domain);
done: talloc_free(req); @@ -1314,14 +1314,14 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn)
reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(1, ("dbus_message_new_method_return failed, cannot send reply.\n")); + DEBUG(1, "dbus_message_new_method_return failed, cannot send reply.\n"); return ENOMEM; }
be_req = be_req_create(becli, becli, becli->bectx, be_pam_handler_callback, reply); if (!be_req) { - DEBUG(7, ("talloc_zero failed.\n")); + DEBUG(7, "talloc_zero failed.\n"); dbus_message_unref(reply); return ENOMEM; } @@ -1330,7 +1330,7 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn)
ret = dp_unpack_pam_request(message, be_req, &pd, &dbus_error); if (!ret) { - DEBUG(1,("Failed, to parse message!\n")); + DEBUG(1,"Failed, to parse message!\n"); talloc_free(be_req); return EIO; } @@ -1345,7 +1345,7 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn) }
- DEBUG(4, ("Got request with the following data\n")); + DEBUG(4, "Got request with the following data\n"); DEBUG_PAM_DATA(4, pd);
switch (pd->cmd) { @@ -1367,7 +1367,7 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn) goto done; break; default: - DEBUG(7, ("Unsupported PAM command [%d].\n", pd->cmd)); + DEBUG(7, "Unsupported PAM command [%d].\n", pd->cmd); pd->pam_status = PAM_MODULE_UNKNOWN; goto done; } @@ -1376,7 +1376,7 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn) * configured */ if (!becli->bectx->bet_info[target].bet_ops) { - DEBUG(7, ("Undefined backend target.\n")); + DEBUG(7, "Undefined backend target.\n"); pd->pam_status = PAM_MODULE_UNKNOWN; goto done; } @@ -1387,7 +1387,7 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn) be_req, becli->bectx->bet_info[target].bet_ops->handler); if (ret != EOK) { - DEBUG(7, ("be_file_request failed.\n")); + DEBUG(7, "be_file_request failed.\n"); goto done; }
@@ -1395,12 +1395,12 @@ static int be_pam_handler(DBusMessage *message, struct sbus_connection *conn)
done:
- DEBUG(4, ("Sending result [%d][%s]\n", - pd->pam_status, pd->domain)); + DEBUG(4, "Sending result [%d][%s]\n", + pd->pam_status, pd->domain);
ret = dp_pack_pam_response(reply, pd); if (!ret) { - DEBUG(1, ("Failed to generate dbus reply\n")); + DEBUG(1, "Failed to generate dbus reply\n"); talloc_free(be_req); dbus_message_unref(reply); return EIO; @@ -1436,16 +1436,16 @@ static void be_sudo_handler_reply(struct sbus_connection *conn, DBUS_TYPE_STRING, &err_msg, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to generate dbus reply\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to generate dbus reply\n"); return; }
- DEBUG(SSSDBG_FUNC_DATA, ("SUDO Backend returned: (%d, %d, %s)\n", - dp_err, dp_ret, errstr ? errstr : "<NULL>")); + DEBUG(SSSDBG_FUNC_DATA, "SUDO Backend returned: (%d, %d, %s)\n", + dp_err, dp_ret, errstr ? errstr : "<NULL>");
dbus_conn = sbus_get_connection(conn); if (!dbus_conn) { - DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "D-BUS not connected\n"); return; }
@@ -1483,7 +1483,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) const char *err_msg = NULL; int i;
- DEBUG(SSSDBG_TRACE_FUNC, ("Entering be_sudo_handler()\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Entering be_sudo_handler()\n");
user_data = sbus_conn_get_private_data(conn); if (user_data == NULL) { @@ -1498,7 +1498,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) reply = dbus_message_new_method_return(message); if (!reply) { DEBUG(SSSDBG_CRIT_FAILURE, - ("dbus_message_new_method_return failed, cannot send reply.\n")); + "dbus_message_new_method_return failed, cannot send reply.\n"); return ENOMEM; }
@@ -1506,7 +1506,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) be_req = be_req_create(be_cli, be_cli, be_cli->bectx, be_sudo_handler_callback, reply); if (be_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); dbus_message_unref(reply); return ENOMEM; } @@ -1516,7 +1516,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn)
/* get type of the request */ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed, to parse the message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse the message!\n"); ret = EIO; err_msg = "Invalid D-Bus message format"; goto fail; @@ -1542,7 +1542,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) /* get and set sudo request data */ sudo_req = talloc_zero(be_req, struct be_sudo_req); if (sudo_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto fail; }
@@ -1560,7 +1560,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) */ /* read rules_num */ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed, to parse the message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse the message!\n"); ret = EIO; err_msg = "Invalid D-Bus message format"; goto fail; @@ -1570,7 +1570,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn)
sudo_req->rules = talloc_array(sudo_req, char*, rules_num + 1); if (sudo_req->rules == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_array failed.\n"); ret = ENOMEM; goto fail; } @@ -1579,13 +1579,13 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) for (i = 0; i < rules_num; i++) { iter_next = dbus_message_iter_next(&iter); if (iter_next == FALSE) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed, to parse the message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse the message!\n"); ret = EIO; err_msg = "Invalid D-Bus message format"; goto fail; } if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed, to parse the message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse the message!\n"); ret = EIO; err_msg = "Invalid D-Bus message format"; goto fail; @@ -1594,7 +1594,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) dbus_message_iter_get_basic(&iter, &rule); sudo_req->rules[i] = talloc_strdup(sudo_req->rules, rule); if (sudo_req->rules[i] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto fail; } @@ -1604,7 +1604,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn)
break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid request type %d\n", sudo_req->type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid request type %d\n", sudo_req->type); ret = EINVAL; err_msg = "Invalid DP request type"; goto fail; @@ -1614,7 +1614,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn)
/* return an error if corresponding backend target is not configured */ if (!be_cli->bectx->bet_info[BET_SUDO].bet_ops) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Undefined backend target.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Undefined backend target.\n"); ret = ENODEV; goto fail; } @@ -1623,7 +1623,7 @@ static int be_sudo_handler(DBusMessage *message, struct sbus_connection *conn) be_req, be_cli->bectx->bet_info[BET_SUDO].bet_ops->handler); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_file_request failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "be_file_request failed.\n"); err_msg = "Cannot file back end request"; goto fail; } @@ -1659,17 +1659,17 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) dbus_uint32_t err_min; const char *err_msg;
- DEBUG(SSSDBG_TRACE_FUNC, ("Entering be_autofs_handler()\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Entering be_autofs_handler()\n");
user_data = sbus_conn_get_private_data(conn); if (user_data == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot get SBUS private data\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot get SBUS private data\n"); return EINVAL; }
be_cli = talloc_get_type(user_data, struct be_client); if (be_cli == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot get back end client context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot get back end client context\n"); return EINVAL; }
@@ -1680,7 +1680,7 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) DBUS_TYPE_STRING, &filter, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed, to parse message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse message!\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); return EIO; } @@ -1688,7 +1688,7 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) reply = dbus_message_new_method_return(message); if (!reply) { DEBUG(SSSDBG_CRIT_FAILURE, - ("dbus_message_new_method_return failed, cannot send reply.\n")); + "dbus_message_new_method_return failed, cannot send reply.\n"); return ENOMEM; }
@@ -1708,8 +1708,8 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) DBUS_TYPE_INVALID); if (!dbret) return EIO;
- DEBUG(SSSDBG_TRACE_LIBS, ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + DEBUG(SSSDBG_TRACE_LIBS, "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg);
sbus_conn_send_reply(conn, reply); dbus_message_unref(reply); @@ -1742,7 +1742,7 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) be_req = be_req_create(be_cli, be_cli, be_cli->bectx, be_autofs_handler_callback, reply); if (be_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); err_maj = DP_ERR_FATAL; err_min = ENOMEM; err_msg = "Out of memory"; @@ -1752,7 +1752,7 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) /* set autofs request data */ be_autofs_req = talloc_zero(be_req, struct be_autofs_req); if (be_autofs_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); err_maj = DP_ERR_FATAL; err_min = ENOMEM; err_msg = "Out of memory"; @@ -1761,7 +1761,7 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn)
be_autofs_req->mapname = talloc_strdup(be_autofs_req, filter_val); if (be_autofs_req->mapname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n"); err_maj = DP_ERR_FATAL; err_min = ENOMEM; err_msg = "Out of memory"; @@ -1778,7 +1778,7 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) be_req->req_data = be_autofs_req;
if (!be_cli->bectx->bet_info[BET_AUTOFS].bet_ops) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Undefined backend target.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Undefined backend target.\n"); err_maj = DP_ERR_FATAL; err_min = ENODEV; err_msg = "Autofs back end target is not configured"; @@ -1789,7 +1789,7 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn) be_req, be_cli->bectx->bet_info[BET_AUTOFS].bet_ops->handler); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_file_request failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "be_file_request failed.\n"); err_maj = DP_ERR_FATAL; err_min = ENODEV; err_msg = "Cannot file back end request"; @@ -1811,8 +1811,8 @@ done: DBUS_TYPE_INVALID); if (!dbret) return EIO;
- DEBUG(SSSDBG_TRACE_LIBS, ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + DEBUG(SSSDBG_TRACE_LIBS, "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg);
/* send reply back */ sbus_conn_send_reply(conn, reply); @@ -1851,7 +1851,7 @@ static void be_autofs_handler_callback(struct be_req *req, } if (!err_msg) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to set err_msg, Out of memory?\n")); + "Failed to set err_msg, Out of memory?\n"); err_msg = "OOM"; }
@@ -1861,13 +1861,13 @@ static void be_autofs_handler_callback(struct be_req *req, DBUS_TYPE_STRING, &err_msg, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to generate dbus reply\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to generate dbus reply\n"); return; }
dbus_conn = sbus_get_connection(req->becli->conn); if (!dbus_conn) { - DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "D-BUS not connected\n"); return; }
@@ -1875,8 +1875,8 @@ static void be_autofs_handler_callback(struct be_req *req, dbus_message_unref(reply);
DEBUG(SSSDBG_TRACE_LIBS, - ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg); }
/* finally free the request */ @@ -1913,13 +1913,13 @@ static int be_host_handler(DBusMessage *message, struct sbus_connection *conn) DBUS_TYPE_STRING, &filter, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed, to parse message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse message!\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); return EIO; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Got request for [%u][%s]\n", flags, filter)); + "Got request for [%u][%s]\n", flags, filter);
reply = dbus_message_new_method_return(message); if (!reply) return ENOMEM; @@ -1941,8 +1941,8 @@ static int be_host_handler(DBusMessage *message, struct sbus_connection *conn) if (!dbret) return EIO;
DEBUG(SSSDBG_TRACE_LIBS, - ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg);
sbus_conn_send_reply(conn, reply); dbus_message_unref(reply); @@ -2000,7 +2000,7 @@ static int be_host_handler(DBusMessage *message, struct sbus_connection *conn) /* process request */
if (!becli->bectx->bet_info[BET_HOSTID].bet_ops) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Undefined backend target.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Undefined backend target.\n"); err_maj = DP_ERR_FATAL; err_min = ENODEV; err_msg = "HostID back end target is not configured"; @@ -2033,8 +2033,8 @@ done: if (!dbret) return EIO;
DEBUG(SSSDBG_TRACE_LIBS, - ("Request processed. Returned %d,%d,%s\n", - err_maj, err_min, err_msg)); + "Request processed. Returned %d,%d,%s\n", + err_maj, err_min, err_msg);
/* send reply back */ sbus_conn_send_reply(conn, reply); @@ -2049,25 +2049,25 @@ static int be_client_destructor(void *ctx) struct be_client *becli = talloc_get_type(ctx, struct be_client); if (becli->bectx) { if (becli->bectx->nss_cli == becli) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removed NSS client\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removed NSS client\n"); becli->bectx->nss_cli = NULL; } else if (becli->bectx->pam_cli == becli) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removed PAM client\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removed PAM client\n"); becli->bectx->pam_cli = NULL; } else if (becli->bectx->sudo_cli == becli) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removed SUDO client\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removed SUDO client\n"); becli->bectx->sudo_cli = NULL; } else if (becli->bectx->autofs_cli == becli) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removed autofs client\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removed autofs client\n"); becli->bectx->autofs_cli = NULL; } else if (becli->bectx->ssh_cli == becli) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removed SSH client\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removed SSH client\n"); becli->bectx->ssh_cli = NULL; } else if (becli->bectx->pac_cli == becli) { - DEBUG(SSSDBG_TRACE_FUNC, ("Removed PAC client\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removed PAC client\n"); becli->bectx->pac_cli = NULL; } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown client removed ...\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown client removed ...\n"); } } return 0; @@ -2088,12 +2088,12 @@ static int client_registration(DBusMessage *message, data = sbus_conn_get_private_data(conn); becli = talloc_get_type(data, struct be_client); if (!becli) { - DEBUG(0, ("Connection holds no valid init data\n")); + DEBUG(0, "Connection holds no valid init data\n"); return EINVAL; }
/* First thing, cancel the timeout */ - DEBUG(4, ("Cancel DP ID timeout [%p]\n", becli->timeout)); + DEBUG(4, "Cancel DP ID timeout [%p]\n", becli->timeout); talloc_zfree(becli->timeout);
dbus_error_init(&dbus_error); @@ -2103,7 +2103,7 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_STRING, &cli_name, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(1, ("Failed to parse message, killing connection\n")); + DEBUG(1, "Failed to parse message, killing connection\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); sbus_disconnect(conn); /* FIXME: should we just talloc_zfree(conn) ? */ @@ -2123,16 +2123,16 @@ static int client_registration(DBusMessage *message, } else if (strcasecmp(cli_name, "PAC") == 0) { becli->bectx->pac_cli = becli; } else { - DEBUG(1, ("Unknown client! [%s]\n", cli_name)); + DEBUG(1, "Unknown client! [%s]\n", cli_name); } talloc_set_destructor((TALLOC_CTX *)becli, be_client_destructor);
- DEBUG(4, ("Added Frontend client [%s]\n", cli_name)); + DEBUG(4, "Added Frontend client [%s]\n", cli_name);
/* reply that all is ok */ reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(0, ("Dbus Out of memory!\n")); + DEBUG(0, "Dbus Out of memory!\n"); return ENOMEM; }
@@ -2140,7 +2140,7 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT16, &version, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(0, ("Failed to build dbus reply\n")); + DEBUG(0, "Failed to build dbus reply\n"); dbus_message_unref(reply); sbus_disconnect(conn); return EIO; @@ -2164,7 +2164,7 @@ static errno_t be_file_check_online_request(struct be_req *req) ret = be_file_request(req->be_ctx, req, req->be_ctx->bet_info[BET_ID].bet_ops->check_online); if (ret != EOK) { - DEBUG(1, ("be_file_request failed.\n")); + DEBUG(1, "be_file_request failed.\n"); }
return ret; @@ -2175,16 +2175,16 @@ static void check_online_callback(struct be_req *req, int dp_err_type, { int ret;
- DEBUG(4, ("Backend returned: (%d, %d, %s) [%s]\n", + DEBUG(4, "Backend returned: (%d, %d, %s) [%s]\n", dp_err_type, errnum, errstr?errstr:"<NULL>", - dp_pam_err_to_string(req, dp_err_type, errnum))); + dp_pam_err_to_string(req, dp_err_type, errnum));
req->be_ctx->check_online_ref_count--;
if (dp_err_type != DP_ERR_OK && req->be_ctx->check_online_ref_count > 0) { ret = be_file_check_online_request(req); if (ret != EOK) { - DEBUG(1, ("be_file_check_online_request failed.\n")); + DEBUG(1, "be_file_check_online_request failed.\n"); goto done; } return; @@ -2210,37 +2210,37 @@ static void check_if_online(struct be_ctx *ctx) struct be_req *be_req = NULL;
if (ctx->offstat.offline == false) { - DEBUG(8, ("Backend is already online, nothing to do.\n")); + DEBUG(8, "Backend is already online, nothing to do.\n"); return; }
/* Make sure nobody tries to go online while we are checking */ ctx->offstat.went_offline = time(NULL);
- DEBUG(8, ("Trying to go back online!\n")); + DEBUG(8, "Trying to go back online!\n");
ctx->check_online_ref_count++;
if (ctx->check_online_ref_count != 1) { - DEBUG(8, ("There is an online check already running.\n")); + DEBUG(8, "There is an online check already running.\n"); return; }
if (ctx->bet_info[BET_ID].bet_ops->check_online == NULL) { - DEBUG(8, ("ID providers does not provide a check_online method.\n")); + DEBUG(8, "ID providers does not provide a check_online method.\n"); goto failed; }
be_req = be_req_create(ctx, NULL, ctx, check_online_callback, NULL); if (be_req == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); goto failed; }
ret = be_file_check_online_request(be_req); if (ret != EOK) { - DEBUG(1, ("be_file_check_online_request failed.\n")); + DEBUG(1, "be_file_check_online_request failed.\n"); goto failed; }
@@ -2248,7 +2248,7 @@ static void check_if_online(struct be_ctx *ctx)
failed: ctx->check_online_ref_count--; - DEBUG(1, ("Failed to run a check_online test.\n")); + DEBUG(1, "Failed to run a check_online test.\n");
talloc_free(be_req);
@@ -2266,7 +2266,7 @@ static void init_timeout(struct tevent_context *ev, { struct be_client *becli;
- DEBUG(2, ("Client timed out before Identification [%p]!\n", te)); + DEBUG(2, "Client timed out before Identification [%p]!\n", te);
becli = talloc_get_type(ptr, struct be_client);
@@ -2287,7 +2287,7 @@ static int be_client_init(struct sbus_connection *conn, void *data)
becli = talloc(conn, struct be_client); if (!becli) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -2301,11 +2301,11 @@ static int be_client_init(struct sbus_connection *conn, void *data) becli->timeout = tevent_add_timer(bectx->ev, becli, tv, init_timeout, becli); if (!becli->timeout) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } - DEBUG(4, ("Set-up Backend ID timeout [%p]\n", becli->timeout)); + DEBUG(4, "Set-up Backend ID timeout [%p]\n", becli->timeout);
/* Attach the client context to the connection context, so that it is * always available when we need to manage the connection. */ @@ -2324,7 +2324,7 @@ static int be_srv_init(struct be_ctx *ctx) /* Set up SBUS connection to the monitor */ ret = dp_get_sbus_address(ctx, &sbus_address, ctx->domain->name); if (ret != EOK) { - DEBUG(0, ("Could not get sbus backend address.\n")); + DEBUG(0, "Could not get sbus backend address.\n"); return ret; }
@@ -2332,7 +2332,7 @@ static int be_srv_init(struct be_ctx *ctx) &be_interface, true, &ctx->sbus_srv, be_client_init, ctx); if (ret != EOK) { - DEBUG(0, ("Could not set up sbus server.\n")); + DEBUG(0, "Could not set up sbus server.\n"); return ret; }
@@ -2343,7 +2343,7 @@ static void be_target_access_permit(struct be_req *be_req) { struct pam_data *pd = talloc_get_type(be_req_get_data(be_req), struct pam_data); - DEBUG(9, ("be_target_access_permit called, returning PAM_SUCCESS.\n")); + DEBUG(9, "be_target_access_permit called, returning PAM_SUCCESS.\n");
pd->pam_status = PAM_SUCCESS; be_req_terminate(be_req, DP_ERR_OK, PAM_SUCCESS, NULL); @@ -2359,7 +2359,7 @@ static void be_target_access_deny(struct be_req *be_req) { struct pam_data *pd = talloc_get_type(be_req_get_data(be_req), struct pam_data); - DEBUG(9, ("be_target_access_deny called, returning PAM_PERM_DENIED.\n")); + DEBUG(9, "be_target_access_deny called, returning PAM_PERM_DENIED.\n");
pd->pam_status = PAM_PERM_DENIED; be_req_terminate(be_req, DP_ERR_OK, PAM_PERM_DENIED, NULL); @@ -2393,13 +2393,13 @@ static int load_backend_module(struct be_ctx *ctx,
if (bet_type <= BET_NULL || bet_type >= BET_MAX || bet_type != bet_data[bet_type].bet_type) { - DEBUG(2, ("invalid bet_type or bet_data corrupted.\n")); + DEBUG(2, "invalid bet_type or bet_data corrupted.\n"); return EINVAL; }
tmp_ctx = talloc_new(ctx); if (!tmp_ctx) { - DEBUG(7, ("talloc_new failed.\n")); + DEBUG(7, "talloc_new failed.\n"); return ENOMEM; }
@@ -2412,8 +2412,8 @@ static int load_backend_module(struct be_ctx *ctx, } if (!mod_name) { if (default_mod_name != NULL) { - DEBUG(5, ("no module name found in confdb, using [%s].\n", - default_mod_name)); + DEBUG(5, "no module name found in confdb, using [%s].\n", + default_mod_name); mod_name = talloc_strdup(ctx, default_mod_name); } else { ret = ENOENT; @@ -2449,7 +2449,7 @@ static int load_backend_module(struct be_ctx *ctx, bet_data[bet_type].mod_init_fn_name_fmt, mod_name); if (mod_init_fn_name == NULL) { - DEBUG(7, ("talloc_asprintf failed\n")); + DEBUG(7, "talloc_asprintf failed\n"); ret = ENOMEM; goto done; } @@ -2459,14 +2459,14 @@ static int load_backend_module(struct be_ctx *ctx, while(ctx->loaded_be[lb].be_name != NULL) { if (strncmp(ctx->loaded_be[lb].be_name, mod_name, strlen(mod_name)) == 0) { - DEBUG(7, ("Backend [%s] already loaded.\n", mod_name)); + DEBUG(7, "Backend [%s] already loaded.\n", mod_name); already_loaded = true; break; }
++lb; if (lb >= BET_MAX) { - DEBUG(2, ("Backend context corrupted.\n")); + DEBUG(2, "Backend context corrupted.\n"); ret = EINVAL; goto done; } @@ -2480,11 +2480,11 @@ static int load_backend_module(struct be_ctx *ctx, goto done; }
- DEBUG(7, ("Loading backend [%s] with path [%s].\n", mod_name, path)); + DEBUG(7, "Loading backend [%s] with path [%s].\n", mod_name, path); handle = dlopen(path, RTLD_NOW); if (!handle) { - DEBUG(0, ("Unable to load %s module with path (%s), error: %s\n", - mod_name, path, dlerror())); + DEBUG(0, "Unable to load %s module with path (%s), error: %s\n", + mod_name, path, dlerror()); ret = ELIBACC; goto done; } @@ -2503,8 +2503,8 @@ static int load_backend_module(struct be_ctx *ctx, * handle the different types of error conditions. */ ret = ENOENT; } else { - DEBUG(0, ("Unable to load init fn %s from module %s, error: %s\n", - mod_init_fn_name, mod_name, dlerror())); + DEBUG(0, "Unable to load init fn %s from module %s, error: %s\n", + mod_init_fn_name, mod_name, dlerror()); ret = ELIBBAD; } goto done; @@ -2512,8 +2512,8 @@ static int load_backend_module(struct be_ctx *ctx,
ret = mod_init_fn(ctx, &(*bet_info).bet_ops, &(*bet_info).pvt_bet_data); if (ret != EOK) { - DEBUG(0, ("Error (%d) in module (%s) initialization (%s)!\n", - ret, mod_name, mod_init_fn_name)); + DEBUG(0, "Error (%d) in module (%s) initialization (%s)!\n", + ret, mod_name, mod_init_fn_name); goto done; }
@@ -2548,7 +2548,7 @@ int be_process_init_sudo(struct be_ctx *be_ctx)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -2556,8 +2556,8 @@ int be_process_init_sudo(struct be_ctx *be_ctx) CONFDB_MONITOR_CONF_ENTRY, CONFDB_MONITOR_ACTIVE_SERVICES, &services); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Unable to read from confdb [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Unable to read from confdb [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -2571,15 +2571,15 @@ int be_process_init_sudo(struct be_ctx *be_ctx) ret = confdb_get_string(be_ctx->cdb, tmp_ctx, be_ctx->conf_path, CONFDB_DOMAIN_SUDO_PROVIDER, NULL, &provider); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Unable to read from confdb [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Unable to read from confdb [%d]: %s\n", + ret, strerror(ret)); goto done; }
if (!responder_enabled && provider == NULL) { /* provider is not set explicitly */ DEBUG(SSSDBG_TRACE_FUNC, - ("SUDO is not listed in services, disabling SUDO module.\n")); + "SUDO is not listed in services, disabling SUDO module.\n"); ret = ENOENT; goto done; } @@ -2587,8 +2587,8 @@ int be_process_init_sudo(struct be_ctx *be_ctx) if (!responder_enabled && provider != NULL && strcmp(provider, NO_PROVIDER) != 0) { /* provider is set but responder is disabled */ - DEBUG(SSSDBG_MINOR_FAILURE, ("SUDO provider is set, but it is not " - "listed in active services. SUDO support will not work!\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "SUDO provider is set, but it is not " + "listed in active services. SUDO support will not work!\n"); }
ret = load_backend_module(be_ctx, BET_SUDO, &be_ctx->bet_info[BET_SUDO], @@ -2610,7 +2610,7 @@ int be_process_init(TALLOC_CTX *mem_ctx,
ctx = talloc_zero(mem_ctx, struct be_ctx); if (!ctx) { - DEBUG(0, ("fatal error initializing be_ctx\n")); + DEBUG(0, "fatal error initializing be_ctx\n"); return ENOMEM; } ctx->ev = ev; @@ -2618,7 +2618,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx->identity = talloc_asprintf(ctx, "%%BE_%s", be_domain); ctx->conf_path = talloc_asprintf(ctx, CONFDB_DOMAIN_PATH_TMPL, be_domain); if (!ctx->identity || !ctx->conf_path) { - DEBUG(0, ("Out of memory!?\n")); + DEBUG(0, "Out of memory!?\n"); ret = ENOMEM; goto fail; } @@ -2626,13 +2626,13 @@ int be_process_init(TALLOC_CTX *mem_ctx, ret = be_init_failover(ctx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing failover context\n")); + "fatal error initializing failover context\n"); goto fail; }
ret = sssd_domain_init(ctx, cdb, be_domain, DB_PATH, &ctx->domain); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error opening cache database\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error opening cache database\n"); goto fail; }
@@ -2641,7 +2641,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx, &ctx->mon_conn); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error setting up monitor bus\n")); + "fatal error setting up monitor bus\n"); goto fail; }
@@ -2651,21 +2651,21 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx->domain->name, &ctx->domain->names); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error setting fully qualified name format for %s\n", - ctx->domain->name)); + "fatal error setting fully qualified name format for %s\n", + ctx->domain->name); goto fail; }
ret = be_srv_init(ctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error setting up server bus\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error setting up server bus\n"); goto fail; }
/* Initialize be_refresh periodic task. */ ctx->refresh_ctx = be_refresh_ctx_init(ctx); if (ctx->refresh_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Unable to initialize refresh_ctx\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Unable to initialize refresh_ctx\n"); ret = ENOMEM; goto fail; } @@ -2678,7 +2678,7 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx->refresh_ctx, "Refresh Records", NULL); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Unable to initialize refresh periodic task\n")); + "Unable to initialize refresh periodic task\n"); goto fail; } } @@ -2687,12 +2687,12 @@ int be_process_init(TALLOC_CTX *mem_ctx, &ctx->bet_info[BET_ID], NULL); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing data providers\n")); + "fatal error initializing data providers\n"); goto fail; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("ID backend target successfully loaded from provider [%s].\n", - ctx->bet_info[BET_ID].mod_name)); + "ID backend target successfully loaded from provider [%s].\n", + ctx->bet_info[BET_ID].mod_name);
ret = load_backend_module(ctx, BET_AUTH, &ctx->bet_info[BET_AUTH], @@ -2700,28 +2700,28 @@ int be_process_init(TALLOC_CTX *mem_ctx, if (ret != EOK) { if (ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing data providers\n")); + "fatal error initializing data providers\n"); goto fail; } DEBUG(SSSDBG_MINOR_FAILURE, - ("No authentication module provided for [%s] !!\n", - be_domain)); + "No authentication module provided for [%s] !!\n", + be_domain); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("AUTH backend target successfully loaded " - "from provider [%s].\n", ctx->bet_info[BET_AUTH].mod_name)); + "AUTH backend target successfully loaded " + "from provider [%s].\n", ctx->bet_info[BET_AUTH].mod_name); }
ret = load_backend_module(ctx, BET_ACCESS, &ctx->bet_info[BET_ACCESS], ACCESS_PERMIT); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to setup ACCESS backend.\n")); + "Failed to setup ACCESS backend.\n"); goto fail; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("ACCESS backend target successfully loaded " - "from provider [%s].\n", ctx->bet_info[BET_ACCESS].mod_name)); + "ACCESS backend target successfully loaded " + "from provider [%s].\n", ctx->bet_info[BET_ACCESS].mod_name);
ret = load_backend_module(ctx, BET_CHPASS, &ctx->bet_info[BET_CHPASS], @@ -2729,31 +2729,31 @@ int be_process_init(TALLOC_CTX *mem_ctx, if (ret != EOK) { if (ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing data providers\n")); + "fatal error initializing data providers\n"); goto fail; } DEBUG(SSSDBG_MINOR_FAILURE, - ("No change password module provided for [%s] !!\n", - be_domain)); + "No change password module provided for [%s] !!\n", + be_domain); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("CHPASS backend target successfully loaded " - "from provider [%s].\n", ctx->bet_info[BET_CHPASS].mod_name)); + "CHPASS backend target successfully loaded " + "from provider [%s].\n", ctx->bet_info[BET_CHPASS].mod_name); }
ret = be_process_init_sudo(ctx); if (ret != EOK) { if (ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing data providers\n")); + "fatal error initializing data providers\n"); goto fail; } DEBUG(SSSDBG_MINOR_FAILURE, - ("No SUDO module provided for [%s] !!\n", be_domain)); + "No SUDO module provided for [%s] !!\n", be_domain); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("SUDO backend target successfully loaded " - "from provider [%s].\n", ctx->bet_info[BET_SUDO].mod_name)); + "SUDO backend target successfully loaded " + "from provider [%s].\n", ctx->bet_info[BET_SUDO].mod_name); }
ret = load_backend_module(ctx, BET_AUTOFS, @@ -2762,15 +2762,15 @@ int be_process_init(TALLOC_CTX *mem_ctx, if (ret != EOK) { if (ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing data providers\n")); + "fatal error initializing data providers\n"); goto fail; } DEBUG(SSSDBG_MINOR_FAILURE, - ("No autofs module provided for [%s] !!\n", be_domain)); + "No autofs module provided for [%s] !!\n", be_domain); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("autofs backend target successfully loaded " - "from provider [%s].\n", ctx->bet_info[BET_AUTOFS].mod_name)); + "autofs backend target successfully loaded " + "from provider [%s].\n", ctx->bet_info[BET_AUTOFS].mod_name); }
ret = load_backend_module(ctx, BET_SELINUX, @@ -2778,14 +2778,14 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx->bet_info[BET_ID].mod_name); if (ret != EOK) { if (ret != ENOENT) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing data providers\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing data providers\n"); goto fail; } - DEBUG(SSSDBG_CRIT_FAILURE, ("No selinux module provided for [%s] !!\n", - be_domain)); + DEBUG(SSSDBG_CRIT_FAILURE, "No selinux module provided for [%s] !!\n", + be_domain); } else { - DEBUG(SSSDBG_TRACE_ALL, ("selinux backend target successfully loaded " - "from provider [%s].\n", ctx->bet_info[BET_SELINUX].mod_name)); + DEBUG(SSSDBG_TRACE_ALL, "selinux backend target successfully loaded " + "from provider [%s].\n", ctx->bet_info[BET_SELINUX].mod_name); }
ret = load_backend_module(ctx, BET_HOSTID, @@ -2794,26 +2794,26 @@ int be_process_init(TALLOC_CTX *mem_ctx, if (ret != EOK) { if (ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing data providers\n")); + "fatal error initializing data providers\n"); goto fail; } DEBUG(SSSDBG_CRIT_FAILURE, - ("No host info module provided for [%s] !!\n", be_domain)); + "No host info module provided for [%s] !!\n", be_domain); } else { DEBUG(SSSDBG_TRACE_ALL, - ("HOST backend target successfully loaded from provider [%s].\n", - ctx->bet_info[BET_HOSTID].mod_name)); + "HOST backend target successfully loaded from provider [%s].\n", + ctx->bet_info[BET_HOSTID].mod_name); }
ret = load_backend_module(ctx, BET_SUBDOMAINS, &ctx->bet_info[BET_SUBDOMAINS], ctx->bet_info[BET_ID].mod_name); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Subdomains are not supported for [%s] !!\n", be_domain)); + DEBUG(SSSDBG_CRIT_FAILURE, "Subdomains are not supported for [%s] !!\n", be_domain); } else { - DEBUG(SSSDBG_TRACE_ALL, ("Get-Subdomains backend target successfully loaded " + DEBUG(SSSDBG_TRACE_ALL, "Get-Subdomains backend target successfully loaded " "from provider [%s].\n", - ctx->bet_info[BET_SUBDOMAINS].mod_name)); + ctx->bet_info[BET_SUBDOMAINS].mod_name); }
/* Handle SIGUSR1 to force offline behavior */ @@ -2887,20 +2887,20 @@ int main(int argc, const char *argv[])
ret = server_setup(srv_name, 0, confdb_path, &main_ctx); if (ret != EOK) { - DEBUG(0, ("Could not set up mainloop [%d]\n", ret)); + DEBUG(0, "Could not set up mainloop [%d]\n", ret); return 2; }
ret = setenv(SSS_DOM_ENV, be_domain, 1); if (ret != 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Setting "SSS_DOM_ENV" failed, journald " - "logging mightnot work as expected\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Setting "SSS_DOM_ENV" failed, journald " + "logging mightnot work as expected\n"); }
ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(2, ("Could not set up to exit when parent process does\n")); + DEBUG(2, "Could not set up to exit when parent process does\n"); }
ret = be_process_init(main_ctx, @@ -2908,11 +2908,11 @@ int main(int argc, const char *argv[]) main_ctx->event_ctx, main_ctx->confdb_ctx); if (ret != EOK) { - DEBUG(0, ("Could not initialize backend [%d]\n", ret)); + DEBUG(0, "Could not initialize backend [%d]\n", ret); return 3; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Backend provider (%s) started!\n", be_domain)); + DEBUG(SSSDBG_TRACE_FUNC, "Backend provider (%s) started!\n", be_domain);
/* loop on main */ server_loop(main_ctx); diff --git a/src/providers/data_provider_callbacks.c b/src/providers/data_provider_callbacks.c index c41595e..0ef5f12 100644 --- a/src/providers/data_provider_callbacks.c +++ b/src/providers/data_provider_callbacks.c @@ -104,7 +104,7 @@ static void be_run_cb_step(struct tevent_context *ev, struct tevent_timer *te, be_run_cb_step, cb_ctx); if (!tev) { - DEBUG(0, ("Out of memory. Could not invoke callbacks\n")); + DEBUG(0, "Out of memory. Could not invoke callbacks\n"); goto final; } return; @@ -130,7 +130,7 @@ static errno_t be_run_cb(struct be_ctx *be, struct be_cb *cb_list)
cb_ctx = talloc(be, struct be_cb_ctx); if (!cb_ctx) { - DEBUG(0, ("Out of memory. Could not invoke callbacks\n")); + DEBUG(0, "Out of memory. Could not invoke callbacks\n"); return ENOMEM; } cb_ctx->be = be; @@ -142,7 +142,7 @@ static errno_t be_run_cb(struct be_ctx *be, struct be_cb *cb_list) be_run_cb_step, cb_ctx); if (!te) { - DEBUG(0, ("Out of memory. Could not invoke callbacks\n")); + DEBUG(0, "Out of memory. Could not invoke callbacks\n"); talloc_free(cb_ctx); return ENOMEM; } @@ -157,7 +157,7 @@ int be_add_reconnect_cb(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, be_callback_t c
ret = be_add_cb(mem_ctx, ctx, cb, pvt, &ctx->reconnect_cb_list, reconnect_cb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_add_cb failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "be_add_cb failed.\n"); return ret; }
@@ -170,7 +170,7 @@ void be_run_reconnect_cb(struct be_ctx *be) struct be_cb *next_cb;
if (callback) { - DEBUG(SSSDBG_TRACE_FUNC, ("Reconnecting. Running callbacks.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reconnecting. Running callbacks.\n");
/** * Call the callback: we have to call this right away @@ -185,7 +185,7 @@ void be_run_reconnect_cb(struct be_ctx *be) callback = next_cb; } while(callback != NULL); } else { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Reconnect call back list is empty, nothing to do.\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Reconnect call back list is empty, nothing to do.\n"); } }
@@ -196,7 +196,7 @@ int be_add_online_cb(TALLOC_CTX *mem_ctx, struct be_ctx *ctx, be_callback_t cb,
ret = be_add_cb(mem_ctx, ctx, cb, pvt, &ctx->online_cb_list, online_cb); if (ret != EOK) { - DEBUG(1, ("be_add_cb failed.\n")); + DEBUG(1, "be_add_cb failed.\n"); return ret; }
@@ -218,15 +218,15 @@ void be_run_online_cb(struct be_ctx *be) { be->run_online_cb = false;
if (be->online_cb_list) { - DEBUG(3, ("Going online. Running callbacks.\n")); + DEBUG(3, "Going online. Running callbacks.\n");
ret = be_run_cb(be, be->online_cb_list); if (ret != EOK) { - DEBUG(1, ("be_run_cb failed.\n")); + DEBUG(1, "be_run_cb failed.\n"); }
} else { - DEBUG(9, ("Online call back list is empty, nothing to do.\n")); + DEBUG(9, "Online call back list is empty, nothing to do.\n"); } } } @@ -241,14 +241,14 @@ void be_run_offline_cb(struct be_ctx *be) { int ret;
if (be->offline_cb_list) { - DEBUG(3, ("Going offline. Running callbacks.\n")); + DEBUG(3, "Going offline. Running callbacks.\n");
ret = be_run_cb(be, be->offline_cb_list); if (ret != EOK) { - DEBUG(1, ("be_run_cb failed.\n")); + DEBUG(1, "be_run_cb failed.\n"); }
} else { - DEBUG(9, ("Offline call back list is empty, nothing to do.\n")); + DEBUG(9, "Offline call back list is empty, nothing to do.\n"); } } diff --git a/src/providers/data_provider_fo.c b/src/providers/data_provider_fo.c index 23a605e..aee289d 100644 --- a/src/providers/data_provider_fo.c +++ b/src/providers/data_provider_fo.c @@ -93,7 +93,7 @@ int be_init_failover(struct be_ctx *ctx) ret = be_res_init(ctx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing resolver context\n")); + "fatal error initializing resolver context\n"); talloc_zfree(ctx->be_fo); return ret; } @@ -159,7 +159,7 @@ int be_fo_add_service(struct be_ctx *ctx, const char *service_name,
svc = be_fo_find_svc_data(ctx, service_name); if (svc) { - DEBUG(6, ("Failover service already initialized!\n")); + DEBUG(6, "Failover service already initialized!\n"); /* we already have a service up and configured, * can happen when using both id and auth provider */ @@ -171,7 +171,7 @@ int be_fo_add_service(struct be_ctx *ctx, const char *service_name, ret = fo_new_service(ctx->be_fo->fo_ctx, service_name, user_data_cmp, &service); if (ret != EOK && ret != EEXIST) { - DEBUG(1, ("Failed to create failover service!\n")); + DEBUG(1, "Failed to create failover service!\n"); return ret; }
@@ -241,16 +241,16 @@ void be_fo_set_srv_lookup_plugin(struct be_ctx *ctx, { bool bret;
- DEBUG(SSSDBG_TRACE_FUNC, ("Trying to set SRV lookup plugin to %s\n", - plugin_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Trying to set SRV lookup plugin to %s\n", + plugin_name);
bret = fo_set_srv_lookup_plugin(ctx->be_fo->fo_ctx, send_fn, recv_fn, pvt); if (bret) { - DEBUG(SSSDBG_TRACE_FUNC, ("SRV lookup plugin is now %s\n", - plugin_name)); + DEBUG(SSSDBG_TRACE_FUNC, "SRV lookup plugin is now %s\n", + plugin_name); } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to set SRV lookup plugin, " - "another plugin may be already in place\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to set SRV lookup plugin, " + "another plugin may be already in place\n"); } }
@@ -266,7 +266,7 @@ errno_t be_fo_set_dns_srv_lookup_plugin(struct be_ctx *be_ctx, if (ret != EOK) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("gethostname() failed: [%d]: %s\n", ret, strerror(ret))); + "gethostname() failed: [%d]: %s\n", ret, strerror(ret)); return ret; } resolved_hostname[HOST_NAME_MAX-1] = '\0'; @@ -278,7 +278,7 @@ errno_t be_fo_set_dns_srv_lookup_plugin(struct be_ctx *be_ctx, default_host_dbs, hostname, be_ctx->domain->name); if (srv_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n"); return ENOMEM; }
@@ -315,7 +315,7 @@ int be_fo_add_srv_server(struct be_ctx *ctx, domain, ctx->domain->name, proto_table[proto], user_data); if (ret && ret != EEXIST) { - DEBUG(1, ("Failed to add SRV lookup reference to failover service\n")); + DEBUG(1, "Failed to add SRV lookup reference to failover service\n"); return ret; }
@@ -327,7 +327,7 @@ int be_fo_add_srv_server(struct be_ctx *ctx, domain, ctx->domain->name, proto_table[i], user_data); if (ret && ret != EEXIST) { - DEBUG(1, ("Failed to add SRV lookup reference to failover service\n")); + DEBUG(1, "Failed to add SRV lookup reference to failover service\n"); return ret; }
@@ -365,7 +365,7 @@ int be_fo_add_server(struct be_ctx *ctx, const char *service_name, ret = fo_add_server(svc->fo_service, server, port, user_data, primary); if (ret && ret != EEXIST) { - DEBUG(1, ("Failed to add server to failover service\n")); + DEBUG(1, "Failed to add server to failover service\n"); return ret; }
@@ -414,7 +414,7 @@ be_primary_server_timeout(struct tevent_context *ev,
ctx->bctx->be_fo->primary_server_handler = NULL;
- DEBUG(SSSDBG_TRACE_FUNC, ("Looking for primary server!\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Looking for primary server!\n"); subreq = fo_resolve_service_send(ctx->bctx, ctx->ev, ctx->bctx->be_fo->be_res->resolv, ctx->bctx->be_fo->fo_ctx, @@ -436,7 +436,7 @@ static void be_primary_server_done(struct tevent_req *subreq)
resolve_state = talloc_zero(ctx->bctx, struct be_resolve_server_state); if (resolve_state == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero() failed\n"); return; }
@@ -462,7 +462,7 @@ static void be_primary_server_done(struct tevent_req *subreq) ret = be_primary_server_timeout_activate(ctx->bctx, ctx->ev, ctx->bctx, ctx->svc, ctx->timeout); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not schedule primary server lookup\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not schedule primary server lookup\n"); } } else if (ret == EOK) { be_run_reconnect_cb(ctx->bctx); @@ -484,8 +484,8 @@ be_primary_server_timeout_activate(TALLOC_CTX *mem_ctx, struct be_failover_ctx *fo_ctx = bctx->be_fo;
if (fo_ctx->primary_server_handler != NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("The primary server reconnection " - "is already scheduled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "The primary server reconnection " + "is already scheduled\n"); return EOK; }
@@ -504,13 +504,13 @@ be_primary_server_timeout_activate(TALLOC_CTX *mem_ctx, fo_ctx->primary_server_handler = tevent_add_timer(ev, bctx, tv, be_primary_server_timeout, ctx); if (fo_ctx->primary_server_handler == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_add_timer failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_add_timer failed.\n"); talloc_free(ctx); return ENOMEM; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Primary server reactivation timeout set " - "to %lu seconds\n", timeout_seconds)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Primary server reactivation timeout set " + "to %lu seconds\n", timeout_seconds); return EOK; }
@@ -590,7 +590,7 @@ static void be_resolve_server_done(struct tevent_req *subreq) return;
fail: - DEBUG(SSSDBG_TRACE_LIBS, ("Server resolution failed: %d\n", ret)); + DEBUG(SSSDBG_TRACE_LIBS, "Server resolution failed: %d\n", ret); state->svc->first_resolved = NULL; tevent_req_error(req, ret); } @@ -622,17 +622,17 @@ errno_t be_resolve_server_process(struct tevent_req *subreq, return EFAULT; } DEBUG(SSSDBG_MINOR_FAILURE, - ("Couldn't resolve server (%s), resolver returned (%d)\n", - fo_get_server_str_name(state->srv), ret)); + "Couldn't resolve server (%s), resolver returned (%d)\n", + fo_get_server_str_name(state->srv), ret);
state->attempts++; if (state->attempts >= 10) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to find a server after 10 attempts\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to find a server after 10 attempts\n"); return EIO; }
/* now try next one */ - DEBUG(SSSDBG_TRACE_LIBS, ("Trying with the next one!\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Trying with the next one!\n"); subreq = fo_resolve_service_send(state, state->ev, state->ctx->be_fo->be_res->resolv, state->ctx->be_fo->fo_ctx, @@ -650,11 +650,11 @@ errno_t be_resolve_server_process(struct tevent_req *subreq,
/* all fine we got the server */ if (state->svc->first_resolved == NULL || state->first_try == true) { - DEBUG(SSSDBG_TRACE_LIBS, ("Saving the first resolved server\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Saving the first resolved server\n"); state->svc->first_resolved = state->srv; } else if (state->svc->first_resolved == state->srv) { DEBUG(SSSDBG_OP_FAILURE, - ("The fail over cycled through all available servers\n")); + "The fail over cycled through all available servers\n"); return ENOENT; }
@@ -664,17 +664,17 @@ errno_t be_resolve_server_process(struct tevent_req *subreq, srvaddr = fo_get_server_hostent(state->srv); if (!srvaddr) { DEBUG(SSSDBG_CRIT_FAILURE, - ("FATAL: No hostent available for server (%s)\n", - fo_get_server_str_name(state->srv))); + "FATAL: No hostent available for server (%s)\n", + fo_get_server_str_name(state->srv)); return EFAULT; }
inet_ntop(srvaddr->family, srvaddr->addr_list[0]->ipaddr, ipaddr, 128);
- DEBUG(SSSDBG_FUNC_DATA, ("Found address for server %s: [%s] TTL %d\n", + DEBUG(SSSDBG_FUNC_DATA, "Found address for server %s: [%s] TTL %d\n", fo_get_server_str_name(state->srv), ipaddr, - srvaddr->addr_list[0]->ttl)); + srvaddr->addr_list[0]->ttl); }
srv_status_change = fo_get_server_hostname_last_change(state->srv); @@ -750,14 +750,14 @@ void be_fo_set_port_status(struct be_ctx *ctx, be_svc = be_fo_find_svc_data(ctx, service_name); if (be_svc == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("No service associated with name %s\n", service_name)); + "No service associated with name %s\n", service_name); return; }
if (!fo_svc_has_server(be_svc->fo_service, server)) { DEBUG(SSSDBG_OP_FAILURE, - ("The server %p is not valid anymore, cannot set its status\n", - server)); + "The server %p is not valid anymore, cannot set its status\n", + server); return; }
@@ -796,7 +796,7 @@ static errno_t be_res_get_opts(struct be_resolv_ctx *res_ctx, }
str_family = dp_opt_get_string(res_ctx->opts, DP_RES_OPT_FAMILY_ORDER); - DEBUG(SSSDBG_CONF_SETTINGS, ("Lookup order: %s\n", str_family)); + DEBUG(SSSDBG_CONF_SETTINGS, "Lookup order: %s\n", str_family);
if (strcasecmp(str_family, "ipv4_first") == 0) { res_ctx->family_order = IPV4_FIRST; @@ -807,8 +807,8 @@ static errno_t be_res_get_opts(struct be_resolv_ctx *res_ctx, } else if (strcasecmp(str_family, "ipv6_only") == 0) { res_ctx->family_order = IPV6_ONLY; } else { - DEBUG(SSSDBG_OP_FAILURE, ("Unknown value for option %s: %s\n", - dp_res_default_opts[DP_RES_OPT_FAMILY_ORDER].opt_name, str_family)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown value for option %s: %s\n", + dp_res_default_opts[DP_RES_OPT_FAMILY_ORDER].opt_name, str_family); return EINVAL; }
diff --git a/src/providers/data_provider_opts.c b/src/providers/data_provider_opts.c index 0edadec..cab01f9 100644 --- a/src/providers/data_provider_opts.c +++ b/src/providers/data_provider_opts.c @@ -53,15 +53,15 @@ int dp_get_options(TALLOC_CTX *memctx, ((opts[i].def_val.string != NULL) && (opts[i].val.string == NULL))) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); if (ret == EOK) ret = EINVAL; goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", opts[i].opt_name, opts[i].val.cstring ? "" : " no", - opts[i].val.cstring ? opts[i].val.cstring : "")); + opts[i].val.cstring ? opts[i].val.cstring : ""); break;
case DP_OPT_BLOB: @@ -70,8 +70,8 @@ int dp_get_options(TALLOC_CTX *memctx, NULL, &tmp); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; }
@@ -83,8 +83,8 @@ int dp_get_options(TALLOC_CTX *memctx, opts[i].val.blob.length = 0; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has %s binary value.\n", - opts[i].opt_name, opts[i].val.blob.length?"a":"no")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has %s binary value.\n", + opts[i].opt_name, opts[i].val.blob.length?"a":"no"); break;
case DP_OPT_NUMBER: @@ -94,12 +94,12 @@ int dp_get_options(TALLOC_CTX *memctx, &opts[i].val.number); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has value %d\n", - opts[i].opt_name, opts[i].val.number)); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has value %d\n", + opts[i].opt_name, opts[i].val.number); break;
case DP_OPT_BOOL: @@ -109,12 +109,12 @@ int dp_get_options(TALLOC_CTX *memctx, &opts[i].val.boolean); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s is %s\n", - opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s is %s\n", + opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE"); break; } } @@ -155,14 +155,14 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to copy value for option (%s)\n", - opts[i].opt_name)); + "Failed to copy value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", opts[i].opt_name, opts[i].val.cstring ? "" : " no", - opts[i].val.cstring ? opts[i].val.cstring : "")); + opts[i].val.cstring ? opts[i].val.cstring : ""); break;
case DP_OPT_BLOB: @@ -173,12 +173,12 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has %s binary value.\n", - opts[i].opt_name, opts[i].val.blob.length?"a":"no")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has %s binary value.\n", + opts[i].opt_name, opts[i].val.blob.length?"a":"no"); break;
case DP_OPT_NUMBER: @@ -189,12 +189,12 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has value %d\n", - opts[i].opt_name, opts[i].val.number)); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has value %d\n", + opts[i].opt_name, opts[i].val.number); break;
case DP_OPT_BOOL: @@ -205,12 +205,12 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s is %s\n", - opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s is %s\n", + opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE"); break; } } @@ -242,10 +242,10 @@ const char *_dp_opt_get_cstring(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_STRING) { - DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + DEBUG(0, "[%s] Requested type 'String' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return NULL; } return opts[id].val.cstring; @@ -255,10 +255,10 @@ char *_dp_opt_get_string(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_STRING) { - DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + DEBUG(0, "[%s] Requested type 'String' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return NULL; } return opts[id].val.string; @@ -269,10 +269,10 @@ struct dp_opt_blob _dp_opt_get_blob(struct dp_option *opts, { struct dp_opt_blob null_blob = { NULL, 0 }; if (opts[id].type != DP_OPT_BLOB) { - DEBUG(0, ("[%s] Requested type 'Blob' for option '%s'" + DEBUG(0, "[%s] Requested type 'Blob' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return null_blob; } return opts[id].val.blob; @@ -282,10 +282,10 @@ int _dp_opt_get_int(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_NUMBER) { - DEBUG(0, ("[%s] Requested type 'Number' for option '%s'" + DEBUG(0, "[%s] Requested type 'Number' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return 0; } return opts[id].val.number; @@ -295,10 +295,10 @@ bool _dp_opt_get_bool(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_BOOL) { - DEBUG(0, ("[%s] Requested type 'Boolean' for option '%s'" + DEBUG(0, "[%s] Requested type 'Boolean' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return false; } return opts[id].val.boolean; @@ -309,10 +309,10 @@ int _dp_opt_set_string(struct dp_option *opts, int id, const char *s, const char *location) { if (opts[id].type != DP_OPT_STRING) { - DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + DEBUG(0, "[%s] Requested type 'String' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; }
@@ -322,7 +322,7 @@ int _dp_opt_set_string(struct dp_option *opts, int id, if (s) { opts[id].val.string = talloc_strdup(opts, s); if (!opts[id].val.string) { - DEBUG(0, ("talloc_strdup() failed!\n")); + DEBUG(0, "talloc_strdup() failed!\n"); return ENOMEM; } } @@ -334,10 +334,10 @@ int _dp_opt_set_blob(struct dp_option *opts, int id, struct dp_opt_blob b, const char *location) { if (opts[id].type != DP_OPT_BLOB) { - DEBUG(0, ("[%s] Requested type 'Blob' for option '%s'" + DEBUG(0, "[%s] Requested type 'Blob' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; }
@@ -348,7 +348,7 @@ int _dp_opt_set_blob(struct dp_option *opts, int id, if (b.data) { opts[id].val.blob.data = talloc_memdup(opts, b.data, b.length); if (!opts[id].val.blob.data) { - DEBUG(0, ("talloc_memdup() failed!\n")); + DEBUG(0, "talloc_memdup() failed!\n"); return ENOMEM; } } @@ -361,10 +361,10 @@ int _dp_opt_set_int(struct dp_option *opts, int id, int i, const char *location) { if (opts[id].type != DP_OPT_NUMBER) { - DEBUG(0, ("[%s] Requested type 'Number' for option '%s'" + DEBUG(0, "[%s] Requested type 'Number' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; }
@@ -377,10 +377,10 @@ int _dp_opt_set_bool(struct dp_option *opts, int id, bool b, const char *location) { if (opts[id].type != DP_OPT_BOOL) { - DEBUG(0, ("[%s] Requested type 'Boolean' for option '%s'" + DEBUG(0, "[%s] Requested type 'Boolean' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; }
diff --git a/src/providers/dp_auth_util.c b/src/providers/dp_auth_util.c index 0bf10a7..98b2f5d 100644 --- a/src/providers/dp_auth_util.c +++ b/src/providers/dp_auth_util.c @@ -102,26 +102,26 @@ bool dp_unpack_pam_request(DBusMessage *msg, TALLOC_CTX *mem_ctx, DBUS_TYPE_INVALID);
if (!db_ret) { - DEBUG(1, ("dbus_message_get_args failed.\n")); + DEBUG(1, "dbus_message_get_args failed.\n"); return false; }
ret = copy_pam_data(mem_ctx, &pd, new_pd); if (ret != EOK) { - DEBUG(1, ("copy_pam_data failed.\n")); + DEBUG(1, "copy_pam_data failed.\n"); return false; }
ret = sss_authtok_set((*new_pd)->authtok, authtok_type, authtok_data, authtok_length); if (ret) { - DEBUG(1, ("Failed to set auth token: %d [%s]\n", ret, strerror(ret))); + DEBUG(1, "Failed to set auth token: %d [%s]\n", ret, strerror(ret)); return false; } ret = sss_authtok_set((*new_pd)->newauthtok, new_authtok_type, new_authtok_data, new_authtok_length); if (ret) { - DEBUG(1, ("Failed to set auth token: %d [%s]\n", ret, strerror(ret))); + DEBUG(1, "Failed to set auth token: %d [%s]\n", ret, strerror(ret)); return false; }
@@ -216,30 +216,30 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db const uint8_t *data;
if (!dbus_message_iter_init(msg, &iter)) { - DEBUG(1, ("pam response has no arguments.\n")); + DEBUG(1, "pam response has no arguments.\n"); return false; }
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32) { - DEBUG(1, ("pam response format error.\n")); + DEBUG(1, "pam response format error.\n"); return false; } dbus_message_iter_get_basic(&iter, &(pd->pam_status));
if (!dbus_message_iter_next(&iter)) { - DEBUG(1, ("pam response has too few arguments.\n")); + DEBUG(1, "pam response has too few arguments.\n"); return false; }
/* After this point will be an array of pam data */ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) { - DEBUG(1, ("pam response format error.\n")); - DEBUG(1, ("Type was %c\n", (char)dbus_message_iter_get_arg_type(&iter))); + DEBUG(1, "pam response format error.\n"); + DEBUG(1, "Type was %c\n", (char)dbus_message_iter_get_arg_type(&iter)); return false; }
if (dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_STRUCT) { - DEBUG(1, ("pam response format error.\n")); + DEBUG(1, "pam response format error.\n"); return false; }
@@ -247,7 +247,7 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db while (dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_INVALID) { /* Read in a pam data struct */ if (dbus_message_iter_get_arg_type(&array_iter) != DBUS_TYPE_STRUCT) { - DEBUG(1, ("pam response format error.\n")); + DEBUG(1, "pam response format error.\n"); return false; }
@@ -257,20 +257,20 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db
/* Get the pam data type */ if (dbus_message_iter_get_arg_type(&struct_iter) != DBUS_TYPE_UINT32) { - DEBUG(1, ("pam response format error.\n")); + DEBUG(1, "pam response format error.\n"); return false; } dbus_message_iter_get_basic(&struct_iter, &type);
if (!dbus_message_iter_next(&struct_iter)) { - DEBUG(1, ("pam response format error.\n")); + DEBUG(1, "pam response format error.\n"); return false; }
/* Get the byte array */ if (dbus_message_iter_get_arg_type(&struct_iter) != DBUS_TYPE_ARRAY || dbus_message_iter_get_element_type(&struct_iter) != DBUS_TYPE_BYTE) { - DEBUG(1, ("pam response format error.\n")); + DEBUG(1, "pam response format error.\n"); return false; }
@@ -278,7 +278,7 @@ bool dp_unpack_pam_response(DBusMessage *msg, struct pam_data *pd, DBusError *db dbus_message_iter_get_fixed_array(&sub_iter, &data, &len);
if (pam_add_response(pd, type, len, data) != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); return false; } dbus_message_iter_next(&array_iter); @@ -303,8 +303,8 @@ void dp_id_callback(DBusPendingCall *pending, void *ptr) * until reply is valid or timeout has occurred. If reply is NULL * here, something is seriously wrong and we should bail out. */ - DEBUG(0, ("Severe error. A reply callback was called but no" - " reply was received and no timeout occurred\n")); + DEBUG(0, "Severe error. A reply callback was called but no" + " reply was received and no timeout occurred\n");
/* FIXME: Destroy this connection ? */ goto done; @@ -317,19 +317,19 @@ void dp_id_callback(DBusPendingCall *pending, void *ptr) DBUS_TYPE_UINT16, &dp_ver, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1, ("Failed to parse message\n")); + DEBUG(1, "Failed to parse message\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); /* FIXME: Destroy this connection ? */ goto done; }
- DEBUG(4, ("Got id ack and version (%d) from DP\n", dp_ver)); + DEBUG(4, "Got id ack and version (%d) from DP\n", dp_ver);
break;
case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0,("The Monitor returned an error [%s]\n", - dbus_message_get_error_name(reply))); + DEBUG(0,"The Monitor returned an error [%s]\n", + dbus_message_get_error_name(reply)); /* Falling through to default intentionally*/ default: /* @@ -362,19 +362,19 @@ int dp_common_send_id(struct sbus_connection *conn, uint16_t version, DP_INTERFACE, DP_METHOD_REGISTER); if (msg == NULL) { - DEBUG(0, ("Out of memory?!\n")); + DEBUG(0, "Out of memory?!\n"); return ENOMEM; }
- DEBUG(4, ("Sending ID to DP: (%d,%s)\n", - version, name)); + DEBUG(4, "Sending ID to DP: (%d,%s)\n", + version, name);
ret = dbus_message_append_args(msg, DBUS_TYPE_UINT16, &version, DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1, ("Failed to build message\n")); + DEBUG(1, "Failed to build message\n"); return EIO; }
diff --git a/src/providers/dp_dyndns.c b/src/providers/dp_dyndns.c index cd11431..faeb473 100644 --- a/src/providers/dp_dyndns.c +++ b/src/providers/dp_dyndns.c @@ -120,7 +120,7 @@ sss_iface_addr_list_as_str_list(TALLOC_CTX *mem_ctx, break;
default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown address family\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown address family\n"); continue; }
@@ -154,18 +154,18 @@ ok_for_dns(struct sockaddr *sa)
if (inet_ntop(AF_INET6, addr6, straddr, INET6_ADDRSTRLEN) == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("inet_ntop failed, won't log IP addresses\n")); + "inet_ntop failed, won't log IP addresses\n"); snprintf(straddr, INET6_ADDRSTRLEN, "unknown"); }
if (IN6_IS_ADDR_LINKLOCAL(addr6)) { - DEBUG(SSSDBG_FUNC_DATA, ("Link local IPv6 address %s\n", straddr)); + DEBUG(SSSDBG_FUNC_DATA, "Link local IPv6 address %s\n", straddr); return false; } else if (IN6_IS_ADDR_LOOPBACK(addr6)) { - DEBUG(SSSDBG_FUNC_DATA, ("Loopback IPv6 address %s\n", straddr)); + DEBUG(SSSDBG_FUNC_DATA, "Loopback IPv6 address %s\n", straddr); return false; } else if (IN6_IS_ADDR_MULTICAST(addr6)) { - DEBUG(SSSDBG_FUNC_DATA, ("Multicast IPv6 address %s\n", straddr)); + DEBUG(SSSDBG_FUNC_DATA, "Multicast IPv6 address %s\n", straddr); return false; } break; @@ -174,27 +174,27 @@ ok_for_dns(struct sockaddr *sa)
if (inet_ntop(AF_INET, addr, straddr, INET6_ADDRSTRLEN) == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("inet_ntop failed, won't log IP addresses\n")); + "inet_ntop failed, won't log IP addresses\n"); snprintf(straddr, INET6_ADDRSTRLEN, "unknown"); }
if (IN_MULTICAST(ntohl(addr->s_addr))) { - DEBUG(SSSDBG_FUNC_DATA, ("Multicast IPv4 address %s\n", straddr)); + DEBUG(SSSDBG_FUNC_DATA, "Multicast IPv4 address %s\n", straddr); return false; } else if (inet_netof(*addr) == IN_LOOPBACKNET) { - DEBUG(SSSDBG_FUNC_DATA, ("Loopback IPv4 address %s\n", straddr)); + DEBUG(SSSDBG_FUNC_DATA, "Loopback IPv4 address %s\n", straddr); return false; } else if ((addr->s_addr & htonl(0xffff0000)) == htonl(0xa9fe0000)) { /* 169.254.0.0/16 */ - DEBUG(SSSDBG_FUNC_DATA, ("Link-local IPv4 address %s\n", straddr)); + DEBUG(SSSDBG_FUNC_DATA, "Link-local IPv4 address %s\n", straddr); return false; } else if (addr->s_addr == htonl(INADDR_BROADCAST)) { - DEBUG(SSSDBG_FUNC_DATA, ("Broadcast IPv4 address %s\n", straddr)); + DEBUG(SSSDBG_FUNC_DATA, "Broadcast IPv4 address %s\n", straddr); return false; } break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown address family\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown address family\n"); return false; }
@@ -221,7 +221,7 @@ sss_iface_addr_list_get(TALLOC_CTX *mem_ctx, const char *ifname, if (ret == -1) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("Could not read interfaces [%d][%s]\n", ret, strerror(ret))); + "Could not read interfaces [%d][%s]\n", ret, strerror(ret)); goto done; }
@@ -298,7 +298,7 @@ nsupdate_msg_add_fwd(char *update_msg, struct sss_iface_addr *addresses, if (ip == NULL) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("inet_ntop failed [%d]: %s\n", ret, strerror(ret))); + "inet_ntop failed [%d]: %s\n", ret, strerror(ret)); return NULL; } break; @@ -310,13 +310,13 @@ nsupdate_msg_add_fwd(char *update_msg, struct sss_iface_addr *addresses, if (ip == NULL) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("inet_ntop failed [%d]: %s\n", ret, strerror(ret))); + "inet_ntop failed [%d]: %s\n", ret, strerror(ret)); return NULL; } break;
default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown address family\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown address family\n"); return NULL; }
@@ -359,7 +359,7 @@ nsupdate_msg_add_ptr(char *update_msg, struct sss_iface_addr *addresses, addr = (uint8_t *) &((struct sockaddr_in6 *) old_record->addr)->sin6_addr; break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown address family\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown address family\n"); return NULL; }
@@ -388,7 +388,7 @@ nsupdate_msg_add_ptr(char *update_msg, struct sss_iface_addr *addresses, addr = (uint8_t *) &((struct sockaddr_in6 *) new_record->addr)->sin6_addr; break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown address family\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown address family\n"); return NULL; }
@@ -436,15 +436,15 @@ nsupdate_msg_create_common(TALLOC_CTX *mem_ctx, const char *realm, */ if (servername) { DEBUG(SSSDBG_FUNC_DATA, - ("Creating update message for server [%s] and realm [%s]\n.", - servername, realm)); + "Creating update message for server [%s] and realm [%s]\n.", + servername, realm);
/* Add the server, realm and headers */ update_msg = talloc_asprintf(tmp_ctx, "server %s\n%s", servername, realm_directive); } else { DEBUG(SSSDBG_FUNC_DATA, - ("Creating update message for realm [%s].\n", realm)); + "Creating update message for realm [%s].\n", realm); /* Add the realm headers */ update_msg = talloc_asprintf(tmp_ctx, "%s", realm_directive); } @@ -490,7 +490,7 @@ be_nsupdate_create_fwd_msg(TALLOC_CTX *mem_ctx, const char *realm,
if (zone) { DEBUG(SSSDBG_FUNC_DATA, - ("Setting the zone explicitly to [%s].\n", zone)); + "Setting the zone explicitly to [%s].\n", zone); update_msg = talloc_asprintf_append(update_msg, "zone %s.\n", zone); if (update_msg == NULL) { ret = ENOMEM; @@ -506,10 +506,10 @@ be_nsupdate_create_fwd_msg(TALLOC_CTX *mem_ctx, const char *realm, }
DEBUG(SSSDBG_TRACE_FUNC, - (" -- Begin nsupdate message -- \n%s", - update_msg)); + " -- Begin nsupdate message -- \n%s", + update_msg); DEBUG(SSSDBG_TRACE_FUNC, - (" -- End nsupdate message -- \n")); + " -- End nsupdate message -- \n");
ret = ERR_OK; *_update_msg = talloc_steal(mem_ctx, update_msg); @@ -548,10 +548,10 @@ be_nsupdate_create_ptr_msg(TALLOC_CTX *mem_ctx, const char *realm, }
DEBUG(SSSDBG_TRACE_FUNC, - (" -- Begin nsupdate message -- \n%s", - update_msg)); + " -- Begin nsupdate message -- \n%s", + update_msg); DEBUG(SSSDBG_TRACE_FUNC, - (" -- End nsupdate message -- \n")); + " -- End nsupdate message -- \n");
ret = ERR_OK; *_update_msg = talloc_steal(mem_ctx, update_msg); @@ -650,9 +650,9 @@ nsupdate_get_addrs_done(struct tevent_req *subreq) goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not resolve address for this machine, error [%d]: %s, " + "Could not resolve address for this machine, error [%d]: %s, " "resolver returned: [%d]: %s\n", ret, sss_strerror(ret), - resolv_status, resolv_strerror(resolv_status))); + resolv_status, resolv_strerror(resolv_status)); goto done; }
@@ -665,8 +665,8 @@ nsupdate_get_addrs_done(struct tevent_req *subreq) * c-ares, but we need to handle it gracefully. */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Lookup of [%s] returned no addresses. Skipping.\n", - rhostent->name)); + "Lookup of [%s] returned no addresses. Skipping.\n", + rhostent->name); count = 0; }
@@ -726,8 +726,8 @@ done: tevent_req_done(req); } else if (ret != EAGAIN) { DEBUG(SSSDBG_OP_FAILURE, - ("nsupdate_get_addrs_done failed: [%d]: [%s]\n", - ret, sss_strerror(ret))); + "nsupdate_get_addrs_done failed: [%d]: [%s]\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); } /* EAGAIN - another lookup in progress */ @@ -803,8 +803,8 @@ nsupdate_child_send(TALLOC_CTX *mem_ctx, ret = child_handler_setup(ev, child_pid, nsupdate_child_handler, req, &state->child_ctx); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set up child handlers [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set up child handlers [%d]: %s\n", + ret, sss_strerror(ret)); ret = ERR_DYNDNS_FAILED; goto done; } @@ -848,7 +848,7 @@ nsupdate_child_timeout(struct tevent_context *ev, struct nsupdate_child_state *state = tevent_req_data(req, struct nsupdate_child_state);
- DEBUG(SSSDBG_CRIT_FAILURE, ("Timeout reached for dynamic DNS update\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Timeout reached for dynamic DNS update\n"); child_handler_destroy(state->child_ctx); state->child_ctx = NULL; state->child_status = ETIMEDOUT; @@ -867,13 +867,13 @@ nsupdate_child_stdin_done(struct tevent_req *subreq) /* Verify that the buffer was sent, then return * and wait for the sigchld handler to finish. */ - DEBUG(SSSDBG_TRACE_LIBS, ("Sending nsupdate data complete\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Sending nsupdate data complete\n");
ret = write_pipe_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Sending nsupdate data failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Sending nsupdate data failed [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ERR_DYNDNS_FAILED); return; } @@ -899,15 +899,15 @@ nsupdate_child_handler(int child_status,
if (WIFEXITED(child_status) && WEXITSTATUS(child_status) != 0) { DEBUG(SSSDBG_OP_FAILURE, - ("Dynamic DNS child failed with status [%d]\n", child_status)); + "Dynamic DNS child failed with status [%d]\n", child_status); tevent_req_error(req, ERR_DYNDNS_FAILED); return; }
if (WIFSIGNALED(child_status)) { DEBUG(SSSDBG_OP_FAILURE, - ("Dynamic DNS child was terminated by signal [%d]\n", - WTERMSIG(child_status))); + "Dynamic DNS child was terminated by signal [%d]\n", + WTERMSIG(child_status)); tevent_req_error(req, ERR_DYNDNS_FAILED); return; } @@ -964,7 +964,7 @@ struct tevent_req *be_nsupdate_send(TALLOC_CTX *mem_ctx, if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("pipe failed [%d][%s].\n", ret, strerror(ret))); + "pipe failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -976,7 +976,7 @@ struct tevent_req *be_nsupdate_send(TALLOC_CTX *mem_ctx, if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("dup2 failed [%d][%s].\n", ret, strerror(ret))); + "dup2 failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -990,7 +990,7 @@ struct tevent_req *be_nsupdate_send(TALLOC_CTX *mem_ctx, execv(NSUPDATE_PATH, args); /* The child should never end up here */ ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("execv failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "execv failed [%d][%s].\n", ret, strerror(ret)); goto done; } else if (child_pid > 0) { /* parent */ close(pipefd_to_child[0]); @@ -1005,7 +1005,7 @@ struct tevent_req *be_nsupdate_send(TALLOC_CTX *mem_ctx, } else { /* error */ ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fork failed [%d][%s].\n", ret, strerror(ret))); + "fork failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -1039,10 +1039,10 @@ be_nsupdate_args(TALLOC_CTX *mem_ctx,
switch (auth_type) { case BE_NSUPDATE_AUTH_NONE: - DEBUG(SSSDBG_FUNC_DATA, ("nsupdate auth type: none\n")); + DEBUG(SSSDBG_FUNC_DATA, "nsupdate auth type: none\n"); break; case BE_NSUPDATE_AUTH_GSS_TSIG: - DEBUG(SSSDBG_FUNC_DATA, ("nsupdate auth type: GSS-TSIG\n")); + DEBUG(SSSDBG_FUNC_DATA, "nsupdate auth type: GSS-TSIG\n"); argv[argc] = talloc_strdup(argv, "-g"); if (argv[argc] == NULL) { goto fail; @@ -1050,12 +1050,12 @@ be_nsupdate_args(TALLOC_CTX *mem_ctx, argc++; break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown nsupdate auth type\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown nsupdate auth type\n"); goto fail; }
if (force_tcp) { - DEBUG(SSSDBG_FUNC_DATA, ("TCP is set to on\n")); + DEBUG(SSSDBG_FUNC_DATA, "TCP is set to on\n"); argv[argc] = talloc_strdup(argv, "-v"); if (argv[argc] == NULL) { goto fail; @@ -1082,14 +1082,14 @@ be_nsupdate_done(struct tevent_req *subreq) ret = nsupdate_child_recv(subreq, &state->child_status); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("nsupdate child execution failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "nsupdate child execution failed [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); return; }
DEBUG(SSSDBG_FUNC_DATA, - ("nsupdate child status: %d\n", state->child_status)); + "nsupdate child status: %d\n", state->child_status); tevent_req_done(req); }
@@ -1127,13 +1127,13 @@ void be_nsupdate_timer_schedule(struct tevent_context *ev, struct timeval tv;
if (ctx->refresh_timer) { - DEBUG(SSSDBG_FUNC_DATA, ("Timer already scheduled\n")); + DEBUG(SSSDBG_FUNC_DATA, "Timer already scheduled\n"); return; }
refresh = dp_opt_get_int(ctx->opts, DP_OPT_DYNDNS_REFRESH_INTERVAL); if (refresh == 0) return; - DEBUG(SSSDBG_FUNC_DATA, ("Scheduling timer in %d seconds\n", refresh)); + DEBUG(SSSDBG_FUNC_DATA, "Scheduling timer in %d seconds\n", refresh);
tv = tevent_timeval_current_ofs(refresh, 0); ctx->refresh_timer = tevent_add_timer(ev, ctx, tv, @@ -1141,7 +1141,7 @@ void be_nsupdate_timer_schedule(struct tevent_context *ev,
if (!ctx->refresh_timer) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add dyndns refresh timer event\n")); + "Failed to add dyndns refresh timer event\n"); } }
@@ -1158,12 +1158,12 @@ be_nsupdate_check(void) ret = errno; if (ret == ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("%s does not exist. Dynamic DNS updates disabled\n", - NSUPDATE_PATH)); + "%s does not exist. Dynamic DNS updates disabled\n", + NSUPDATE_PATH); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Could not set up dynamic DNS updates: [%d][%s]\n", - ret, strerror(ret))); + "Could not set up dynamic DNS updates: [%d][%s]\n", + ret, strerror(ret)); } }
@@ -1200,7 +1200,7 @@ be_nsupdate_init(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx, ret = dp_get_options(ctx, be_ctx->cdb, be_ctx->conf_path, src_opts, DP_OPT_DYNDNS, &ctx->opts); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot retrieve dynamic DNS options\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot retrieve dynamic DNS options\n"); return ret; }
@@ -1210,7 +1210,7 @@ be_nsupdate_init(TALLOC_CTX *mem_ctx, struct be_ctx *be_ctx, } else if (strcasecmp(strauth, "none") == 0) { ctx->auth_type = BE_NSUPDATE_AUTH_NONE; } else { - DEBUG(SSSDBG_OP_FAILURE, ("Uknown dyndns auth type %s\n", strauth)); + DEBUG(SSSDBG_OP_FAILURE, "Uknown dyndns auth type %s\n", strauth); return EINVAL; }
diff --git a/src/providers/dp_pam_data_util.c b/src/providers/dp_pam_data_util.c index 2bc5368..8b0ca88 100644 --- a/src/providers/dp_pam_data_util.c +++ b/src/providers/dp_pam_data_util.c @@ -65,19 +65,19 @@ struct pam_data *create_pam_data(TALLOC_CTX *mem_ctx)
pd = talloc_zero(mem_ctx, struct pam_data); if (pd == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; }
pd->authtok = sss_authtok_new(pd); if (pd->authtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; }
pd->newauthtok = sss_authtok_new(pd); if (pd->newauthtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); goto failed; }
@@ -174,23 +174,23 @@ errno_t copy_pam_data(TALLOC_CTX *mem_ctx, struct pam_data *src,
failed: talloc_free(pd); - DEBUG(1, ("copy_pam_data failed: (%d) %s.\n", ret, strerror(ret))); + DEBUG(1, "copy_pam_data failed: (%d) %s.\n", ret, strerror(ret)); return ret; }
void pam_print_data(int l, struct pam_data *pd) { - DEBUG(l, ("command: %s\n", pamcmd2str(pd->cmd))); - DEBUG(l, ("domain: %s\n", PAM_SAFE_ITEM(pd->domain))); - DEBUG(l, ("user: %s\n", PAM_SAFE_ITEM(pd->user))); - DEBUG(l, ("service: %s\n", PAM_SAFE_ITEM(pd->service))); - DEBUG(l, ("tty: %s\n", PAM_SAFE_ITEM(pd->tty))); - DEBUG(l, ("ruser: %s\n", PAM_SAFE_ITEM(pd->ruser))); - DEBUG(l, ("rhost: %s\n", PAM_SAFE_ITEM(pd->rhost))); - DEBUG(l, ("authtok type: %d\n", sss_authtok_get_type(pd->authtok))); - DEBUG(l, ("newauthtok type: %d\n", sss_authtok_get_type(pd->newauthtok))); - DEBUG(l, ("priv: %d\n", pd->priv)); - DEBUG(l, ("cli_pid: %d\n", pd->cli_pid)); + DEBUG(l, "command: %s\n", pamcmd2str(pd->cmd)); + DEBUG(l, "domain: %s\n", PAM_SAFE_ITEM(pd->domain)); + DEBUG(l, "user: %s\n", PAM_SAFE_ITEM(pd->user)); + DEBUG(l, "service: %s\n", PAM_SAFE_ITEM(pd->service)); + DEBUG(l, "tty: %s\n", PAM_SAFE_ITEM(pd->tty)); + DEBUG(l, "ruser: %s\n", PAM_SAFE_ITEM(pd->ruser)); + DEBUG(l, "rhost: %s\n", PAM_SAFE_ITEM(pd->rhost)); + DEBUG(l, "authtok type: %d\n", sss_authtok_get_type(pd->authtok)); + DEBUG(l, "newauthtok type: %d\n", sss_authtok_get_type(pd->newauthtok)); + DEBUG(l, "priv: %d\n", pd->priv); + DEBUG(l, "cli_pid: %d\n", pd->cli_pid); }
int pam_add_response(struct pam_data *pd, enum response_type type, diff --git a/src/providers/dp_ptask.c b/src/providers/dp_ptask.c index d0f7c6d..01b0210 100644 --- a/src/providers/dp_ptask.c +++ b/src/providers/dp_ptask.c @@ -60,11 +60,11 @@ static int be_ptask_destructor(void *pvt)
task = talloc_get_type(pvt, struct be_ptask); if (task == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("BUG: task is NULL\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "BUG: task is NULL\n"); return 0; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Terminating periodic task [%s]\n", task->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Terminating periodic task [%s]\n", task->name);
return 0; } @@ -75,11 +75,11 @@ static void be_ptask_online_cb(void *pvt)
task = talloc_get_type(pvt, struct be_ptask); if (task == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("BUG: task is NULL\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "BUG: task is NULL\n"); return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Back end is online\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Back end is online\n"); be_ptask_enable(task); }
@@ -88,7 +88,7 @@ static void be_ptask_offline_cb(void *pvt) struct be_ptask *task = NULL; task = talloc_get_type(pvt, struct be_ptask);
- DEBUG(SSSDBG_TRACE_FUNC, ("Back end is offline\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Back end is offline\n"); be_ptask_disable(task); }
@@ -100,7 +100,7 @@ static void be_ptask_timeout(struct tevent_context *ev, struct be_ptask *task = NULL; task = talloc_get_type(pvt, struct be_ptask);
- DEBUG(SSSDBG_OP_FAILURE, ("Task [%s]: timed out\n", task->name)); + DEBUG(SSSDBG_OP_FAILURE, "Task [%s]: timed out\n", task->name);
talloc_zfree(task->req); be_ptask_schedule(task, task->period, BE_PTASK_SCHEDULE_FROM_NOW); @@ -120,7 +120,7 @@ static void be_ptask_execute(struct tevent_context *ev, task->timer = NULL; /* timer is freed by tevent */
if (be_is_offline(task->be_ctx)) { - DEBUG(SSSDBG_TRACE_FUNC, ("Back end is offline\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Back end is offline\n"); switch (task->offline) { case BE_PTASK_OFFLINE_SKIP: be_ptask_schedule(task, task->period, BE_PTASK_SCHEDULE_FROM_NOW); @@ -134,16 +134,16 @@ static void be_ptask_execute(struct tevent_context *ev, } }
- DEBUG(SSSDBG_TRACE_FUNC, ("Task [%s]: executing task, timeout %lu " - "seconds\n", task->name, task->timeout)); + DEBUG(SSSDBG_TRACE_FUNC, "Task [%s]: executing task, timeout %lu " + "seconds\n", task->name, task->timeout);
task->last_execution = time(NULL);
task->req = task->send_fn(task, task->ev, task->be_ctx, task, task->pvt); if (task->req == NULL) { /* skip this iteration and try again later */ - DEBUG(SSSDBG_OP_FAILURE, ("Task [%s]: failed to execute task, " - "will try again later\n", task->name)); + DEBUG(SSSDBG_OP_FAILURE, "Task [%s]: failed to execute task, " + "will try again later\n", task->name);
be_ptask_schedule(task, task->period, BE_PTASK_SCHEDULE_FROM_NOW); return; @@ -161,8 +161,8 @@ static void be_ptask_execute(struct tevent_context *ev, * we need to cancel the request. */ talloc_zfree(task->req);
- DEBUG(SSSDBG_OP_FAILURE, ("Task [%s]: failed to set timeout, " - "the task will be rescheduled\n", task->name)); + DEBUG(SSSDBG_OP_FAILURE, "Task [%s]: failed to set timeout, " + "the task will be rescheduled\n", task->name);
be_ptask_schedule(task, task->period, BE_PTASK_SCHEDULE_FROM_NOW); } @@ -183,14 +183,14 @@ static void be_ptask_done(struct tevent_req *req) task->req = NULL; switch (ret) { case EOK: - DEBUG(SSSDBG_TRACE_FUNC, ("Task [%s]: finished successfully\n", - task->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Task [%s]: finished successfully\n", + task->name);
be_ptask_schedule(task, task->period, BE_PTASK_SCHEDULE_FROM_LAST); break; default: - DEBUG(SSSDBG_OP_FAILURE, ("Task [%s]: failed with [%d]: %s\n", - task->name, ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Task [%s]: failed with [%d]: %s\n", + task->name, ret, sss_strerror(ret));
be_ptask_schedule(task, task->period, BE_PTASK_SCHEDULE_FROM_NOW); break; @@ -204,7 +204,7 @@ static void be_ptask_schedule(struct be_ptask *task, struct timeval tv;
if (!task->enabled) { - DEBUG(SSSDBG_TRACE_FUNC, ("Task [%s]: disabled\n", task->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Task [%s]: disabled\n", task->name); return; }
@@ -212,29 +212,29 @@ static void be_ptask_schedule(struct be_ptask *task, case BE_PTASK_SCHEDULE_FROM_NOW: tv = tevent_timeval_current_ofs(delay, 0);
- DEBUG(SSSDBG_TRACE_FUNC, ("Task [%s]: scheduling task %lu seconds " - "from now [%lu]\n", task->name, delay, tv.tv_sec)); + DEBUG(SSSDBG_TRACE_FUNC, "Task [%s]: scheduling task %lu seconds " + "from now [%lu]\n", task->name, delay, tv.tv_sec); break; case BE_PTASK_SCHEDULE_FROM_LAST: tv = tevent_timeval_set(task->last_execution + delay, 0);
- DEBUG(SSSDBG_TRACE_FUNC, ("Task [%s]: scheduling task %lu seconds " + DEBUG(SSSDBG_TRACE_FUNC, "Task [%s]: scheduling task %lu seconds " "from last execution time [%lu]\n", - task->name, delay, tv.tv_sec)); + task->name, delay, tv.tv_sec); break; }
if (task->timer != NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Task [%s]: another timer is already " - "active?\n", task->name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Task [%s]: another timer is already " + "active?\n", task->name); talloc_zfree(task->timer); }
task->timer = tevent_add_timer(task->ev, task, tv, be_ptask_execute, task); if (task->timer == NULL) { /* nothing we can do about it */ - DEBUG(SSSDBG_CRIT_FAILURE, ("FATAL: Unable to schedule task [%s]\n", - task->name)); + DEBUG(SSSDBG_CRIT_FAILURE, "FATAL: Unable to schedule task [%s]\n", + task->name); be_ptask_disable(task); } } @@ -289,20 +289,20 @@ errno_t be_ptask_create(TALLOC_CTX *mem_ctx, /* install offline and online callbacks */ ret = be_add_online_cb(task, be_ctx, be_ptask_online_cb, task, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to install online callback " - "[%d]: %s", ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Unable to install online callback " + "[%d]: %s", ret, sss_strerror(ret)); goto done; }
ret = be_add_offline_cb(task, be_ctx, be_ptask_offline_cb, task, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to install offline callback " - "[%d]: %s", ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Unable to install offline callback " + "[%d]: %s", ret, sss_strerror(ret)); goto done; } }
- DEBUG(SSSDBG_TRACE_FUNC, ("Periodic task [%s] was created\n", task->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Periodic task [%s] was created\n", task->name);
be_ptask_schedule(task, first_delay, BE_PTASK_SCHEDULE_FROM_NOW);
@@ -323,12 +323,12 @@ done: void be_ptask_enable(struct be_ptask *task) { if (task->enabled) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Task [%s]: already enabled\n", - task->name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Task [%s]: already enabled\n", + task->name); return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Task [%s]: enabling task\n", task->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Task [%s]: enabling task\n", task->name);
task->enabled = true; be_ptask_schedule(task, task->enabled_delay, BE_PTASK_SCHEDULE_FROM_NOW); @@ -337,7 +337,7 @@ void be_ptask_enable(struct be_ptask *task) /* Disable the task, but if a request already in progress, let it finish. */ void be_ptask_disable(struct be_ptask *task) { - DEBUG(SSSDBG_TRACE_FUNC, ("Task [%s]: disabling task\n", task->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Task [%s]: disabling task\n", task->name);
talloc_zfree(task->timer); task->enabled = false; diff --git a/src/providers/dp_refresh.c b/src/providers/dp_refresh.c index c368668..109fdc3 100644 --- a/src/providers/dp_refresh.c +++ b/src/providers/dp_refresh.c @@ -71,7 +71,7 @@ static errno_t be_refresh_get_values(TALLOC_CTX *mem_ctx, ret = sysdb_msg2attrs(tmp_ctx, count, msgs, &records); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not convert ldb message to sysdb_attrs\n")); + "Could not convert ldb message to sysdb_attrs\n"); goto done; }
@@ -191,7 +191,7 @@ struct tevent_req *be_refresh_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct be_refresh_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -208,8 +208,8 @@ struct tevent_req *be_refresh_send(TALLOC_CTX *mem_ctx, if (ret == EOK) { goto immediately; } else if (ret != EAGAIN) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_refresh_step() failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "be_refresh_step() failed [%d]: %s\n", + ret, sss_strerror(ret)); goto immediately; }
@@ -255,8 +255,8 @@ static errno_t be_refresh_step(struct tevent_req *req) ret = state->cb->get_values(state, state->be_ctx->domain, state->period, &values); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to obtain DN list [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to obtain DN list [%d]: %s\n", + ret, sss_strerror(ret)); goto done; }
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c index 98c2006..e8d4903 100644 --- a/src/providers/fail_over.c +++ b/src/providers/fail_over.c @@ -140,12 +140,12 @@ fo_context_init(TALLOC_CTX *mem_ctx, struct fo_options *opts)
ctx = talloc_zero(mem_ctx, struct fo_ctx); if (ctx == NULL) { - DEBUG(1, ("No memory\n")); + DEBUG(1, "No memory\n"); return NULL; } ctx->opts = talloc_zero(ctx, struct fo_options); if (ctx->opts == NULL) { - DEBUG(1, ("No memory\n")); + DEBUG(1, "No memory\n"); return NULL; }
@@ -155,8 +155,8 @@ fo_context_init(TALLOC_CTX *mem_ctx, struct fo_options *opts) ctx->opts->service_resolv_timeout = opts->service_resolv_timeout;
DEBUG(SSSDBG_TRACE_FUNC, - ("Created new fail over context, retry timeout is %ld\n", - ctx->opts->retry_timeout)); + "Created new fail over context, retry timeout is %ld\n", + ctx->opts->retry_timeout); return ctx; }
@@ -223,8 +223,8 @@ collapse_srv_lookup(struct fo_server **_server)
server = *_server; meta = server->srv_data->meta; - DEBUG(4, ("Need to refresh SRV lookup for domain %s\n", - meta->srv_data->dns_domain)); + DEBUG(4, "Need to refresh SRV lookup for domain %s\n", + meta->srv_data->dns_domain);
if (server != meta) { while (server->prev && server->prev->srv_data == meta->srv_data) { @@ -282,7 +282,7 @@ get_srv_data_status(struct srv_data *data) data->last_status_change.tv_sec = 0; break; default: - DEBUG(1, ("Unknown state for SRV server!\n")); + DEBUG(1, "Unknown state for SRV server!\n"); } }
@@ -292,8 +292,8 @@ get_srv_data_status(struct srv_data *data) static void set_srv_data_status(struct srv_data *data, enum srv_lookup_status status) { - DEBUG(4, ("Marking SRV lookup of service '%s' as '%s'\n", - data->meta->service->name, str_srv_data_status(status))); + DEBUG(4, "Marking SRV lookup of service '%s' as '%s'\n", + data->meta->service->name, str_srv_data_status(status));
gettimeofday(&data->last_status_change, NULL); data->srv_lookup_status = status; @@ -312,15 +312,15 @@ get_server_status(struct fo_server *server) if (server->common == NULL) return SERVER_NAME_RESOLVED;
- DEBUG(7, ("Status of server '%s' is '%s'\n", SERVER_NAME(server), - str_server_status(server->common->server_status))); + DEBUG(7, "Status of server '%s' is '%s'\n", SERVER_NAME(server), + str_server_status(server->common->server_status));
timeout = server->service->ctx->opts->retry_timeout; gettimeofday(&tv, NULL); if (timeout != 0 && server->common->server_status == SERVER_NOT_WORKING) { if (STATUS_DIFF(server->common, tv) > timeout) { - DEBUG(4, ("Reseting the server status of '%s'\n", - SERVER_NAME(server))); + DEBUG(4, "Reseting the server status of '%s'\n", + SERVER_NAME(server)); server->common->server_status = SERVER_NAME_NOT_RESOLVED; server->common->last_status_change.tv_sec = tv.tv_sec; } @@ -328,8 +328,8 @@ get_server_status(struct fo_server *server)
if (server->common->rhostent && STATUS_DIFF(server->common, tv) > server->common->rhostent->addr_list[0]->ttl) { - DEBUG(4, ("Hostname resolution expired, resetting the server " - "status of '%s'\n", SERVER_NAME(server))); + DEBUG(4, "Hostname resolution expired, resetting the server " + "status of '%s'\n", SERVER_NAME(server)); fo_set_server_status(server, SERVER_NAME_NOT_RESOLVED); }
@@ -346,15 +346,15 @@ get_port_status(struct fo_server *server) struct timeval tv; time_t timeout;
- DEBUG(7, ("Port status of port %d for server '%s' is '%s'\n", server->port, - SERVER_NAME(server), str_port_status(server->port_status))); + DEBUG(7, "Port status of port %d for server '%s' is '%s'\n", server->port, + SERVER_NAME(server), str_port_status(server->port_status));
timeout = server->service->ctx->opts->retry_timeout; if (timeout != 0 && server->port_status == PORT_NOT_WORKING) { gettimeofday(&tv, NULL); if (STATUS_DIFF(server, tv) > timeout) { - DEBUG(4, ("Reseting the status of port %d for server '%s'\n", - server->port, SERVER_NAME(server))); + DEBUG(4, "Reseting the status of port %d for server '%s'\n", + server->port, SERVER_NAME(server)); server->port_status = PORT_NEUTRAL; server->last_status_change.tv_sec = tv.tv_sec; } @@ -398,10 +398,10 @@ fo_new_service(struct fo_ctx *ctx, const char *name, struct fo_service *service; int ret;
- DEBUG(SSSDBG_TRACE_FUNC, ("Creating new service '%s'\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Creating new service '%s'\n", name); ret = fo_get_service(ctx, name, &service); if (ret == EOK) { - DEBUG(5, ("Service '%s' already exists\n", name)); + DEBUG(5, "Service '%s' already exists\n", name); if (_service) { *_service = service; } @@ -473,7 +473,7 @@ static int server_common_destructor(void *memptr)
common = talloc_get_type(memptr, struct server_common); if (common->request_list) { - DEBUG(1, ("BUG: pending requests still associated with this server\n")); + DEBUG(1, "BUG: pending requests still associated with this server\n"); return -1; } DLIST_REMOVE(common->ctx->server_common_list, common); @@ -518,8 +518,8 @@ fo_add_srv_server(struct fo_service *service, const char *srv, struct fo_server *server;
DEBUG(SSSDBG_TRACE_FUNC, - ("Adding new SRV server to service '%s' using '%s'.\n", - service->name, proto)); + "Adding new SRV server to service '%s' using '%s'.\n", + service->name, proto);
DLIST_FOR_EACH(server, service->server_list) { /* Compare user data only if user_data_cmp and both arguments @@ -713,16 +713,16 @@ static errno_t fo_add_server_to_list(struct fo_server **to_list, server->user_data);
if (exists) { - DEBUG(SSSDBG_TRACE_FUNC, ("Server '%s:%d' for service '%s' " - "is already present\n", debug_name, server->port, service_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Server '%s:%d' for service '%s' " + "is already present\n", debug_name, server->port, service_name); return EEXIST; }
DLIST_ADD_END(*to_list, server, struct fo_server *);
- DEBUG(SSSDBG_TRACE_FUNC, ("Inserted %s server '%s:%d' to service " + DEBUG(SSSDBG_TRACE_FUNC, "Inserted %s server '%s:%d' to service " "'%s'\n", (server->primary ? "primary" : "backup"), - debug_name, server->port, service_name)); + debug_name, server->port, service_name);
return EOK; } @@ -879,7 +879,7 @@ set_lookup_hook(struct fo_server *server, struct tevent_req *req)
request = talloc(req, struct resolve_service_request); if (request == NULL) { - DEBUG(1, ("No memory\n")); + DEBUG(1, "No memory\n"); talloc_free(request); return ENOMEM; } @@ -936,7 +936,7 @@ fo_resolve_service_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct tevent_req *subreq; struct resolve_service_state *state;
- DEBUG(4, ("Trying to resolve service '%s'\n", service->name)); + DEBUG(4, "Trying to resolve service '%s'\n", service->name); req = tevent_req_create(mem_ctx, &state, struct resolve_service_state); if (req == NULL) return NULL; @@ -947,7 +947,7 @@ fo_resolve_service_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
ret = get_first_server_entity(service, &server); if (ret != EOK) { - DEBUG(1, ("No available servers for service '%s'\n", service->name)); + DEBUG(1, "No available servers for service '%s'\n", service->name); goto done; }
@@ -955,7 +955,7 @@ fo_resolve_service_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, ret = fo_resolve_service_activate_timeout(req, ev, ctx->opts->service_resolv_timeout); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set service timeout\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set service timeout\n"); goto done; }
@@ -999,7 +999,7 @@ fo_resolve_service_timeout(struct tevent_context *ev, { struct tevent_req *req = talloc_get_type(pvt, struct tevent_req);
- DEBUG(SSSDBG_MINOR_FAILURE, ("Service resolving timeout reached\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Service resolving timeout reached\n"); tevent_req_error(req, ETIMEDOUT); }
@@ -1017,12 +1017,12 @@ fo_resolve_service_activate_timeout(struct tevent_req *req, state->timeout_handler = tevent_add_timer(ev, state, tv, fo_resolve_service_timeout, req); if (state->timeout_handler == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_add_timer failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_add_timer failed.\n"); return ENOMEM; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Resolve timeout set to %lu seconds\n", - timeout_seconds)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Resolve timeout set to %lu seconds\n", + timeout_seconds); return EOK; }
@@ -1105,9 +1105,9 @@ fo_resolve_service_done(struct tevent_req *subreq) &common->rhostent); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("Failed to resolve server '%s': %s\n", + DEBUG(1, "Failed to resolve server '%s': %s\n", common->name, - resolv_strerror(resolv_status))); + resolv_strerror(resolv_status)); /* If the resolver failed to resolve a hostname but did not * encounter an error, tell the caller to retry another server. * @@ -1189,8 +1189,8 @@ resolve_srv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, state->meta = server->srv_data->meta;
status = get_srv_data_status(server->srv_data); - DEBUG(SSSDBG_FUNC_DATA, ("The status of SRV lookup is %s\n", - str_srv_data_status(status))); + DEBUG(SSSDBG_FUNC_DATA, "The status of SRV lookup is %s\n", + str_srv_data_status(status)); switch(status) { case SRV_EXPIRED: /* Need a refresh */ state->meta = collapse_srv_lookup(&server); @@ -1207,7 +1207,7 @@ resolve_srv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, }
if (ctx->srv_send_fn == NULL || ctx->srv_recv_fn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("No SRV lookup plugin is set\n")); + DEBUG(SSSDBG_OP_FAILURE, "No SRV lookup plugin is set\n"); ret = ENOTSUP; goto done; } @@ -1234,7 +1234,7 @@ resolve_srv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, tevent_req_post(req, state->ev); return req; default: - DEBUG(1, ("Unexpected status %d for a SRV server\n", status)); + DEBUG(1, "Unexpected status %d for a SRV server\n", status); ret = EIO; goto done; } @@ -1271,8 +1271,8 @@ resolve_srv_done(struct tevent_req *subreq) case EOK: if ((num_primary_servers == 0 || primary_servers == NULL) && (num_backup_servers == 0 || backup_servers == NULL)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("SRV lookup plugin returned EOK but " - "no servers\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "SRV lookup plugin returned EOK but " + "no servers\n"); ret = EFAULT; goto done; } @@ -1308,8 +1308,8 @@ resolve_srv_done(struct tevent_req *subreq) if (last_server == state->meta) { /* SRV lookup returned only those servers * that are already present. */ - DEBUG(SSSDBG_TRACE_FUNC, ("SRV lookup did not return " - "any new server.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "SRV lookup did not return " + "any new server.\n"); ret = ERR_SRV_DUPLICATES; goto done; } @@ -1318,7 +1318,7 @@ resolve_srv_done(struct tevent_req *subreq) * We will return the first new server. */ if (state->meta->next == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("BUG: state->meta->next is NULL\n")); + "BUG: state->meta->next is NULL\n"); ret = ERR_INTERNAL; goto done; } @@ -1341,8 +1341,8 @@ resolve_srv_done(struct tevent_req *subreq) fo_set_port_status(state->meta, PORT_NOT_WORKING); /* fall through */ default: - DEBUG(SSSDBG_OP_FAILURE, ("Unable to resolve SRV [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Unable to resolve SRV [%d]: %s\n", + ret, sss_strerror(ret)); }
done: @@ -1385,8 +1385,8 @@ static void set_server_common_status(struct server_common *common, enum server_status status) { - DEBUG(4, ("Marking server '%s' as '%s'\n", common->name, - str_server_status(status))); + DEBUG(4, "Marking server '%s' as '%s'\n", common->name, + str_server_status(status));
common->server_status = status; gettimeofday(&common->last_status_change, NULL); @@ -1396,7 +1396,7 @@ void fo_set_server_status(struct fo_server *server, enum server_status status) { if (server->common == NULL) { - DEBUG(1, ("Bug: Trying to set server status of a name-less server\n")); + DEBUG(1, "Bug: Trying to set server status of a name-less server\n"); return; }
@@ -1408,8 +1408,8 @@ fo_set_port_status(struct fo_server *server, enum port_status status) { struct fo_server *siter;
- DEBUG(4, ("Marking port %d of server '%s' as '%s'\n", server->port, - SERVER_NAME(server), str_port_status(status))); + DEBUG(4, "Marking port %d of server '%s' as '%s'\n", server->port, + SERVER_NAME(server), str_port_status(status));
server->port_status = status; gettimeofday(&server->last_status_change, NULL); @@ -1426,9 +1426,9 @@ fo_set_port_status(struct fo_server *server, enum port_status status) DLIST_FOR_EACH(siter, server->service->server_list) { if (fo_server_cmp(siter, server)) { DEBUG(SSSDBG_TRACE_FUNC, - ("Marking port %d of duplicate server '%s' as '%s'\n", + "Marking port %d of duplicate server '%s' as '%s'\n", siter->port, SERVER_NAME(siter), - str_port_status(status))); + str_port_status(status)); siter->port_status = status; gettimeofday(&siter->last_status_change, NULL); } @@ -1440,7 +1440,7 @@ void fo_try_next_server(struct fo_service *service) struct fo_server *server;
if (!service) { - DEBUG(1, ("Bug: No service supplied\n")); + DEBUG(1, "Bug: No service supplied\n"); return; }
@@ -1493,7 +1493,7 @@ struct resolv_hostent * fo_get_server_hostent(struct fo_server *server) { if (server->common == NULL) { - DEBUG(1, ("Bug: Trying to get hostent from a name-less server\n")); + DEBUG(1, "Bug: Trying to get hostent from a name-less server\n"); return NULL; }
@@ -1559,12 +1559,12 @@ bool fo_set_srv_lookup_plugin(struct fo_ctx *ctx, void *pvt) { if (ctx == NULL || send_fn == NULL || recv_fn == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid parameters\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid parameters\n"); return false; }
if (ctx->srv_send_fn != NULL || ctx->srv_recv_fn != NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("SRV lookup plugin is already set\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "SRV lookup plugin is already set\n"); return false; }
diff --git a/src/providers/fail_over_srv.c b/src/providers/fail_over_srv.c index 543516e..2645b28 100644 --- a/src/providers/fail_over_srv.c +++ b/src/providers/fail_over_srv.c @@ -48,7 +48,7 @@ struct tevent_req *fo_discover_srv_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct fo_discover_srv_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -95,13 +95,13 @@ static void fo_discover_srv_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Got answer. Processing...\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Got answer. Processing...\n");
/* sort and store the answer */ ret = resolv_sort_srv_reply(&reply_list); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not sort the answers from DNS " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not sort the answers from DNS " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -110,7 +110,7 @@ static void fo_discover_srv_done(struct tevent_req *subreq) state->num_servers++; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Got %zu servers\n", state->num_servers)); + DEBUG(SSSDBG_TRACE_FUNC, "Got %zu servers\n", state->num_servers);
state->servers = talloc_array(state, struct fo_server_info, state->num_servers); @@ -201,7 +201,7 @@ struct tevent_req *fo_discover_servers_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct fo_discover_servers_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -248,7 +248,7 @@ struct tevent_req *fo_discover_servers_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Looking up primary servers\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Looking up primary servers\n");
domains = talloc_zero_array(state, const char *, 3); if (domains == NULL) { @@ -293,8 +293,8 @@ static void fo_discover_servers_primary_done(struct tevent_req *subreq) &state->num_primary_servers); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to retrieve primary servers " - "[%d]: %s\n", ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Unable to retrieve primary servers " + "[%d]: %s\n", ret, sss_strerror(ret)); if (ret != ERR_SRV_NOT_FOUND && ret != ERR_SRV_LOOKUP_ERROR) { /* abort on system error */ goto done; @@ -302,7 +302,7 @@ static void fo_discover_servers_primary_done(struct tevent_req *subreq) }
if (state->backup_domain == NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("No backup domain specified\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No backup domain specified\n"); goto done; }
@@ -316,7 +316,7 @@ static void fo_discover_servers_primary_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Looking up backup servers\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Looking up backup servers\n");
domains = talloc_zero_array(state, const char *, 2); if (domains == NULL) { @@ -361,8 +361,8 @@ static void fo_discover_servers_backup_done(struct tevent_req *subreq) &state->num_backup_servers); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to retrieve backup servers " - "[%d]: %s\n", ret, sss_strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to retrieve backup servers " + "[%d]: %s\n", ret, sss_strerror(ret)); if (ret == ERR_SRV_NOT_FOUND || ret == ERR_SRV_LOOKUP_ERROR) { /* we have successfully fetched primary servers, so we will * finish the request normally on non system error */ @@ -491,7 +491,7 @@ struct tevent_req *fo_resolve_srv_dns_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct fo_resolve_srv_dns_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
diff --git a/src/providers/ipa/ipa_access.c b/src/providers/ipa/ipa_access.c index 7d44788..4f5bc8d 100644 --- a/src/providers/ipa/ipa_access.c +++ b/src/providers/ipa/ipa_access.c @@ -143,7 +143,7 @@ static void ipa_hbac_check(struct tevent_req *req)
hbac_ctx = talloc_zero(be_req, struct hbac_ctx); if (hbac_ctx == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); ret = ENOMEM; goto fail; } @@ -158,7 +158,7 @@ static void ipa_hbac_check(struct tevent_req *req) hbac_ctx->tr_ctx = ipa_access_ctx->tr_ctx; hbac_ctx->search_bases = ipa_access_ctx->hbac_search_bases; if (hbac_ctx->search_bases == NULL) { - DEBUG(1, ("No HBAC search base found.\n")); + DEBUG(1, "No HBAC search base found.\n"); ret = EINVAL; goto fail; } @@ -197,7 +197,7 @@ static int hbac_retry(struct hbac_ctx *hbac_ctx) struct be_ctx *be_ctx = be_req_get_be_ctx(hbac_ctx->be_req);
offline = be_is_offline(be_ctx); - DEBUG(9, ("Connection status is [%s].\n", offline ? "offline" : "online")); + DEBUG(9, "Connection status is [%s].\n", offline ? "offline" : "online");
refresh_interval = dp_opt_get_int(hbac_ctx->ipa_options, IPA_HBAC_REFRESH); @@ -205,7 +205,7 @@ static int hbac_retry(struct hbac_ctx *hbac_ctx) now = time(NULL); if (now < access_ctx->last_update + refresh_interval) { /* Simulate offline mode and just go to the cache */ - DEBUG(6, ("Performing cached HBAC evaluation\n")); + DEBUG(6, "Performing cached HBAC evaluation\n"); offline = true; }
@@ -214,14 +214,14 @@ static int hbac_retry(struct hbac_ctx *hbac_ctx) hbac_ctx->sdap_op = sdap_id_op_create(hbac_ctx, hbac_ctx->sdap_ctx->conn->conn_cache); if (hbac_ctx->sdap_op == NULL) { - DEBUG(1, ("sdap_id_op_create failed.\n")); + DEBUG(1, "sdap_id_op_create failed.\n"); return EIO; } }
subreq = sdap_id_op_connect_send(hbac_ctx->sdap_op, hbac_ctx, &ret); if (!subreq) { - DEBUG(1, ("sdap_id_op_connect_send failed: %d(%s).\n", ret, strerror(ret))); + DEBUG(1, "sdap_id_op_connect_send failed: %d(%s).\n", ret, strerror(ret)); talloc_zfree(hbac_ctx->sdap_op); return ret; } @@ -348,8 +348,8 @@ static int hbac_get_host_info_step(struct hbac_ctx *hbac_ctx) hostname = NULL;
/* THIS FEATURE IS DEPRECATED */ - DEBUG(SSSDBG_MINOR_FAILURE, ("WARNING: Using deprecated option " - "ipa_hbac_support_srchost.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "WARNING: Using deprecated option " + "ipa_hbac_support_srchost.\n"); sss_log(SSS_LOG_NOTICE, "WARNING: Using deprecated option " "ipa_hbac_support_srchost.\n"); } else { @@ -364,7 +364,7 @@ static int hbac_get_host_info_step(struct hbac_ctx *hbac_ctx) hbac_ctx->access_ctx->hostgroup_map, hbac_ctx->access_ctx->host_search_bases); if (req == NULL) { - DEBUG(1, ("Could not get host info\n")); + DEBUG(1, "Could not get host info\n"); return ENOMEM; } tevent_req_set_callback(req, hbac_get_service_info_step, hbac_ctx); @@ -395,7 +395,7 @@ static void hbac_get_service_info_step(struct tevent_req *req) hbac_ctx->sdap_ctx->opts, hbac_ctx->search_bases); if (req == NULL) { - DEBUG(1,("Could not get service info\n")); + DEBUG(1,"Could not get service info\n"); goto fail; } tevent_req_set_callback(req, hbac_get_rule_info_step, hbac_ctx); @@ -429,7 +429,7 @@ static void hbac_get_rule_info_step(struct tevent_req *req) hbac_ctx->ipa_host = NULL; ipa_hostname = dp_opt_get_cstring(hbac_ctx->ipa_options, IPA_HOSTNAME); if (ipa_hostname == NULL) { - DEBUG(1, ("Missing ipa_hostname, this should never happen.\n")); + DEBUG(1, "Missing ipa_hostname, this should never happen.\n"); goto fail; }
@@ -438,7 +438,7 @@ static void hbac_get_rule_info_step(struct tevent_req *req) SYSDB_FQDN, &hostname); if (ret != EOK) { - DEBUG(1, ("Could not locate IPA host\n")); + DEBUG(1, "Could not locate IPA host\n"); goto fail; }
@@ -448,7 +448,7 @@ static void hbac_get_rule_info_step(struct tevent_req *req) } } if (hbac_ctx->ipa_host == NULL) { - DEBUG(1, ("Could not locate IPA host\n")); + DEBUG(1, "Could not locate IPA host\n"); goto fail; }
@@ -462,7 +462,7 @@ static void hbac_get_rule_info_step(struct tevent_req *req) hbac_ctx->search_bases, hbac_ctx->ipa_host); if (req == NULL) { - DEBUG(1, ("Could not get rules\n")); + DEBUG(1, "Could not get rules\n"); goto fail; }
@@ -515,7 +515,7 @@ static void hbac_sysdb_save(struct tevent_req *req) ret = sysdb_delete_recursive(domain->sysdb, base_dn, true); talloc_free(tmp_ctx); if (ret != EOK) { - DEBUG(1, ("sysdb_delete_recursive failed.\n")); + DEBUG(1, "sysdb_delete_recursive failed.\n"); ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR); return; } @@ -531,7 +531,7 @@ static void hbac_sysdb_save(struct tevent_req *req)
ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(0, ("Could not start transaction\n")); + DEBUG(0, "Could not start transaction\n"); goto fail; } in_transaction = true; @@ -544,8 +544,8 @@ static void hbac_sysdb_save(struct tevent_req *req) hbac_ctx->hostgroup_count, hbac_ctx->hostgroups); if (ret != EOK) { - DEBUG(1, ("Error saving hosts: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Error saving hosts: [%d][%s]\n", + ret, strerror(ret)); goto fail; }
@@ -557,8 +557,8 @@ static void hbac_sysdb_save(struct tevent_req *req) hbac_ctx->servicegroup_count, hbac_ctx->servicegroups); if (ret != EOK) { - DEBUG(1, ("Error saving services: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Error saving services: [%d][%s]\n", + ret, strerror(ret)); goto fail; } /* Save the rules */ @@ -568,14 +568,14 @@ static void hbac_sysdb_save(struct tevent_req *req) hbac_ctx->rules, NULL, NULL, 0, NULL); if (ret != EOK) { - DEBUG(1, ("Error saving rules: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Error saving rules: [%d][%s]\n", + ret, strerror(ret)); goto fail; }
ret = sysdb_transaction_commit(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -598,7 +598,7 @@ fail: if (in_transaction) { ret = sysdb_transaction_cancel(domain->sysdb); if (ret != EOK) { - DEBUG(0, ("Could not cancel transaction\n")); + DEBUG(0, "Could not cancel transaction\n"); } } ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR); @@ -617,43 +617,43 @@ void ipa_hbac_evaluate_rules(struct hbac_ctx *hbac_ctx) ret = hbac_get_cached_rules(hbac_ctx, be_ctx->domain, &hbac_ctx->rule_count, &hbac_ctx->rules); if (ret != EOK) { - DEBUG(1, ("Could not retrieve rules from the cache\n")); + DEBUG(1, "Could not retrieve rules from the cache\n"); ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR); }
ret = hbac_ctx_to_rules(hbac_ctx, hbac_ctx, &hbac_rules, &eval_req); if (ret == EPERM) { - DEBUG(1, ("DENY rules detected. Denying access to all users\n")); + DEBUG(1, "DENY rules detected. Denying access to all users\n"); ipa_access_reply(hbac_ctx, PAM_PERM_DENIED); return; } else if (ret != EOK) { - DEBUG(1, ("Could not construct HBAC rules\n")); + DEBUG(1, "Could not construct HBAC rules\n"); ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR); return; }
result = hbac_evaluate(hbac_rules, eval_req, &info); if (result == HBAC_EVAL_ALLOW) { - DEBUG(3, ("Access granted by HBAC rule [%s]\n", - info->rule_name)); + DEBUG(3, "Access granted by HBAC rule [%s]\n", + info->rule_name); hbac_free_info(info); ipa_access_reply(hbac_ctx, PAM_SUCCESS); return; } else if (result == HBAC_EVAL_ERROR) { - DEBUG(1, ("Error [%s] occurred in rule [%s]\n", + DEBUG(1, "Error [%s] occurred in rule [%s]\n", hbac_error_string(info->code), - info->rule_name)); + info->rule_name); hbac_free_info(info); ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR); return; } else if (result == HBAC_EVAL_OOM) { - DEBUG(1, ("Insufficient memory\n")); + DEBUG(1, "Insufficient memory\n"); ipa_access_reply(hbac_ctx, PAM_SYSTEM_ERR); return; }
- DEBUG(3, ("Access denied by HBAC rules\n")); + DEBUG(3, "Access denied by HBAC rules\n"); hbac_free_info(info); ipa_access_reply(hbac_ctx, PAM_PERM_DENIED); } @@ -699,7 +699,7 @@ errno_t hbac_get_cached_rules(TALLOC_CTX *mem_ctx, HBAC_RULES_SUBDIR, attrs, &rule_count, &msgs); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("Error looking up HBAC rules")); + DEBUG(1, "Error looking up HBAC rules"); goto done; } if (ret == ENOENT) { rule_count = 0; @@ -707,7 +707,7 @@ errno_t hbac_get_cached_rules(TALLOC_CTX *mem_ctx,
ret = sysdb_msg2attrs(tmp_ctx, rule_count, msgs, &rules); if (ret != EOK) { - DEBUG(1, ("Could not convert ldb message to sysdb_attrs\n")); + DEBUG(1, "Could not convert ldb message to sysdb_attrs\n"); goto done; }
diff --git a/src/providers/ipa/ipa_auth.c b/src/providers/ipa/ipa_auth.c index 3db623f..2c892a4 100644 --- a/src/providers/ipa/ipa_auth.c +++ b/src/providers/ipa/ipa_auth.c @@ -55,14 +55,14 @@ static struct tevent_req *get_password_migration_flag_send(TALLOC_CTX *memctx, struct get_password_migration_flag_state *state;
if (sdap_id_ctx == NULL || ipa_realm == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing parameter.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing parameter.\n"); return NULL; }
req = tevent_req_create(memctx, &state, struct get_password_migration_flag_state); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("tevent_req_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "tevent_req_create failed.\n"); return NULL; }
@@ -75,14 +75,14 @@ static struct tevent_req *get_password_migration_flag_send(TALLOC_CTX *memctx, state->sdap_op = sdap_id_op_create(state, state->sdap_id_ctx->conn->conn_cache); if (state->sdap_op == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed.\n"); goto fail; }
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (!subreq) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: %d(%s).\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n", + ret, strerror(ret)); goto fail; }
@@ -108,12 +108,12 @@ static void get_password_migration_flag_auth_done(struct tevent_req *subreq) if (ret) { if (dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No IPA server is available, cannot get the " - "migration flag while offline\n")); + "No IPA server is available, cannot get the " + "migration flag while offline\n"); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to IPA server: [%d](%s)\n", - ret, strerror(ret))); + "Failed to connect to IPA server: [%d](%s)\n", + ret, strerror(ret)); }
tevent_req_error(req, ret); @@ -195,7 +195,7 @@ void ipa_auth(struct be_req *be_req)
state = talloc_zero(be_req, struct ipa_auth_state); if (state == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); goto fail; }
@@ -220,14 +220,14 @@ void ipa_auth(struct be_req *be_req) struct ipa_auth_ctx); break; default: - DEBUG(SSSDBG_OP_FAILURE, ("Unsupported PAM task.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unsupported PAM task.\n"); goto fail; }
req = krb5_auth_send(state, state->ev, be_ctx, state->pd, state->ipa_auth_ctx->krb5_auth_ctx); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_send failed.\n"); goto fail; }
@@ -252,7 +252,7 @@ static void ipa_auth_handler_done(struct tevent_req *req) talloc_zfree(req); state->pd->pam_status = pam_status; if (ret != EOK && pam_status != PAM_CRED_ERR) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_recv request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_recv request failed.\n"); dp_err = DP_ERR_OK; goto done; } @@ -271,7 +271,7 @@ static void ipa_auth_handler_done(struct tevent_req *req) IPA_KRB5_REALM)); if (req == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("get_password_migration_flag failed.\n")); + "get_password_migration_flag failed.\n"); goto done; }
@@ -294,8 +294,8 @@ static void ipa_get_migration_flag_done(struct tevent_req *req) &state->password_migration); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("get_password_migration_flag " - "request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_password_migration_flag " + "request failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; dp_err = DP_ERR_OK; goto done; @@ -308,7 +308,7 @@ static void ipa_get_migration_flag_done(struct tevent_req *req) state->ipa_auth_ctx->sdap_auth_ctx->service, true, CON_TLS_ON, true); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_cli_connect_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_cli_connect_send failed.\n"); goto done; }
@@ -316,7 +316,7 @@ static void ipa_get_migration_flag_done(struct tevent_req *req) return; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Password migration is not enabled.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "Password migration is not enabled.\n"); dp_err = DP_ERR_OK; done: be_req_terminate(state->be_req, dp_err, state->pd->pam_status, NULL); @@ -337,17 +337,17 @@ static void ipa_migration_flag_connect_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot connect to LDAP server to perform migration\n")); + "Cannot connect to LDAP server to perform migration\n"); goto done; }
state->pd->pam_status = PAM_SYSTEM_ERR; - DEBUG(SSSDBG_TRACE_FUNC, ("Assuming Kerberos password is missing, " - "starting password migration.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Assuming Kerberos password is missing, " + "starting password migration.\n");
attrs = talloc_array(state, const char *, 2); if (attrs == NULL) { - DEBUG(1, ("talloc_array failed.\n")); + DEBUG(1, "talloc_array failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; dp_err = DP_ERR_OK; goto done; @@ -359,14 +359,14 @@ static void ipa_migration_flag_connect_done(struct tevent_req *req) be_ctx->domain, state->pd->user, attrs, &user_msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_user_by_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_user_by_name failed.\n"); goto done; }
dn = ldb_msg_find_attr_as_string(user_msg, SYSDB_ORIG_DN, NULL); if (dn == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Missing original DN for user [%s].\n", - state->pd->user)); + DEBUG(SSSDBG_MINOR_FAILURE, "Missing original DN for user [%s].\n", + state->pd->user); state->pd->pam_status = PAM_SYSTEM_ERR; dp_err = DP_ERR_OK; goto done; @@ -375,7 +375,7 @@ static void ipa_migration_flag_connect_done(struct tevent_req *req) req = sdap_auth_send(state, state->ev, state->sh, NULL, NULL, dn, state->pd->authtok); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_auth_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_auth_send failed.\n"); goto done; }
@@ -404,26 +404,26 @@ static void ipa_auth_ldap_done(struct tevent_req *req) case ERR_AUTH_FAILED: case ERR_PASSWORD_EXPIRED: /* TODO: do we need to handle expired passwords? */ - DEBUG(SSSDBG_MINOR_FAILURE, ("LDAP authentication failed, " - "Password migration not possible.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "LDAP authentication failed, " + "Password migration not possible.\n"); state->pd->pam_status = PAM_CRED_INSUFFICIENT; dp_err = DP_ERR_OK; goto done; default: - DEBUG(SSSDBG_OP_FAILURE, ("auth_send request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "auth_send request failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; dp_err = DP_ERR_OK; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("LDAP authentication succeded, " - "trying Kerberos authentication again.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "LDAP authentication succeded, " + "trying Kerberos authentication again.\n");
req = krb5_auth_send(state, state->ev, be_ctx, state->pd, state->ipa_auth_ctx->krb5_auth_ctx); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_send failed.\n"); goto done; }
@@ -445,7 +445,7 @@ static void ipa_auth_handler_retry_done(struct tevent_req *req) ret = krb5_auth_recv(req, &pam_status, &dp_err); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_auth_recv request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_auth_recv request failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; dp_err = DP_ERR_OK; goto done; diff --git a/src/providers/ipa/ipa_autofs.c b/src/providers/ipa/ipa_autofs.c index de34321..504735d 100644 --- a/src/providers/ipa/ipa_autofs.c +++ b/src/providers/ipa/ipa_autofs.c @@ -44,7 +44,7 @@ int ipa_autofs_init(struct be_ctx *be_ctx, { int ret;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing autofs LDAP back end\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing autofs LDAP back end\n");
*ops = &ipa_autofs_ops; *pvt_data = id_ctx->sdap_id_ctx; @@ -52,7 +52,7 @@ int ipa_autofs_init(struct be_ctx *be_ctx, ret = ipa_get_autofs_options(id_ctx->ipa_options, be_ctx->cdb, be_ctx->conf_path, &id_ctx->sdap_id_ctx->opts); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot get IPA autofs options\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot get IPA autofs options\n"); return ret; }
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c index 6713740..180163b 100644 --- a/src/providers/ipa/ipa_common.c +++ b/src/providers/ipa/ipa_common.c @@ -73,20 +73,20 @@ int ipa_get_options(TALLOC_CTX *memctx,
server = dp_opt_get_string(opts->basic, IPA_SERVER); if (!server) { - DEBUG(1, ("No ipa server set, will use service discovery!\n")); + DEBUG(1, "No ipa server set, will use service discovery!\n"); }
ipa_hostname = dp_opt_get_string(opts->basic, IPA_HOSTNAME); if (ipa_hostname == NULL) { ret = gethostname(hostname, HOST_NAME_MAX); if (ret != EOK) { - DEBUG(1, ("gethostname failed [%d][%s].\n", errno, - strerror(errno))); + DEBUG(1, "gethostname failed [%d][%s].\n", errno, + strerror(errno)); ret = errno; goto done; } hostname[HOST_NAME_MAX] = '\0'; - DEBUG(9, ("Setting ipa_hostname to [%s].\n", hostname)); + DEBUG(9, "Setting ipa_hostname to [%s].\n", hostname); ret = dp_opt_set_string(opts->basic, IPA_HOSTNAME, hostname); if (ret != EOK) { goto done; @@ -150,7 +150,7 @@ static errno_t ipa_parse_search_base(TALLOC_CTX *mem_ctx, break; default: DEBUG(SSSDBG_CONF_SETTINGS, - ("Unknown search base type: [%d]\n", class)); + "Unknown search base type: [%d]\n", class); class_name = "UNKNOWN"; /* Non-fatal */ break; @@ -224,9 +224,9 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_SEARCH_BASE].opt_name, - dp_opt_get_string(ipa_opts->id->basic, SDAP_SEARCH_BASE))); + dp_opt_get_string(ipa_opts->id->basic, SDAP_SEARCH_BASE)); } ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_SEARCH_BASE, @@ -238,7 +238,7 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, realm = dp_opt_get_string(ipa_opts->basic, IPA_KRB5_REALM); value = talloc_strdup(tmpctx, realm); if (value == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -247,9 +247,9 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, if (ret != EOK) { goto done; } - DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_KRB5_REALM].opt_name, - dp_opt_get_string(ipa_opts->id->basic, SDAP_KRB5_REALM))); + dp_opt_get_string(ipa_opts->id->basic, SDAP_KRB5_REALM)); }
ret = sdap_set_sasl_options(ipa_opts->id, @@ -260,7 +260,7 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, dp_opt_get_string(ipa_opts->id->basic, SDAP_KRB5_KEYTAB)); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the SASL-related options\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set the SASL-related options\n"); goto done; }
@@ -277,10 +277,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_USER_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->id->basic, - SDAP_USER_SEARCH_BASE))); + SDAP_USER_SEARCH_BASE)); } ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_USER_SEARCH_BASE, @@ -296,10 +296,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_GROUP_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->id->basic, - SDAP_GROUP_SEARCH_BASE))); + SDAP_GROUP_SEARCH_BASE)); } ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_GROUP_SEARCH_BASE, @@ -334,10 +334,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, } #endif
- DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_SUDO_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->id->basic, - SDAP_SUDO_SEARCH_BASE))); + SDAP_SUDO_SEARCH_BASE)); } ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_SUDO_SEARCH_BASE, @@ -357,10 +357,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_NETGROUP_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->id->basic, - SDAP_NETGROUP_SEARCH_BASE))); + SDAP_NETGROUP_SEARCH_BASE)); } ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_NETGROUP_SEARCH_BASE, @@ -376,10 +376,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", ipa_opts->basic[IPA_HOST_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->basic, - IPA_HOST_SEARCH_BASE))); + IPA_HOST_SEARCH_BASE)); } ret = ipa_parse_search_base(ipa_opts->basic, ipa_opts->basic, IPA_HOST_SEARCH_BASE, @@ -399,10 +399,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->basic[IPA_HBAC_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->basic, - IPA_HBAC_SEARCH_BASE))); + IPA_HBAC_SEARCH_BASE)); } ret = ipa_parse_search_base(ipa_opts->basic, ipa_opts->basic, IPA_HBAC_SEARCH_BASE, @@ -422,10 +422,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", ipa_opts->basic[IPA_SELINUX_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->basic, - IPA_SELINUX_SEARCH_BASE))); + IPA_SELINUX_SEARCH_BASE)); } ret = ipa_parse_search_base(ipa_opts->basic, ipa_opts->basic, IPA_SELINUX_SEARCH_BASE, @@ -436,7 +436,7 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, if (value != NULL) { ret = deref_string_to_val(value, &i); if (ret != EOK) { - DEBUG(1, ("Failed to verify ldap_deref option.\n")); + DEBUG(1, "Failed to verify ldap_deref option.\n"); goto done; } } @@ -450,10 +450,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_GROUP_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->id->basic, - SDAP_GROUP_SEARCH_BASE))); + SDAP_GROUP_SEARCH_BASE)); } ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_SERVICE_SEARCH_BASE, @@ -473,10 +473,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", ipa_opts->basic[IPA_SUBDOMAINS_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->basic, - IPA_SUBDOMAINS_SEARCH_BASE))); + IPA_SUBDOMAINS_SEARCH_BASE)); } ret = ipa_parse_search_base(ipa_opts, ipa_opts->basic, IPA_SUBDOMAINS_SEARCH_BASE, @@ -496,10 +496,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", ipa_opts->basic[IPA_MASTER_DOMAIN_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->basic, - IPA_MASTER_DOMAIN_SEARCH_BASE))); + IPA_MASTER_DOMAIN_SEARCH_BASE)); } ret = ipa_parse_search_base(ipa_opts, ipa_opts->basic, IPA_MASTER_DOMAIN_SEARCH_BASE, @@ -519,10 +519,10 @@ int ipa_get_id_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", ipa_opts->basic[IPA_RANGES_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->basic, - IPA_RANGES_SEARCH_BASE))); + IPA_RANGES_SEARCH_BASE)); } ret = ipa_parse_search_base(ipa_opts, ipa_opts->basic, IPA_RANGES_SEARCH_BASE, @@ -638,7 +638,7 @@ int ipa_get_auth_options(struct ipa_options *ipa_opts, /* FIXME - this can be removed in a future version */ ret = krb5_try_kdcip(cdb, conf_path, ipa_opts->auth, KRB5_KDC); if (ret != EOK) { - DEBUG(1, ("sss_krb5_try_kdcip failed.\n")); + DEBUG(1, "sss_krb5_try_kdcip failed.\n"); goto done; }
@@ -651,7 +651,7 @@ int ipa_get_auth_options(struct ipa_options *ipa_opts, } copy = talloc_strdup(ipa_opts->auth, value); if (copy == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -659,9 +659,9 @@ int ipa_get_auth_options(struct ipa_options *ipa_opts, if (ret != EOK) { goto done; } - DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", ipa_opts->auth[KRB5_REALM].opt_name, - dp_opt_get_string(ipa_opts->auth, KRB5_REALM))); + dp_opt_get_string(ipa_opts->auth, KRB5_REALM)); }
/* Set flag that controls whether we want to write the @@ -669,9 +669,9 @@ int ipa_get_auth_options(struct ipa_options *ipa_opts, */ ipa_opts->service->krb5_service->write_kdcinfo = \ dp_opt_get_bool(ipa_opts->auth, KRB5_USE_KDCINFO); - DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", ipa_opts->auth[KRB5_USE_KDCINFO].opt_name, - ipa_opts->service->krb5_service->write_kdcinfo ? "true" : "false")); + ipa_opts->service->krb5_service->write_kdcinfo ? "true" : "false");
*_opts = ipa_opts->auth; ret = EOK; @@ -698,53 +698,53 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed\n")); + DEBUG(1, "talloc_new failed\n"); return; }
service = talloc_get_type(private_data, struct ipa_service); if (!service) { - DEBUG(1, ("FATAL: Bad private_data\n")); + DEBUG(1, "FATAL: Bad private_data\n"); talloc_free(tmp_ctx); return; }
srvaddr = fo_get_server_hostent(server); if (!srvaddr) { - DEBUG(1, ("FATAL: No hostent available for server (%s)\n", - fo_get_server_str_name(server))); + DEBUG(1, "FATAL: No hostent available for server (%s)\n", + fo_get_server_str_name(server)); talloc_free(tmp_ctx); return; }
sockaddr = resolv_get_sockaddr_address(tmp_ctx, srvaddr, LDAP_PORT); if (sockaddr == NULL) { - DEBUG(1, ("resolv_get_sockaddr_address failed.\n")); + DEBUG(1, "resolv_get_sockaddr_address failed.\n"); talloc_free(tmp_ctx); return; }
address = resolv_get_string_address(tmp_ctx, srvaddr); if (address == NULL) { - DEBUG(1, ("resolv_get_string_address failed.\n")); + DEBUG(1, "resolv_get_string_address failed.\n"); talloc_free(tmp_ctx); return; }
srv_name = fo_get_server_name(server); if (srv_name == NULL) { - DEBUG(1, ("Could not get server host name\n")); + DEBUG(1, "Could not get server host name\n"); talloc_free(tmp_ctx); return; }
new_uri = talloc_asprintf(service, "ldap://%s", srv_name); if (!new_uri) { - DEBUG(2, ("Failed to copy URI ...\n")); + DEBUG(2, "Failed to copy URI ...\n"); talloc_free(tmp_ctx); return; } - DEBUG(6, ("Constructed uri '%s'\n", new_uri)); + DEBUG(6, "Constructed uri '%s'\n", new_uri);
/* free old one and replace with new one */ talloc_zfree(service->sdap->uri); @@ -757,7 +757,7 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server) srvaddr->family, address); if (safe_address == NULL) { - DEBUG(1, ("sss_escape_ip_address failed.\n")); + DEBUG(1, "sss_escape_ip_address failed.\n"); talloc_free(tmp_ctx); return; } @@ -765,7 +765,7 @@ static void ipa_resolve_callback(void *private_data, struct fo_server *server) ret = write_krb5info_file(service->krb5_service->realm, safe_address, SSS_KRB5KDC_FO_SRV); if (ret != EOK) { - DEBUG(2, ("write_krb5info_file failed, authentication might fail.\n")); + DEBUG(2, "write_krb5info_file failed, authentication might fail.\n"); } }
@@ -792,7 +792,7 @@ static errno_t _ipa_servers_init(struct be_ctx *ctx, /* split server parm into a list */ ret = split_on_separator(tmp_ctx, servers, ',', true, true, &list, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to parse server list!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to parse server list!\n"); goto done; }
@@ -804,9 +804,9 @@ static errno_t _ipa_servers_init(struct be_ctx *ctx, if (be_fo_is_srv_identifier(list[i])) { if (!primary) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add server [%s] to failover service: " + "Failed to add server [%s] to failover service: " "SRV resolution only allowed for primary servers!\n", - list[i])); + list[i]); continue; }
@@ -814,11 +814,11 @@ static errno_t _ipa_servers_init(struct be_ctx *ctx, ret = be_fo_add_srv_server(ctx, "IPA", "ldap", ipa_domain, BE_FO_PROTO_TCP, false, NULL); if (ret) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add server\n"); goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Added service lookup for service IPA\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Added service lookup for service IPA\n"); continue; }
@@ -831,11 +831,11 @@ static errno_t _ipa_servers_init(struct be_ctx *ctx,
ret = be_fo_add_server(ctx, "IPA", list[i], 0, NULL, primary); if (ret && ret != EEXIST) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add server\n"); goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Added Server %s\n", list[i])); + DEBUG(SSSDBG_TRACE_FUNC, "Added Server %s\n", list[i]); }
done: @@ -896,7 +896,7 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
ret = be_fo_add_service(ctx, "IPA", ipa_user_data_cmp); if (ret != EOK) { - DEBUG(1, ("Failed to create failover service!\n")); + DEBUG(1, "Failed to create failover service!\n"); goto done; }
@@ -915,7 +915,7 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
realm = dp_opt_get_string(options->basic, IPA_KRB5_REALM); if (!realm) { - DEBUG(1, ("No Kerberos realm set\n")); + DEBUG(1, "No Kerberos realm set\n"); ret = EINVAL; goto done; } @@ -928,7 +928,7 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
if (!primary_servers) { DEBUG(SSSDBG_CONF_SETTINGS, - ("No primary servers defined, using service discovery\n")); + "No primary servers defined, using service discovery\n"); primary_servers = BE_SRV_IDENTIFIER; }
@@ -947,7 +947,7 @@ int ipa_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, ret = be_fo_service_add_callback(memctx, ctx, "IPA", ipa_resolve_callback, service); if (ret != EOK) { - DEBUG(1, ("Failed to add failover callback!\n")); + DEBUG(1, "Failed to add failover callback!\n"); goto done; }
@@ -1002,17 +1002,17 @@ int ipa_get_autofs_options(struct ipa_options *ipa_opts, goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Option %s set to %s\n", + DEBUG(SSSDBG_TRACE_LIBS, "Option %s set to %s\n", ipa_opts->id->basic[SDAP_AUTOFS_SEARCH_BASE].opt_name, dp_opt_get_string(ipa_opts->id->basic, - SDAP_AUTOFS_SEARCH_BASE))); + SDAP_AUTOFS_SEARCH_BASE)); }
ret = sdap_parse_search_base(ipa_opts->id, ipa_opts->id->basic, SDAP_AUTOFS_SEARCH_BASE, &ipa_opts->id->sdom->autofs_search_bases); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not parse autofs search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not parse autofs search base\n"); goto done; }
@@ -1022,7 +1022,7 @@ int ipa_get_autofs_options(struct ipa_options *ipa_opts, &ipa_opts->id->autofs_mobject_map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get autofs map object attribute map\n")); + "Could not get autofs map object attribute map\n"); goto done; }
@@ -1032,7 +1032,7 @@ int ipa_get_autofs_options(struct ipa_options *ipa_opts, &ipa_opts->id->autofs_entry_map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get autofs entry object attribute map\n")); + "Could not get autofs entry object attribute map\n"); goto done; }
@@ -1054,14 +1054,14 @@ errno_t ipa_get_dyndns_options(struct be_ctx *be_ctx, ret = be_nsupdate_init(ctx, be_ctx, ipa_dyndns_opts, &ctx->dyndns_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot initialize IPA dyndns opts [%d]: %s\n", - ret, sss_strerror(ret))); + "Cannot initialize IPA dyndns opts [%d]: %s\n", + ret, sss_strerror(ret)); return ret; }
if (ctx->basic == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("IPA basic options not (yet) " - "initialized, cannot copy legacy options\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "IPA basic options not (yet) " + "initialized, cannot copy legacy options\n"); return EOK; }
@@ -1069,8 +1069,8 @@ errno_t ipa_get_dyndns_options(struct be_ctx *be_ctx, ret = confdb_get_string(be_ctx->cdb, ctx, be_ctx->conf_path, "ipa_dyndns_update", NULL, &val); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get the value of %s\n", - "ipa_dyndns_update")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get the value of %s\n", + "ipa_dyndns_update"); /* Not fatal */ } else if (ret == EOK && val) { if (strcasecmp(val, "FALSE") == 0) { @@ -1079,20 +1079,20 @@ errno_t ipa_get_dyndns_options(struct be_ctx *be_ctx, update = true; } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("ipa_dyndns_update value is not a boolean!\n")); + "ipa_dyndns_update value is not a boolean!\n"); talloc_free(val); return EINVAL; }
- DEBUG(SSSDBG_MINOR_FAILURE, ("Deprecation warning: The option %s is " + DEBUG(SSSDBG_MINOR_FAILURE, "Deprecation warning: The option %s is " "deprecated and should not be used in favor of %s\n", - "ipa_dyndns_update", "dyndns_update")); + "ipa_dyndns_update", "dyndns_update");
ret = dp_opt_set_bool(ctx->dyndns_ctx->opts, DP_OPT_DYNDNS_UPDATE, update); talloc_free(val); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set option value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set option value\n"); return ret; } } @@ -1100,17 +1100,17 @@ errno_t ipa_get_dyndns_options(struct be_ctx *be_ctx, ret = confdb_get_int(be_ctx->cdb, be_ctx->conf_path, "ipa_dyndns_ttl", -1, &ttl); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get the value of %s\n", - "ipa_dyndns_ttl")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get the value of %s\n", + "ipa_dyndns_ttl"); /* Not fatal */ } else if (ret == EOK && ttl != -1) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Deprecation warning: The option %s is " + DEBUG(SSSDBG_MINOR_FAILURE, "Deprecation warning: The option %s is " "deprecated and should not be used in favor of %s\n", - "ipa_dyndns_ttl", "dyndns_ttl")); + "ipa_dyndns_ttl", "dyndns_ttl");
ret = dp_opt_set_int(ctx->dyndns_ctx->opts, DP_OPT_DYNDNS_TTL, ttl); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set option value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set option value\n"); return ret; } } @@ -1119,18 +1119,18 @@ errno_t ipa_get_dyndns_options(struct be_ctx *be_ctx, ret = confdb_get_string(be_ctx->cdb, ctx, be_ctx->conf_path, "ipa_dyndns_iface", NULL, &val); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get the value of %s\n", - "ipa_dyndns_iface")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get the value of %s\n", + "ipa_dyndns_iface"); /* Not fatal */ } else if (ret == EOK && val) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Deprecation warning: The option %s is " + DEBUG(SSSDBG_MINOR_FAILURE, "Deprecation warning: The option %s is " "deprecated and should not be used in favor of %s\n", - "ipa_dyndns_iface", "dyndns_iface")); + "ipa_dyndns_iface", "dyndns_iface");
ret = dp_opt_set_string(ctx->dyndns_ctx->opts, DP_OPT_DYNDNS_IFACE, val); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set option value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set option value\n"); return ret; } } diff --git a/src/providers/ipa/ipa_config.c b/src/providers/ipa/ipa_config.c index 0b392f5..0d564f5 100644 --- a/src/providers/ipa/ipa_config.c +++ b/src/providers/ipa/ipa_config.c @@ -70,14 +70,14 @@ ipa_get_config_send(TALLOC_CTX *mem_ctx,
ret = domain_to_basedn(state, domain, &ldap_basedn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("domain_to_basedn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "domain_to_basedn failed.\n"); goto done; }
state->base = talloc_asprintf(state, IPA_CONFIG_SEARCH_BASE_TEMPLATE, ldap_basedn); if (state->base == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -124,8 +124,8 @@ static void ipa_get_config_done(struct tevent_req *subreq) }
if (reply_count != 1) { - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected number of results, expected 1, " - "got %zu.\n", reply_count)); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected number of results, expected 1, " + "got %zu.\n", reply_count); ret = EINVAL; goto done; } diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c index a74a3cc..ca11c00 100644 --- a/src/providers/ipa/ipa_dyndns.c +++ b/src/providers/ipa/ipa_dyndns.c @@ -39,15 +39,15 @@ errno_t ipa_dyndns_init(struct be_ctx *be_ctx,
ctx->be_res = be_ctx->be_res; if (ctx->be_res == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Resolver must be initialized in order " - "to use the IPA dynamic DNS updates\n")); + DEBUG(SSSDBG_OP_FAILURE, "Resolver must be initialized in order " + "to use the IPA dynamic DNS updates\n"); return EINVAL; }
ret = be_nsupdate_init_timer(ctx->dyndns_ctx, be_ctx->ev, ipa_dyndns_timer, ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set up periodic update\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not set up periodic update\n"); return ret; }
@@ -55,7 +55,7 @@ errno_t ipa_dyndns_init(struct be_ctx *be_ctx, ipa_dyndns_update, ctx, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set up online callback\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not set up online callback\n"); return ret; }
@@ -80,7 +80,7 @@ void ipa_dyndns_timer(void *pvt) req = sdap_dyndns_timer_conn_send(ctx, sdap_ctx->be->ev, sdap_ctx, ctx->dyndns_ctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); /* Not much we can do. Just attempt to reschedule */ be_nsupdate_timer_schedule(sdap_ctx->be->ev, ctx->dyndns_ctx); return; @@ -98,8 +98,8 @@ static void ipa_dyndns_timer_connected(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to IPA: [%d](%s)\n", - ret, sss_strerror(ret))); + "Failed to connect to IPA: [%d](%s)\n", + ret, sss_strerror(ret)); return; }
@@ -121,7 +121,7 @@ void ipa_dyndns_update(void *pvt)
struct tevent_req *req = ipa_dyndns_update_send(ctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not update DNS\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not update DNS\n"); return; } tevent_req_set_callback(req, ipa_dyndns_nsupdate_done, NULL); @@ -132,12 +132,12 @@ static void ipa_dyndns_nsupdate_done(struct tevent_req *req) int ret = ipa_dyndns_update_recv(req); talloc_free(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Updating DNS entry failed [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Updating DNS entry failed [%d]: %s\n", + ret, sss_strerror(ret)); return; }
- DEBUG(SSSDBG_OP_FAILURE, ("DNS update finished\n")); + DEBUG(SSSDBG_OP_FAILURE, "DNS update finished\n"); }
struct ipa_dyndns_update_state { @@ -157,7 +157,7 @@ ipa_dyndns_update_send(struct ipa_options *ctx) const char *servername; int i;
- DEBUG(SSSDBG_TRACE_FUNC, ("Performing update\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Performing update\n");
req = tevent_req_create(ctx, &state, struct ipa_dyndns_update_state); if (req == NULL) { @@ -167,8 +167,8 @@ ipa_dyndns_update_send(struct ipa_options *ctx)
if (ctx->dyndns_ctx->last_refresh + 60 > time(NULL) || ctx->dyndns_ctx->timer_in_progress) { - DEBUG(SSSDBG_FUNC_DATA, ("Last periodic update ran recently or timer" - "in progress, not scheduling another update\n")); + DEBUG(SSSDBG_FUNC_DATA, "Last periodic update ran recently or timer" + "in progress, not scheduling another update\n"); tevent_req_done(req); tevent_req_post(req, sdap_ctx->be->ev); return req; @@ -190,7 +190,7 @@ ipa_dyndns_update_send(struct ipa_options *ctx)
if (strncmp(ctx->service->sdap->uri, "ldap://", 7) != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unexpected format of LDAP URI.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unexpected format of LDAP URI.\n"); ret = EIO; goto done; } @@ -219,8 +219,8 @@ ipa_dyndns_update_send(struct ipa_options *ctx) if (!subreq) { ret = EIO; DEBUG(SSSDBG_OP_FAILURE, - ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); goto done; } tevent_req_set_callback(subreq, ipa_dyndns_sdap_update_done, req); @@ -243,7 +243,7 @@ static void ipa_dyndns_sdap_update_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Dynamic DNS update failed [%d]: %s\n", ret, sss_strerror(ret))); + "Dynamic DNS update failed [%d]: %s\n", ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } diff --git a/src/providers/ipa/ipa_hbac_common.c b/src/providers/ipa/ipa_hbac_common.c index 0473a02..81830cd 100644 --- a/src/providers/ipa/ipa_hbac_common.c +++ b/src/providers/ipa/ipa_hbac_common.c @@ -39,7 +39,7 @@ ipa_hbac_save_list(struct sss_domain_info *domain,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed.\n")); + DEBUG(1, "talloc_new failed.\n"); return ENOMEM; }
@@ -53,7 +53,7 @@ ipa_hbac_save_list(struct sss_domain_info *domain,
ret = sysdb_delete_recursive(domain->sysdb, base_dn, true); if (ret != EOK) { - DEBUG(1, ("sysdb_delete_recursive failed.\n")); + DEBUG(1, "sysdb_delete_recursive failed.\n"); goto done; } } @@ -61,27 +61,27 @@ ipa_hbac_save_list(struct sss_domain_info *domain, for (c = 0; c < count; c++) { ret = sysdb_attrs_get_el(list[c], naming_attribute, &el); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_get_el failed.\n")); + DEBUG(1, "sysdb_attrs_get_el failed.\n"); goto done; } if (el->num_values == 0) { - DEBUG(1, ("[%s] not found.\n", naming_attribute)); + DEBUG(1, "[%s] not found.\n", naming_attribute); ret = EINVAL; goto done; } object_name = talloc_strndup(tmp_ctx, (const char *)el->values[0].data, el->values[0].length); if (object_name == NULL) { - DEBUG(1, ("talloc_strndup failed.\n")); + DEBUG(1, "talloc_strndup failed.\n"); ret = ENOMEM; goto done; } - DEBUG(9, ("Object name: [%s].\n", object_name)); + DEBUG(9, "Object name: [%s].\n", object_name);
ret = sysdb_store_custom(domain->sysdb, domain, object_name, subdir, list[c]); if (ret != EOK) { - DEBUG(1, ("sysdb_store_custom failed.\n")); + DEBUG(1, "sysdb_store_custom failed.\n"); goto done; } } @@ -114,7 +114,7 @@ ipa_hbac_sysdb_save(struct sss_domain_info *domain, /* Save the entries and groups to the cache */ ret = sysdb_transaction_start(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }; in_transaction = true; @@ -123,8 +123,8 @@ ipa_hbac_sysdb_save(struct sss_domain_info *domain, ret = ipa_hbac_save_list(domain, true, primary_subdir, attr_name, primary_count, primary); if (ret != EOK) { - DEBUG(1, ("Could not save %s. [%d][%s]\n", - primary_subdir, ret, strerror(ret))); + DEBUG(1, "Could not save %s. [%d][%s]\n", + primary_subdir, ret, strerror(ret)); goto done; }
@@ -133,15 +133,15 @@ ipa_hbac_sysdb_save(struct sss_domain_info *domain, ret = ipa_hbac_save_list(domain, true, group_subdir, groupattr_name, group_count, groups); if (ret != EOK) { - DEBUG(1, ("Could not save %s. [%d][%s]\n", - group_subdir, ret, strerror(ret))); + DEBUG(1, "Could not save %s. [%d][%s]\n", + group_subdir, ret, strerror(ret)); goto done; } }
ret = sysdb_transaction_commit(domain->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -150,12 +150,12 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(domain->sysdb); if (sret != EOK) { - DEBUG(0, ("Could not cancel sysdb transaction\n")); + DEBUG(0, "Could not cancel sysdb transaction\n"); } }
if (ret != EOK) { - DEBUG(3, ("Error [%d][%s]\n", ret, strerror(ret))); + DEBUG(3, "Error [%d][%s]\n", ret, strerror(ret)); } return ret; } @@ -171,7 +171,7 @@ replace_attribute_name(const char *old_name, for (i = 0; i < count; i++) { ret = sysdb_attrs_replace_name(list[i], old_name, new_name); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_replace_name failed.\n")); + DEBUG(1, "sysdb_attrs_replace_name failed.\n"); return ret; } } @@ -236,7 +236,7 @@ hbac_ctx_to_rules(TALLOC_CTX *mem_ctx, if (ret == EPERM) { goto done; } else if (ret != EOK) { - DEBUG(1, ("Could not construct rules\n")); + DEBUG(1, "Could not construct rules\n"); goto done; } } @@ -245,7 +245,7 @@ hbac_ctx_to_rules(TALLOC_CTX *mem_ctx, /* Create the eval request */ ret = hbac_ctx_to_eval_request(tmp_ctx, hbac_ctx, &new_request); if (ret != EOK) { - DEBUG(1, ("Could not construct eval request\n")); + DEBUG(1, "Could not construct eval request\n"); goto done; }
@@ -276,7 +276,7 @@ hbac_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_el(hbac_ctx->rules[idx], IPA_CN, &el); if (ret != EOK || el->num_values == 0) { - DEBUG(4, ("rule has no name, assuming '(none)'.\n")); + DEBUG(4, "rule has no name, assuming '(none)'.\n"); new_rule->name = talloc_strdup(new_rule, "(none)"); } else { new_rule->name = talloc_strndup(new_rule, @@ -284,7 +284,7 @@ hbac_attrs_to_rule(TALLOC_CTX *mem_ctx, el->values[0].length); }
- DEBUG(7, ("Processing rule [%s]\n", new_rule->name)); + DEBUG(7, "Processing rule [%s]\n", new_rule->name);
ret = sysdb_attrs_get_bool(hbac_ctx->rules[idx], IPA_ENABLED_FLAG, &new_rule->enabled); @@ -301,7 +301,7 @@ hbac_attrs_to_rule(TALLOC_CTX *mem_ctx, if (ret != EOK) goto done;
if (strcasecmp(rule_type, IPA_HBAC_ALLOW) != 0) { - DEBUG(7, ("Rule [%s] is not an ALLOW rule\n", new_rule->name)); + DEBUG(7, "Rule [%s] is not an ALLOW rule\n", new_rule->name); ret = EPERM; goto done; } @@ -312,8 +312,8 @@ hbac_attrs_to_rule(TALLOC_CTX *mem_ctx, hbac_ctx->rules[idx], &new_rule->users); if (ret != EOK) { - DEBUG(1, ("Could not parse users for rule [%s]\n", - new_rule->name)); + DEBUG(1, "Could not parse users for rule [%s]\n", + new_rule->name); goto done; }
@@ -323,8 +323,8 @@ hbac_attrs_to_rule(TALLOC_CTX *mem_ctx, hbac_ctx->rules[idx], &new_rule->services); if (ret != EOK) { - DEBUG(1, ("Could not parse services for rule [%s]\n", - new_rule->name)); + DEBUG(1, "Could not parse services for rule [%s]\n", + new_rule->name); goto done; }
@@ -334,8 +334,8 @@ hbac_attrs_to_rule(TALLOC_CTX *mem_ctx, hbac_ctx->rules[idx], &new_rule->targethosts); if (ret != EOK) { - DEBUG(1, ("Could not parse target hosts for rule [%s]\n", - new_rule->name)); + DEBUG(1, "Could not parse target hosts for rule [%s]\n", + new_rule->name); goto done; }
@@ -348,8 +348,8 @@ hbac_attrs_to_rule(TALLOC_CTX *mem_ctx, IPA_HBAC_SUPPORT_SRCHOST), &new_rule->srchosts); if (ret != EOK) { - DEBUG(1, ("Could not parse source hosts for rule [%s]\n", - new_rule->name)); + DEBUG(1, "Could not parse source hosts for rule [%s]\n", + new_rule->name); goto done; }
@@ -381,12 +381,12 @@ hbac_get_category(struct sysdb_attrs *attrs, if (ret != ENOENT) { for (i = 0; categories[i]; i++) { if (strcasecmp("all", categories[i]) == 0) { - DEBUG(5, ("Category is set to 'all'.\n")); + DEBUG(5, "Category is set to 'all'.\n"); cats |= HBAC_CATEGORY_ALL; continue; } - DEBUG(9, ("Unsupported user category [%s].\n", - categories[i])); + DEBUG(9, "Unsupported user category [%s].\n", + categories[i]); } }
@@ -450,7 +450,7 @@ hbac_ctx_to_eval_request(TALLOC_CTX *mem_ctx, if (strcasecmp(pd->domain, domain->name) != 0) { user_dom = find_subdomain_by_name(domain, pd->domain, true); if (user_dom == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("find_subdomain_by_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_subdomain_by_name failed.\n"); ret = ENOMEM; goto done; } @@ -486,7 +486,7 @@ hbac_ctx_to_eval_request(TALLOC_CTX *mem_ctx, /* The target host is always the current machine */ thost = dp_opt_get_cstring(hbac_ctx->ipa_options, IPA_HOSTNAME); if (thost == NULL) { - DEBUG(1, ("Missing ipa_hostname, this should never happen.\n")); + DEBUG(1, "Missing ipa_hostname, this should never happen.\n"); ret = EINVAL; goto done; } @@ -539,18 +539,18 @@ hbac_eval_user_element(TALLOC_CTX *mem_ctx, ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain, users->name, attrs, &msg); if (ret != EOK) { - DEBUG(1, ("Could not determine user memberships for [%s]\n", - users->name)); + DEBUG(1, "Could not determine user memberships for [%s]\n", + users->name); goto done; }
el = ldb_msg_find_element(msg, SYSDB_ORIG_MEMBEROF); if (el == NULL || el->num_values == 0) { - DEBUG(7, ("No groups for [%s]\n", users->name)); + DEBUG(7, "No groups for [%s]\n", users->name); ret = create_empty_grouplist(users); goto done; } - DEBUG(7, ("[%d] groups for [%s]\n", el->num_values, users->name)); + DEBUG(7, "[%d] groups for [%s]\n", el->num_values, users->name);
users->groups = talloc_array(users, const char *, el->num_values + 1); if (users->groups == NULL) { @@ -564,16 +564,16 @@ hbac_eval_user_element(TALLOC_CTX *mem_ctx, ret = get_ipa_groupname(users->groups, sysdb, member_dn, &users->groups[num_groups]); if (ret != EOK && ret != ENOENT) { - DEBUG(3, ("Parse error on [%s]\n", member_dn)); + DEBUG(3, "Parse error on [%s]\n", member_dn); goto done; } else if (ret == EOK) { - DEBUG(7, ("Added group [%s] for user [%s]\n", - users->groups[num_groups], users->name)); + DEBUG(7, "Added group [%s] for user [%s]\n", + users->groups[num_groups], users->name); num_groups++; continue; } /* Skip entries that are not groups */ - DEBUG(8, ("Skipping non-group memberOf [%s]\n", member_dn)); + DEBUG(8, "Skipping non-group memberOf [%s]\n", member_dn); } users->groups[num_groups] = NULL;
@@ -646,7 +646,7 @@ hbac_eval_service_element(TALLOC_CTX *mem_ctx, } else if (ret != EOK) { goto done; } else if (count > 1) { - DEBUG(1, ("More than one result for a BASE search!\n")); + DEBUG(1, "More than one result for a BASE search!\n"); ret = EIO; goto done; } @@ -754,7 +754,7 @@ hbac_eval_host_element(TALLOC_CTX *mem_ctx, } else if (ret != EOK) { goto done; } else if (count > 1) { - DEBUG(1, ("More than one result for a BASE search!\n")); + DEBUG(1, "More than one result for a BASE search!\n"); ret = EIO; goto done; } diff --git a/src/providers/ipa/ipa_hbac_hosts.c b/src/providers/ipa/ipa_hbac_hosts.c index e85206e..33595da 100644 --- a/src/providers/ipa/ipa_hbac_hosts.c +++ b/src/providers/ipa/ipa_hbac_hosts.c @@ -63,7 +63,7 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, /* First check for host category */ ret = hbac_get_category(rule_attrs, category_attr, &new_hosts->category); if (ret != EOK) { - DEBUG(1, ("Could not identify host categories\n")); + DEBUG(1, "Could not identify host categories\n"); goto done; } if (new_hosts->category & HBAC_CATEGORY_ALL) { @@ -75,12 +75,12 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Get the list of DNs from the member_attr */ ret = sysdb_attrs_get_el(rule_attrs, member_attr, &el); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("sysdb_attrs_get_el failed.\n")); + DEBUG(1, "sysdb_attrs_get_el failed.\n"); goto done; } if (ret == ENOENT || el->num_values == 0) { el->num_values = 0; - DEBUG(4, ("No host specified, rule will never apply.\n")); + DEBUG(4, "No host specified, rule will never apply.\n"); }
/* Assume maximum size; We'll trim it later */ @@ -124,7 +124,7 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx,
if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple hosts. Skipping \n")); + DEBUG(1, "Original DN matched multiple hosts. Skipping \n"); talloc_zfree(member_dn); continue; } @@ -134,7 +134,7 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, SYSDB_FQDN, NULL); if (name == NULL) { - DEBUG(1, ("FQDN is missing!\n")); + DEBUG(1, "FQDN is missing!\n"); ret = EFAULT; goto done; } @@ -145,8 +145,8 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(8, ("Added host [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added host [%s] to rule [%s]\n", + name, rule_name); num_hosts++; } else { /* ret == ENOENT */ /* Check if this is a hostgroup */ @@ -160,8 +160,8 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx,
if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple hostgroups. " - "Skipping\n")); + DEBUG(1, "Original DN matched multiple hostgroups. " + "Skipping\n"); talloc_zfree(member_dn); continue; } @@ -169,7 +169,7 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Original DN matched a single group. Get the groupname */ name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (name == NULL) { - DEBUG(1, ("Hostgroup name is missing!\n")); + DEBUG(1, "Hostgroup name is missing!\n"); ret = EFAULT; goto done; } @@ -181,14 +181,14 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, goto done; }
- DEBUG(8, ("Added hostgroup [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added hostgroup [%s] to rule [%s]\n", + name, rule_name); num_hostgroups++; } else { /* ret == ENOENT */ /* Neither a host nor a hostgroup? Skip it */ DEBUG(SSSDBG_TRACE_LIBS, - ("[%s] does not map to either a host or hostgroup. " - "Skipping\n", member_dn)); + "[%s] does not map to either a host or hostgroup. " + "Skipping\n", member_dn); } } talloc_zfree(member_dn); @@ -229,7 +229,7 @@ hbac_thost_attrs_to_rule(TALLOC_CTX *mem_ctx, struct sysdb_attrs *rule_attrs, struct hbac_rule_element **thosts) { - DEBUG(7, ("Processing target hosts for rule [%s]\n", rule_name)); + DEBUG(7, "Processing target hosts for rule [%s]\n", rule_name);
return hbac_host_attrs_to_rule(mem_ctx, domain, rule_name, rule_attrs, @@ -255,10 +255,10 @@ hbac_shost_attrs_to_rule(TALLOC_CTX *mem_ctx, tmp_ctx = talloc_new(mem_ctx); if (tmp_ctx == NULL) return ENOMEM;
- DEBUG(SSSDBG_TRACE_FUNC, ("Processing source hosts for rule [%s]\n", rule_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing source hosts for rule [%s]\n", rule_name);
if (!support_srchost) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Source hosts disabled, setting ALL\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Source hosts disabled, setting ALL\n"); shosts = talloc_zero(tmp_ctx, struct hbac_rule_element); if (shosts == NULL) { ret = ENOMEM; @@ -269,8 +269,8 @@ hbac_shost_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = EOK; goto done; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("WARNING: Using deprecated option " - "ipa_hbac_support_srchost.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "WARNING: Using deprecated option " + "ipa_hbac_support_srchost.\n"); sss_log(SSS_LOG_NOTICE, "WARNING: Using deprecated option " "ipa_hbac_support_srchost.\n"); } @@ -311,8 +311,8 @@ hbac_shost_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(8, ("Added external source host [%s] to rule [%s]\n", - shosts->names[idx], rule_name)); + DEBUG(8, "Added external source host [%s] to rule [%s]\n", + shosts->names[idx], rule_name); } shosts->names[idx] = NULL; } diff --git a/src/providers/ipa/ipa_hbac_rules.c b/src/providers/ipa/ipa_hbac_rules.c index 24caf1f..dcc5e76 100644 --- a/src/providers/ipa/ipa_hbac_rules.c +++ b/src/providers/ipa/ipa_hbac_rules.c @@ -68,7 +68,7 @@ ipa_hbac_rule_info_send(TALLOC_CTX *mem_ctx, const char **memberof_list;
if (ipa_host == NULL) { - DEBUG(1, ("Missing host\n")); + DEBUG(1, "Missing host\n"); return NULL; }
@@ -77,7 +77,7 @@ ipa_hbac_rule_info_send(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_get_string(ipa_host, SYSDB_ORIG_DN, &host_dn); if (ret != EOK) { - DEBUG(1, ("Could not identify IPA hostname\n")); + DEBUG(1, "Could not identify IPA hostname\n"); goto error; }
@@ -86,7 +86,7 @@ ipa_hbac_rule_info_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct ipa_hbac_rule_state); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; }
@@ -144,7 +144,7 @@ ipa_hbac_rule_info_send(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string_array(ipa_host, SYSDB_ORIG_MEMBEROF, tmp_ctx, &memberof_list); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("Could not identify ")); + DEBUG(1, "Could not identify "); } if (ret == ENOENT) { /* This host is not a member of any hostgroups */ memberof_list = talloc_array(tmp_ctx, const char *, 1); @@ -224,9 +224,9 @@ ipa_hbac_rule_info_next(struct tevent_req *req, return ENOMEM; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Sending request for next search base: " + DEBUG(SSSDBG_TRACE_FUNC, "Sending request for next search base: " "[%s][%d][%s]\n", base->basedn, base->scope, - state->cur_filter)); + state->cur_filter);
subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, base->basedn, base->scope, @@ -236,7 +236,7 @@ ipa_hbac_rule_info_next(struct tevent_req *req, SDAP_ENUM_SEARCH_TIMEOUT), true); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_get_generic_send failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_get_generic_send failed.\n"); return ENOMEM; } tevent_req_set_callback(subreq, ipa_hbac_rule_info_done, req); @@ -262,7 +262,7 @@ ipa_hbac_rule_info_done(struct tevent_req *subreq) &rule_count, &rules); if (ret != EOK) { - DEBUG(3, ("Could not retrieve HBAC rules\n")); + DEBUG(3, "Could not retrieve HBAC rules\n"); goto fail; }
@@ -293,7 +293,7 @@ ipa_hbac_rule_info_done(struct tevent_req *subreq) } else if (ret != EOK) { goto fail; } else if (ret == EOK && state->rule_count == 0) { - DEBUG(3, ("No rules apply to this host\n")); + DEBUG(3, "No rules apply to this host\n"); tevent_req_error(req, ENOENT); return; } diff --git a/src/providers/ipa/ipa_hbac_services.c b/src/providers/ipa/ipa_hbac_services.c index ace01fa..85333d8 100644 --- a/src/providers/ipa/ipa_hbac_services.c +++ b/src/providers/ipa/ipa_hbac_services.c @@ -69,7 +69,7 @@ ipa_hbac_service_info_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct ipa_hbac_service_state); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; }
@@ -92,7 +92,7 @@ ipa_hbac_service_info_send(TALLOC_CTX *mem_ctx,
state->attrs = talloc_array(state, const char *, 6); if (state->attrs == NULL) { - DEBUG(1, ("Failed to allocate service attribute list.\n")); + DEBUG(1, "Failed to allocate service attribute list.\n"); ret = ENOMEM; goto immediate; } @@ -143,9 +143,9 @@ static errno_t ipa_hbac_service_info_next(struct tevent_req *req, return ENOMEM; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Sending request for next search base: " + DEBUG(SSSDBG_TRACE_FUNC, "Sending request for next search base: " "[%s][%d][%s]\n", base->basedn, base->scope, - state->cur_filter)); + state->cur_filter); subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, base->basedn, base->scope, state->cur_filter, @@ -154,7 +154,7 @@ static errno_t ipa_hbac_service_info_next(struct tevent_req *req, SDAP_ENUM_SEARCH_TIMEOUT), true); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting service info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting service info\n"); return EIO; } tevent_req_set_callback(subreq, ipa_hbac_service_info_done, req); @@ -203,7 +203,7 @@ ipa_hbac_service_info_done(struct tevent_req *subreq) state->service_count, state->services); if (ret != EOK) { - DEBUG(1, ("Could not replace attribute names\n")); + DEBUG(1, "Could not replace attribute names\n"); goto done; }
@@ -258,9 +258,9 @@ ipa_hbac_servicegroup_info_next(struct tevent_req *req, }
/* Look up service groups */ - DEBUG(SSSDBG_TRACE_FUNC, ("Sending request for next search base: " + DEBUG(SSSDBG_TRACE_FUNC, "Sending request for next search base: " "[%s][%d][%s]\n", base->basedn, base->scope, - state->cur_filter)); + state->cur_filter); subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, base->basedn, base->scope, state->cur_filter, state->attrs, NULL, 0, @@ -268,7 +268,7 @@ ipa_hbac_servicegroup_info_next(struct tevent_req *req, SDAP_ENUM_SEARCH_TIMEOUT), true); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting servicegroup info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting servicegroup info\n"); return EIO; } tevent_req_set_callback(subreq, ipa_hbac_servicegroup_info_done, req); @@ -303,7 +303,7 @@ ipa_hbac_servicegroup_info_done(struct tevent_req *subreq) group_count, groups); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not replace attribute names\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not replace attribute names\n"); goto done; }
@@ -311,7 +311,7 @@ ipa_hbac_servicegroup_info_done(struct tevent_req *subreq) state->servicegroup_count, state->servicegroups); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not replace attribute names\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not replace attribute names\n"); goto done; }
@@ -346,7 +346,7 @@ done: if (ret == EOK) { tevent_req_done(req); } else { - DEBUG(3, ("Error [%d][%s]\n", ret, strerror(ret))); + DEBUG(3, "Error [%d][%s]\n", ret, strerror(ret)); tevent_req_error(req, ret); } } @@ -399,7 +399,7 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx, struct ldb_message **msgs; const char *name;
- DEBUG(7, ("Processing PAM services for rule [%s]\n", rule_name)); + DEBUG(7, "Processing PAM services for rule [%s]\n", rule_name);
tmp_ctx = talloc_new(mem_ctx); if (tmp_ctx == NULL) return ENOMEM; @@ -414,7 +414,7 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = hbac_get_category(rule_attrs, IPA_SERVICE_CATEGORY, &new_services->category); if (ret != EOK) { - DEBUG(1, ("Could not identify service categories\n")); + DEBUG(1, "Could not identify service categories\n"); goto done; } if (new_services->category & HBAC_CATEGORY_ALL) { @@ -426,12 +426,12 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Get the list of DNs from the member attr */ ret = sysdb_attrs_get_el(rule_attrs, IPA_MEMBER_SERVICE, &el); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("sysdb_attrs_get_el failed.\n")); + DEBUG(1, "sysdb_attrs_get_el failed.\n"); goto done; } if (ret == ENOENT || el->num_values == 0) { el->num_values = 0; - DEBUG(4, ("No services specified, rule will never apply.\n")); + DEBUG(4, "No services specified, rule will never apply.\n"); }
/* Assume maximum size; We'll trim it later */ @@ -475,8 +475,8 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx,
if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple services. " - "Skipping \n")); + DEBUG(1, "Original DN matched multiple services. " + "Skipping \n"); talloc_zfree(member_dn); continue; } @@ -484,7 +484,7 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Original DN matched a single service. Get the service name */ name = ldb_msg_find_attr_as_string(msgs[0], IPA_CN, NULL); if (name == NULL) { - DEBUG(1, ("Attribute is missing!\n")); + DEBUG(1, "Attribute is missing!\n"); ret = EFAULT; goto done; } @@ -495,8 +495,8 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(8, ("Added service [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added service [%s] to rule [%s]\n", + name, rule_name); num_services++; } else { /* ret == ENOENT */ /* Check if this is a service group */ @@ -510,8 +510,8 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx,
if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple service groups. " - "Skipping\n")); + DEBUG(1, "Original DN matched multiple service groups. " + "Skipping\n"); talloc_zfree(member_dn); continue; } @@ -519,7 +519,7 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Original DN matched a single group. Get the groupname */ name = ldb_msg_find_attr_as_string(msgs[0], IPA_CN, NULL); if (name == NULL) { - DEBUG(1, ("Attribute is missing!\n")); + DEBUG(1, "Attribute is missing!\n"); ret = EFAULT; goto done; } @@ -531,13 +531,13 @@ hbac_service_attrs_to_rule(TALLOC_CTX *mem_ctx, goto done; }
- DEBUG(8, ("Added service group [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added service group [%s] to rule [%s]\n", + name, rule_name); num_servicegroups++; } else { /* ret == ENOENT */ /* Neither a service nor a service group? Skip it */ - DEBUG(1, ("[%s] does not map to either a service or " - "service group. Skipping\n", member_dn)); + DEBUG(1, "[%s] does not map to either a service or " + "service group. Skipping\n", member_dn); } } talloc_zfree(member_dn); diff --git a/src/providers/ipa/ipa_hbac_users.c b/src/providers/ipa/ipa_hbac_users.c index a5fcaad..7c83b89 100644 --- a/src/providers/ipa/ipa_hbac_users.c +++ b/src/providers/ipa/ipa_hbac_users.c @@ -172,12 +172,12 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, goto done; }
- DEBUG(7, ("Processing users for rule [%s]\n", rule_name)); + DEBUG(7, "Processing users for rule [%s]\n", rule_name);
ret = hbac_get_category(rule_attrs, IPA_USER_CATEGORY, &new_users->category); if (ret != EOK) { - DEBUG(1, ("Could not identify user categories\n")); + DEBUG(1, "Could not identify user categories\n"); goto done; } if (new_users->category & HBAC_CATEGORY_ALL) { @@ -188,12 +188,12 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_get_el(rule_attrs, IPA_MEMBER_USER, &el); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("sysdb_attrs_get_el failed.\n")); + DEBUG(1, "sysdb_attrs_get_el failed.\n"); goto done; } if (ret == ENOENT || el->num_values == 0) { el->num_values = 0; - DEBUG(4, ("No user specified, rule will never apply.\n")); + DEBUG(4, "No user specified, rule will never apply.\n"); }
new_users->names = talloc_array(new_users, @@ -234,7 +234,7 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx,
if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple users. Skipping \n")); + DEBUG(1, "Original DN matched multiple users. Skipping \n"); talloc_zfree(member_dn); continue; } @@ -242,7 +242,7 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Original DN matched a single user. Get the username */ name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (name == NULL) { - DEBUG(1, ("Attribute is missing!\n")); + DEBUG(1, "Attribute is missing!\n"); ret = EFAULT; goto done; } @@ -253,8 +253,8 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(8, ("Added user [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added user [%s] to rule [%s]\n", + name, rule_name); num_users++; } else { /* Check if it is a group instead */ @@ -267,8 +267,8 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx,
if (ret == EOK) { if (count > 1) { - DEBUG(1, ("Original DN matched multiple groups. " - "Skipping\n")); + DEBUG(1, "Original DN matched multiple groups. " + "Skipping\n"); talloc_zfree(member_dn); continue; } @@ -276,7 +276,7 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, /* Original DN matched a single group. Get the groupname */ name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (name == NULL) { - DEBUG(1, ("Attribute is missing!\n")); + DEBUG(1, "Attribute is missing!\n"); ret = EFAULT; goto done; } @@ -287,8 +287,8 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(8, ("Added POSIX group [%s] to rule [%s]\n", - name, rule_name)); + DEBUG(8, "Added POSIX group [%s] to rule [%s]\n", + name, rule_name); num_groups++; } else { /* If the group still matches the group pattern, @@ -298,13 +298,13 @@ hbac_user_attrs_to_rule(TALLOC_CTX *mem_ctx, member_user, &new_users->groups[num_groups]); if (ret == EOK) { - DEBUG(8, ("Added non-POSIX group [%s] to rule [%s]\n", - new_users->groups[num_groups], rule_name)); + DEBUG(8, "Added non-POSIX group [%s] to rule [%s]\n", + new_users->groups[num_groups], rule_name); num_groups++; } else { /* Not a group, so we don't care about it */ - DEBUG(1, ("[%s] does not map to either a user or group. " - "Skipping\n", member_dn)); + DEBUG(1, "[%s] does not map to either a user or group. " + "Skipping\n", member_dn); } } } diff --git a/src/providers/ipa/ipa_hostid.c b/src/providers/ipa/ipa_hostid.c index 7afe350..2101230 100644 --- a/src/providers/ipa/ipa_hostid.c +++ b/src/providers/ipa/ipa_hostid.c @@ -110,7 +110,7 @@ ipa_host_info_complete(struct be_req *breq, int dp_error, error_text = NULL; } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Bug: dp_error is OK on failed request")); + "Bug: dp_error is OK on failed request"); dp_error = DP_ERR_FATAL; error_text = default_error_text; } @@ -167,7 +167,7 @@ hosts_get_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, ctx->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -270,7 +270,7 @@ hosts_get_done(struct tevent_req *subreq)
if (state->count == 0) { DEBUG(SSSDBG_OP_FAILURE, - ("No host with name [%s] found.\n", state->name)); + "No host with name [%s] found.\n", state->name);
ret = sysdb_delete_ssh_host(state->domain->sysdb, state->domain, state->name); @@ -284,7 +284,7 @@ hosts_get_done(struct tevent_req *subreq)
if (state->count > 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Found more than one host with name [%s].\n", state->name)); + "Found more than one host with name [%s].\n", state->name); ret = EINVAL; goto done; } diff --git a/src/providers/ipa/ipa_hosts.c b/src/providers/ipa/ipa_hosts.c index 1323cac..64f80f0 100644 --- a/src/providers/ipa/ipa_hosts.c +++ b/src/providers/ipa/ipa_hosts.c @@ -122,7 +122,7 @@ ipa_host_info_send(TALLOC_CTX *mem_ctx,
ret = ipa_host_info_next(req, state); if (ret == EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No host search base configured?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No host search base configured?\n"); ret = EINVAL; }
@@ -169,7 +169,7 @@ static errno_t ipa_host_info_next(struct tevent_req *req, SDAP_ENUM_SEARCH_TIMEOUT), true); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting host info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting host info\n"); talloc_zfree(state->cur_filter); return EIO; } @@ -232,7 +232,7 @@ ipa_host_info_done(struct tevent_req *subreq)
ret = ipa_hostgroup_info_next(req, state); if (ret == EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No host search base configured?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No host search base configured?\n"); tevent_req_error(req, EINVAL); return; } else if (ret != EAGAIN) { @@ -255,7 +255,7 @@ ipa_host_info_done(struct tevent_req *subreq) }
if (!sdap_has_deref_support(state->sh, state->opts)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Server does not support deref\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Server does not support deref\n"); tevent_req_error(req, EIO); return; } @@ -268,7 +268,7 @@ ipa_host_info_done(struct tevent_req *subreq) dp_opt_get_int(state->opts->basic, SDAP_ENUM_SEARCH_TIMEOUT)); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting host info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting host info\n"); tevent_req_error(req, EIO); return; } @@ -307,7 +307,7 @@ static errno_t ipa_hostgroup_info_next(struct tevent_req *req, SDAP_ENUM_SEARCH_TIMEOUT), true); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting hostgroup info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting hostgroup info\n"); talloc_zfree(state->cur_filter); return EIO; } @@ -340,7 +340,7 @@ ipa_hostgroup_info_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_get_generic_recv failed: [%d]\n", ret)); + "sdap_get_generic_recv failed: [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -385,7 +385,7 @@ ipa_hostgroup_info_done(struct tevent_req *subreq) if (ret != EOK) goto done;
if (state->hostgroup_count == 0) { - DEBUG(SSSDBG_FUNC_DATA, ("No host groups were dereferenced\n")); + DEBUG(SSSDBG_FUNC_DATA, "No host groups were dereferenced\n"); } else { state->hostgroups = talloc_zero_array(state, struct sysdb_attrs *, state->hostgroup_count); @@ -411,8 +411,8 @@ ipa_hostgroup_info_done(struct tevent_req *subreq) &hostgroup_name); if (ret != EOK) goto done;
- DEBUG(SSSDBG_FUNC_DATA, ("Dereferenced host group: %s\n", - hostgroup_name)); + DEBUG(SSSDBG_FUNC_DATA, "Dereferenced host group: %s\n", + hostgroup_name); state->hostgroups[j] = talloc_steal(state->hostgroups, deref_result[i]->attrs); j++; @@ -425,7 +425,7 @@ done: if (ret == EOK) { tevent_req_done(req); } else { - DEBUG(SSSDBG_OP_FAILURE, ("Error [%d][%s]\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error [%d][%s]\n", ret, strerror(ret)); tevent_req_error(req, ret); } } diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c index 6e09644..77e5e1b 100644 --- a/src/providers/ipa/ipa_id.c +++ b/src/providers/ipa/ipa_id.c @@ -39,7 +39,7 @@ static const char *ipa_account_info_error_text(int ret, int *dp_error, return NULL; } DEBUG(SSSDBG_CRIT_FAILURE, - ("Bug: dp_error is OK on failed request\n")); + "Bug: dp_error is OK on failed request\n"); *dp_error = DP_ERR_FATAL; break; case DP_ERR_OFFLINE: @@ -191,7 +191,7 @@ static struct tevent_req *ipa_id_get_netgroup_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, ctx->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -211,7 +211,7 @@ static struct tevent_req *ipa_id_get_netgroup_send(TALLOC_CTX *memctx, clean_name, ctx->opts->netgroup_map[IPA_OC_NETGROUP].name); if (!state->filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } @@ -302,8 +302,8 @@ static void ipa_id_get_netgroup_done(struct tevent_req *subreq) }
if (ret == EOK && state->count > 1) { - DEBUG(1, ("Found more than one netgroup with the name [%s].\n", - state->name)); + DEBUG(1, "Found more than one netgroup with the name [%s].\n", + state->name); tevent_req_error(req, EINVAL); return; } diff --git a/src/providers/ipa/ipa_idmap.c b/src/providers/ipa/ipa_idmap.c index 2f141f8..c471328 100644 --- a/src/providers/ipa/ipa_idmap.c +++ b/src/providers/ipa/ipa_idmap.c @@ -45,14 +45,14 @@ errno_t ipa_idmap_find_new_domain(struct sdap_idmap_ctx *idmap_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
ret = sysdb_get_ranges(tmp_ctx, idmap_ctx->id_ctx->be->domain->sysdb, &range_count, &range_list); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_get_ranges failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_get_ranges failed.\n"); goto done; }
@@ -77,9 +77,9 @@ errno_t ipa_idmap_find_new_domain(struct sdap_idmap_ctx *idmap_ctx, name = r->trusted_dom_sid; sid = r->trusted_dom_sid; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot determine range type, " \ + DEBUG(SSSDBG_MINOR_FAILURE, "Cannot determine range type, " \ "skipping id ange [%s].\n", - r->name)); + r->name); continue; } } else { @@ -99,9 +99,9 @@ errno_t ipa_idmap_find_new_domain(struct sdap_idmap_ctx *idmap_ctx, name = r->trusted_dom_sid; sid = r->trusted_dom_sid; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Range type [%s] not supported, " \ + DEBUG(SSSDBG_MINOR_FAILURE, "Range type [%s] not supported, " \ "skipping id range [%s].\n", - r->range_type, r->name)); + r->range_type, r->name); continue; } } @@ -111,8 +111,8 @@ errno_t ipa_idmap_find_new_domain(struct sdap_idmap_ctx *idmap_ctx, err = sss_idmap_add_domain_ex(idmap_ctx->map, name, sid, &range, r->name, rid, external_mapping); if (err != IDMAP_SUCCESS && err != IDMAP_COLLISION) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not add range [%s] to ID map\n", - r->name)); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not add range [%s] to ID map\n", + r->name); ret = EIO; goto done; } @@ -162,8 +162,8 @@ errno_t ipa_idmap_init(TALLOC_CTX *mem_ctx, &idmap_ctx->map); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not initialize the ID map: [%s]\n", - idmap_error_string(err))); + "Could not initialize the ID map: [%s]\n", + idmap_error_string(err)); if (err == IDMAP_OUT_OF_MEMORY) { ret = ENOMEM; } else { @@ -177,13 +177,13 @@ errno_t ipa_idmap_init(TALLOC_CTX *mem_ctx, ret = sysdb_get_ranges(tmp_ctx, sysdb, &range_count, &range_list); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not read ranges from the cache: [%s]\n", - strerror(ret))); + "Could not read ranges from the cache: [%s]\n", + strerror(ret)); goto done; }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Initializing [%zu] domains for ID-mapping\n", range_count)); + "Initializing [%zu] domains for ID-mapping\n", range_count);
for (c = 0; c < range_count; c++) {
@@ -207,9 +207,9 @@ errno_t ipa_idmap_init(TALLOC_CTX *mem_ctx, sid = r->trusted_dom_sid; name = sid; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot determine range type, " \ + DEBUG(SSSDBG_MINOR_FAILURE, "Cannot determine range type, " \ "skipping id ange [%s].\n", - r->name)); + r->name); continue; } } else { @@ -229,9 +229,9 @@ errno_t ipa_idmap_init(TALLOC_CTX *mem_ctx, sid = r->trusted_dom_sid; name = sid; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Range type [%s] not supported, " \ + DEBUG(SSSDBG_MINOR_FAILURE, "Range type [%s] not supported, " \ "skipping id range [%s].\n", - r->range_type, r->name)); + r->range_type, r->name); continue; } } @@ -241,8 +241,8 @@ errno_t ipa_idmap_init(TALLOC_CTX *mem_ctx, err = sss_idmap_add_domain_ex(idmap_ctx->map, name, sid, &range, r->name, rid, external_mapping); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not add range [%s] to ID map\n", - r->name)); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not add range [%s] to ID map\n", + r->name); ret = EIO; goto done; } diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c index b1440da..5a77fc8 100644 --- a/src/providers/ipa/ipa_init.c +++ b/src/providers/ipa/ipa_init.c @@ -96,7 +96,7 @@ static bool srv_in_server_list(const char *servers) /* split server parm into a list */ ret = split_on_separator(tmp_ctx, servers, ',', true, true, &list, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to parse server list!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to parse server list!\n"); goto done; }
@@ -132,7 +132,7 @@ int common_ipa_init(struct be_ctx *bectx) ipa_backup_servers, ipa_options, &ipa_options->service); if (ret != EOK) { - DEBUG(0, ("Failed to init IPA failover service!\n")); + DEBUG(0, "Failed to init IPA failover service!\n"); return ret; }
@@ -200,7 +200,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx, */
DEBUG(SSSDBG_CONF_SETTINGS, - ("Dynamic DNS updates are on. Checking for nsupdate..\n")); + "Dynamic DNS updates are on. Checking for nsupdate..\n"); ret = be_nsupdate_check(); if (ret == EOK) { /* nsupdate is available. Dynamic updates @@ -208,7 +208,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx, */ ret = ipa_dyndns_init(sdap_ctx->be, ipa_options); if (ret != EOK) { - DEBUG(1, ("Failure setting up automatic DNS update\n")); + DEBUG(1, "Failure setting up automatic DNS update\n"); /* We will continue without DNS updating */ } } @@ -216,8 +216,8 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
ret = setup_tls_config(sdap_ctx->opts->basic); if (ret != EOK) { - DEBUG(1, ("setup_tls_config failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "setup_tls_config failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
@@ -233,8 +233,8 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
ret = sdap_setup_child(); if (ret != EOK) { - DEBUG(1, ("setup_child failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "setup_child failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
@@ -248,7 +248,7 @@ int sssm_ipa_id_init(struct be_ctx *bectx, srv_ctx = ipa_srv_plugin_ctx_init(bectx, bectx->be_res->resolv, hostname, ipa_domain); if (srv_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n"); ret = ENOMEM; goto done; } @@ -258,8 +258,8 @@ int sssm_ipa_id_init(struct be_ctx *bectx, } else if (server_mode == true) { ipa_servers = dp_opt_get_string(ipa_options->basic, IPA_SERVER); if (srv_in_server_list(ipa_servers) == true) { - DEBUG(SSSDBG_MINOR_FAILURE, ("SRV resolution enabled on the IPA server. " - "Site discovery of trusted AD servers might not work\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "SRV resolution enabled on the IPA server. " + "Site discovery of trusted AD servers might not work\n");
/* If SRV discovery is enabled on the server and * dns_discovery_domain is set explicitly, then @@ -274,18 +274,18 @@ int sssm_ipa_id_init(struct be_ctx *bectx, "It is recommended not to use SRV discovery or the " "dns_discovery_domain option for the IPA domain while " "running on the server itself\n")); - DEBUG(SSSDBG_CRIT_FAILURE, ("SRV discovery is enabled on IPA " + DEBUG(SSSDBG_CRIT_FAILURE, "SRV discovery is enabled on IPA " "server while using custom dns_discovery_domain. " "DNS discovery of trusted AD domain will likely fail. " "It is recommended not to use SRV discovery or the " "dns_discovery_domain option for the IPA domain while " - "running on the server itself\n")); + "running on the server itself\n"); }
ret = be_fo_set_dns_srv_lookup_plugin(bectx, hostname); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to set SRV lookup plugin " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin " + "[%d]: %s\n", ret, strerror(ret)); goto done; } } else { @@ -295,21 +295,21 @@ int sssm_ipa_id_init(struct be_ctx *bectx, ret = dp_opt_set_string(bectx->be_res->opts, DP_RES_OPT_DNS_DOMAIN, NULL); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not reset the " + DEBUG(SSSDBG_MINOR_FAILURE, "Could not reset the " "dns_discovery_domain, trusted AD domains discovery " "might fail. Please remove dns_discovery_domain " - "from the config file and restart the SSSD\n")); + "from the config file and restart the SSSD\n"); } else { - DEBUG(SSSDBG_CONF_SETTINGS, ("The value of dns_discovery_domain " - "will be ignored in ipa_server_mode\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "The value of dns_discovery_domain " + "will be ignored in ipa_server_mode\n"); } } } else { /* fall back to standard plugin on clients. */ ret = be_fo_set_dns_srv_lookup_plugin(bectx, hostname); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to set SRV lookup plugin " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin " + "[%d]: %s\n", ret, strerror(ret)); goto done; } } @@ -320,8 +320,8 @@ int sssm_ipa_id_init(struct be_ctx *bectx, sdap_refresh_netgroups_recv, sdap_ctx); if (ret != EOK && ret != EEXIST) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Periodical refresh of netgroups " - "will not work [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups " + "will not work [%d]: %s\n", ret, strerror(ret)); }
*ops = &ipa_id_ops; @@ -368,7 +368,7 @@ int sssm_ipa_auth_init(struct be_ctx *bectx,
ret = sssm_ipa_id_init(bectx, &id_ops, (void **) &id_ctx); if (ret != EOK) { - DEBUG(1, ("sssm_ipa_id_init failed.\n")); + DEBUG(1, "sssm_ipa_id_init failed.\n"); goto done; } ipa_auth_ctx->sdap_id_ctx = id_ctx->sdap_id_ctx; @@ -376,7 +376,7 @@ int sssm_ipa_auth_init(struct be_ctx *bectx, ret = dp_copy_options(ipa_auth_ctx, ipa_options->basic, IPA_OPTS_BASIC, &ipa_auth_ctx->ipa_options); if (ret != EOK) { - DEBUG(1, ("dp_copy_options failed.\n")); + DEBUG(1, "dp_copy_options failed.\n"); goto done; }
@@ -419,8 +419,8 @@ int sssm_ipa_auth_init(struct be_ctx *bectx,
ret = setup_tls_config(sdap_auth_ctx->opts->basic); if (ret != EOK) { - DEBUG(1, ("setup_tls_config failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "setup_tls_config failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
@@ -428,8 +428,8 @@ int sssm_ipa_auth_init(struct be_ctx *bectx, ret = krb5_child_init(krb5_auth_ctx, bectx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not initialize krb5_child settings: [%s]\n", - strerror(ret))); + "Could not initialize krb5_child settings: [%s]\n", + strerror(ret)); goto done; }
@@ -464,13 +464,13 @@ int sssm_ipa_access_init(struct be_ctx *bectx,
ipa_access_ctx = talloc_zero(bectx, struct ipa_access_ctx); if (ipa_access_ctx == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; }
ret = sssm_ipa_id_init(bectx, ops, (void **) &id_ctx); if (ret != EOK) { - DEBUG(1, ("sssm_ipa_id_init failed.\n")); + DEBUG(1, "sssm_ipa_id_init failed.\n"); goto done; } ipa_access_ctx->sdap_ctx = id_ctx->sdap_id_ctx; @@ -482,7 +482,7 @@ int sssm_ipa_access_init(struct be_ctx *bectx, ret = dp_copy_options(ipa_access_ctx, ipa_options->basic, IPA_OPTS_BASIC, &ipa_access_ctx->ipa_options); if (ret != EOK) { - DEBUG(1, ("dp_copy_options failed.\n")); + DEBUG(1, "dp_copy_options failed.\n"); goto done; }
@@ -516,13 +516,13 @@ int sssm_ipa_selinux_init(struct be_ctx *bectx,
selinux_ctx = talloc_zero(bectx, struct ipa_selinux_ctx); if (selinux_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; }
ret = sssm_ipa_id_init(bectx, ops, (void **) &selinux_ctx->id_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ipa_id_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sssm_ipa_id_init failed.\n"); goto done; }
@@ -553,13 +553,13 @@ int sssm_ipa_hostid_init(struct be_ctx *bectx,
hostid_ctx = talloc_zero(bectx, struct ipa_hostid_ctx); if (hostid_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; }
ret = sssm_ipa_id_init(bectx, ops, (void **) &id_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ipa_id_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sssm_ipa_id_init failed.\n"); goto done; } hostid_ctx->sdap_id_ctx = id_ctx->sdap_id_ctx; @@ -585,18 +585,18 @@ int sssm_ipa_autofs_init(struct be_ctx *bectx, struct ipa_id_ctx *id_ctx; int ret;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing IPA autofs handler\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing IPA autofs handler\n");
ret = sssm_ipa_id_init(bectx, ops, (void **) &id_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ipa_id_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sssm_ipa_id_init failed.\n"); return ret; }
return ipa_autofs_init(bectx, id_ctx, ops, pvt_data); #else - DEBUG(SSSDBG_MINOR_FAILURE, ("Autofs init handler called but SSSD is " - "built without autofs support, ignoring\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Autofs init handler called but SSSD is " + "built without autofs support, ignoring\n"); return EOK; #endif } @@ -610,19 +610,19 @@ int sssm_ipa_subdomains_init(struct be_ctx *bectx,
ret = sssm_ipa_id_init(bectx, ops, (void **) &id_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ipa_id_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sssm_ipa_id_init failed.\n"); return ret; }
ret = ipa_subdom_init(bectx, id_ctx, ops, pvt_data); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("ipa_subdom_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ipa_subdom_init failed.\n"); return ret; }
ret = ipa_ad_subdom_init(bectx, id_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("ipa_ad_subdom_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ipa_ad_subdom_init failed.\n"); return ret; }
@@ -637,18 +637,18 @@ int sssm_ipa_sudo_init(struct be_ctx *bectx, struct ipa_id_ctx *id_ctx; int ret;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing IPA sudo handler\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing IPA sudo handler\n");
ret = sssm_ipa_id_init(bectx, ops, (void **) &id_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sssm_ipa_id_init failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sssm_ipa_id_init failed.\n"); return ret; }
return ipa_sudo_init(bectx, id_ctx, ops, pvt_data); #else - DEBUG(SSSDBG_MINOR_FAILURE, ("Sudo init handler called but SSSD is " - "built without sudo support, ignoring\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Sudo init handler called but SSSD is " + "built without sudo support, ignoring\n"); return EOK; #endif } diff --git a/src/providers/ipa/ipa_netgroups.c b/src/providers/ipa/ipa_netgroups.c index 0deb394..44f653a 100644 --- a/src/providers/ipa/ipa_netgroups.c +++ b/src/providers/ipa/ipa_netgroups.c @@ -84,7 +84,7 @@ static errno_t ipa_save_netgroup(TALLOC_CTX *mem_ctx, goto fail; } name = (const char *)el->values[0].data; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Storing netgroup %s\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Storing netgroup %s\n", name);
netgroup_attrs = sysdb_new_attrs(mem_ctx); if (!netgroup_attrs) { @@ -97,10 +97,10 @@ static errno_t ipa_save_netgroup(TALLOC_CTX *mem_ctx, goto fail; } if (el->num_values == 0) { - DEBUG(7, ("Original DN is not available for [%s].\n", name)); + DEBUG(7, "Original DN is not available for [%s].\n", name); } else { - DEBUG(7, ("Adding original DN [%s] to attributes of [%s].\n", - el->values[0].data, name)); + DEBUG(7, "Adding original DN [%s] to attributes of [%s].\n", + el->values[0].data, name); ret = sysdb_attrs_add_string(netgroup_attrs, SYSDB_ORIG_DN, (const char *)el->values[0].data); if (ret) { @@ -113,7 +113,7 @@ static errno_t ipa_save_netgroup(TALLOC_CTX *mem_ctx, goto fail; } if (el->num_values == 0) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("No netgroup triples for netgroup [%s].\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "No netgroup triples for netgroup [%s].\n", name); ret = sysdb_attrs_get_el(netgroup_attrs, SYSDB_NETGROUP_TRIPLE, &el); if (ret != EOK) { goto fail; @@ -136,10 +136,10 @@ static errno_t ipa_save_netgroup(TALLOC_CTX *mem_ctx, goto fail; } if (el->num_values == 0) { - DEBUG(7, ("No original members for netgroup [%s]\n", name)); + DEBUG(7, "No original members for netgroup [%s]\n", name);
} else { - DEBUG(7, ("Adding original members to netgroup [%s]\n", name)); + DEBUG(7, "Adding original members to netgroup [%s]\n", name); for(c = 0; c < el->num_values; c++) { ret = sysdb_attrs_add_string(netgroup_attrs, opts->netgroup_map[IPA_AT_NETGROUP_MEMBER].sys_name, @@ -156,10 +156,10 @@ static errno_t ipa_save_netgroup(TALLOC_CTX *mem_ctx, goto fail; } if (el->num_values == 0) { - DEBUG(7, ("No members for netgroup [%s]\n", name)); + DEBUG(7, "No members for netgroup [%s]\n", name);
} else { - DEBUG(7, ("Adding members to netgroup [%s]\n", name)); + DEBUG(7, "Adding members to netgroup [%s]\n", name); for(c = 0; c < el->num_values; c++) { ret = sysdb_attrs_add_string(netgroup_attrs, SYSDB_NETGROUP_MEMBER, (const char*)el->values[c].data); @@ -169,7 +169,7 @@ static errno_t ipa_save_netgroup(TALLOC_CTX *mem_ctx, } }
- DEBUG(6, ("Storing info for netgroup %s\n", name)); + DEBUG(6, "Storing info for netgroup %s\n", name);
ret = sysdb_add_netgroup(ctx, dom, name, NULL, netgroup_attrs, NULL, dom->netgroup_timeout, 0); @@ -178,7 +178,7 @@ static errno_t ipa_save_netgroup(TALLOC_CTX *mem_ctx, return EOK;
fail: - DEBUG(2, ("Failed to save netgroup %s\n", name)); + DEBUG(2, "Failed to save netgroup %s\n", name); return ret; }
@@ -217,7 +217,7 @@ struct tevent_req *ipa_get_netgroups_send(TALLOC_CTX *memctx,
if (!ipa_options->id->sdom->netgroup_search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Netgroup lookup request without a search base\n")); + "Netgroup lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -260,8 +260,8 @@ static errno_t ipa_netgr_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for netgroups with base [%s]\n", - netgr_bases[state->netgr_base_iter]->basedn)); + "Searching for netgroups with base [%s]\n", + netgr_bases[state->netgr_base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -315,8 +315,8 @@ static void ipa_get_netgroups_process(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Search for netgroups, returned %zu results.\n", - netgroups_count)); + DEBUG(SSSDBG_TRACE_FUNC, "Search for netgroups, returned %zu results.\n", + netgroups_count);
if (netgroups_count == 0) { /* No netgroups found in this search */ @@ -576,8 +576,8 @@ static void ipa_netgr_members_process(struct tevent_req *subreq) goto fail; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Found %zu members in current search base\n", - count)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found %zu members in current search base\n", + count);
next_call = NULL; /* While processing a batch of entities from one search base, @@ -613,8 +613,8 @@ static void ipa_netgr_members_process(struct tevent_req *subreq) table = state->new_hosts; } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid entity type given for processing: %d\n", - state->current_entity)); + "Invalid entity type given for processing: %d\n", + state->current_entity); ret = EINVAL; goto fail; } @@ -869,7 +869,7 @@ static int ipa_netgr_process_all(struct ipa_get_netgroups_state *state) hash_iterate(state->new_netgroups, extract_netgroups, state); for (i = 0; i < state->netgroups_count; i++) { /* load all its member netgroups, translate */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("Extracting netgroup members of netgroup %d\n", i)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Extracting netgroup members of netgroup %d\n", i); ret = sysdb_attrs_get_string_array(state->netgroups[i], SYSDB_ORIG_NETGROUP_MEMBER, state, &members); @@ -902,10 +902,10 @@ static int ipa_netgr_process_all(struct ipa_get_netgroups_state *state) } talloc_zfree(members); } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Extracted %d netgroup members\n", j)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Extracted %d netgroup members\n", j);
/* Load all UIDs */ - DEBUG(SSSDBG_TRACE_ALL, ("Extracting user members of netgroup %d\n", i)); + DEBUG(SSSDBG_TRACE_ALL, "Extracting user members of netgroup %d\n", i); ret = extract_members(state, state->netgroups[i], SYSDB_ORIG_MEMBER_USER, state->new_users, @@ -913,9 +913,9 @@ static int ipa_netgr_process_all(struct ipa_get_netgroups_state *state) if (ret != EOK) { goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Extracted %d user members\n", uids_count)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Extracted %d user members\n", uids_count);
- DEBUG(SSSDBG_TRACE_ALL, ("Extracting host members of netgroup %d\n", i)); + DEBUG(SSSDBG_TRACE_ALL, "Extracting host members of netgroup %d\n", i); ret = extract_members(state, state->netgroups[i], SYSDB_ORIG_MEMBER_HOST, state->new_hosts, @@ -923,7 +923,7 @@ static int ipa_netgr_process_all(struct ipa_get_netgroups_state *state) if (ret != EOK) { goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Extracted %d host members\n", hosts_count)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Extracted %d host members\n", hosts_count);
ret = sysdb_attrs_get_el(state->netgroups[i], SYSDB_ORIG_NETGROUP_EXTERNAL_HOST, @@ -967,8 +967,8 @@ static int ipa_netgr_process_all(struct ipa_get_netgroups_state *state) hosts = dash; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Putting together triples of " - "netgroup %d\n", i)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Putting together triples of " + "netgroup %d\n", i); for (j = 0; j < uids_count; j++) { for (k = 0; k < hosts_count; k++) { triple = talloc_asprintf(state, "(%s,%s,%s)", diff --git a/src/providers/ipa/ipa_s2n_exop.c b/src/providers/ipa/ipa_s2n_exop.c index e7dbeb4..64f09b1 100644 --- a/src/providers/ipa/ipa_s2n_exop.c +++ b/src/providers/ipa/ipa_s2n_exop.c @@ -79,22 +79,22 @@ static struct tevent_req *ipa_s2n_exop_send(TALLOC_CTX *mem_ctx, state->retoid = NULL; state->retdata = NULL;
- DEBUG(SSSDBG_TRACE_FUNC, ("Executing extended operation\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Executing extended operation\n");
ret = ldap_extended_operation(state->sh->ldap, EXOP_SID2NAME_OID, bv, NULL, NULL, &msgid); if (ret == -1 || msgid == -1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("ldap_extended_operation failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ldap_extended_operation failed\n"); ret = ERR_NETWORK_IO; goto fail; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("ldap_extended_operation sent, msgid = %d\n", msgid)); + DEBUG(SSSDBG_TRACE_INTERNAL, "ldap_extended_operation sent, msgid = %d\n", msgid);
/* FIXME: get timeouts from configuration, for now 10 secs. */ ret = sdap_op_add(state, ev, state->sh, msgid, ipa_s2n_exop_done, req, 10, &state->op); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set up operation!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set up operation!\n"); ret = ERR_INTERNAL; goto fail; } @@ -129,13 +129,13 @@ static void ipa_s2n_exop_done(struct sdap_op *op, &result, &errmsg, NULL, NULL, NULL, 0); if (ret != LDAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("ldap_parse_result failed (%d)\n", state->op->msgid)); + DEBUG(SSSDBG_OP_FAILURE, "ldap_parse_result failed (%d)\n", state->op->msgid); ret = ERR_NETWORK_IO; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("ldap_extended_operation result: %s(%d), %s\n", - sss_ldap_err2string(result), result, errmsg)); + DEBUG(SSSDBG_TRACE_FUNC, "ldap_extended_operation result: %s(%d), %s\n", + sss_ldap_err2string(result), result, errmsg);
if (result != LDAP_SUCCESS) { ret = ERR_NETWORK_IO; @@ -145,21 +145,21 @@ static void ipa_s2n_exop_done(struct sdap_op *op, ret = ldap_parse_extended_result(state->sh->ldap, reply->msg, &retoid, &retdata, 0); if (ret != LDAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("ldap_parse_extendend_result failed (%d)\n", ret)); + DEBUG(SSSDBG_OP_FAILURE, "ldap_parse_extendend_result failed (%d)\n", ret); ret = ERR_NETWORK_IO; goto done; }
state->retoid = talloc_strdup(state, retoid); if (state->retoid == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; }
state->retdata = talloc(state, struct berval); if (state->retdata == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc failed.\n"); ret = ENOMEM; goto done; } @@ -167,7 +167,7 @@ static void ipa_s2n_exop_done(struct sdap_op *op, state->retdata->bv_val = talloc_memdup(state->retdata, retdata->bv_val, retdata->bv_len); if (state->retdata->bv_val == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_memdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_memdup failed.\n"); ret = ENOMEM; goto done; } @@ -306,8 +306,8 @@ static errno_t s2n_encode_request(TALLOC_CTX *mem_ctx, domain_name, req_input->inp.id); } else { - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected input type [%d].\n", - req_input->type == REQ_INP_ID)); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected input type [%d].\n", + req_input->type == REQ_INP_ID); ret = EINVAL; goto done; } @@ -322,8 +322,8 @@ static errno_t s2n_encode_request(TALLOC_CTX *mem_ctx, domain_name, req_input->inp.id); } else { - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected input type [%d].\n", - req_input->type == REQ_INP_ID)); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected input type [%d].\n", + req_input->type == REQ_INP_ID); ret = EINVAL; goto done; } @@ -333,8 +333,8 @@ static errno_t s2n_encode_request(TALLOC_CTX *mem_ctx, ret = ber_printf(ber, "{ees}", INP_SID, request_type, req_input->inp.secid); } else { - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected input type [%d].\n", - req_input->type == REQ_INP_ID)); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected input type [%d].\n", + req_input->type == REQ_INP_ID); ret = EINVAL; goto done; } @@ -430,33 +430,33 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, char *sid_str;
if (retoid == NULL || retdata == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing OID or data.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing OID or data.\n"); return EINVAL; }
if (strcmp(retoid, EXOP_SID2NAME_OID) != 0) { DEBUG(SSSDBG_OP_FAILURE, - ("Result has wrong OID, expected [%s], got [%s].\n", - EXOP_SID2NAME_OID, retoid)); + "Result has wrong OID, expected [%s], got [%s].\n", + EXOP_SID2NAME_OID, retoid); return EINVAL; }
ber = ber_init(retdata); if (ber == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ber_init failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ber_init failed.\n"); return EINVAL; }
tag = ber_scanf(ber, "{e", &type); if (tag == LBER_ERROR) { - DEBUG(SSSDBG_OP_FAILURE, ("ber_scanf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ber_scanf failed.\n"); ret = EINVAL; goto done; }
attrs = talloc_zero(mem_ctx, struct resp_attrs); if (attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); ret = ENOMEM; goto done; } @@ -465,7 +465,7 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, case RESP_USER: tag = ber_scanf(ber, "{aaii}}", &domain_name, &name, &uid, &gid); if (tag == LBER_ERROR) { - DEBUG(SSSDBG_OP_FAILURE, ("ber_scanf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ber_scanf failed.\n"); ret = EINVAL; goto done; } @@ -477,7 +477,7 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, * lowercase the name. */ attrs->a.user.pw_name = sss_tc_utf8_str_tolower(attrs, name); if (attrs->a.user.pw_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -489,7 +489,7 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, case RESP_GROUP: tag = ber_scanf(ber, "{aai}}", &domain_name, &name, &gid); if (tag == LBER_ERROR) { - DEBUG(SSSDBG_OP_FAILURE, ("ber_scanf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ber_scanf failed.\n"); ret = EINVAL; goto done; } @@ -501,7 +501,7 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, * lowercase the name. */ attrs->a.group.gr_name = sss_tc_utf8_str_tolower(attrs, name); if (attrs->a.group.gr_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -512,14 +512,14 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, case RESP_SID: tag = ber_scanf(ber, "a}", &sid_str); if (tag == LBER_ERROR) { - DEBUG(SSSDBG_OP_FAILURE, ("ber_scanf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ber_scanf failed.\n"); ret = EINVAL; goto done; }
attrs->a.sid_str = talloc_strdup(attrs, sid_str); if (attrs->a.sid_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -527,21 +527,21 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, case RESP_NAME: tag = ber_scanf(ber, "{aa}", &domain_name, &name); if (tag == LBER_ERROR) { - DEBUG(SSSDBG_OP_FAILURE, ("ber_scanf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ber_scanf failed.\n"); ret = EINVAL; goto done; }
attrs->a.name = sss_tc_utf8_str_tolower(attrs, name); if (attrs->a.name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_tc_utf8_str_tolower failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_tc_utf8_str_tolower failed.\n"); ret = ENOMEM; goto done; } break; default: - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected response type [%d].\n", - type)); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected response type [%d].\n", + type); ret = EINVAL; goto done; } @@ -550,7 +550,7 @@ static errno_t s2n_response_to_attrs(TALLOC_CTX *mem_ctx, if (type != RESP_SID) { attrs->domain_name = talloc_strdup(attrs, domain_name); if (attrs->domain_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -620,7 +620,7 @@ struct tevent_req *ipa_s2n_get_acct_info_send(TALLOC_CTX *mem_ctx,
subreq = ipa_s2n_exop_send(state, state->ev, state->sh, bv_req); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_s2n_exop_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_exop_send failed.\n"); ret = ENOMEM; goto fail; } @@ -661,7 +661,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) ret = ipa_s2n_exop_recv(subreq, state, &retoid, &retdata); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("s2n exop request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "s2n exop request failed.\n"); goto done; }
@@ -669,19 +669,19 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) case REQ_FULL: ret = s2n_response_to_attrs(state, retoid, retdata, &attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("s2n_response_to_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "s2n_response_to_attrs failed.\n"); goto done; }
if (!(strcasecmp(state->dom->name, attrs->domain_name) == 0 || (state->dom->flat_name != NULL && strcasecmp(state->dom->flat_name, attrs->domain_name) == 0))) { - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected domain name returned, " + DEBUG(SSSDBG_OP_FAILURE, "Unexpected domain name returned, " "expected [%s] or [%s], got [%s].\n", state->dom->name, state->dom->flat_name == NULL ? "" : state->dom->flat_name, - attrs->domain_name)); + attrs->domain_name); ret = EINVAL; goto done; } @@ -704,7 +704,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq)
subreq = ipa_s2n_exop_send(state, state->ev, state->sh, bv_req); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_s2n_exop_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_s2n_exop_send failed.\n"); ret = ENOMEM; goto done; } @@ -715,19 +715,19 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) case REQ_SIMPLE: ret = s2n_response_to_attrs(state, retoid, retdata, &simple_attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("s2n_response_to_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "s2n_response_to_attrs failed.\n"); goto done; }
break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unexpected request type.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unexpected request type.\n"); ret = EINVAL; goto done; }
if (state->attrs == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Missing data of full request.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing data of full request.\n"); ret = EINVAL; goto done; } else { @@ -754,7 +754,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq)
user_attrs = sysdb_new_attrs(state); if (user_attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; } @@ -763,21 +763,21 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) name = sss_tc_fqname(state, state->dom->names, state->dom, attrs->a.user.pw_name); if (!name) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to format user name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "failed to format user name.\n"); ret = ENOMEM; goto done; }
lc_name = sss_tc_utf8_str_tolower(user_attrs, name); if (lc_name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot convert name to lowercase\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot convert name to lowercase\n"); ret = ENOMEM; goto done; }
ret = sysdb_attrs_add_string(user_attrs, SYSDB_NAME_ALIAS, lc_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
@@ -789,21 +789,21 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) * it from there. */ realm = get_uppercase_realm(state, state->dom->name); if (!realm) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to get realm.\n")); + DEBUG(SSSDBG_OP_FAILURE, "failed to get realm.\n"); ret = ENOMEM; goto done; } upn = talloc_asprintf(state, "%s@%s", attrs->a.user.pw_name, realm); if (!upn) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to format UPN.\n")); + DEBUG(SSSDBG_OP_FAILURE, "failed to format UPN.\n"); ret = ENOMEM; goto done; }
ret = sysdb_attrs_add_string(user_attrs, SYSDB_UPN, upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
@@ -811,7 +811,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) ret = sysdb_attrs_add_string(user_attrs, SYSDB_SID_STR, state->req_input->inp.secid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; } } @@ -820,7 +820,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) ret = sysdb_attrs_add_string(user_attrs, SYSDB_SID_STR, simple_attrs->a.sid_str); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; } } @@ -841,14 +841,14 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) name = sss_tc_fqname(state, state->dom->names, state->dom, attrs->a.group.gr_name); if (!name) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to format user name,\n")); + DEBUG(SSSDBG_OP_FAILURE, "failed to format user name,\n"); ret = ENOMEM; goto done; }
group_attrs = sysdb_new_attrs(state); if (group_attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; } @@ -856,7 +856,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) lc_name = sss_tc_utf8_str_tolower(group_attrs, name); if (lc_name == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot convert name to lowercase\n")); + "Cannot convert name to lowercase\n"); ret = ENOMEM; goto done; } @@ -864,7 +864,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) ret = sysdb_attrs_add_string(group_attrs, SYSDB_NAME_ALIAS, lc_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
@@ -872,7 +872,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) ret = sysdb_attrs_add_string(group_attrs, SYSDB_SID_STR, state->req_input->inp.secid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; } } @@ -881,7 +881,7 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) ret = sysdb_attrs_add_string(group_attrs, SYSDB_SID_STR, simple_attrs->a.sid_str); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; } } @@ -891,8 +891,8 @@ static void ipa_s2n_get_user_done(struct tevent_req *subreq) timeout, now); break; default: - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected response type [%d].\n", - attrs->response_type)); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected response type [%d].\n", + attrs->response_type); ret = EINVAL; goto done; } diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c index c227db9..df3b35a 100644 --- a/src/providers/ipa/ipa_selinux.c +++ b/src/providers/ipa/ipa_selinux.c @@ -106,23 +106,23 @@ void ipa_selinux_handler(struct be_req *be_req) hostname = dp_opt_get_string(selinux_ctx->id_ctx->ipa_options->basic, IPA_HOSTNAME); if (!hostname) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot determine this machine's host name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot determine this machine's host name\n"); goto fail; }
if (strcasecmp(pd->domain, be_ctx->domain->name) != 0) { subdom_be_ctx = ipa_get_subdomains_be_ctx(be_ctx); if (subdom_be_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Subdomains are not configured, " \ + DEBUG(SSSDBG_OP_FAILURE, "Subdomains are not configured, " \ "cannot lookup domain [%s].\n", - pd->domain)); + pd->domain); goto fail; } else { user_domain = find_subdomain_by_name(subdom_be_ctx->domain, pd->domain, true); if (user_domain == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No domain entry found " \ - "for [%s].\n", pd->domain)); + DEBUG(SSSDBG_MINOR_FAILURE, "No domain entry found " \ + "for [%s].\n", pd->domain); goto fail; } } @@ -135,14 +135,14 @@ void ipa_selinux_handler(struct be_req *be_req) be_req, pd->user, hostname, selinux_ctx); if (op_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot create op context\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot create op context\n"); goto fail; }
req = ipa_get_selinux_send(be_req, be_ctx, op_ctx->user, op_ctx->host, selinux_ctx); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot initiate the search\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot initiate the search\n"); goto fail; }
@@ -198,7 +198,7 @@ ipa_selinux_create_op_ctx(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, } else if (ret != EOK) { goto fail; } else if (count > 1) { - DEBUG(SSSDBG_OP_FAILURE, ("More than one result for a BASE search!\n")); + DEBUG(SSSDBG_OP_FAILURE, "More than one result for a BASE search!\n"); goto fail; }
@@ -267,7 +267,7 @@ static void ipa_selinux_handler_done(struct tevent_req *req) &order_array, &order_count); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to create ordered SELinux users array.\n")); + "Failed to create ordered SELinux users array.\n"); goto fail; }
@@ -275,13 +275,13 @@ static void ipa_selinux_handler_done(struct tevent_req *req) default_user); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to evaluate ordered SELinux users array.\n")); + "Failed to evaluate ordered SELinux users array.\n"); goto fail; }
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -289,7 +289,7 @@ static void ipa_selinux_handler_done(struct tevent_req *req) ret = sysdb_delete_usermaps(op_ctx->domain->sysdb, op_ctx->domain); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot delete existing maps from sysdb\n")); + "Cannot delete existing maps from sysdb\n"); goto fail; }
@@ -308,7 +308,7 @@ static void ipa_selinux_handler_done(struct tevent_req *req)
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not commit transaction\n"); goto fail; } in_transaction = false; @@ -326,7 +326,7 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } } if (ret == EAGAIN) { @@ -473,10 +473,10 @@ ipa_selinux_process_seealso_maps(struct sysdb_attrs *user, el->name = SYSDB_ORIG_MEMBER_USER;
DEBUG(SSSDBG_TRACE_ALL, - ("Matching HBAC rule %s with SELinux mappings\n", hbac_dn)); + "Matching HBAC rule %s with SELinux mappings\n", hbac_dn);
if (!sss_selinux_match(hbac_rules[i], user, host, &priority)) { - DEBUG(SSSDBG_TRACE_ALL, ("Rule did not match\n")); + DEBUG(SSSDBG_TRACE_ALL, "Rule did not match\n"); continue; }
@@ -493,9 +493,9 @@ ipa_selinux_process_seealso_maps(struct sysdb_attrs *user, }
if (strcasecmp(hbac_dn, seealso_dn) == 0) { - DEBUG(SSSDBG_TRACE_FUNC, ("HBAC rule [%s] matched, copying its" + DEBUG(SSSDBG_TRACE_FUNC, "HBAC rule [%s] matched, copying its" "attributes to SELinux user map [%s]\n", - hbac_dn, seealso_dn)); + hbac_dn, seealso_dn);
/* Selinux maps priority evaluation removed --DELETE this comment before pushing*/ if (priority < top_priority) { @@ -613,7 +613,7 @@ static errno_t choose_best_seuser(struct sysdb_attrs **usermaps,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -687,7 +687,7 @@ static errno_t write_selinux_login_file(const char *username, char *string)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -719,8 +719,8 @@ static errno_t write_selinux_login_file(const char *username, char *string) /* continue if we can't get enforce mode or selinux is enabled */ }
- DEBUG(SSSDBG_OP_FAILURE, ("unable to create temp file [%s] " - "for SELinux data [%d]: %s\n", tmp_path, ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "unable to create temp file [%s] " + "for SELinux data [%d]: %s\n", tmp_path, ret, strerror(ret)); goto done; }
@@ -736,15 +736,15 @@ static errno_t write_selinux_login_file(const char *username, char *string) written = sss_atomic_write_s(fd, full_string, len); if (written == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("writing to SELinux data file %s" + DEBUG(SSSDBG_OP_FAILURE, "writing to SELinux data file %s" "failed [%d]: %s", tmp_path, ret, - strerror(ret))); + strerror(ret)); goto done; }
if (written != len) { - DEBUG(SSSDBG_OP_FAILURE, ("Expected to write %zd bytes, wrote %zu", - written, len)); + DEBUG(SSSDBG_OP_FAILURE, "Expected to write %zd bytes, wrote %zu", + written, len); ret = EIO; goto done; } @@ -762,8 +762,8 @@ done: if (fd != -1) { close(fd); if (unlink(tmp_path) < 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not remove file [%s]", - tmp_path)); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not remove file [%s]", + tmp_path); } }
@@ -788,8 +788,8 @@ static errno_t remove_selinux_login_file(const char *username) ret = EOK; } else { DEBUG(SSSDBG_OP_FAILURE, - ("Could not remove login file %s [%d]: %s\n", - path, ret, strerror(ret))); + "Could not remove login file %s [%d]: %s\n", + path, ret, strerror(ret)); } }
@@ -836,7 +836,7 @@ ipa_get_selinux_send(TALLOC_CTX *mem_ctx, time_t refresh_interval; struct ipa_options *ipa_options = selinux_ctx->id_ctx->ipa_options;
- DEBUG(SSSDBG_TRACE_FUNC, ("Retrieving SELinux user mapping\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Retrieving SELinux user mapping\n"); req = tevent_req_create(mem_ctx, &state, struct ipa_get_selinux_state); if (req == NULL) { return NULL; @@ -848,8 +848,8 @@ ipa_get_selinux_send(TALLOC_CTX *mem_ctx, state->host = host;
offline = be_is_offline(be_ctx); - DEBUG(SSSDBG_TRACE_INTERNAL, ("Connection status is [%s].\n", - offline ? "offline" : "online")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Connection status is [%s].\n", + offline ? "offline" : "online");
if (!offline) { refresh_interval = dp_opt_get_int(ipa_options->basic, @@ -858,7 +858,7 @@ ipa_get_selinux_send(TALLOC_CTX *mem_ctx, if (now < selinux_ctx->last_update + refresh_interval) { /* SELinux maps were recently updated -> force offline */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("Performing cached SELinux processing\n")); + "Performing cached SELinux processing\n"); offline = true; } } @@ -867,15 +867,15 @@ ipa_get_selinux_send(TALLOC_CTX *mem_ctx, state->op = sdap_id_op_create(state, selinux_ctx->id_ctx->sdap_id_ctx->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto immediate; }
subreq = sdap_id_op_connect_send(state->op, state, &ret); if (!subreq) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_id_op_connect_send failed: " - "%d(%s).\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_connect_send failed: " + "%d(%s).\n", ret, strerror(ret)); talloc_zfree(state->op); goto immediate; } @@ -941,7 +941,7 @@ static void ipa_get_selinux_connect_done(struct tevent_req *subreq) hostname = dp_opt_get_string(state->selinux_ctx->id_ctx->ipa_options->basic, IPA_HOSTNAME); if (hostname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot determine the host name\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot determine the host name\n"); goto fail; }
@@ -989,8 +989,8 @@ ipa_get_selinux_maps_offline(struct tevent_req *req) ret = sysdb_search_selinux_config(state, state->be_ctx->domain->sysdb, state->be_ctx->domain, NULL, &defaults); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_selinux_config failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_selinux_config failed [%d]: %s\n", + ret, strerror(ret)); return ret; }
@@ -1023,8 +1023,8 @@ ipa_get_selinux_maps_offline(struct tevent_req *req) state->be_ctx->domain, attrs, &nmaps, &maps); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_get_selinux_usermaps failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_get_selinux_usermaps failed [%d]: %s\n", + ret, strerror(ret)); return ret; }
@@ -1038,8 +1038,8 @@ ipa_get_selinux_maps_offline(struct tevent_req *req) ret = hbac_get_cached_rules(state, state->be_ctx->domain, &state->hbac_rule_count, &state->hbac_rules); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("hbac_get_cached_rules failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "hbac_get_cached_rules failed [%d]: %s\n", + ret, strerror(ret)); return ret; }
@@ -1105,7 +1105,7 @@ static void ipa_get_selinux_config_done(struct tevent_req *subreq) ret = ipa_get_config_recv(subreq, state, &state->defaults); talloc_free(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get IPA config\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not get IPA config\n"); goto done; }
@@ -1163,7 +1163,7 @@ static void ipa_get_selinux_maps_done(struct tevent_req *subreq) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Found %zu SELinux user maps\n", state->nmaps)); + "Found %zu SELinux user maps\n", state->nmaps);
check_hbac = false; for (i = 0; i < state->nmaps; i++) { @@ -1186,8 +1186,8 @@ static void ipa_get_selinux_maps_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("SELinux maps referenced an HBAC rule. " - "Need to refresh HBAC rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "SELinux maps referenced an HBAC rule. " + "Need to refresh HBAC rules\n"); subreq = ipa_hbac_rule_info_send(state, false, state->be_ctx->ev, sdap_id_op_handle(state->op), id_ctx->sdap_id_ctx->opts, @@ -1222,7 +1222,7 @@ static void ipa_get_selinux_hbac_done(struct tevent_req *subreq) ret = ipa_hbac_rule_info_recv(subreq, state, &state->hbac_rule_count, &state->hbac_rules); DEBUG(SSSDBG_TRACE_INTERNAL, - ("Received %zu HBAC rules\n", state->hbac_rule_count)); + "Received %zu HBAC rules\n", state->hbac_rule_count); talloc_free(subreq);
if (ret != EOK) { diff --git a/src/providers/ipa/ipa_selinux_common.c b/src/providers/ipa/ipa_selinux_common.c index 2276d0c..9f1b757 100644 --- a/src/providers/ipa/ipa_selinux_common.c +++ b/src/providers/ipa/ipa_selinux_common.c @@ -39,7 +39,7 @@ errno_t ipa_save_user_maps(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -47,16 +47,16 @@ errno_t ipa_save_user_maps(struct sysdb_ctx *sysdb, for (i = 0; i < map_count; i++) { ret = sysdb_store_selinux_usermap(sysdb, domain, maps[i]); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store user map %d. " - "Ignoring.\n", i)); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store user map %d. " + "Ignoring.\n", i); } else { - DEBUG(SSSDBG_TRACE_FUNC, ("User map %d processed.\n", i)); + DEBUG(SSSDBG_TRACE_FUNC, "User map %d processed.\n", i); } }
ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -66,7 +66,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction"); } } return ret; diff --git a/src/providers/ipa/ipa_selinux_maps.c b/src/providers/ipa/ipa_selinux_maps.c index 1a21068..315cc7d 100644 --- a/src/providers/ipa/ipa_selinux_maps.c +++ b/src/providers/ipa/ipa_selinux_maps.c @@ -127,9 +127,9 @@ ipa_selinux_get_maps_next(struct tevent_req *req, return ENOMEM; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Trying to fetch SELinux maps with following " + DEBUG(SSSDBG_TRACE_FUNC, "Trying to fetch SELinux maps with following " "parameters: [%d][%s][%s]\n", base->scope, - state->cur_filter, base->basedn)); + state->cur_filter, base->basedn); subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, base->basedn, base->scope, state->cur_filter, @@ -166,7 +166,7 @@ static void ipa_selinux_get_maps_done(struct tevent_req *subreq)
if (count > 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("Found %zu user maps in current search base\n", count)); + "Found %zu user maps in current search base\n", count);
total_count = count + state->map_count; state->maps = talloc_realloc(state, state->maps, struct sysdb_attrs *, total_count); @@ -192,7 +192,7 @@ static void ipa_selinux_get_maps_done(struct tevent_req *subreq) }
if (state->map_count == 0) { - DEBUG(SSSDBG_TRACE_FUNC, ("No SELinux user maps found!\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No SELinux user maps found!\n"); ret = ENOENT; }
diff --git a/src/providers/ipa/ipa_srv.c b/src/providers/ipa/ipa_srv.c index 21c7540..4be5f33 100644 --- a/src/providers/ipa/ipa_srv.c +++ b/src/providers/ipa/ipa_srv.c @@ -100,7 +100,7 @@ struct tevent_req *ipa_srv_plugin_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct ipa_srv_plugin_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -133,8 +133,8 @@ struct tevent_req *ipa_srv_plugin_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_FUNC, ("About to discover primary and " - "backup servers\n")); + DEBUG(SSSDBG_TRACE_FUNC, "About to discover primary and " + "backup servers\n");
subreq = fo_discover_servers_send(state, ev, ctx->resolv_ctx, service, protocol, primary_domain, backup_domain); @@ -174,8 +174,8 @@ static void ipa_srv_plugin_done(struct tevent_req *subreq) return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Got %zu primary and %zu backup servers\n", - state->num_primary_servers, state->num_backup_servers)); + DEBUG(SSSDBG_TRACE_FUNC, "Got %zu primary and %zu backup servers\n", + state->num_primary_servers, state->num_backup_servers);
tevent_req_done(req); } diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c index bfbdabf..740dfe4 100644 --- a/src/providers/ipa/ipa_subdomains.c +++ b/src/providers/ipa/ipa_subdomains.c @@ -86,7 +86,7 @@ struct be_ctx *ipa_get_subdomains_be_ctx(struct be_ctx *be_ctx) subdom_ctx = talloc_get_type(be_ctx->bet_info[BET_SUBDOMAINS].pvt_bet_data, struct ipa_subdomains_ctx); if (subdom_ctx == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("Subdomains are not configured.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Subdomains are not configured.\n"); return NULL; }
@@ -110,7 +110,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, ad_options = ad_create_default_options(id_ctx, id_ctx->server_mode->realm, id_ctx->server_mode->hostname); if (ad_options == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot initialize AD options\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize AD options\n"); talloc_free(ad_options); return ENOMEM; } @@ -119,7 +119,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx,
ret = dp_opt_set_string(ad_options->basic, AD_DOMAIN, ad_domain); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set AD domain\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set AD domain\n"); talloc_free(ad_options); return ret; } @@ -127,7 +127,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, ret = dp_opt_set_string(ad_options->basic, AD_KRB5_REALM, id_ctx->server_mode->realm); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set AD realm\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set AD realm\n"); talloc_free(ad_options); return ret; } @@ -145,7 +145,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, subdom->name, gc_service_name, subdom->name, &ad_options->service); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot initialize AD failover\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize AD failover\n"); talloc_free(ad_options); return ret; } @@ -165,7 +165,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, id_ctx->server_mode->hostname, ad_domain); if (srv_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n"); return ENOMEM; } be_fo_set_srv_lookup_plugin(be_ctx, ad_srv_plugin_send, @@ -175,7 +175,7 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx, ad_id_ctx->sdap_id_ctx->opts->sdom, subdom->parent); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot initialize sdap domain\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize sdap domain\n"); talloc_free(ad_options); return ret; } @@ -214,7 +214,7 @@ ipa_server_trust_add(struct be_ctx *be_ctx, ret = ipa_ad_ctx_new(be_ctx, id_ctx, subdom, &ad_id_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot create ad_id_ctx for subdomain %s\n", subdom->name)); + "Cannot create ad_id_ctx for subdomain %s\n", subdom->name); return ret; }
@@ -259,8 +259,8 @@ ipa_ad_subdom_refresh(struct be_ctx *be_ctx, ret = ipa_server_trust_add(be_ctx, id_ctx, dom); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot create ad_id_ctx for subdomain %s\n", - dom->name)); + "Cannot create ad_id_ctx for subdomain %s\n", + dom->name); continue; } } @@ -286,8 +286,8 @@ ipa_ad_subdom_remove(struct ipa_subdomains_ctx *ctx, }
if (iter == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No IPA-AD context for subdomain %s\n", - subdom->name)); + DEBUG(SSSDBG_CRIT_FAILURE, "No IPA-AD context for subdomain %s\n", + subdom->name); return; }
@@ -308,7 +308,7 @@ const char *get_flat_name_from_subdomain_name(struct be_ctx *be_ctx, ctx = talloc_get_type(be_ctx->bet_info[BET_SUBDOMAINS].pvt_bet_data, struct ipa_subdomains_ctx); if (ctx == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("Subdomains are not configured.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Subdomains are not configured.\n"); return NULL; }
@@ -332,26 +332,26 @@ static errno_t ipa_ranges_parse_results(TALLOC_CTX *mem_ctx,
range_list = talloc_array(mem_ctx, struct range_info *, count + 1); if (range_list == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n"); return ENOMEM; }
for (c = 0; c < count; c++) { range_list[c] = talloc_zero(range_list, struct range_info); if (range_list[c] == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); ret = ENOMEM; goto done; }
ret = sysdb_attrs_get_string(reply[c], IPA_CN, &value); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; } range_list[c]->name = talloc_strdup(range_list[c], value); if (range_list[c]->name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -361,40 +361,40 @@ static errno_t ipa_ranges_parse_results(TALLOC_CTX *mem_ctx, range_list[c]->trusted_dom_sid = talloc_strdup(range_list[c], value); if (range_list[c]->trusted_dom_sid == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } } else if (ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
ret = sysdb_attrs_get_uint32_t(reply[c], IPA_BASE_ID, &range_list[c]->base_id); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
ret = sysdb_attrs_get_uint32_t(reply[c], IPA_ID_RANGE_SIZE, &range_list[c]->id_range_size); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
ret = sysdb_attrs_get_uint32_t(reply[c], IPA_BASE_RID, &range_list[c]->base_rid); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
ret = sysdb_attrs_get_uint32_t(reply[c], IPA_SECONDARY_BASE_RID, &range_list[c]->secondary_base_rid); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
@@ -402,7 +402,7 @@ static errno_t ipa_ranges_parse_results(TALLOC_CTX *mem_ctx, if (ret == EOK) { range_list[c]->range_type = talloc_strdup(range_list[c], value); if (range_list[c]->range_type == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -417,11 +417,11 @@ static errno_t ipa_ranges_parse_results(TALLOC_CTX *mem_ctx, IPA_RANGE_AD_TRUST); } } else { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; } if (range_list[c]->range_type == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -448,7 +448,7 @@ static errno_t ipa_subdom_enumerates(struct sss_domain_info *parent,
ret = sysdb_attrs_get_string(attrs, IPA_CN, &name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); return ret; }
@@ -469,21 +469,21 @@ static errno_t ipa_subdom_get_forest(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_get_string(attrs, SYSDB_ORIG_DN, &orig_dn); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; } - DEBUG(SSSDBG_TRACE_ALL, ("Checking if we need the forest name for [%s].\n", - orig_dn)); + DEBUG(SSSDBG_TRACE_ALL, "Checking if we need the forest name for [%s].\n", + orig_dn);
dn = ldb_dn_new(mem_ctx, ldb_ctx, orig_dn); if (dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_dn_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_dn_new failed.\n"); goto done; }
if (!ldb_dn_validate(dn)) { - DEBUG(SSSDBG_OP_FAILURE, ("Original DN [%s] is not a valid DN.\n", - orig_dn)); + DEBUG(SSSDBG_OP_FAILURE, "Original DN [%s] is not a valid DN.\n", + orig_dn); ret = EINVAL; goto done; } @@ -503,7 +503,7 @@ static errno_t ipa_subdom_get_forest(TALLOC_CTX *mem_ctx, val = ldb_dn_get_component_val(dn, 3); if (strncasecmp("trusts", (const char *) val->data, val->length) != 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("4th component is not 'trust', nothing to do.\n")); + "4th component is not 'trust', nothing to do.\n"); ret = EOK; goto done; } @@ -511,7 +511,7 @@ static errno_t ipa_subdom_get_forest(TALLOC_CTX *mem_ctx, val = ldb_dn_get_component_val(dn, 2); if (strncasecmp("ad", (const char *) val->data, val->length) != 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("3rd component is not 'ad', nothing to do.\n")); + "3rd component is not 'ad', nothing to do.\n"); ret = EOK; goto done; } @@ -519,7 +519,7 @@ static errno_t ipa_subdom_get_forest(TALLOC_CTX *mem_ctx, val = ldb_dn_get_component_val(dn, 1); forest = talloc_strndup(mem_ctx, (const char *) val->data, val->length); if (forest == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strndup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strndup failed.\n"); ret = ENOMEM; goto done; } @@ -555,7 +555,7 @@ static errno_t ipa_subdom_store(struct sss_domain_info *parent,
ret = sysdb_attrs_get_string(attrs, IPA_CN, &name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
@@ -567,13 +567,13 @@ static errno_t ipa_subdom_store(struct sss_domain_info *parent,
ret = sysdb_attrs_get_string(attrs, IPA_FLATNAME, &flat); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
ret = sysdb_attrs_get_string(attrs, IPA_TRUSTED_DOMAIN_SID, &id); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; }
@@ -588,7 +588,7 @@ static errno_t ipa_subdom_store(struct sss_domain_info *parent, ret = sysdb_subdomain_store(parent->sysdb, name, realm, flat, id, mpg, enumerate, forest); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_subdomain_store failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_subdomain_store failed.\n"); goto done; }
@@ -623,7 +623,7 @@ static errno_t ipa_subdomains_refresh(struct ipa_subdomains_ctx *ctx, } ret = sysdb_attrs_get_string(reply[c], IPA_CN, &value); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n"); goto done; } if (strcmp(value, dom->name) == 0) { @@ -654,8 +654,8 @@ static errno_t ipa_subdomains_refresh(struct ipa_subdomains_ctx *ctx, /* Nothing we can do about the errorr. Let's at least try * to reuse the existing domain */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to parse subdom data, " - "will try to use cached subdomain\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to parse subdom data, " + "will try to use cached subdomain\n"); } handled[c] = true; h++; @@ -686,8 +686,8 @@ static errno_t ipa_subdomains_refresh(struct ipa_subdomains_ctx *ctx, ret = ipa_subdom_store(parent, ctx->sdap_id_ctx->opts->idmap_ctx, reply[c], enumerate); if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to parse subdom data, " - "will try to use cached subdomain\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to parse subdom data, " + "will try to use cached subdomain\n"); } }
@@ -767,15 +767,15 @@ static void ipa_subdomains_retrieve(struct ipa_subdomains_ctx *ctx, struct be_re req_ctx->sdap_op = sdap_id_op_create(req_ctx, ctx->sdap_id_ctx->conn->conn_cache); if (req_ctx->sdap_op == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed.\n"); ret = ENOMEM; goto done; }
req = sdap_id_op_connect_send(req_ctx->sdap_op, req_ctx, &ret); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: %d(%s).\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n", + ret, strerror(ret)); goto done; }
@@ -804,14 +804,14 @@ static void ipa_subdomains_get_conn_done(struct tevent_req *req) if (ret) { if (dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No IPA server is available, cannot get the " - "subdomain list while offline\n")); + "No IPA server is available, cannot get the " + "subdomain list while offline\n");
/* FIXME: return saved results ?? */ } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to IPA server: [%d](%s)\n", - ret, strerror(ret))); + "Failed to connect to IPA server: [%d](%s)\n", + ret, strerror(ret)); }
goto fail; @@ -863,7 +863,7 @@ ipa_subdomains_handler_get(struct ipa_subdomains_req_ctx *ctx, SDAP_SEARCH_TIMEOUT), false);
if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send failed.\n"); return ENOMEM; }
@@ -888,7 +888,7 @@ static void ipa_subdomains_handler_done(struct tevent_req *req) ret = sdap_get_generic_recv(req, ctx, &reply_count, &reply); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send request failed.\n"); goto done; }
@@ -915,21 +915,21 @@ static void ipa_subdomains_handler_done(struct tevent_req *req) ret = ipa_subdomains_refresh(ctx->sd_ctx, ctx->reply_count, ctx->reply, &refresh_has_changes); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to refresh subdomains.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to refresh subdomains.\n"); goto done; }
if (refresh_has_changes) { ret = sysdb_update_subdomains(domain); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_update_subdomains failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_update_subdomains failed.\n"); goto done; }
ret = ipa_ad_subdom_refresh(ctx->sd_ctx->be_ctx, ctx->sd_ctx->id_ctx, domain); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_ad_subdom_refresh failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_ad_subdom_refresh failed.\n"); goto done; }
@@ -938,7 +938,7 @@ static void ipa_subdomains_handler_done(struct tevent_req *req) IPA_SERVER_MODE)); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("sss_krb5_write_mappings failed.\n")); + "sss_krb5_write_mappings failed.\n"); /* Just continue */ } } @@ -990,21 +990,21 @@ static void ipa_subdomains_handler_ranges_done(struct tevent_req *req) ret = sdap_get_generic_recv(req, ctx, &reply_count, &reply); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send request failed.\n"); goto done; }
ret = ipa_ranges_parse_results(ctx, reply_count, reply, &range_list); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("ipa_ranges_parse_results request failed.\n")); + "ipa_ranges_parse_results request failed.\n"); goto done; }
ret = sysdb_update_ranges(sysdb, range_list); talloc_free(range_list); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_update_ranges failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_update_ranges failed.\n"); goto done; }
@@ -1017,7 +1017,7 @@ static void ipa_subdomains_handler_ranges_done(struct tevent_req *req) goto done; }
- DEBUG(SSSDBG_OP_FAILURE, ("No search base for ranges available.\n")); + DEBUG(SSSDBG_OP_FAILURE, "No search base for ranges available.\n"); ret = EINVAL;
done: @@ -1040,7 +1040,7 @@ static void ipa_subdomains_handler_master_done(struct tevent_req *req) ret = sdap_get_generic_recv(req, ctx, &reply_count, &reply); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send request failed.\n"); goto done; }
@@ -1072,7 +1072,7 @@ static void ipa_subdomains_handler_master_done(struct tevent_req *req) /* Right now we know there has been an error * and we don't have the master domain record */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Master domain record not found!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Master domain record not found!\n");
if (!ctx->sd_ctx->configured_explicit) { ctx->sd_ctx->disabled_until = time(NULL) + @@ -1114,7 +1114,7 @@ static void ipa_subdom_online_cb(void *pvt)
ctx = talloc_get_type(pvt, struct ipa_subdomains_ctx); if (!ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Bad private pointer\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Bad private pointer\n"); return; }
@@ -1123,7 +1123,7 @@ static void ipa_subdom_online_cb(void *pvt) be_req = be_req_create(ctx, NULL, ctx->be_ctx, ipa_subdom_be_req_callback, NULL); if (be_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_req_create() failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "be_req_create() failed.\n"); return; }
@@ -1133,7 +1133,7 @@ static void ipa_subdom_online_cb(void *pvt) ctx->timer_event = tevent_add_timer(ctx->be_ctx->ev, ctx, tv, ipa_subdom_timer_refresh, ctx); if (!ctx->timer_event) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom timer event\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to add subdom timer event\n"); } }
@@ -1157,7 +1157,7 @@ static errno_t get_config_status(struct be_ctx *be_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -1165,7 +1165,7 @@ static errno_t get_config_status(struct be_ctx *be_ctx, CONFDB_DOMAIN_SUBDOMAINS_PROVIDER, NULL, &tmp_str); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("confdb_get_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "confdb_get_string failed.\n"); goto done; }
@@ -1175,8 +1175,8 @@ static errno_t get_config_status(struct be_ctx *be_ctx, *configured_explicit = true; }
- DEBUG(SSSDBG_TRACE_ALL, ("IPA subdomain provider is configured %s.\n", - *configured_explicit ? "explicit" : "implicit")); + DEBUG(SSSDBG_TRACE_ALL, "IPA subdomain provider is configured %s.\n", + *configured_explicit ? "explicit" : "implicit");
ret = EOK;
@@ -1202,7 +1202,7 @@ void ipa_subdomains_handler(struct be_req *be_req) now = time(NULL);
if (ctx->disabled_until > now) { - DEBUG(SSSDBG_TRACE_ALL, ("Subdomain provider disabled.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Subdomain provider disabled.\n"); be_req_terminate(be_req, DP_ERR_OK, EOK, NULL); return; } @@ -1231,13 +1231,13 @@ int ipa_subdom_init(struct be_ctx *be_ctx,
ret = get_config_status(be_ctx, &configured_explicit); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("get_config_status failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_config_status failed.\n"); return ret; }
ctx = talloc_zero(id_ctx, struct ipa_subdomains_ctx); if (ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; }
@@ -1254,12 +1254,12 @@ int ipa_subdom_init(struct be_ctx *be_ctx,
ret = be_add_online_cb(ctx, be_ctx, ipa_subdom_online_cb, ctx, NULL); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom online callback")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to add subdom online callback"); }
ret = be_add_offline_cb(ctx, be_ctx, ipa_subdom_offline_cb, ctx, NULL); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to add subdom offline callback")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to add subdom offline callback"); }
return EOK; @@ -1284,9 +1284,9 @@ int ipa_ad_subdom_init(struct be_ctx *be_ctx, CONFDB_DEFAULT_FULL_NAME_FORMAT) != 0) && (strcmp(be_ctx->domain->names->fq_fmt, CONFDB_DEFAULT_FULL_NAME_FORMAT_INTERNAL) != 0)) { - DEBUG(SSSDBG_FATAL_FAILURE, ("%s is set to a non-default value [%s] " \ + DEBUG(SSSDBG_FATAL_FAILURE, "%s is set to a non-default value [%s] " \ "lookups of subdomain users will likely fail!\n", - CONFDB_FULL_NAME_FORMAT, be_ctx->domain->names->fq_fmt)); + CONFDB_FULL_NAME_FORMAT, be_ctx->domain->names->fq_fmt); sss_log(SSS_LOG_ERR, "%s is set to a non-default value [%s] " \ "lookups of subdomain users will likely fail!\n", CONFDB_FULL_NAME_FORMAT, be_ctx->domain->names->fq_fmt); @@ -1295,13 +1295,13 @@ int ipa_ad_subdom_init(struct be_ctx *be_ctx,
realm = dp_opt_get_string(id_ctx->ipa_options->basic, IPA_KRB5_REALM); if (realm == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No Kerberos realm for IPA?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No Kerberos realm for IPA?\n"); return EINVAL; }
hostname = dp_opt_get_string(id_ctx->ipa_options->basic, IPA_HOSTNAME); if (hostname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No host name for IPA?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No host name for IPA?\n"); return EINVAL; }
diff --git a/src/providers/ipa/ipa_subdomains_ext_groups.c b/src/providers/ipa/ipa_subdomains_ext_groups.c index 7df3dbb..1d0c260 100644 --- a/src/providers/ipa/ipa_subdomains_ext_groups.c +++ b/src/providers/ipa/ipa_subdomains_ext_groups.c @@ -58,14 +58,14 @@ static errno_t process_ext_groups(TALLOC_CTX *mem_ctx, size_t reply_count,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); ret = ENOMEM; goto done; }
ret = sss_hash_create(mem_ctx, reply_count, &ext_group_hash); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_hash_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_hash_create failed.\n"); goto done; }
@@ -83,7 +83,7 @@ static errno_t process_ext_groups(TALLOC_CTX *mem_ctx, size_t reply_count, } if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sysdb_attrs_get_string_array failed.\n")); + "sysdb_attrs_get_string_array failed.\n"); goto done; }
@@ -95,7 +95,7 @@ static errno_t process_ext_groups(TALLOC_CTX *mem_ctx, size_t reply_count, } if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sysdb_attrs_get_string_array failed.\n")); + "sysdb_attrs_get_string_array failed.\n"); goto done; }
@@ -105,7 +105,7 @@ static errno_t process_ext_groups(TALLOC_CTX *mem_ctx, size_t reply_count, ret = hash_lookup(ext_group_hash, &key, &value); if (ret == HASH_SUCCESS) { if (value.type != HASH_VALUE_PTR) { - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected value type.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected value type.\n"); ret = EINVAL; goto done; } @@ -113,18 +113,18 @@ static errno_t process_ext_groups(TALLOC_CTX *mem_ctx, size_t reply_count, for (m = 0; mof[m] != NULL; m++) { /* hash_enter does not modify m_key.str. */ m_key.str = discard_const(mof[m]); - DEBUG(SSSDBG_TRACE_ALL, ("Adding group [%s] to SID [%s].\n", - m_key.str, key.str)); + DEBUG(SSSDBG_TRACE_ALL, "Adding group [%s] to SID [%s].\n", + m_key.str, key.str); ret = hash_enter(value.ptr, &m_key, &m_value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed.\n"); goto done; } } } else if (ret == HASH_ERROR_KEY_NOT_FOUND) { ret = sss_hash_create(ext_group_hash, 5, &m_hash); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_hash_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_hash_create failed.\n"); goto done; }
@@ -132,26 +132,26 @@ static errno_t process_ext_groups(TALLOC_CTX *mem_ctx, size_t reply_count, value.ptr = m_hash;
DEBUG(SSSDBG_TRACE_ALL, - ("Adding SID [%s] to external group hash.\n", key.str)); + "Adding SID [%s] to external group hash.\n", key.str); ret = hash_enter(ext_group_hash, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed.\n"); goto done; }
for (m = 0; mof[m] != NULL; m++) { /* hash_enter does not modify m_key.str. */ m_key.str = discard_const(mof[m]); - DEBUG(SSSDBG_TRACE_ALL, ("Adding group [%s] to SID [%s].\n", - m_key.str, key.str)); + DEBUG(SSSDBG_TRACE_ALL, "Adding group [%s] to SID [%s].\n", + m_key.str, key.str); ret = hash_enter(m_hash, &m_key, &m_value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed.\n"); goto done; } } } else { - DEBUG(SSSDBG_OP_FAILURE, ("hash_lookup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "hash_lookup failed.\n"); goto done; } } @@ -199,20 +199,20 @@ static errno_t find_ipa_ext_memberships(TALLOC_CTX *mem_ctx, ret = sysdb_initgroups(tmp_ctx, user_dom->sysdb, user_dom, user_name, &result); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_initgroups failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_initgroups failed.\n"); goto done; }
if (result->count == 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("User [%s] not found in cache.\n", - user_name)); + DEBUG(SSSDBG_MINOR_FAILURE, "User [%s] not found in cache.\n", + user_name); ret = EOK; goto done; }
ret = sss_hash_create(tmp_ctx, 10, &group_hash); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_hash_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_hash_create failed.\n"); goto done; }
@@ -225,20 +225,20 @@ static errno_t find_ipa_ext_memberships(TALLOC_CTX *mem_ctx, sid = ldb_msg_find_attr_as_string(result->msgs[c], SYSDB_SID_STR, NULL); if (sid == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Group [%s] does not have a SID.\n", - ldb_dn_get_linearized(result->msgs[c]->dn))); + DEBUG(SSSDBG_MINOR_FAILURE, "Group [%s] does not have a SID.\n", + ldb_dn_get_linearized(result->msgs[c]->dn)); continue; }
key.str = discard_const(sid); ret = hash_lookup(ext_group_hash, &key, &value); if (ret == HASH_ERROR_KEY_NOT_FOUND) { - DEBUG(SSSDBG_TRACE_ALL, ("SID [%s] not found in ext group hash.\n", - sid)); + DEBUG(SSSDBG_TRACE_ALL, "SID [%s] not found in ext group hash.\n", + sid); } else if (ret == HASH_SUCCESS) { iter = new_hash_iter_context(value.ptr); if (iter == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("new_hash_iter_context failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "new_hash_iter_context failed.\n"); ret = EINVAL; goto done; } @@ -246,35 +246,35 @@ static errno_t find_ipa_ext_memberships(TALLOC_CTX *mem_ctx, while ((entry = iter->next(iter)) != NULL) { ret = hash_enter(group_hash, &entry->key, &entry->value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to add group [%s].\n", - entry->key.str)); + DEBUG(SSSDBG_OP_FAILURE, "Failed to add group [%s].\n", + entry->key.str); } }
talloc_free(iter); } else { - DEBUG(SSSDBG_OP_FAILURE, ("hash_lookup failed for SID [%s].\n", - sid)); + DEBUG(SSSDBG_OP_FAILURE, "hash_lookup failed for SID [%s].\n", + sid); } }
g_count = hash_count(group_hash); if (g_count == 0) { - DEBUG(SSSDBG_TRACE_FUNC, ("No external groupmemberships found.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No external groupmemberships found.\n"); ret = EOK; goto done; }
groups = talloc_zero_array(mem_ctx, char *, g_count + 1); if (groups == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n"); ret = ENOMEM; goto done; }
iter = new_hash_iter_context(group_hash); if (iter == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("new_hash_iter_context failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "new_hash_iter_context failed.\n"); ret = EINVAL; goto done; } @@ -283,7 +283,7 @@ static errno_t find_ipa_ext_memberships(TALLOC_CTX *mem_ctx, while ((entry = iter->next(iter)) != NULL) { groups[c] = talloc_strdup(groups, entry->key.str); if (groups[c] == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -292,7 +292,7 @@ static errno_t find_ipa_ext_memberships(TALLOC_CTX *mem_ctx,
user_dn = ldb_dn_copy(mem_ctx, result->msgs[0]->dn); if (user_dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_dn_copy failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_dn_copy failed.\n"); ret = ENOMEM; goto done; } @@ -325,7 +325,7 @@ static errno_t add_ad_user_to_cached_groups(struct ldb_dn *user_dn,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -336,7 +336,7 @@ static errno_t add_ad_user_to_cached_groups(struct ldb_dn *user_dn,
subfilter = talloc_asprintf(tmp_ctx, "(%s=%s)", SYSDB_ORIG_DN, groups[c]); if (subfilter == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -345,12 +345,12 @@ static errno_t add_ad_user_to_cached_groups(struct ldb_dn *user_dn, subfilter, NULL, &msgs_count, &msgs); if (ret != EOK) { if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_ALL, ("Group [%s] not in the cache.\n", - groups[c])); + DEBUG(SSSDBG_TRACE_ALL, "Group [%s] not in the cache.\n", + groups[c]); *missing_groups = true; continue; } else { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_entry failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_entry failed.\n"); goto done; } } @@ -361,13 +361,13 @@ static errno_t add_ad_user_to_cached_groups(struct ldb_dn *user_dn, ret = sysdb_mod_group_member(group_dom->sysdb, user_dn, msgs[0]->dn, LDB_FLAG_MOD_ADD); if (ret != EOK && ret != EEXIST) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_mod_group_member failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_mod_group_member failed.\n"); goto done; }
user_attrs = sysdb_new_attrs(tmp_ctx); if (user_attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; } @@ -375,14 +375,14 @@ static errno_t add_ad_user_to_cached_groups(struct ldb_dn *user_dn, ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_MEMBEROF, groups[c]); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
ret = sysdb_set_entry_attr(user_dom->sysdb, user_dn, user_attrs, LDB_FLAG_MOD_ADD); if (ret != EOK && ret != EEXIST) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_set_entry_attr failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_set_entry_attr failed.\n"); goto done; }
@@ -442,7 +442,7 @@ struct tevent_req *ipa_get_ad_memberships_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct get_ad_membership_state); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("tevent_req_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "tevent_req_create failed.\n"); return NULL; }
@@ -455,14 +455,14 @@ struct tevent_req *ipa_get_ad_memberships_send(TALLOC_CTX *mem_ctx,
if ((ar->entry_type & BE_REQ_TYPE_MASK) != BE_REQ_INITGROUPS || ar->filter_type != BE_FILTER_NAME) { - DEBUG(SSSDBG_OP_FAILURE, ("Unsupported request type.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unsupported request type.\n"); ret = EINVAL; goto done; }
state->user_name = talloc_strdup(state, ar->filter_value); if (state->user_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_Strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_Strdup failed.\n"); ret = ENOMEM; goto done; } @@ -470,7 +470,7 @@ struct tevent_req *ipa_get_ad_memberships_send(TALLOC_CTX *mem_ctx, state->sdap_op = sdap_id_op_create(state, state->sdap_id_ctx->conn->conn_cache); if (state->sdap_op == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto done; } @@ -480,21 +480,21 @@ struct tevent_req *ipa_get_ad_memberships_send(TALLOC_CTX *mem_ctx, server_mode->ext_groups = talloc_zero(server_mode, struct ipa_ext_groups); if (server_mode->ext_groups == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); ret = ENOMEM; goto done; } }
if (server_mode->ext_groups->next_update > time(NULL)) { - DEBUG(SSSDBG_TRACE_FUNC, ("External group information still valid.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "External group information still valid.\n"); ret = ipa_add_ext_groups_step(req); if (ret == EOK) { goto done; } else if (ret == EAGAIN) { return req; } else { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_add_ext_groups_step failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_add_ext_groups_step failed.\n"); goto done; }
@@ -502,8 +502,8 @@ struct tevent_req *ipa_get_ad_memberships_send(TALLOC_CTX *mem_ctx,
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: %d(%s).\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n", + ret, strerror(ret)); goto done; }
@@ -538,11 +538,11 @@ static void ipa_get_ad_memberships_connect_done(struct tevent_req *subreq) if (ret != EOK) { if (state->dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No IPA server is available, going offline\n")); + "No IPA server is available, going offline\n"); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to IPA server: [%d](%s)\n", - ret, strerror(ret))); + "Failed to connect to IPA server: [%d](%s)\n", + ret, strerror(ret)); }
goto fail; @@ -551,7 +551,7 @@ static void ipa_get_ad_memberships_connect_done(struct tevent_req *subreq)
ret = domain_to_basedn(state, state->domain, &basedn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("domain_to_basedn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "domain_to_basedn failed.\n"); goto fail; }
@@ -563,7 +563,7 @@ static void ipa_get_ad_memberships_connect_done(struct tevent_req *subreq) SDAP_ENUM_SEARCH_TIMEOUT), false); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_get_generic_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_get_generic_send failed.\n"); ret = ENOMEM; goto fail; } @@ -589,18 +589,18 @@ static void ipa_get_ext_groups_done(struct tevent_req *subreq) &state->reply_count, &state->reply); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_get_ext_groups request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_get_ext_groups request failed.\n"); tevent_req_error(req, ret); return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("[%zu] external groups found.\n", - state->reply_count)); + DEBUG(SSSDBG_TRACE_FUNC, "[%zu] external groups found.\n", + state->reply_count);
ret = process_ext_groups(state->server_mode->ext_groups, state->reply_count, state->reply, &ext_group_hash); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("process_ext_groups failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "process_ext_groups failed.\n"); goto fail; }
@@ -615,7 +615,7 @@ static void ipa_get_ext_groups_done(struct tevent_req *subreq) } else if (ret == EAGAIN) { return; } else { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_add_ext_groups_step failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_add_ext_groups_step failed.\n"); goto fail; }
@@ -637,12 +637,12 @@ static errno_t ipa_add_ext_groups_step(struct tevent_req *req) state->server_mode->ext_groups->ext_groups, &user_dn, &groups); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("find_ipa_ext_memberships failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_ipa_ext_memberships failed.\n"); goto fail; }
if (groups == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("No external groups memberships found.\n")); + DEBUG(SSSDBG_TRACE_ALL, "No external groups memberships found.\n"); state->dp_error = DP_ERR_OK; return EOK; } @@ -651,7 +651,7 @@ static errno_t ipa_add_ext_groups_step(struct tevent_req *req) user_dn, state->user_dom, groups, state->sdap_id_ctx->be->domain); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_add_ad_memberships_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_add_ad_memberships_send failed.\n"); ret = ENOMEM; goto fail; } @@ -675,7 +675,7 @@ static void ipa_add_ad_memberships_done(struct tevent_req *subreq) ret = ipa_add_ad_memberships_recv(subreq, &state->dp_error); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ipa_add_ad_memberships request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ipa_add_ad_memberships request failed.\n"); tevent_req_error(req, ret); return; } @@ -731,7 +731,7 @@ static struct tevent_req *ipa_add_ad_memberships_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct add_ad_membership_state); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("tevent_req_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "tevent_req_create failed.\n"); return NULL; }
@@ -752,12 +752,12 @@ static struct tevent_req *ipa_add_ad_memberships_send(TALLOC_CTX *mem_ctx, ret = add_ad_user_to_cached_groups(user_dn, user_dom, group_dom, groups, &missing_groups); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("add_ad_user_to_cached_groups failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "add_ad_user_to_cached_groups failed.\n"); goto done; }
if (!missing_groups) { - DEBUG(SSSDBG_TRACE_ALL, ("All groups found in cache.\n")); + DEBUG(SSSDBG_TRACE_ALL, "All groups found in cache.\n"); ret = EOK; goto done; } @@ -765,15 +765,15 @@ static struct tevent_req *ipa_add_ad_memberships_send(TALLOC_CTX *mem_ctx, state->sdap_op = sdap_id_op_create(state, state->sdap_id_ctx->conn->conn_cache); if (state->sdap_op == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto done; }
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: %d(%s).\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: %d(%s).\n", + ret, strerror(ret)); goto done; }
@@ -807,11 +807,11 @@ static void ipa_add_ad_memberships_connect_done(struct tevent_req *subreq) if (ret != EOK) { if (state->dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No IPA server is available, going offline\n")); + "No IPA server is available, going offline\n"); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to IPA server: [%d](%s)\n", - ret, strerror(ret))); + "Failed to connect to IPA server: [%d](%s)\n", + ret, strerror(ret)); }
tevent_req_error(req, ret); @@ -842,14 +842,14 @@ static void ipa_add_ad_memberships_get_next(struct tevent_req *req) state->group_dom, state->groups, &missing_groups); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("add_ad_user_to_cached_groups failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "add_ad_user_to_cached_groups failed.\n"); goto fail; }
if (missing_groups) { - DEBUG(SSSDBG_CRIT_FAILURE, ("There are unresolved external group " \ + DEBUG(SSSDBG_CRIT_FAILURE, "There are unresolved external group " \ "memberships even after all groups have " \ - "been looked up on the LDAP server.")); + "been looked up on the LDAP server."); } tevent_req_done(req); return; @@ -858,7 +858,7 @@ static void ipa_add_ad_memberships_get_next(struct tevent_req *req) group_dn = ldb_dn_new(state, sysdb_ctx_get_ldb(state->group_dom->sysdb), state->groups[state->iter]); if (group_dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_dn_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_dn_new failed.\n"); ret = ENOMEM; goto fail; } @@ -874,7 +874,7 @@ static void ipa_add_ad_memberships_get_next(struct tevent_req *req) BE_FILTER_NAME, BE_ATTR_CORE, false); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("groups_get_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "groups_get_send failed.\n"); ret = ENOMEM; goto fail; } @@ -897,8 +897,8 @@ static void ipa_add_ad_memberships_get_group_done(struct tevent_req *subreq) ret = groups_get_recv(subreq, &state->dp_error, NULL); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to read group [%s] from LDAP [%d](%s)\n", - state->groups[state->iter], ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to read group [%s] from LDAP [%d](%s)\n", + state->groups[state->iter], ret, strerror(ret));
tevent_req_error(req, ret); return; diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c index c29a2a3..22cfb99 100644 --- a/src/providers/ipa/ipa_subdomains_id.c +++ b/src/providers/ipa/ipa_subdomains_id.c @@ -69,7 +69,7 @@ struct tevent_req *ipa_get_subdom_acct_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -77,7 +77,7 @@ struct tevent_req *ipa_get_subdom_acct_send(TALLOC_CTX *memctx, state->domain = find_subdomain_by_name(state->ctx->be->domain, ar->domain, true); if (state->domain == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("find_subdomain_by_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_subdomain_by_name failed.\n"); ret = ENOMEM; goto fail; } @@ -96,14 +96,14 @@ struct tevent_req *ipa_get_subdom_acct_send(TALLOC_CTX *memctx, break; case BE_REQ_INITGROUPS: ret = ENOTSUP; - DEBUG(SSSDBG_TRACE_FUNC, ("Initgroups requests are not handled " \ + DEBUG(SSSDBG_TRACE_FUNC, "Initgroups requests are not handled " \ "by the IPA provider but are resolved " \ "by the responder directly from the " \ - "cache.\n")); + "cache.\n"); break; default: ret = EINVAL; - DEBUG(SSSDBG_OP_FAILURE, ("Invalid sub-domain request type.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Invalid sub-domain request type.\n"); } if (ret != EOK) goto fail;
@@ -142,7 +142,7 @@ static void ipa_get_subdom_acct_connected(struct tevent_req *subreq)
req_input = talloc(state, struct req_input); if (req_input == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -152,7 +152,7 @@ static void ipa_get_subdom_acct_connected(struct tevent_req *subreq) req_input->type = REQ_INP_NAME; req_input->inp.name = talloc_strdup(req_input, state->filter); if (req_input->inp.name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -169,13 +169,13 @@ static void ipa_get_subdom_acct_connected(struct tevent_req *subreq) req_input->type = REQ_INP_SECID; req_input->inp.secid = talloc_strdup(req_input, state->filter); if (req_input->inp.secid == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); tevent_req_error(req, ENOMEM); return; } break; default: - DEBUG(SSSDBG_OP_FAILURE, ("Invalid sub-domain filter type.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Invalid sub-domain filter type.\n"); state->dp_error = dp_error; tevent_req_error(req, EINVAL); return; @@ -362,7 +362,7 @@ ipa_get_ad_acct_ad_part_done(struct tevent_req *subreq) ret = ad_handle_acct_info_recv(subreq, &state->dp_error, NULL); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("AD lookup failed: %d\n", ret)); + DEBUG(SSSDBG_OP_FAILURE, "AD lookup failed: %d\n", ret); tevent_req_error(req, ret); return; } @@ -406,8 +406,8 @@ ipa_get_ad_acct_done(struct tevent_req *subreq) ret = ipa_get_ad_memberships_recv(subreq, &state->dp_error); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("IPA external groups lookup failed: %d\n", - ret)); + DEBUG(SSSDBG_OP_FAILURE, "IPA external groups lookup failed: %d\n", + ret); tevent_req_error(req, ret); return; } diff --git a/src/providers/ipa/ipa_sudo.c b/src/providers/ipa/ipa_sudo.c index 726b116..4863aa5 100644 --- a/src/providers/ipa/ipa_sudo.c +++ b/src/providers/ipa/ipa_sudo.c @@ -34,7 +34,7 @@ int ipa_sudo_init(struct be_ctx *be_ctx, struct ipa_options *ipa_options; struct sdap_options *ldap_options;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing sudo IPA back end\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing sudo IPA back end\n");
/* * SDAP_SUDO_SEARCH_BASE has already been initialized in @@ -42,8 +42,8 @@ int ipa_sudo_init(struct be_ctx *be_ctx, */ ret = sdap_sudo_init(be_ctx, id_ctx->sdap_id_ctx, ops, pvt_data); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot initialize LDAP SUDO [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize LDAP SUDO [%d]: %s\n", + ret, strerror(ret)); return ret; }
diff --git a/src/providers/krb5/krb5_access.c b/src/providers/krb5/krb5_access.c index 479d015..d4dc464 100644 --- a/src/providers/krb5/krb5_access.c +++ b/src/providers/krb5/krb5_access.c @@ -54,7 +54,7 @@ struct tevent_req *krb5_access_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct krb5_access_state); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; }
@@ -66,19 +66,19 @@ struct tevent_req *krb5_access_send(TALLOC_CTX *mem_ctx,
ret = krb5_setup(state, pd, krb5_ctx, &state->kr); if (ret != EOK) { - DEBUG(1, ("krb5_setup failed.\n")); + DEBUG(1, "krb5_setup failed.\n"); goto done; }
if (pd->cmd != SSS_PAM_ACCT_MGMT) { - DEBUG(1, ("Unexpected pam task.\n")); + DEBUG(1, "Unexpected pam task.\n"); ret = EINVAL; goto done; }
attrs = talloc_array(state, const char *, 5); if (attrs == NULL) { - DEBUG(1, ("talloc_array failed.\n")); + DEBUG(1, "talloc_array failed.\n"); ret = ENOMEM; goto done; } @@ -92,13 +92,13 @@ struct tevent_req *krb5_access_send(TALLOC_CTX *mem_ctx, ret = sysdb_get_user_attr(state, be_ctx->domain->sysdb, be_ctx->domain, state->pd->user, attrs, &res); if (ret) { - DEBUG(5, ("sysdb search for upn of user [%s] failed.\n", pd->user)); + DEBUG(5, "sysdb search for upn of user [%s] failed.\n", pd->user); goto done; }
switch (res->count) { case 0: - DEBUG(5, ("No attributes for user [%s] found.\n", pd->user)); + DEBUG(5, "No attributes for user [%s] found.\n", pd->user); ret = ENOENT; goto done; break; @@ -107,14 +107,14 @@ struct tevent_req *krb5_access_send(TALLOC_CTX *mem_ctx, be_ctx->domain, pd->user, pd->domain, &state->kr->upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("find_or_guess_upn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_or_guess_upn failed.\n"); goto done; }
state->kr->uid = ldb_msg_find_attr_as_uint64(res->msgs[0], SYSDB_UIDNUM, 0); if (state->kr->uid == 0) { - DEBUG(4, ("UID for user [%s] not known.\n", pd->user)); + DEBUG(4, "UID for user [%s] not known.\n", pd->user); ret = ENOENT; goto done; } @@ -122,14 +122,14 @@ struct tevent_req *krb5_access_send(TALLOC_CTX *mem_ctx, state->kr->gid = ldb_msg_find_attr_as_uint64(res->msgs[0], SYSDB_GIDNUM, 0); if (state->kr->gid == 0) { - DEBUG(4, ("GID for user [%s] not known.\n", pd->user)); + DEBUG(4, "GID for user [%s] not known.\n", pd->user); ret = ENOENT; goto done; }
break; default: - DEBUG(1, ("User search for [%s] returned > 1 results!\n", pd->user)); + DEBUG(1, "User search for [%s] returned > 1 results!\n", pd->user); ret = EINVAL; goto done; break; @@ -137,7 +137,7 @@ struct tevent_req *krb5_access_send(TALLOC_CTX *mem_ctx,
subreq = handle_child_send(state, state->ev, state->kr); if (subreq == NULL) { - DEBUG(1, ("handle_child_send failed.\n")); + DEBUG(1, "handle_child_send failed.\n"); ret = ENOMEM; goto done; } @@ -168,12 +168,12 @@ static void krb5_access_done(struct tevent_req *subreq) ret = handle_child_recv(subreq, state, &buf, &len); talloc_free(subreq); if (ret != EOK) { - DEBUG(1, ("child failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "child failed [%d][%s].\n", ret, strerror(ret)); goto fail; }
if ((size_t) len != sizeof(int32_t)) { - DEBUG(1, ("message has the wrong size.\n")); + DEBUG(1, "message has the wrong size.\n"); ret = EINVAL; goto fail; } diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c index a4183dc..7633c67 100644 --- a/src/providers/krb5/krb5_auth.c +++ b/src/providers/krb5/krb5_auth.c @@ -47,8 +47,8 @@ static errno_t safe_remove_old_ccache_file(const char *old_ccache, if ((old_ccache == new_ccache) || (old_ccache && new_ccache && (strcmp(old_ccache, new_ccache) == 0))) { - DEBUG(SSSDBG_TRACE_FUNC, ("New and old ccache file are the same, " - "none will be deleted.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "New and old ccache file are the same, " + "none will be deleted.\n"); return EOK; }
@@ -71,7 +71,7 @@ check_old_ccache(const char *old_ccache, struct krb5child_req *kr, case ERR_NOT_FOUND: case ENOENT: DEBUG(SSSDBG_TRACE_FUNC, - ("Saved ccache %s doesn't exist.\n", old_ccache)); + "Saved ccache %s doesn't exist.\n", old_ccache); return ENOENT; case EINVAL: /* cache found but no tgt or expired */ @@ -80,14 +80,14 @@ check_old_ccache(const char *old_ccache, struct krb5child_req *kr, break; default: DEBUG(SSSDBG_OP_FAILURE, - ("Cannot check if saved ccache %s is valid\n", - old_ccache)); + "Cannot check if saved ccache %s is valid\n", + old_ccache); return ret; }
ret = check_if_uid_is_active(kr->uid, active); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("check_if_uid_is_active failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "check_if_uid_is_active failed.\n"); return ret; }
@@ -108,17 +108,17 @@ static int krb5_mod_ccname(TALLOC_CTX *mem_ctx, bool in_transaction = false;
if (name == NULL || ccname == NULL) { - DEBUG(1, ("Missing user or ccache name.\n")); + DEBUG(1, "Missing user or ccache name.\n"); return EINVAL; }
if (mod_op != SYSDB_MOD_REP && mod_op != SYSDB_MOD_DEL) { - DEBUG(1, ("Unsupported operation [%d].\n", mod_op)); + DEBUG(1, "Unsupported operation [%d].\n", mod_op); return EINVAL; }
- DEBUG(9, ("%s ccname [%s] for user [%s].\n", - mod_op == SYSDB_MOD_REP ? "Save" : "Delete", ccname, name)); + DEBUG(9, "%s ccname [%s] for user [%s].\n", + mod_op == SYSDB_MOD_REP ? "Save" : "Delete", ccname, name);
tmpctx = talloc_new(mem_ctx); if (!tmpctx) { @@ -133,27 +133,27 @@ static int krb5_mod_ccname(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_add_string(attrs, SYSDB_CCACHE_FILE, ccname); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); goto done; }
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error %d starting transaction (%s)\n", ret, strerror(ret))); + "Error %d starting transaction (%s)\n", ret, strerror(ret)); goto done; } in_transaction = true;
ret = sysdb_set_user_attr(sysdb, domain, name, attrs, mod_op); if (ret != EOK) { - DEBUG(6, ("Error: %d (%s)\n", ret, strerror(ret))); + DEBUG(6, "Error: %d (%s)\n", ret, strerror(ret)); goto done; }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -162,7 +162,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } talloc_zfree(tmpctx); @@ -212,7 +212,7 @@ static struct krb5_ctx *get_krb5_ctx(struct be_req *be_req) struct krb5_ctx); break; default: - DEBUG(1, ("Unsupported PAM task.\n")); + DEBUG(1, "Unsupported PAM task.\n"); return NULL; } } @@ -235,7 +235,7 @@ errno_t krb5_setup(TALLOC_CTX *mem_ctx, struct pam_data *pd,
kr = talloc_zero(mem_ctx, struct krb5child_req); if (kr == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; } kr->is_offline = false; @@ -264,7 +264,7 @@ static void krb5_auth_cache_creds(struct krb5_ctx *krb5_ctx,
ret = sss_authtok_get_password(pd->authtok, &password, NULL); if (ret != EOK) { - DEBUG(0, ("Failed to get password [%d] %s\n", ret, strerror(ret))); + DEBUG(0, "Failed to get password [%d] %s\n", ret, strerror(ret)); *pam_status = PAM_SYSTEM_ERR; *dp_err = DP_ERR_OK; return; @@ -273,7 +273,7 @@ static void krb5_auth_cache_creds(struct krb5_ctx *krb5_ctx, ret = sysdb_cache_auth(sysdb, domain, pd->user, password, cdb, true, NULL, NULL); if (ret != EOK) { - DEBUG(1, ("Offline authentication failed\n")); + DEBUG(1, "Offline authentication failed\n"); *pam_status = cached_login_pam_status(ret); *dp_err = DP_ERR_OK; return; @@ -282,7 +282,7 @@ static void krb5_auth_cache_creds(struct krb5_ctx *krb5_ctx, ret = add_user_to_delayed_online_authentication(krb5_ctx, pd, uid); if (ret != EOK) { /* This error is not fatal */ - DEBUG(1, ("add_user_to_delayed_online_authentication failed.\n")); + DEBUG(1, "add_user_to_delayed_online_authentication failed.\n"); } *pam_status = PAM_AUTHINFO_UNAVAIL; *dp_err = DP_ERR_OFFLINE; @@ -312,13 +312,13 @@ static errno_t krb5_auth_prepare_ccache_name(struct krb5child_req *kr, if (kr->ccname == NULL || (kr->is_offline && !kr->active_ccache && !kr->valid_tgt) || (!kr->is_offline && !kr->active_ccache && kr->pd->cmd != SSS_CMD_RENEW)) { - DEBUG(9, ("Recreating ccache file.\n")); + DEBUG(9, "Recreating ccache file.\n"); ccname_template = dp_opt_get_cstring(kr->krb5_ctx->opts, KRB5_CCNAME_TMPL); kr->ccname = expand_ccname_template(kr, kr, ccname_template, true, be_ctx->domain->case_sensitive); if (kr->ccname == NULL) { - DEBUG(1, ("expand_ccname_template failed.\n")); + DEBUG(1, "expand_ccname_template failed.\n"); return ENOMEM; }
@@ -326,7 +326,7 @@ static errno_t krb5_auth_prepare_ccache_name(struct krb5child_req *kr, kr->krb5_ctx->illegal_path_re, kr->uid, kr->gid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ccache creation failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ccache creation failed.\n"); return ret; } } @@ -356,18 +356,18 @@ static void krb5_auth_store_creds(struct sysdb_ctx *sysdb, ret = sss_authtok_get_password(pd->newauthtok, &password, NULL); break; default: - DEBUG(0, ("unsupported PAM command [%d].\n", pd->cmd)); + DEBUG(0, "unsupported PAM command [%d].\n", pd->cmd); }
if (ret != EOK) { - DEBUG(0, ("Failed to get password [%d] %s\n", ret, strerror(ret))); + DEBUG(0, "Failed to get password [%d] %s\n", ret, strerror(ret)); /* password caching failures are not fatal errors */ return; }
if (password == NULL) { if (pd->cmd != SSS_CMD_RENEW) { - DEBUG(0, ("password not available, offline auth may not work.\n")); + DEBUG(0, "password not available, offline auth may not work.\n"); /* password caching failures are not fatal errors */ } return; @@ -375,8 +375,8 @@ static void krb5_auth_store_creds(struct sysdb_ctx *sysdb,
ret = sysdb_cache_password(sysdb, domain, pd->user, password); if (ret) { - DEBUG(2, ("Failed to cache password, offline auth may not work." - " (%d)[%s]!?\n", ret, strerror(ret))); + DEBUG(2, "Failed to cache password, offline auth may not work." + " (%d)[%s]!?\n", ret, strerror(ret)); /* password caching failures are not fatal errors */ } } @@ -420,7 +420,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct krb5_auth_state); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; }
@@ -434,7 +434,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx,
ret = get_domain_or_subdomain(be_ctx, pd->domain, &state->domain); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("get_domain_or_subdomain failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_domain_or_subdomain failed.\n"); goto done; }
@@ -449,8 +449,8 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, /* handle empty password gracefully */ if (authtok_type == SSS_AUTHTOK_TYPE_EMPTY) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Illegal zero-length authtok for user [%s]\n", - pd->user)); + "Illegal zero-length authtok for user [%s]\n", + pd->user); state->pam_status = PAM_AUTH_ERR; state->dp_err = DP_ERR_OK; ret = EOK; @@ -458,10 +458,10 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, }
DEBUG(SSSDBG_CRIT_FAILURE, - ("Wrong authtok type for user [%s]. " \ + "Wrong authtok type for user [%s]. " \ "Expected [%d], got [%d]\n", pd->user, SSS_AUTHTOK_TYPE_PASSWORD, - authtok_type)); + authtok_type); state->pam_status = PAM_SYSTEM_ERR; state->dp_err = DP_ERR_FATAL; ret = EINVAL; @@ -472,7 +472,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, if (pd->priv == 1 && authtok_type != SSS_AUTHTOK_TYPE_PASSWORD) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Password reset by root is not supported.\n")); + "Password reset by root is not supported.\n"); state->pam_status = PAM_PERM_DENIED; state->dp_err = DP_ERR_OK; ret = EOK; @@ -482,10 +482,10 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, case SSS_CMD_RENEW: if (authtok_type != SSS_AUTHTOK_TYPE_CCFILE) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Wrong authtok type for user [%s]. " \ + "Wrong authtok type for user [%s]. " \ "Expected [%d], got [%d]\n", pd->user, SSS_AUTHTOK_TYPE_CCFILE, - authtok_type)); + authtok_type); state->pam_status = PAM_SYSTEM_ERR; state->dp_err = DP_ERR_FATAL; ret = EINVAL; @@ -493,7 +493,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, } break; default: - DEBUG(4, ("Unexpected pam task %d.\n", pd->cmd)); + DEBUG(4, "Unexpected pam task %d.\n", pd->cmd); state->pam_status = PAM_SYSTEM_ERR; state->dp_err = DP_ERR_FATAL; ret = EINVAL; @@ -503,8 +503,8 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, if (be_is_offline(be_ctx) && (pd->cmd == SSS_PAM_CHAUTHTOK || pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM || pd->cmd == SSS_CMD_RENEW)) { - DEBUG(9, ("Password changes and ticket renewal are not possible " - "while offline.\n")); + DEBUG(9, "Password changes and ticket renewal are not possible " + "while offline.\n"); state->pam_status = PAM_AUTHINFO_UNAVAIL; state->dp_err = DP_ERR_OFFLINE; ret = EOK; @@ -527,7 +527,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx,
ret = krb5_setup(state, pd, krb5_ctx, &state->kr); if (ret != EOK) { - DEBUG(1, ("krb5_setup failed.\n")); + DEBUG(1, "krb5_setup failed.\n"); goto done; } kr = state->kr; @@ -535,7 +535,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, ret = sysdb_get_user_attr(state, state->sysdb, state->domain, state->pd->user, attrs, &res); if (ret) { - DEBUG(5, ("sysdb search for upn of user [%s] failed.\n", pd->user)); + DEBUG(5, "sysdb search for upn of user [%s] failed.\n", pd->user); state->pam_status = PAM_SYSTEM_ERR; state->dp_err = DP_ERR_OK; goto done; @@ -543,14 +543,14 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx,
realm = dp_opt_get_cstring(krb5_ctx->opts, KRB5_REALM); if (realm == NULL) { - DEBUG(1, ("Missing Kerberos realm.\n")); + DEBUG(1, "Missing Kerberos realm.\n"); ret = ENOENT; goto done; }
switch (res->count) { case 0: - DEBUG(5, ("No attributes for user [%s] found.\n", pd->user)); + DEBUG(5, "No attributes for user [%s] found.\n", pd->user); ret = ENOENT; goto done; break; @@ -560,33 +560,33 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, be_ctx->domain, pd->user, pd->domain, &kr->upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("find_or_guess_upn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_or_guess_upn failed.\n"); goto done; }
ret = compare_principal_realm(kr->upn, realm, &kr->upn_from_different_realm); if (ret != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("compare_principal_realm failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "compare_principal_realm failed.\n"); goto done; }
kr->homedir = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_HOMEDIR, NULL); if (kr->homedir == NULL) { - DEBUG(4, ("Home directory for user [%s] not known.\n", pd->user)); + DEBUG(4, "Home directory for user [%s] not known.\n", pd->user); }
kr->uid = ldb_msg_find_attr_as_uint64(res->msgs[0], SYSDB_UIDNUM, 0); if (kr->uid == 0) { - DEBUG(4, ("UID for user [%s] not known.\n", pd->user)); + DEBUG(4, "UID for user [%s] not known.\n", pd->user); ret = ENOENT; goto done; }
kr->gid = ldb_msg_find_attr_as_uint64(res->msgs[0], SYSDB_GIDNUM, 0); if (kr->gid == 0) { - DEBUG(4, ("GID for user [%s] not known.\n", pd->user)); + DEBUG(4, "GID for user [%s] not known.\n", pd->user); ret = ENOENT; goto done; } @@ -600,28 +600,28 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, &kr->valid_tgt); if (ret == ENOENT) { DEBUG(SSSDBG_FUNC_DATA, - ("Ignoring ccache attribute [%s], because it doesn't" - "exist.\n", ccache_file)); + "Ignoring ccache attribute [%s], because it doesn't" + "exist.\n", ccache_file); ccache_file = NULL; } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("check_if_ccache_file_is_used failed.\n")); + "check_if_ccache_file_is_used failed.\n"); ccache_file = NULL; } } else { kr->active_ccache = false; kr->valid_tgt = false; - DEBUG(4, ("No ccache file for user [%s] found.\n", pd->user)); + DEBUG(4, "No ccache file for user [%s] found.\n", pd->user); } - DEBUG(9, ("Ccache_file is [%s] and is %s active and TGT is %s valid.\n", + DEBUG(9, "Ccache_file is [%s] and is %s active and TGT is %s valid.\n", ccache_file ? ccache_file : "not set", kr->active_ccache ? "" : "not", - kr->valid_tgt ? "" : "not")); + kr->valid_tgt ? "" : "not"); if (ccache_file != NULL) { kr->ccname = ccache_file; kr->old_ccname = talloc_strdup(kr, ccache_file); if (kr->old_ccname == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -632,7 +632,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, break;
default: - DEBUG(1, ("User search for (%s) returned > 1 results!\n", pd->user)); + DEBUG(1, "User search for (%s) returned > 1 results!\n", pd->user); ret = EINVAL; goto done; break; @@ -646,7 +646,7 @@ struct tevent_req *krb5_auth_send(TALLOC_CTX *mem_ctx, state->krb5_ctx->service->name, state->kr->srv == NULL ? true : false); if (!subreq) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed resolver request.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed resolver request.\n"); ret = EIO; goto done; } @@ -704,7 +704,7 @@ static void krb5_auth_resolve_done(struct tevent_req *subreq) if (kr->pd->cmd == SSS_PAM_CHAUTHTOK || kr->pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM) { DEBUG(SSSDBG_TRACE_FUNC, - ("No KDC suitable for password change is available\n")); + "No KDC suitable for password change is available\n"); state->pam_status = PAM_AUTHTOK_LOCK_BUSY; state->dp_err = DP_ERR_OK; ret = EOK; @@ -718,7 +718,7 @@ static void krb5_auth_resolve_done(struct tevent_req *subreq) state->krb5_ctx->kpasswd_service->name, kr->kpasswd_srv == NULL ? true : false); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Resolver request failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Resolver request failed.\n"); ret = EIO; goto done; } @@ -734,21 +734,21 @@ static void krb5_auth_resolve_done(struct tevent_req *subreq) }
if (kr->is_offline) { - DEBUG(9, ("Preparing for offline operation.\n")); + DEBUG(9, "Preparing for offline operation.\n");
if (kr->valid_tgt || kr->active_ccache) { - DEBUG(9, ("Valid TGT available or " - "ccache file is already in use.\n")); + DEBUG(9, "Valid TGT available or " + "ccache file is already in use.\n"); kr->ccname = kr->old_ccname; msg = talloc_asprintf(kr->pd, "%s=%s", CCACHE_ENV_NAME, kr->ccname); if (msg == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); } else { ret = pam_add_response(kr->pd, SSS_PAM_ENV_ITEM, strlen(msg) + 1, (uint8_t *) msg); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } }
@@ -785,7 +785,7 @@ static void krb5_auth_resolve_done(struct tevent_req *subreq)
subreq = handle_child_send(state, state->ev, kr); if (subreq == NULL) { - DEBUG(1, ("handle_child_send failed.\n")); + DEBUG(1, "handle_child_send failed.\n"); ret = ENOMEM; goto done; } @@ -820,7 +820,7 @@ static void krb5_auth_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret == ETIMEDOUT) {
- DEBUG(1, ("child timed out!\n")); + DEBUG(1, "child timed out!\n");
switch (pd->cmd) { case SSS_PAM_AUTHENTICATE: @@ -840,7 +840,7 @@ static void krb5_auth_done(struct tevent_req *subreq) break; } default: - DEBUG(1, ("Unexpected PAM task\n")); + DEBUG(1, "Unexpected PAM task\n"); ret = EINVAL; goto done; } @@ -851,7 +851,7 @@ static void krb5_auth_done(struct tevent_req *subreq) state->krb5_ctx->service->name, search_srv == NULL ? true : false); if (subreq == NULL) { - DEBUG(1, ("Failed resolved request.\n")); + DEBUG(1, "Failed resolved request.\n"); ret = ENOMEM; goto done; } @@ -860,7 +860,7 @@ static void krb5_auth_done(struct tevent_req *subreq)
} else if (ret != EOK) {
- DEBUG(1, ("child failed (%d [%s])\n", ret, strerror(ret))); + DEBUG(1, "child failed (%d [%s])\n", ret, strerror(ret)); goto done; }
@@ -870,8 +870,8 @@ static void krb5_auth_done(struct tevent_req *subreq) state->be_ctx->domain->pwd_expiration_warning, &res); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not parse child response [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not parse child response [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -896,7 +896,7 @@ static void krb5_auth_done(struct tevent_req *subreq) talloc_free(kr->upn); kr->upn = talloc_strdup(kr, res->correct_upn); if (kr->upn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -905,14 +905,14 @@ static void krb5_auth_done(struct tevent_req *subreq) pd->user, res->correct_upn); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("check_if_cached_upn_needs_update failed.\n")); + "check_if_cached_upn_needs_update failed.\n"); goto done; } } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("UPN used in the request [%s] and " \ + DEBUG(SSSDBG_CRIT_FAILURE, "UPN used in the request [%s] and " \ "returned UPN [%s] differ by more " \ "than just the case.\n", - kr->upn, res->correct_upn)); + kr->upn, res->correct_upn); ret = EINVAL; goto done; } @@ -947,7 +947,7 @@ static void krb5_auth_done(struct tevent_req *subreq) state->krb5_ctx->kpasswd_service->name, state->kr->kpasswd_srv == NULL ? true : false); if (subreq == NULL) { - DEBUG(1, ("Resolver request failed.\n")); + DEBUG(1, "Resolver request failed.\n"); ret = ENOMEM; goto done; } @@ -964,7 +964,7 @@ static void krb5_auth_done(struct tevent_req *subreq) state->krb5_ctx->service->name, kr->srv == NULL ? true : false); if (subreq == NULL) { - DEBUG(1, ("Resolver request failed.\n")); + DEBUG(1, "Resolver request failed.\n"); ret = ENOMEM; goto done; } @@ -983,14 +983,14 @@ static void krb5_auth_done(struct tevent_req *subreq) ret = safe_remove_old_ccache_file(kr->old_ccname, NULL, kr->uid, kr->gid); if (ret != EOK) { - DEBUG(1, ("Failed to remove old ccache file [%s], " - "please remove it manually.\n", kr->old_ccname)); + DEBUG(1, "Failed to remove old ccache file [%s], " + "please remove it manually.\n", kr->old_ccname); }
ret = krb5_delete_ccname(state, state->sysdb, state->domain, pd->user, kr->old_ccname); if (ret != EOK) { - DEBUG(1, ("krb5_delete_ccname failed.\n")); + DEBUG(1, "krb5_delete_ccname failed.\n"); } } } @@ -1043,7 +1043,7 @@ static void krb5_auth_done(struct tevent_req *subreq) * We expect that one of the messages in the received buffer contains * the name of the credential cache file. */ if (kr->ccname == NULL) { - DEBUG(1, ("Missing ccache name in child response.\n")); + DEBUG(1, "Missing ccache name in child response.\n"); ret = EINVAL; goto done; } @@ -1051,7 +1051,7 @@ static void krb5_auth_done(struct tevent_req *subreq) ret = sss_krb5_check_ccache_princ(kr->uid, kr->gid, kr->ccname, kr->upn); if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("No ccache for %s in %s?\n", kr->upn, kr->ccname)); + "No ccache for %s in %s?\n", kr->upn, kr->ccname); goto done; }
@@ -1060,15 +1060,15 @@ static void krb5_auth_done(struct tevent_req *subreq) kr->uid, kr->gid); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to remove old ccache file [%s], " - "please remove it manually.\n", kr->old_ccname)); + "Failed to remove old ccache file [%s], " + "please remove it manually.\n", kr->old_ccname); } }
ret = krb5_save_ccname(state, state->sysdb, state->domain, pd->user, kr->ccname); if (ret) { - DEBUG(1, ("krb5_save_ccname failed.\n")); + DEBUG(1, "krb5_save_ccname failed.\n"); goto done; } renew_interval_str = dp_opt_get_string(kr->krb5_ctx->opts, @@ -1077,7 +1077,7 @@ static void krb5_auth_done(struct tevent_req *subreq) ret = krb5_string_to_deltat(renew_interval_str, &renew_interval_delta); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Reading krb5_renew_interval failed.\n")); + "Reading krb5_renew_interval failed.\n"); renew_interval_delta = 0; } renew_interval_time = renew_interval_delta; @@ -1088,12 +1088,12 @@ static void krb5_auth_done(struct tevent_req *subreq) pd->cmd == SSS_PAM_CHAUTHTOK) && (res->tgtt.renew_till > res->tgtt.endtime) && (kr->ccname != NULL)) { - DEBUG(7, ("Adding [%s] for automatic renewal.\n", kr->ccname)); + DEBUG(7, "Adding [%s] for automatic renewal.\n", kr->ccname); ret = add_tgt_to_renew_table(kr->krb5_ctx, kr->ccname, &(res->tgtt), pd, kr->upn); if (ret != EOK) { - DEBUG(1, ("add_tgt_to_renew_table failed, " - "automatic renewal not possible.\n")); + DEBUG(1, "add_tgt_to_renew_table failed, " + "automatic renewal not possible.\n"); } }
@@ -1107,7 +1107,7 @@ static void krb5_auth_done(struct tevent_req *subreq) state->pd, state->kr->uid, &state->pam_status, &state->dp_err); } else { - DEBUG(4, ("Backend is marked offline, retry later!\n")); + DEBUG(4, "Backend is marked offline, retry later!\n"); state->pam_status = PAM_AUTHINFO_UNAVAIL; state->dp_err = DP_ERR_OFFLINE; } @@ -1160,7 +1160,7 @@ void krb5_pam_handler(struct be_req *be_req)
krb5_ctx = get_krb5_ctx(be_req); if (krb5_ctx == NULL) { - DEBUG(1, ("Kerberos context not available.\n")); + DEBUG(1, "Kerberos context not available.\n"); goto done; }
@@ -1171,20 +1171,20 @@ void krb5_pam_handler(struct be_req *be_req) case SSS_PAM_CHAUTHTOK: ret = add_to_wait_queue(be_req, pd, krb5_ctx); if (ret == EOK) { - DEBUG(7, ("Request successfully added to wait queue " - "of user [%s].\n", pd->user)); + DEBUG(7, "Request successfully added to wait queue " + "of user [%s].\n", pd->user); return; } else if (ret == ENOENT) { - DEBUG(7, ("Wait queue of user [%s] is empty, " - "running request immediately.\n", pd->user)); + DEBUG(7, "Wait queue of user [%s] is empty, " + "running request immediately.\n", pd->user); } else { - DEBUG(7, ("Failed to add request to wait queue of user [%s], " - "running request immediately.\n", pd->user)); + DEBUG(7, "Failed to add request to wait queue of user [%s], " + "running request immediately.\n", pd->user); }
req = krb5_auth_send(be_req, be_ctx->ev, be_ctx, pd, krb5_ctx); if (req == NULL) { - DEBUG(1, ("krb5_auth_send failed.\n")); + DEBUG(1, "krb5_auth_send failed.\n"); goto done; }
@@ -1193,7 +1193,7 @@ void krb5_pam_handler(struct be_req *be_req) case SSS_PAM_ACCT_MGMT: req = krb5_access_send(be_req, be_ctx->ev, be_ctx, pd, krb5_ctx); if (req == NULL) { - DEBUG(1, ("krb5_access_send failed.\n")); + DEBUG(1, "krb5_access_send failed.\n"); goto done; }
@@ -1207,7 +1207,7 @@ void krb5_pam_handler(struct be_req *be_req) goto done; break; default: - DEBUG(4, ("krb5 does not handles pam task %d.\n", pd->cmd)); + DEBUG(4, "krb5 does not handles pam task %d.\n", pd->cmd); pd->pam_status = PAM_MODULE_UNKNOWN; dp_err = DP_ERR_OK; goto done; @@ -1243,7 +1243,7 @@ void krb5_pam_handler_auth_done(struct tevent_req *req) if (krb5_ctx != NULL) { check_wait_queue(krb5_ctx, pd->user); } else { - DEBUG(1, ("Kerberos context not available.\n")); + DEBUG(1, "Kerberos context not available.\n"); }
be_req_terminate(be_req, dp_err, pd->pam_status, NULL); @@ -1263,12 +1263,12 @@ static void krb5_pam_handler_access_done(struct tevent_req *req) ret = krb5_access_recv(req, &access_allowed); talloc_zfree(req); if (ret != EOK) { - DEBUG(1, ("krb5_access request failed [%d][%s]\n", ret, strerror(ret))); + DEBUG(1, "krb5_access request failed [%d][%s]\n", ret, strerror(ret)); goto done; }
- DEBUG(7, ("Access %s for user [%s].\n", - access_allowed ? "allowed" : "denied", pd->user)); + DEBUG(7, "Access %s for user [%s].\n", + access_allowed ? "allowed" : "denied", pd->user); pd->pam_status = access_allowed ? PAM_SUCCESS : PAM_PERM_DENIED; dp_err = DP_ERR_OK;
diff --git a/src/providers/krb5/krb5_become_user.c b/src/providers/krb5/krb5_become_user.c index 4d5346f..6ddb35a 100644 --- a/src/providers/krb5/krb5_become_user.c +++ b/src/providers/krb5/krb5_become_user.c @@ -32,12 +32,12 @@ errno_t become_user(uid_t uid, gid_t gid) int ret;
DEBUG(SSSDBG_FUNC_DATA, - ("Trying to become user [%"SPRIuid"][%"SPRIgid"].\n", uid, gid)); + "Trying to become user [%"SPRIuid"][%"SPRIgid"].\n", uid, gid);
/* skip call if we already are the requested user */ cuid = geteuid(); if (uid == cuid) { - DEBUG(SSSDBG_FUNC_DATA, ("Already user [%"SPRIuid"].\n", uid)); + DEBUG(SSSDBG_FUNC_DATA, "Already user [%"SPRIuid"].\n", uid); return EOK; }
@@ -46,7 +46,7 @@ errno_t become_user(uid_t uid, gid_t gid) if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("setgroups failed [%d][%s].\n", ret, strerror(ret))); + "setgroups failed [%d][%s].\n", ret, strerror(ret)); return ret; }
@@ -55,7 +55,7 @@ errno_t become_user(uid_t uid, gid_t gid) if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("setresgid failed [%d][%s].\n", ret, strerror(ret))); + "setresgid failed [%d][%s].\n", ret, strerror(ret)); return ret; }
@@ -65,7 +65,7 @@ errno_t become_user(uid_t uid, gid_t gid) if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("setresuid failed [%d][%s].\n", ret, strerror(ret))); + "setresuid failed [%d][%s].\n", ret, strerror(ret)); return ret; }
@@ -92,22 +92,22 @@ errno_t switch_creds(TALLOC_CTX *mem_ctx, int size; int ret;
- DEBUG(SSSDBG_FUNC_DATA, ("Switch user to [%d][%d].\n", uid, gid)); + DEBUG(SSSDBG_FUNC_DATA, "Switch user to [%d][%d].\n", uid, gid);
if (saved_creds) { /* save current user credentials */ size = getgroups(0, NULL); if (size == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Getgroups failed! (%d, %s)\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Getgroups failed! (%d, %s)\n", + ret, strerror(ret)); goto done; }
ssc = talloc_size(mem_ctx, (sizeof(struct sss_creds) + size * sizeof(gid_t))); if (!ssc) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation failed!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation failed!\n"); ret = ENOMEM; goto done; } @@ -116,8 +116,8 @@ errno_t switch_creds(TALLOC_CTX *mem_ctx, size = getgroups(ssc->num_gids, ssc->gids); if (size == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Getgroups failed! (%d, %s)\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Getgroups failed! (%d, %s)\n", + ret, strerror(ret)); /* free ssc immediately otherwise the code will try to restore * wrong creds */ talloc_zfree(ssc); @@ -137,7 +137,7 @@ errno_t switch_creds(TALLOC_CTX *mem_ctx, if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("setresuid failed [%d][%s].\n", ret, strerror(ret))); + "setresuid failed [%d][%s].\n", ret, strerror(ret)); goto done; } } @@ -151,7 +151,7 @@ errno_t switch_creds(TALLOC_CTX *mem_ctx, if (ret == -1) { ret = errno; DEBUG(SSSDBG_TRACE_FUNC, - ("setgroups failed [%d][%s].\n", ret, strerror(ret))); + "setgroups failed [%d][%s].\n", ret, strerror(ret)); }
/* change gid now, (leaves saved gid to current, so we can restore) */ @@ -159,7 +159,7 @@ errno_t switch_creds(TALLOC_CTX *mem_ctx, if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("setresgid failed [%d][%s].\n", ret, strerror(ret))); + "setresgid failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -169,7 +169,7 @@ errno_t switch_creds(TALLOC_CTX *mem_ctx, if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("setresuid failed [%d][%s].\n", ret, strerror(ret))); + "setresuid failed [%d][%s].\n", ret, strerror(ret)); goto done; } } diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c index 16ab4db..8b56dea 100644 --- a/src/providers/krb5/krb5_child.c +++ b/src/providers/krb5/krb5_child.c @@ -100,8 +100,8 @@ static errno_t sss_send_pac(krb5_authdata **pac_authdata) ret = sss_pac_make_request(SSS_PAC_ADD_PAC_USER, &sss_data, NULL, NULL, &errnop); if (ret != NSS_STATUS_SUCCESS || errnop != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_pac_make_request failed [%d][%d].\n", - ret, errnop)); + DEBUG(SSSDBG_OP_FAILURE, "sss_pac_make_request failed [%d][%d].\n", + ret, errnop); return EIO; }
@@ -124,14 +124,14 @@ static void sss_krb5_expire_callback_func(krb5_context context, void *data,
exp_time = password_expiration - time(NULL); if (exp_time < 0 || exp_time > UINT32_MAX) { - DEBUG(1, ("Time to expire out of range.\n")); + DEBUG(1, "Time to expire out of range.\n"); return; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("exp_time: [%ld]\n", exp_time)); + DEBUG(SSSDBG_TRACE_INTERNAL, "exp_time: [%ld]\n", exp_time);
blob = talloc_array(kr->pd, uint32_t, 2); if (blob == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return; }
@@ -141,7 +141,7 @@ static void sss_krb5_expire_callback_func(krb5_context context, void *data, ret = pam_add_response(kr->pd, SSS_PAM_USER_INFO, 2 * sizeof(uint32_t), (uint8_t *) blob); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return; @@ -324,7 +324,7 @@ static krb5_error_code answer_otp(krb5_context ctx, } if (chl->tokeninfo[i] == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("No tokeninfos found which match our credentials.\n")); + "No tokeninfos found which match our credentials.\n"); ret = EOK; goto done; } @@ -333,7 +333,7 @@ static krb5_error_code answer_otp(krb5_context ctx, /* Don't let SSSD cache the OTP authtok since it is single-use. */ ret = pam_add_response(kr->pd, SSS_OTP, 0, NULL); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); goto done; } } @@ -369,21 +369,21 @@ static krb5_error_code sss_krb5_prompter(krb5_context context, void *data, struct krb5_req *kr = talloc_get_type(data, struct krb5_req);
if (num_prompts != 0) { - DEBUG(1, ("Cannot handle password prompts.\n")); + DEBUG(1, "Cannot handle password prompts.\n"); return KRB5_LIBOS_CANTREADPWD; }
if (banner == NULL || *banner == '\0') { - DEBUG(5, ("Prompter called with empty banner, nothing to do.\n")); + DEBUG(5, "Prompter called with empty banner, nothing to do.\n"); return EOK; }
- DEBUG(SSSDBG_FUNC_DATA, ("Prompter called with [%s].\n", banner)); + DEBUG(SSSDBG_FUNC_DATA, "Prompter called with [%s].\n", banner);
ret = pam_add_response(kr->pd, SSS_PAM_TEXT_MSG, strlen(banner)+1, (const uint8_t *) banner); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return EOK; @@ -399,13 +399,13 @@ static krb5_error_code create_empty_cred(krb5_context ctx, krb5_principal princ,
cred = calloc(sizeof(krb5_creds), 1); if (cred == NULL) { - DEBUG(1, ("calloc failed.\n")); + DEBUG(1, "calloc failed.\n"); return ENOMEM; }
kerr = krb5_copy_principal(ctx, princ, &cred->client); if (kerr != 0) { - DEBUG(1, ("krb5_copy_principal failed.\n")); + DEBUG(1, "krb5_copy_principal failed.\n"); goto done; }
@@ -416,11 +416,11 @@ static krb5_error_code create_empty_cred(krb5_context ctx, krb5_principal princ, KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME, krb5_realm->length, krb5_realm->data, 0); if (kerr != 0) { - DEBUG(1, ("krb5_build_principal_ext failed.\n")); + DEBUG(1, "krb5_build_principal_ext failed.\n"); goto done; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Created empty krb5_creds.\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Created empty krb5_creds.\n");
done: if (kerr != 0) { @@ -466,7 +466,7 @@ static errno_t handle_randomized(char *in) umask(old_umask); if (fd == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("mkstemp("%s") failed!\n", ccname)); + DEBUG(SSSDBG_CRIT_FAILURE, "mkstemp("%s") failed!\n", ccname); return ret; } } @@ -508,7 +508,7 @@ static krb5_error_code create_ccache(char *ccname, krb5_creds *creds) if (kerr) goto done;
type = krb5_cc_get_type(kctx, kcc); - DEBUG(SSSDBG_TRACE_ALL, ("Initializing ccache of type [%s]\n", type)); + DEBUG(SSSDBG_TRACE_ALL, "Initializing ccache of type [%s]\n", type);
#ifdef HAVE_KRB5_CC_COLLECTION if (krb5_cc_support_switch(kctx, type)) { @@ -574,7 +574,7 @@ static errno_t pack_response_packet(TALLOC_CTX *mem_ctx, errno_t error,
buf = talloc_array(mem_ctx, uint8_t, size); if (!buf) { - DEBUG(1, ("Insufficient memory to create message.\n")); + DEBUG(1, "Insufficient memory to create message.\n"); return ENOMEM; }
@@ -586,7 +586,7 @@ static errno_t pack_response_packet(TALLOC_CTX *mem_ctx, errno_t error, safealign_memcpy(&buf[p], pdr->data, pdr->len, &p); }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("response packet size: [%zu]\n", p)); + DEBUG(SSSDBG_TRACE_INTERNAL, "response packet size: [%zu]\n", p);
*_buf = buf; *_len = p; @@ -599,13 +599,13 @@ static errno_t k5c_attach_ccname_msg(struct krb5_req *kr) int ret;
if (kr->ccname == NULL) { - DEBUG(1, ("Error obtaining ccname.\n")); + DEBUG(1, "Error obtaining ccname.\n"); return ERR_INTERNAL; }
msg = talloc_asprintf(kr, "%s=%s",CCACHE_ENV_NAME, kr->ccname); if (msg == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return ENOMEM; }
@@ -625,7 +625,7 @@ static errno_t k5c_send_data(struct krb5_req *kr, int fd, errno_t error)
ret = pack_response_packet(kr, error, kr->pd->resp_list, &buf, &len); if (ret != EOK) { - DEBUG(1, ("pack_response_packet failed.\n")); + DEBUG(1, "pack_response_packet failed.\n"); return ret; }
@@ -634,18 +634,18 @@ static errno_t k5c_send_data(struct krb5_req *kr, int fd, errno_t error) if (written == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("write failed [%d][%s].\n", ret, strerror(ret))); + "write failed [%d][%s].\n", ret, strerror(ret)); return ret; }
if (written != len) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Write error, wrote [%zu] bytes, expected [%zu]\n", - written, len)); + "Write error, wrote [%zu] bytes, expected [%zu]\n", + written, len); return EOK; }
- DEBUG(SSSDBG_TRACE_ALL, ("Response sent.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Response sent.\n");
return EOK; } @@ -666,13 +666,13 @@ static errno_t add_ticket_times_and_upn_to_response(struct krb5_req *kr) ret = pam_add_response(kr->pd, SSS_KRB5_INFO_TGT_LIFETIME, 4*sizeof(int64_t), (uint8_t *) t); if (ret != EOK) { - DEBUG(1, ("pack_response_packet failed.\n")); + DEBUG(1, "pack_response_packet failed.\n"); goto done; }
kerr = krb5_unparse_name_ext(kr->ctx, kr->creds->client, &upn, &upn_len); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_unparse_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_unparse_name failed.\n"); goto done; }
@@ -680,7 +680,7 @@ static errno_t add_ticket_times_and_upn_to_response(struct krb5_req *kr) (uint8_t *) upn); krb5_free_unparsed_name(kr->ctx, upn); if (ret != EOK) { - DEBUG(1, ("pack_response_packet failed.\n")); + DEBUG(1, "pack_response_packet failed.\n"); goto done; }
@@ -705,16 +705,16 @@ static krb5_error_code validate_tgt(struct krb5_req *kr) memset(&keytab, 0, sizeof(keytab)); kerr = krb5_kt_resolve(kr->ctx, kr->keytab, &keytab); if (kerr != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("error resolving keytab [%s], " \ - "not verifying TGT.\n", kr->keytab)); + DEBUG(SSSDBG_CRIT_FAILURE, "error resolving keytab [%s], " \ + "not verifying TGT.\n", kr->keytab); return kerr; }
memset(&cursor, 0, sizeof(cursor)); kerr = krb5_kt_start_seq_get(kr->ctx, keytab, &cursor); if (kerr != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("error reading keytab [%s], " \ - "not verifying TGT.\n", kr->keytab)); + DEBUG(SSSDBG_CRIT_FAILURE, "error reading keytab [%s], " \ + "not verifying TGT.\n", kr->keytab); return kerr; }
@@ -728,19 +728,19 @@ static krb5_error_code validate_tgt(struct krb5_req *kr) kerr = krb5_copy_principal(kr->ctx, entry.principal, &validation_princ); if (kerr != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_copy_principal failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_copy_principal failed.\n"); goto done; }
kerr = sss_krb5_free_keytab_entry_contents(kr->ctx, &entry); if (kerr != 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to free keytab entry.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to free keytab entry.\n"); } memset(&entry, 0, sizeof(entry));
if (krb5_realm_compare(kr->ctx, validation_princ, kr->creds->client)) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Found keytab entry with the realm of the credential.\n")); + "Found keytab entry with the realm of the credential.\n"); realm_entry_found = true; break; } @@ -748,8 +748,8 @@ static krb5_error_code validate_tgt(struct krb5_req *kr)
if (!realm_entry_found) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Keytab entry with the realm of the credential not found " - "in keytab. Using the last entry.\n")); + "Keytab entry with the realm of the credential not found " + "in keytab. Using the last entry.\n"); }
/* Close the keytab here. Even though we're using cursors, the file @@ -758,15 +758,15 @@ static krb5_error_code validate_tgt(struct krb5_req *kr) * cursor, creating a leak. */ kerr = krb5_kt_end_seq_get(kr->ctx, keytab, &cursor); if (kerr != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_kt_end_seq_get failed, " \ - "not verifying TGT.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_kt_end_seq_get failed, " \ + "not verifying TGT.\n"); goto done; }
/* check if we got any errors from krb5_kt_next_entry */ if (kt_err != 0 && kt_err != KRB5_KT_END) { - DEBUG(SSSDBG_CRIT_FAILURE, ("error reading keytab [%s], " \ - "not verifying TGT.\n", kr->keytab)); + DEBUG(SSSDBG_CRIT_FAILURE, "error reading keytab [%s], " \ + "not verifying TGT.\n", kr->keytab); goto done; }
@@ -774,8 +774,8 @@ static krb5_error_code validate_tgt(struct krb5_req *kr) principal = NULL; kerr = krb5_unparse_name(kr->ctx, validation_princ, &principal); if (kerr != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("internal error parsing principal name, " - "not verifying TGT.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "internal error parsing principal name, " + "not verifying TGT.\n"); KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); goto done; } @@ -786,11 +786,11 @@ static krb5_error_code validate_tgt(struct krb5_req *kr) &validation_ccache, &opt);
if (kerr == 0) { - DEBUG(SSSDBG_TRACE_FUNC, ("TGT verified using key for [%s].\n", - principal)); + DEBUG(SSSDBG_TRACE_FUNC, "TGT verified using key for [%s].\n", + principal); } else { - DEBUG(SSSDBG_CRIT_FAILURE ,("TGT failed verification using key " \ - "for [%s].\n", principal)); + DEBUG(SSSDBG_CRIT_FAILURE ,"TGT failed verification using key " \ + "for [%s].\n", principal); goto done; }
@@ -800,9 +800,9 @@ static krb5_error_code validate_tgt(struct krb5_req *kr) kerr = sss_extract_pac(kr->ctx, validation_ccache, validation_princ, kr->creds->client, keytab, &pac_authdata); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_extract_and_send_pac failed, group " \ + DEBUG(SSSDBG_OP_FAILURE, "sss_extract_and_send_pac failed, group " \ "membership for user with principal [%s] " \ - "might not be correct.\n", kr->name)); + "might not be correct.\n", kr->name); kerr = 0; goto done; } @@ -810,9 +810,9 @@ static krb5_error_code validate_tgt(struct krb5_req *kr) kerr = sss_send_pac(pac_authdata); krb5_free_authdata(kr->ctx, pac_authdata); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_send_pac failed, group " \ + DEBUG(SSSDBG_OP_FAILURE, "sss_send_pac failed, group " \ "membership for user with principal [%s] " \ - "might not be correct.\n", kr->name)); + "might not be correct.\n", kr->name); kerr = 0; } } @@ -823,7 +823,7 @@ done: }
if (krb5_kt_close(kr->ctx, keytab) != 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("krb5_kt_close failed")); + DEBUG(SSSDBG_MINOR_FAILURE, "krb5_kt_close failed"); } if (validation_princ != NULL) { krb5_free_principal(kr->ctx, validation_princ); @@ -845,8 +845,8 @@ static void krb5_set_canonicalize(krb5_get_init_creds_opt *opts) if (tmp_str != NULL && strcasecmp(tmp_str, "true") == 0) { canonicalize = 1; } - DEBUG(SSSDBG_CONF_SETTINGS, ("%s is set to [%s]\n", - SSSD_KRB5_CANONICALIZE, tmp_str ? tmp_str : "not set")); + DEBUG(SSSDBG_CONF_SETTINGS, "%s is set to [%s]\n", + SSSD_KRB5_CANONICALIZE, tmp_str ? tmp_str : "not set"); sss_krb5_get_init_creds_opt_set_canonicalize(opts, canonicalize); }
@@ -903,13 +903,13 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr, kr); if (kerr != 0) { KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); - DEBUG(1, ("Failed to set expire callback, continue without.\n")); + DEBUG(1, "Failed to set expire callback, continue without.\n"); }
sss_krb5_princ_realm(kr->ctx, kr->princ, &realm_name, &realm_length);
DEBUG(SSSDBG_TRACE_FUNC, - ("Attempting kinit for realm [%s]\n",realm_name)); + "Attempting kinit for realm [%s]\n",realm_name); kerr = krb5_get_init_creds_password(kr->ctx, kr->creds, kr->princ, discard_const(password), sss_krb5_prompter, kr, 0, @@ -927,7 +927,7 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr, }
} else { - DEBUG(SSSDBG_CONF_SETTINGS, ("TGT validation is disabled.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "TGT validation is disabled.\n"); }
if (kr->validate || kr->fast_ccname != NULL) { @@ -936,7 +936,7 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr, * ccache I/O operations with user privileges. */ kerr = become_user(kr->uid, kr->gid); if (kerr != 0) { - DEBUG(1, ("become_user failed.\n")); + DEBUG(1, "become_user failed.\n"); return kerr; } } @@ -962,7 +962,7 @@ static krb5_error_code get_and_save_tgt(struct krb5_req *kr,
kerr = add_ticket_times_and_upn_to_response(kr); if (kerr != 0) { - DEBUG(1, ("add_ticket_times_and_upn_to_response failed.\n")); + DEBUG(1, "add_ticket_times_and_upn_to_response failed.\n"); }
kerr = 0; @@ -1025,12 +1025,12 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim) size_t msg_len; uint8_t *msg;
- DEBUG(SSSDBG_TRACE_LIBS, ("Password change operation\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Password change operation\n");
ret = sss_authtok_get_password(kr->pd->authtok, &password, NULL); if (ret != EOK) { - DEBUG(1, ("Failed to fetch current password [%d] %s.\n", - ret, strerror(ret))); + DEBUG(1, "Failed to fetch current password [%d] %s.\n", + ret, strerror(ret)); return ERR_NO_CREDS; }
@@ -1041,14 +1041,14 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim)
kerr = get_changepw_options(kr->ctx, &chagepw_options); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("get_changepw_options failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_changepw_options failed.\n"); return kerr; }
sss_krb5_princ_realm(kr->ctx, kr->princ, &realm_name, &realm_length);
DEBUG(SSSDBG_TRACE_FUNC, - ("Attempting kinit for realm [%s]\n",realm_name)); + "Attempting kinit for realm [%s]\n",realm_name); kerr = krb5_get_init_creds_password(kr->ctx, kr->creds, kr->princ, discard_const(password), prompter, kr, 0, @@ -1060,13 +1060,13 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim) &msg_len, &msg); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("pack_user_info_chpass_error failed.\n")); + "pack_user_info_chpass_error failed.\n"); } else { ret = pam_add_response(kr->pd, SSS_PAM_USER_INFO, msg_len, msg); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("pam_add_response failed.\n")); + "pam_add_response failed.\n"); } } return kerr; @@ -1076,16 +1076,16 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim)
if (prelim) { DEBUG(SSSDBG_TRACE_LIBS, - ("Initial authentication for change password operation " - "successful.\n")); + "Initial authentication for change password operation " + "successful.\n"); krb5_free_cred_contents(kr->ctx, kr->creds); return EOK; }
ret = sss_authtok_get_password(kr->pd->newauthtok, &newpassword, NULL); if (ret != EOK) { - DEBUG(1, ("Failed to fetch new password [%d] %s.\n", - ret, strerror(ret))); + DEBUG(1, "Failed to fetch new password [%d] %s.\n", + ret, strerror(ret)); return ERR_NO_CREDS; }
@@ -1105,29 +1105,29 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim) }
if (result_code_string.length > 0) { - DEBUG(1, ("krb5_change_password failed [%d][%.*s].\n", result_code, - result_code_string.length, result_code_string.data)); + DEBUG(1, "krb5_change_password failed [%d][%.*s].\n", result_code, + result_code_string.length, result_code_string.data); user_error_message = talloc_strndup(kr->pd, result_code_string.data, result_code_string.length); if (user_error_message == NULL) { - DEBUG(1, ("talloc_strndup failed.\n")); + DEBUG(1, "talloc_strndup failed.\n"); } }
if (result_string.length > 0 && result_string.data[0] != '\0') { - DEBUG(1, ("krb5_change_password failed [%d][%.*s].\n", result_code, - result_string.length, result_string.data)); + DEBUG(1, "krb5_change_password failed [%d][%.*s].\n", result_code, + result_string.length, result_string.data); talloc_free(user_error_message); user_error_message = talloc_strndup(kr->pd, result_string.data, result_string.length); if (user_error_message == NULL) { - DEBUG(1, ("talloc_strndup failed.\n")); + DEBUG(1, "talloc_strndup failed.\n"); } } else if (result_code == KRB5_KPASSWD_SOFTERROR) { user_error_message = talloc_strdup(kr->pd, "Please make sure the " "password meets the complexity constraints."); if (user_error_message == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strndup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strndup failed.\n"); } }
@@ -1135,12 +1135,12 @@ static errno_t changepw_child(struct krb5_req *kr, bool prelim) ret = pack_user_info_chpass_error(kr->pd, user_error_message, &user_resp_len, &user_resp); if (ret != EOK) { - DEBUG(1, ("pack_user_info_chpass_error failed.\n")); + DEBUG(1, "pack_user_info_chpass_error failed.\n"); } else { ret = pam_add_response(kr->pd, SSS_PAM_USER_INFO, user_resp_len, user_resp); if (ret != EOK) { - DEBUG(1, ("pack_response_packet failed.\n")); + DEBUG(1, "pack_response_packet failed.\n"); } } } @@ -1167,7 +1167,7 @@ static errno_t tgt_req_child(struct krb5_req *kr) krb5_error_code kerr; int ret;
- DEBUG(SSSDBG_TRACE_LIBS, ("Attempting to get a TGT\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Attempting to get a TGT\n");
ret = sss_authtok_get_password(kr->pd->authtok, &password, NULL); switch (ret) { @@ -1175,12 +1175,12 @@ static errno_t tgt_req_child(struct krb5_req *kr) break;
case EACCES: - DEBUG(SSSDBG_OP_FAILURE, ("Invalid authtok type\n")); + DEBUG(SSSDBG_OP_FAILURE, "Invalid authtok type\n"); return ERR_INVALID_CRED_TYPE; break;
default: - DEBUG(SSSDBG_OP_FAILURE, ("No credentials available\n")); + DEBUG(SSSDBG_OP_FAILURE, "No credentials available\n"); return ERR_NO_CREDS; break; } @@ -1199,18 +1199,18 @@ static errno_t tgt_req_child(struct krb5_req *kr) KRB5KDC_ERR_KEY_EXP regardless if the supplied password is correct or not. In general the password can still be used to get a changepw ticket. So we validate the password by trying to get a changepw ticket. */ - DEBUG(SSSDBG_TRACE_LIBS, ("Password was expired\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Password was expired\n"); kerr = sss_krb5_get_init_creds_opt_set_expire_callback(kr->ctx, kr->options, NULL, NULL); if (kerr != 0) { KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); - DEBUG(1, ("Failed to unset expire callback, continue ...\n")); + DEBUG(1, "Failed to unset expire callback, continue ...\n"); }
kerr = get_changepw_options(kr->ctx, &chagepw_options); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("get_changepw_options failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_changepw_options failed.\n"); return kerr; }
@@ -1239,24 +1239,24 @@ static errno_t kuserok_child(struct krb5_req *kr) krb5_boolean access_allowed; krb5_error_code kerr;
- DEBUG(SSSDBG_TRACE_LIBS, ("Verifying if principal can log in as user\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Verifying if principal can log in as user\n");
/* krb5_kuserok tries to verify that kr->pd->user is a locally known * account, so we have to unset _SSS_LOOPS to make getpwnam() work. */ if (unsetenv("_SSS_LOOPS") != 0) { - DEBUG(1, ("Failed to unset _SSS_LOOPS, " - "krb5_kuserok will most certainly fail.\n")); + DEBUG(1, "Failed to unset _SSS_LOOPS, " + "krb5_kuserok will most certainly fail.\n"); }
kerr = krb5_set_default_realm(kr->ctx, kr->realm); if (kerr != 0) { - DEBUG(1, ("krb5_set_default_realm failed, " - "krb5_kuserok may fail.\n")); + DEBUG(1, "krb5_set_default_realm failed, " + "krb5_kuserok may fail.\n"); }
access_allowed = krb5_kuserok(kr->ctx, kr->princ, kr->pd->user); DEBUG(SSSDBG_TRACE_LIBS, - ("Access was %s\n", access_allowed ? "allowed" : "denied")); + "Access was %s\n", access_allowed ? "allowed" : "denied");
if (access_allowed) { return EOK; @@ -1272,13 +1272,13 @@ static errno_t renew_tgt_child(struct krb5_req *kr) krb5_error_code kerr; int ret;
- DEBUG(SSSDBG_TRACE_LIBS, ("Renewing a ticket\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Renewing a ticket\n");
ret = sss_authtok_get_ccfile(kr->pd->authtok, &ccname, NULL); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Unsupported authtok type for TGT renewal [%d].\n", - sss_authtok_get_type(kr->pd->authtok))); + "Unsupported authtok type for TGT renewal [%d].\n", + sss_authtok_get_type(kr->pd->authtok)); return ERR_INVALID_CRED_TYPE; }
@@ -1301,7 +1301,7 @@ static errno_t renew_tgt_child(struct krb5_req *kr) }
} else { - DEBUG(SSSDBG_CONF_SETTINGS, ("TGT validation is disabled.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "TGT validation is disabled.\n"); }
if (kr->validate || kr->fast_ccname != NULL) { @@ -1310,7 +1310,7 @@ static errno_t renew_tgt_child(struct krb5_req *kr) * ccache I/O operations with user privileges. */ kerr = become_user(kr->uid, kr->gid); if (kerr != 0) { - DEBUG(1, ("become_user failed.\n")); + DEBUG(1, "become_user failed.\n"); goto done; } } @@ -1329,7 +1329,7 @@ static errno_t renew_tgt_child(struct krb5_req *kr)
kerr = add_ticket_times_and_upn_to_response(kr); if (kerr != 0) { - DEBUG(1, ("add_ticket_times_and_upn_to_response failed.\n")); + DEBUG(1, "add_ticket_times_and_upn_to_response failed.\n"); }
kerr = k5c_attach_ccname_msg(kr); @@ -1349,7 +1349,7 @@ static errno_t create_empty_ccache(struct krb5_req *kr) krb5_creds *creds = NULL; krb5_error_code kerr;
- DEBUG(SSSDBG_TRACE_LIBS, ("Creating empty ccache\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Creating empty ccache\n");
kerr = create_empty_cred(kr->ctx, kr->princ, &creds); if (kerr == 0) { @@ -1409,13 +1409,13 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, struct pam_data *pd; errno_t ret;
- DEBUG(SSSDBG_TRACE_LIBS, ("total buffer size: [%zu]\n", size)); + DEBUG(SSSDBG_TRACE_LIBS, "total buffer size: [%zu]\n", size);
if (!offline || !kr) return EINVAL;
pd = create_pam_data(kr); if (pd == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; } kr->pd = pd; @@ -1437,12 +1437,12 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, p += len;
DEBUG(SSSDBG_CONF_SETTINGS, - ("cmd [%d] uid [%llu] gid [%llu] validate [%s] " + "cmd [%d] uid [%llu] gid [%llu] validate [%s] " "enterprise principal [%s] offline [%s] UPN [%s]\n", pd->cmd, (unsigned long long) kr->uid, (unsigned long long) kr->gid, kr->validate ? "true" : "false", kr->use_enterprise_princ ? "true" : "false", - *offline ? "true" : "false", kr->upn ? kr->upn : "none")); + *offline ? "true" : "false", kr->upn ? kr->upn : "none");
if (pd->cmd == SSS_PAM_AUTHENTICATE || pd->cmd == SSS_CMD_RENEW || @@ -1464,8 +1464,8 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, return ret; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("ccname: [%s] keytab: [%s]\n", - kr->ccname, kr->keytab)); + DEBUG(SSSDBG_CONF_SETTINGS, "ccname: [%s] keytab: [%s]\n", + kr->ccname, kr->keytab); } else { kr->ccname = NULL; kr->keytab = NULL; @@ -1487,7 +1487,7 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, pd->user = talloc_strndup(pd, (char *)(buf + p), len); if (pd->user == NULL) return ENOMEM; p += len; - DEBUG(SSSDBG_CONF_SETTINGS, ("user: [%s]\n", pd->user)); + DEBUG(SSSDBG_CONF_SETTINGS, "user: [%s]\n", pd->user); } else { pd->user = NULL; } @@ -1531,7 +1531,7 @@ static krb5_error_code get_tgt_times(krb5_context ctx, const char *ccname,
krberr = krb5_cc_resolve(ctx, ccname, &ccache); if (krberr != 0) { - DEBUG(1, ("krb5_cc_resolve failed.\n")); + DEBUG(1, "krb5_cc_resolve failed.\n"); goto done; }
@@ -1543,7 +1543,7 @@ static krb5_error_code get_tgt_times(krb5_context ctx, const char *ccname,
krberr = krb5_cc_retrieve_cred(ctx, ccache, 0, &mcred, &cred); if (krberr != 0) { - DEBUG(1, ("krb5_cc_retrieve_cred failed.\n")); + DEBUG(1, "krb5_cc_retrieve_cred failed.\n"); krberr = 0; goto done; } @@ -1583,13 +1583,13 @@ static krb5_error_code check_fast_ccache(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed.\n")); + DEBUG(1, "talloc_new failed.\n"); return ENOMEM; }
ccname = talloc_asprintf(tmp_ctx, "FILE:%s/fast_ccache_%s", DB_PATH, realm); if (ccname == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); kerr = ENOMEM; goto done; } @@ -1601,30 +1601,30 @@ static krb5_error_code check_fast_ccache(TALLOC_CTX *mem_ctx, } if (kerr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to read keytab file [%s]: %s\n", + "Failed to read keytab file [%s]: %s\n", KEYTAB_CLEAN_NAME, - sss_krb5_get_error_message(ctx, kerr))); + sss_krb5_get_error_message(ctx, kerr)); goto done; }
kerr = find_principal_in_keytab(ctx, keytab, primary, realm, &client_princ); if (kerr != 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("find_principal_in_keytab failed for principal %s@%s.\n", - primary, realm)); + "find_principal_in_keytab failed for principal %s@%s.\n", + primary, realm); goto done; }
server_name = talloc_asprintf(tmp_ctx, "krbtgt/%s@%s", realm, realm); if (server_name == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); kerr = ENOMEM; goto done; }
kerr = krb5_parse_name(ctx, server_name, &server_princ); if (kerr != 0) { - DEBUG(1, ("krb5_parse_name failed.\n")); + DEBUG(1, "krb5_parse_name failed.\n"); goto done; }
@@ -1632,14 +1632,14 @@ static krb5_error_code check_fast_ccache(TALLOC_CTX *mem_ctx, kerr = get_tgt_times(ctx, ccname, server_princ, client_princ, &tgtt); if (kerr == 0) { if (tgtt.endtime > time(NULL)) { - DEBUG(5, ("FAST TGT is still valid.\n")); + DEBUG(5, "FAST TGT is still valid.\n"); goto done; } }
kerr = get_and_save_tgt_with_keytab(ctx, client_princ, keytab, ccname); if (kerr != 0) { - DEBUG(1, ("get_and_save_tgt_with_keytab failed.\n")); + DEBUG(1, "get_and_save_tgt_with_keytab failed.\n"); goto done; }
@@ -1676,13 +1676,13 @@ static errno_t k5c_recv_data(struct krb5_req *kr, int fd, uint32_t *offline) if (len == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("read failed [%d][%s].\n", ret, strerror(ret))); + "read failed [%d][%s].\n", ret, strerror(ret)); return ret; }
ret = unpack_buffer(buf, len, kr, offline); if (ret != EOK) { - DEBUG(1, ("unpack_buffer failed.\n")); + DEBUG(1, "unpack_buffer failed.\n"); }
return ret; @@ -1697,35 +1697,35 @@ static int k5c_setup_fast(struct krb5_req *kr, char *lifetime_str, bool demand) krb5_error_code kerr; char *tmp_str;
- DEBUG(SSSDBG_CONF_SETTINGS, ("%s is set to [%s]\n", - SSSD_KRB5_LIFETIME, lifetime_str)); + DEBUG(SSSDBG_CONF_SETTINGS, "%s is set to [%s]\n", + SSSD_KRB5_LIFETIME, lifetime_str);
tmp_str = getenv(SSSD_KRB5_FAST_PRINCIPAL); if (tmp_str) { - DEBUG(SSSDBG_CONF_SETTINGS, ("%s is set to [%s]\n", - SSSD_KRB5_FAST_PRINCIPAL, tmp_str)); + DEBUG(SSSDBG_CONF_SETTINGS, "%s is set to [%s]\n", + SSSD_KRB5_FAST_PRINCIPAL, tmp_str); kerr = krb5_parse_name(kr->ctx, tmp_str, &fast_princ_struct); if (kerr) { - DEBUG(1, ("krb5_parse_name failed.\n")); + DEBUG(1, "krb5_parse_name failed.\n"); return kerr; } kerr = sss_krb5_unparse_name_flags(kr->ctx, fast_princ_struct, KRB5_PRINCIPAL_UNPARSE_NO_REALM, &tmp_str); if (kerr) { - DEBUG(1, ("sss_krb5_unparse_name_flags failed.\n")); + DEBUG(1, "sss_krb5_unparse_name_flags failed.\n"); return kerr; } fast_principal = talloc_strdup(kr, tmp_str); if (!fast_principal) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); return KRB5KRB_ERR_GENERIC; } free(tmp_str); realm_data = krb5_princ_realm(kr->ctx, fast_princ_struct); fast_principal_realm = talloc_asprintf(kr, "%.*s", realm_data->length, realm_data->data); if (!fast_principal_realm) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return ENOMEM; } } else { @@ -1736,7 +1736,7 @@ static int k5c_setup_fast(struct krb5_req *kr, char *lifetime_str, bool demand) kerr = check_fast_ccache(kr, kr->ctx, fast_principal, fast_principal_realm, kr->keytab, &kr->fast_ccname); if (kerr != 0) { - DEBUG(1, ("check_fast_ccache failed.\n")); + DEBUG(1, "check_fast_ccache failed.\n"); KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); return kerr; } @@ -1745,8 +1745,8 @@ static int k5c_setup_fast(struct krb5_req *kr, char *lifetime_str, bool demand) kr->options, kr->fast_ccname); if (kerr != 0) { - DEBUG(1, ("sss_krb5_get_init_creds_opt_set_fast_ccache_name " - "failed.\n")); + DEBUG(1, "sss_krb5_get_init_creds_opt_set_fast_ccache_name " + "failed.\n"); KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); return kerr; } @@ -1756,8 +1756,8 @@ static int k5c_setup_fast(struct krb5_req *kr, char *lifetime_str, bool demand) kr->options, SSS_KRB5_FAST_REQUIRED); if (kerr != 0) { - DEBUG(1, ("sss_krb5_get_init_creds_opt_set_fast_flags " - "failed.\n")); + DEBUG(1, "sss_krb5_get_init_creds_opt_set_fast_flags " + "failed.\n"); KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); return kerr; } @@ -1777,7 +1777,7 @@ static int k5c_setup(struct krb5_req *kr, uint32_t offline) kr->realm = getenv(SSSD_KRB5_REALM); if (kr->realm == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot read [%s] from environment.\n", SSSD_KRB5_REALM)); + "Cannot read [%s] from environment.\n", SSSD_KRB5_REALM); }
kerr = krb5_init_context(&kr->ctx); @@ -1805,7 +1805,7 @@ static int k5c_setup(struct krb5_req *kr, uint32_t offline) if (kr->use_enterprise_princ) { kerr = krb5_set_default_realm(kr->ctx, kr->realm); if (kerr != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_set_default_realm failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_set_default_realm failed.\n"); } }
@@ -1824,7 +1824,7 @@ static int k5c_setup(struct krb5_req *kr, uint32_t offline)
kr->creds = calloc(1, sizeof(krb5_creds)); if (kr->creds == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; }
@@ -1852,35 +1852,35 @@ static int k5c_setup(struct krb5_req *kr, uint32_t offline)
lifetime_str = getenv(SSSD_KRB5_RENEWABLE_LIFETIME); if (lifetime_str == NULL) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Cannot read [%s] from environment.\n", - SSSD_KRB5_RENEWABLE_LIFETIME)); + DEBUG(SSSDBG_CONF_SETTINGS, "Cannot read [%s] from environment.\n", + SSSD_KRB5_RENEWABLE_LIFETIME); } else { kerr = krb5_string_to_deltat(lifetime_str, &lifetime); if (kerr != 0) { - DEBUG(1, ("krb5_string_to_deltat failed for [%s].\n", - lifetime_str)); + DEBUG(1, "krb5_string_to_deltat failed for [%s].\n", + lifetime_str); KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); return kerr; } - DEBUG(SSSDBG_CONF_SETTINGS, ("%s is set to [%s]\n", - SSSD_KRB5_RENEWABLE_LIFETIME, lifetime_str)); + DEBUG(SSSDBG_CONF_SETTINGS, "%s is set to [%s]\n", + SSSD_KRB5_RENEWABLE_LIFETIME, lifetime_str); krb5_get_init_creds_opt_set_renew_life(kr->options, lifetime); }
lifetime_str = getenv(SSSD_KRB5_LIFETIME); if (lifetime_str == NULL) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Cannot read [%s] from environment.\n", - SSSD_KRB5_LIFETIME)); + DEBUG(SSSDBG_CONF_SETTINGS, "Cannot read [%s] from environment.\n", + SSSD_KRB5_LIFETIME); } else { kerr = krb5_string_to_deltat(lifetime_str, &lifetime); if (kerr != 0) { - DEBUG(1, ("krb5_string_to_deltat failed for [%s].\n", - lifetime_str)); + DEBUG(1, "krb5_string_to_deltat failed for [%s].\n", + lifetime_str); KRB5_CHILD_DEBUG(SSSDBG_CRIT_FAILURE, kerr); return kerr; } DEBUG(SSSDBG_CONF_SETTINGS, - ("%s is set to [%s]\n", SSSD_KRB5_LIFETIME, lifetime_str)); + "%s is set to [%s]\n", SSSD_KRB5_LIFETIME, lifetime_str); krb5_get_init_creds_opt_set_tkt_life(kr->options, lifetime); }
@@ -1889,15 +1889,15 @@ static int k5c_setup(struct krb5_req *kr, uint32_t offline)
use_fast_str = getenv(SSSD_KRB5_USE_FAST); if (use_fast_str == NULL || strcasecmp(use_fast_str, "never") == 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Not using FAST.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "Not using FAST.\n"); } else if (strcasecmp(use_fast_str, "try") == 0) { kerr = k5c_setup_fast(kr, lifetime_str, false); } else if (strcasecmp(use_fast_str, "demand") == 0) { kerr = k5c_setup_fast(kr, lifetime_str, true); } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unsupported value [%s] for krb5_use_fast.\n", - use_fast_str)); + "Unsupported value [%s] for krb5_use_fast.\n", + use_fast_str); return EINVAL; } } @@ -1958,13 +1958,13 @@ int main(int argc, const char *argv[])
kr = talloc_zero(NULL, struct krb5_req); if (kr == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); exit(-1); }
debug_prg_name = talloc_asprintf(kr, "[sssd[krb5_child[%d]]]", getpid()); if (!debug_prg_name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -1972,11 +1972,11 @@ int main(int argc, const char *argv[]) if (debug_fd != -1) { ret = set_debug_file_from_fd(debug_fd); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("set_debug_file_from_fd failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "set_debug_file_from_fd failed.\n"); } }
- DEBUG(SSSDBG_TRACE_FUNC, ("krb5_child started.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "krb5_child started.\n");
ret = k5c_recv_data(kr, STDIN_FILENO, &offline); if (ret != EOK) { @@ -1987,7 +1987,7 @@ int main(int argc, const char *argv[])
ret = k5c_setup(kr, offline); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_child_setup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_child_setup failed.\n"); goto done; }
@@ -1995,53 +1995,53 @@ int main(int argc, const char *argv[]) case SSS_PAM_AUTHENTICATE: /* If we are offline, we need to create an empty ccache file */ if (offline) { - DEBUG(SSSDBG_TRACE_FUNC, ("Will perform offline auth\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Will perform offline auth\n"); ret = create_empty_ccache(kr); } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Will perform online auth\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Will perform online auth\n"); ret = tgt_req_child(kr); } break; case SSS_PAM_CHAUTHTOK: - DEBUG(SSSDBG_TRACE_FUNC, ("Will perform password change\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Will perform password change\n"); ret = changepw_child(kr, false); break; case SSS_PAM_CHAUTHTOK_PRELIM: - DEBUG(SSSDBG_TRACE_FUNC, ("Will perform password change checks\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Will perform password change checks\n"); ret = changepw_child(kr, true); break; case SSS_PAM_ACCT_MGMT: - DEBUG(SSSDBG_TRACE_FUNC, ("Will perform account management\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Will perform account management\n"); ret = kuserok_child(kr); break; case SSS_CMD_RENEW: if (offline) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot renew TGT while offline\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot renew TGT while offline\n"); ret = KRB5_KDC_UNREACH; goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Will perform ticket renewal\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Will perform ticket renewal\n"); ret = renew_tgt_child(kr); break; default: - DEBUG(1, ("PAM command [%d] not supported.\n", kr->pd->cmd)); + DEBUG(1, "PAM command [%d] not supported.\n", kr->pd->cmd); ret = EINVAL; goto done; }
ret = k5c_send_data(kr, STDOUT_FILENO, ret); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to send reply\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to send reply\n"); }
done: krb5_cleanup(kr); talloc_free(kr); if (ret == EOK) { - DEBUG(SSSDBG_TRACE_FUNC, ("krb5_child completed successfully\n")); + DEBUG(SSSDBG_TRACE_FUNC, "krb5_child completed successfully\n"); exit(0); } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_child failed!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_child failed!\n"); exit(-1); } } diff --git a/src/providers/krb5/krb5_child_handler.c b/src/providers/krb5/krb5_child_handler.c index 92dec0d..ce9a6f2 100644 --- a/src/providers/krb5/krb5_child_handler.c +++ b/src/providers/krb5/krb5_child_handler.c @@ -69,7 +69,7 @@ static int child_io_destructor(void *ptr) io->write_to_child_fd = -1; if (ret != EOK) { ret = errno; - DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "close failed [%d][%s].\n", ret, strerror(ret)); } }
@@ -78,7 +78,7 @@ static int child_io_destructor(void *ptr) io->read_from_child_fd = -1; if (ret != EOK) { ret = errno; - DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "close failed [%d][%s].\n", ret, strerror(ret)); } }
@@ -136,7 +136,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
keytab = dp_opt_get_cstring(kr->krb5_ctx->opts, KRB5_KEYTAB); if (keytab == NULL) { - DEBUG(1, ("Missing keytab option.\n")); + DEBUG(1, "Missing keytab option.\n"); return EINVAL; }
@@ -164,7 +164,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
buf = talloc(kr, struct io_buffer); if (buf == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; }
@@ -190,7 +190,7 @@ static errno_t create_send_buffer(struct krb5child_req *kr,
buf->data = talloc_size(kr, buf->size); if (buf->data == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); talloc_free(buf); return ENOMEM; } @@ -254,11 +254,11 @@ static void krb5_child_timeout(struct tevent_context *ev, return; }
- DEBUG(9, ("timeout for child [%d] reached.\n", state->child_pid)); + DEBUG(9, "timeout for child [%d] reached.\n", state->child_pid);
ret = kill(state->child_pid, SIGKILL); if (ret == -1) { - DEBUG(1, ("kill failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "kill failed [%d][%s].\n", errno, strerror(errno)); }
tevent_req_error(req, ETIMEDOUT); @@ -277,7 +277,7 @@ static errno_t activate_child_timeout_handler(struct tevent_req *req, state->timeout_handler = tevent_add_timer(ev, state, tv, krb5_child_timeout, req); if (state->timeout_handler == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); return ENOMEM; }
@@ -297,13 +297,13 @@ static errno_t fork_child(struct tevent_req *req) ret = pipe(pipefd_from_child); if (ret == -1) { err = errno; - DEBUG(1, ("pipe failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "pipe failed [%d][%s].\n", errno, strerror(errno)); return err; } ret = pipe(pipefd_to_child); if (ret == -1) { err = errno; - DEBUG(1, ("pipe failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "pipe failed [%d][%s].\n", errno, strerror(errno)); return err; }
@@ -313,7 +313,7 @@ static errno_t fork_child(struct tevent_req *req) if (state->kr->run_as_user) { ret = become_user(state->kr->uid, state->kr->gid); if (ret != EOK) { - DEBUG(1, ("become_user failed.\n")); + DEBUG(1, "become_user failed.\n"); return ret; } } @@ -322,8 +322,8 @@ static errno_t fork_child(struct tevent_req *req) pipefd_to_child, pipefd_from_child, KRB5_CHILD, state->kr->krb5_ctx->child_debug_fd); if (err != EOK) { - DEBUG(1, ("Could not exec KRB5 child: [%d][%s].\n", - err, strerror(err))); + DEBUG(1, "Could not exec KRB5 child: [%d][%s].\n", + err, strerror(err)); return err; } } else if (pid > 0) { /* parent */ @@ -337,19 +337,19 @@ static errno_t fork_child(struct tevent_req *req)
ret = child_handler_setup(state->ev, pid, NULL, NULL, NULL); if (ret != EOK) { - DEBUG(1, ("Could not set up child signal handler\n")); + DEBUG(1, "Could not set up child signal handler\n"); return ret; }
err = activate_child_timeout_handler(req, state->ev, dp_opt_get_int(state->kr->krb5_ctx->opts, KRB5_AUTH_TIMEOUT)); if (err != EOK) { - DEBUG(1, ("activate_child_timeout_handler failed.\n")); + DEBUG(1, "activate_child_timeout_handler failed.\n"); }
} else { /* error */ err = errno; - DEBUG(1, ("fork failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "fork failed [%d][%s].\n", errno, strerror(errno)); return err; }
@@ -382,7 +382,7 @@ struct tevent_req *handle_child_send(TALLOC_CTX *mem_ctx,
state->io = talloc(state, struct io); if (state->io == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); ret = ENOMEM; goto fail; } @@ -392,13 +392,13 @@ struct tevent_req *handle_child_send(TALLOC_CTX *mem_ctx,
ret = create_send_buffer(kr, &buf); if (ret != EOK) { - DEBUG(1, ("create_send_buffer failed.\n")); + DEBUG(1, "create_send_buffer failed.\n"); goto fail; }
ret = fork_child(req); if (ret != EOK) { - DEBUG(1, ("fork_child failed.\n")); + DEBUG(1, "fork_child failed.\n"); goto fail; }
@@ -506,7 +506,7 @@ parse_krb5_child_response(TALLOC_CTX *mem_ctx, uint8_t *buf, ssize_t len, bool otp = false;
if ((size_t) len < sizeof(int32_t)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("message too short.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "message too short.\n"); return EINVAL; }
@@ -534,12 +534,12 @@ parse_krb5_child_response(TALLOC_CTX *mem_ctx, uint8_t *buf, ssize_t len, SAFEALIGN_COPY_INT32(&msg_type, buf+p, &p); SAFEALIGN_COPY_INT32(&msg_len, buf+p, &p);
- DEBUG(SSSDBG_TRACE_LIBS, ("child response [%d][%d][%d].\n", - msg_status, msg_type, msg_len)); + DEBUG(SSSDBG_TRACE_LIBS, "child response [%d][%d][%d].\n", + msg_status, msg_type, msg_len);
if ((p + msg_len) > len) { - DEBUG(SSSDBG_CRIT_FAILURE, ("message format error [%zu] > [%zd].\n", - p+msg_len, len)); + DEBUG(SSSDBG_CRIT_FAILURE, "message format error [%zu] > [%zd].\n", + p+msg_len, len); return EINVAL; }
@@ -564,8 +564,8 @@ parse_krb5_child_response(TALLOC_CTX *mem_ctx, uint8_t *buf, ssize_t len, tgtt.endtime = int64_to_time_t(time_data); SAFEALIGN_COPY_INT64(&time_data, buf+p+3*sizeof(int64_t), NULL); tgtt.renew_till = int64_to_time_t(time_data); - DEBUG(SSSDBG_TRACE_LIBS, ("TGT times are [%ld][%ld][%ld][%ld].\n", - tgtt.authtime, tgtt.starttime, tgtt.endtime, tgtt.renew_till)); + DEBUG(SSSDBG_TRACE_LIBS, "TGT times are [%ld][%ld][%ld][%ld].\n", + tgtt.authtime, tgtt.starttime, tgtt.endtime, tgtt.renew_till); }
if (msg_type == SSS_KRB5_INFO_UPN) { @@ -594,7 +594,7 @@ parse_krb5_child_response(TALLOC_CTX *mem_ctx, uint8_t *buf, ssize_t len, ret = pam_add_response(pd, msg_type, msg_len, &buf[p]); if (ret != EOK) { /* This is not a fatal error */ - DEBUG(SSSDBG_CRIT_FAILURE, ("pam_add_response failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "pam_add_response failed.\n"); } }
@@ -602,7 +602,7 @@ parse_krb5_child_response(TALLOC_CTX *mem_ctx, uint8_t *buf, ssize_t len,
if ((p < len) && (p + 2*sizeof(int32_t) >= len)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("The remainder of the message is too short.\n")); + "The remainder of the message is too short.\n"); return EINVAL; } } @@ -617,7 +617,7 @@ parse_krb5_child_response(TALLOC_CTX *mem_ctx, uint8_t *buf, ssize_t len, if (ccname) { res->ccname = talloc_strndup(res, ccname, ccname_len); if (res->ccname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strndup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strndup failed.\n"); talloc_free(res); return ENOMEM; } @@ -626,7 +626,7 @@ parse_krb5_child_response(TALLOC_CTX *mem_ctx, uint8_t *buf, ssize_t len, if (upn != NULL) { res->correct_upn = talloc_strndup(res, upn, upn_len); if (res->correct_upn == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strndup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strndup failed.\n"); talloc_free(res); return ENOMEM; } diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c index c40f0dd..308a4d1 100644 --- a/src/providers/krb5/krb5_common.c +++ b/src/providers/krb5/krb5_common.c @@ -48,28 +48,28 @@ errno_t check_and_export_lifetime(struct dp_option *opts, const int opt_id,
str = dp_opt_get_string(opts, opt_id); if (str == NULL || *str == '\0') { - DEBUG(5, ("No lifetime configured.\n")); + DEBUG(5, "No lifetime configured.\n"); return EOK; }
if (isdigit(str[strlen(str)-1])) { str = talloc_asprintf(opts, "%ss", str); if (str == NULL) { - DEBUG(1, ("talloc_asprintf failed\n")); + DEBUG(1, "talloc_asprintf failed\n"); return ENOMEM; } free_str = true;
ret = dp_opt_set_string(opts, opt_id, str); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed\n")); + DEBUG(1, "dp_opt_set_string failed\n"); goto done; } }
ret = krb5_string_to_deltat(str, &lifetime); if (ret != 0) { - DEBUG(1, ("Invalid value [%s] for a lifetime.\n", str)); + DEBUG(1, "Invalid value [%s] for a lifetime.\n", str); ret = EINVAL; goto done; } @@ -77,7 +77,7 @@ errno_t check_and_export_lifetime(struct dp_option *opts, const int opt_id, ret = setenv(env_name, str, 1); if (ret != EOK) { ret = errno; - DEBUG(2, ("setenv [%s] failed.\n", env_name)); + DEBUG(2, "setenv [%s] failed.\n", env_name); goto done; }
@@ -136,9 +136,9 @@ static errno_t sss_get_system_ccname_template(TALLOC_CTX *mem_ctx, char **ccname) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Your kerberos library does not support the default_ccache_name " + "Your kerberos library does not support the default_ccache_name " "option or the profile library. Please use krb5_ccname_template " - "in sssd.conf if you want to change the default\n")); + "in sssd.conf if you want to change the default\n"); *ccname = NULL; return ERR_NOT_FOUND; } @@ -151,9 +151,9 @@ static void sss_check_cc_template(const char *cc_template) template_len = strlen(cc_template); if (template_len >= 6 && strcmp(cc_template + (template_len - 6), "XXXXXX") != 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("ccache file name template [%s] doesn't " + DEBUG(SSSDBG_CONF_SETTINGS, "ccache file name template [%s] doesn't " "contain randomizing characters (XXXXXX), file might not " - "be rewritable\n", cc_template)); + "be rewritable\n", cc_template); } }
@@ -179,7 +179,7 @@ errno_t check_and_export_options(struct dp_option *opts, if (realm == NULL) { ret = dp_opt_set_string(opts, KRB5_REALM, dom->name); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); goto done; } realm = dom->name; @@ -187,23 +187,23 @@ errno_t check_and_export_options(struct dp_option *opts,
ret = setenv(SSSD_KRB5_REALM, realm, 1); if (ret != EOK) { - DEBUG(2, ("setenv %s failed, authentication might fail.\n", - SSSD_KRB5_REALM)); + DEBUG(2, "setenv %s failed, authentication might fail.\n", + SSSD_KRB5_REALM); }
ret = check_and_export_lifetime(opts, KRB5_RENEWABLE_LIFETIME, SSSD_KRB5_RENEWABLE_LIFETIME); if (ret != EOK) { - DEBUG(1, ("Failed to check value of krb5_renewable_lifetime. [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Failed to check value of krb5_renewable_lifetime. [%d][%s]\n", + ret, strerror(ret)); goto done; }
ret = check_and_export_lifetime(opts, KRB5_LIFETIME, SSSD_KRB5_LIFETIME); if (ret != EOK) { - DEBUG(1, ("Failed to check value of krb5_lifetime. [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Failed to check value of krb5_lifetime. [%d][%s]\n", + ret, strerror(ret)); goto done; }
@@ -212,20 +212,20 @@ errno_t check_and_export_options(struct dp_option *opts, if (use_fast_str != NULL) { ret = check_fast(use_fast_str, &krb5_ctx->use_fast); if (ret != EOK) { - DEBUG(1, ("check_fast failed.\n")); + DEBUG(1, "check_fast failed.\n"); goto done; }
if (krb5_ctx->use_fast) { ret = setenv(SSSD_KRB5_USE_FAST, use_fast_str, 1); if (ret != EOK) { - DEBUG(2, ("setenv [%s] failed.\n", SSSD_KRB5_USE_FAST)); + DEBUG(2, "setenv [%s] failed.\n", SSSD_KRB5_USE_FAST); } else { fast_principal = dp_opt_get_string(opts, KRB5_FAST_PRINCIPAL); if (fast_principal != NULL) { ret = setenv(SSSD_KRB5_FAST_PRINCIPAL, fast_principal, 1); if (ret != EOK) { - DEBUG(2, ("setenv [%s] failed.\n", SSSD_KRB5_FAST_PRINCIPAL)); + DEBUG(2, "setenv [%s] failed.\n", SSSD_KRB5_FAST_PRINCIPAL); } } } @@ -243,26 +243,26 @@ errno_t check_and_export_options(struct dp_option *opts, ret = setenv(SSSD_KRB5_CANONICALIZE, "false", 1); } if (ret != EOK) { - DEBUG(2, ("setenv [%s] failed.\n", SSSD_KRB5_CANONICALIZE)); + DEBUG(2, "setenv [%s] failed.\n", SSSD_KRB5_CANONICALIZE); }
dummy = dp_opt_get_cstring(opts, KRB5_KDC); if (dummy == NULL) { - DEBUG(SSSDBG_CONF_SETTINGS, ("No KDC explicitly configured, using defaults.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "No KDC explicitly configured, using defaults.\n"); }
dummy = dp_opt_get_cstring(opts, KRB5_KPASSWD); if (dummy == NULL) { - DEBUG(SSSDBG_CONF_SETTINGS, ("No kpasswd server explicitly configured, " - "using the KDC or defaults.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "No kpasswd server explicitly configured, " + "using the KDC or defaults.\n"); }
ccname = dp_opt_get_string(opts, KRB5_CCNAME_TMPL); if (ccname != NULL) { DEBUG(SSSDBG_CONF_SETTINGS, - ("The credential ccache name template has been explicitly set " + "The credential ccache name template has been explicitly set " "in sssd.conf, it is recommended to set default_ccache_name " - "in krb5.conf instead so that a system default is used\n")); + "in krb5.conf instead so that a system default is used\n"); ccname = talloc_strdup(tmp_ctx, ccname); if (!ccname) { ret = ENOMEM; @@ -285,22 +285,22 @@ errno_t check_and_export_options(struct dp_option *opts, /* set back in opts */ ret = dp_opt_set_string(opts, KRB5_CCNAME_TMPL, ccname); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("dp_opt_set_string failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "dp_opt_set_string failed.\n"); goto done; } }
if ((ccname[0] == '/') || (strncmp(ccname, "FILE:", 5) == 0)) { - DEBUG(SSSDBG_CONF_SETTINGS, ("ccache is of type FILE\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "ccache is of type FILE\n"); /* warn if the file type (which is usally created in a sticky bit * laden directory) does not have randomizing chracters */ sss_check_cc_template(ccname);
if (ccname[0] == '/') { /* /path/to/cc prepend FILE: */ - DEBUG(SSSDBG_CONF_SETTINGS, ("The ccname template was " + DEBUG(SSSDBG_CONF_SETTINGS, "The ccname template was " "missing an explicit type, but is an absolute " - "path specifier. Assuming FILE:\n")); + "path specifier. Assuming FILE:\n");
ccname = talloc_asprintf(tmp_ctx, "FILE:%s", ccname); if (!ccname) { @@ -310,7 +310,7 @@ errno_t check_and_export_options(struct dp_option *opts,
ret = dp_opt_set_string(opts, KRB5_CCNAME_TMPL, ccname); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("dp_opt_set_string failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "dp_opt_set_string failed.\n"); goto done; } } @@ -331,11 +331,11 @@ errno_t krb5_try_kdcip(struct confdb_ctx *cdb, const char *conf_path,
krb5_servers = dp_opt_get_string(opts, opt_id); if (krb5_servers == NULL) { - DEBUG(4, ("No KDC found in configuration, trying legacy option\n")); + DEBUG(4, "No KDC found in configuration, trying legacy option\n"); ret = confdb_get_string(cdb, NULL, conf_path, "krb5_kdcip", NULL, &krb5_servers); if (ret != EOK) { - DEBUG(1, ("confdb_get_string failed.\n")); + DEBUG(1, "confdb_get_string failed.\n"); return ret; }
@@ -343,19 +343,19 @@ errno_t krb5_try_kdcip(struct confdb_ctx *cdb, const char *conf_path, { ret = dp_opt_set_string(opts, opt_id, krb5_servers); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); talloc_free(krb5_servers); return ret; }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Set krb5 server [%s] based on legacy krb5_kdcip option\n", - krb5_servers)); + "Set krb5 server [%s] based on legacy krb5_kdcip option\n", + krb5_servers); DEBUG(SSSDBG_FATAL_FAILURE, - ("Your configuration uses the deprecated option " + "Your configuration uses the deprecated option " "'krb5_kdcip' to specify the KDC. Please change the " "configuration to use the 'krb5_server' option " - "instead.\n")); + "instead.\n"); talloc_free(krb5_servers); } } @@ -371,14 +371,14 @@ errno_t krb5_get_options(TALLOC_CTX *memctx, struct confdb_ctx *cdb,
opts = talloc_zero(memctx, struct dp_option); if (opts == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; }
ret = dp_get_options(opts, cdb, conf_path, default_krb5_opts, KRB5_OPTS, &opts); if (ret != EOK) { - DEBUG(1, ("dp_get_options failed.\n")); + DEBUG(1, "dp_get_options failed.\n"); goto done; }
@@ -386,7 +386,7 @@ errno_t krb5_get_options(TALLOC_CTX *memctx, struct confdb_ctx *cdb, /* FIXME - this can be removed in a future version */ ret = krb5_try_kdcip(cdb, conf_path, opts, KRB5_KDC); if (ret != EOK) { - DEBUG(1, ("sss_krb5_try_kdcip failed.\n")); + DEBUG(1, "sss_krb5_try_kdcip failed.\n"); goto done; }
@@ -416,7 +416,7 @@ errno_t write_krb5info_file(const char *realm, const char *server,
if (realm == NULL || *realm == '\0' || server == NULL || *server == '\0' || service == NULL || service == '\0') { - DEBUG(1, ("Missing or empty realm, server or service.\n")); + DEBUG(1, "Missing or empty realm, server or service.\n"); return EINVAL; }
@@ -425,7 +425,7 @@ errno_t write_krb5info_file(const char *realm, const char *server, } else if (strcmp(service, SSS_KRB5KPASSWD_FO_SRV) == 0) { name_tmpl = KPASSWDINFO_TMPL; } else { - DEBUG(1, ("Unsupported service [%s]\n.", service)); + DEBUG(1, "Unsupported service [%s]\n.", service); return EINVAL; }
@@ -433,20 +433,20 @@ errno_t write_krb5info_file(const char *realm, const char *server,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed.\n")); + DEBUG(1, "talloc_new failed.\n"); return ENOMEM; }
tmp_name = talloc_asprintf(tmp_ctx, PUBCONF_PATH"/.krb5info_dummy_XXXXXX"); if (tmp_name == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; }
krb5info_name = talloc_asprintf(tmp_ctx, name_tmpl, realm); if (krb5info_name == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -456,7 +456,7 @@ errno_t write_krb5info_file(const char *realm, const char *server, umask(old_umask); if (fd == -1) { ret = errno; - DEBUG(1, ("mkstemp failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "mkstemp failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -465,14 +465,14 @@ errno_t write_krb5info_file(const char *realm, const char *server, if (written == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("write failed [%d][%s].\n", ret, strerror(ret))); + "write failed [%d][%s].\n", ret, strerror(ret)); goto done; }
if (written != server_len) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Write error, wrote [%zd] bytes, expected [%zu]\n", - written, server_len)); + "Write error, wrote [%zd] bytes, expected [%zu]\n", + written, server_len); ret = EIO; goto done; } @@ -480,21 +480,21 @@ errno_t write_krb5info_file(const char *realm, const char *server, ret = fchmod(fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); if (ret == -1) { ret = errno; - DEBUG(1, ("fchmod failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "fchmod failed [%d][%s].\n", ret, strerror(ret)); goto done; }
ret = close(fd); if (ret == -1) { ret = errno; - DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "close failed [%d][%s].\n", ret, strerror(ret)); goto done; }
ret = rename(tmp_name, krb5info_name); if (ret == -1) { ret = errno; - DEBUG(1, ("rename failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "rename failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -514,28 +514,28 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed\n")); + DEBUG(1, "talloc_new failed\n"); return; }
krb5_service = talloc_get_type(private_data, struct krb5_service); if (!krb5_service) { - DEBUG(1, ("FATAL: Bad private_data\n")); + DEBUG(1, "FATAL: Bad private_data\n"); talloc_free(tmp_ctx); return; }
srvaddr = fo_get_server_hostent(server); if (!srvaddr) { - DEBUG(1, ("FATAL: No hostent available for server (%s)\n", - fo_get_server_str_name(server))); + DEBUG(1, "FATAL: No hostent available for server (%s)\n", + fo_get_server_str_name(server)); talloc_free(tmp_ctx); return; }
address = resolv_get_string_address(tmp_ctx, srvaddr); if (address == NULL) { - DEBUG(1, ("resolv_get_string_address failed.\n")); + DEBUG(1, "resolv_get_string_address failed.\n"); talloc_free(tmp_ctx); return; } @@ -544,7 +544,7 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server) srvaddr->family, address); if (safe_address == NULL) { - DEBUG(1, ("sss_escape_ip_address failed.\n")); + DEBUG(1, "sss_escape_ip_address failed.\n"); talloc_free(tmp_ctx); return; } @@ -553,7 +553,7 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server) safe_address = talloc_asprintf_append(safe_address, ":%d", fo_get_server_port(server)); if (safe_address == NULL) { - DEBUG(1, ("talloc_asprintf_append failed.\n")); + DEBUG(1, "talloc_asprintf_append failed.\n"); talloc_free(tmp_ctx); return; } @@ -561,7 +561,7 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server) ret = write_krb5info_file(krb5_service->realm, safe_address, krb5_service->name); if (ret != EOK) { - DEBUG(2, ("write_krb5info_file failed, authentication might fail.\n")); + DEBUG(2, "write_krb5info_file failed, authentication might fail.\n"); } }
@@ -592,7 +592,7 @@ static errno_t _krb5_servers_init(struct be_ctx *ctx,
ret = split_on_separator(tmp_ctx, servers, ',', true, true, &list, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to parse server list!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to parse server list!\n"); goto done; }
@@ -607,20 +607,20 @@ static errno_t _krb5_servers_init(struct be_ctx *ctx, if (be_fo_is_srv_identifier(server_spec)) { if (!primary) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add server [%s] to failover service: " + "Failed to add server [%s] to failover service: " "SRV resolution only allowed for primary servers!\n", - list[i])); + list[i]); continue; }
ret = be_fo_add_srv_server(ctx, service_name, service_name, NULL, BE_FO_PROTO_UDP, true, NULL); if (ret) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add server\n"); goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Added service lookup\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Added service lookup\n"); continue; }
@@ -641,34 +641,34 @@ static errno_t _krb5_servers_init(struct be_ctx *ctx, port = strtol(port_str, &endptr, 10); if (errno != 0) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("strtol failed on [%s]: [%d][%s].\n", port_str, - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "strtol failed on [%s]: [%d][%s].\n", port_str, + ret, strerror(ret)); goto done; } if (*endptr != '\0') { - DEBUG(SSSDBG_CRIT_FAILURE, ("Found additional characters [%s] in port number " - "[%s].\n", endptr, port_str)); + DEBUG(SSSDBG_CRIT_FAILURE, "Found additional characters [%s] in port number " + "[%s].\n", endptr, port_str); ret = EINVAL; goto done; }
if (port < 1 || port > 65535) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Illegal port number [%ld].\n", port)); + DEBUG(SSSDBG_CRIT_FAILURE, "Illegal port number [%ld].\n", port); ret = EINVAL; goto done; } } else if (isalpha(*port_str)) { servent = getservbyname(port_str, NULL); if (servent == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("getservbyname cannot find service [%s].\n", - port_str)); + DEBUG(SSSDBG_CRIT_FAILURE, "getservbyname cannot find service [%s].\n", + port_str); ret = EINVAL; goto done; }
port = servent->s_port; } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unsupported port specifier in [%s].\n", list[i])); + DEBUG(SSSDBG_CRIT_FAILURE, "Unsupported port specifier in [%s].\n", list[i]); ret = EINVAL; goto done; } @@ -684,11 +684,11 @@ static errno_t _krb5_servers_init(struct be_ctx *ctx, ret = be_fo_add_server(ctx, service_name, server_spec, (int) port, list[i], primary); if (ret && ret != EEXIST) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to add server\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to add server\n"); goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Added Server %s\n", list[i])); + DEBUG(SSSDBG_TRACE_FUNC, "Added Server %s\n", list[i]); }
done: @@ -740,7 +740,7 @@ int krb5_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
ret = be_fo_add_service(ctx, service_name, krb5_user_data_cmp); if (ret != EOK) { - DEBUG(1, ("Failed to create failover service!\n")); + DEBUG(1, "Failed to create failover service!\n"); goto done; }
@@ -760,7 +760,7 @@ int krb5_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
if (!primary_servers) { DEBUG(SSSDBG_CONF_SETTINGS, - ("No primary servers defined, using service discovery\n")); + "No primary servers defined, using service discovery\n"); primary_servers = BE_SRV_IDENTIFIER; }
@@ -780,7 +780,7 @@ int krb5_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, ret = be_fo_service_add_callback(memctx, ctx, service_name, krb5_resolve_callback, service); if (ret != EOK) { - DEBUG(1, ("Failed to add failover callback!\n")); + DEBUG(1, "Failed to add failover callback!\n"); goto done; }
@@ -803,7 +803,7 @@ errno_t remove_krb5_info_files(TALLOC_CTX *mem_ctx, const char *realm)
file = talloc_asprintf(mem_ctx, KDCINFO_TMPL, realm); if(file == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return ENOMEM; }
@@ -811,13 +811,13 @@ errno_t remove_krb5_info_files(TALLOC_CTX *mem_ctx, const char *realm) ret = unlink(file); if (ret == -1) { err = errno; - DEBUG(5, ("Could not remove [%s], [%d][%s]\n", file, - err, strerror(err))); + DEBUG(5, "Could not remove [%s], [%d][%s]\n", file, + err, strerror(err)); }
file = talloc_asprintf(mem_ctx, KPASSWDINFO_TMPL, realm); if(file == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return ENOMEM; }
@@ -825,8 +825,8 @@ errno_t remove_krb5_info_files(TALLOC_CTX *mem_ctx, const char *realm) ret = unlink(file); if (ret == -1) { err = errno; - DEBUG(5, ("Could not remove [%s], [%d][%s]\n", file, - err, strerror(err))); + DEBUG(5, "Could not remove [%s], [%d][%s]\n", file, + err, strerror(err)); }
return EOK; @@ -842,31 +842,31 @@ void remove_krb5_info_files_callback(void *pvt) ret = be_fo_run_callbacks_at_next_request(ctx->be_ctx, ctx->kdc_service_name); if (ret != EOK) { - DEBUG(1, ("be_fo_run_callbacks_at_next_request failed, " + DEBUG(1, "be_fo_run_callbacks_at_next_request failed, " "krb5 info files will not be removed, because " - "it is unclear if they will be recreated properly.\n")); + "it is unclear if they will be recreated properly.\n"); return; } if (ctx->kpasswd_service_name != NULL) { ret = be_fo_run_callbacks_at_next_request(ctx->be_ctx, ctx->kpasswd_service_name); if (ret != EOK) { - DEBUG(1, ("be_fo_run_callbacks_at_next_request failed, " + DEBUG(1, "be_fo_run_callbacks_at_next_request failed, " "krb5 info files will not be removed, because " - "it is unclear if they will be recreated properly.\n")); + "it is unclear if they will be recreated properly.\n"); return; } }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed, cannot remove krb5 info files.\n")); + DEBUG(1, "talloc_new failed, cannot remove krb5 info files.\n"); return; }
ret = remove_krb5_info_files(tmp_ctx, ctx->realm); if (ret != EOK) { - DEBUG(1, ("remove_krb5_info_files failed.\n")); + DEBUG(1, "remove_krb5_info_files failed.\n"); }
talloc_zfree(tmp_ctx); @@ -884,7 +884,7 @@ void krb5_finalize(struct tevent_context *ev,
ret = remove_krb5_info_files(se, realm); if (ret != EOK) { - DEBUG(1, ("remove_krb5_info_files failed.\n")); + DEBUG(1, "remove_krb5_info_files failed.\n"); }
sig_term(signum); @@ -898,26 +898,26 @@ errno_t krb5_install_offline_callback(struct be_ctx *be_ctx, const char *krb5_realm;
if (krb5_ctx->service == NULL || krb5_ctx->service->name == NULL) { - DEBUG(1, ("Missing KDC service name!\n")); + DEBUG(1, "Missing KDC service name!\n"); return EINVAL; }
ctx = talloc_zero(krb5_ctx, struct remove_info_files_ctx); if (ctx == NULL) { - DEBUG(1, ("talloc_zfree failed.\n")); + DEBUG(1, "talloc_zfree failed.\n"); return ENOMEM; }
krb5_realm = dp_opt_get_cstring(krb5_ctx->opts, KRB5_REALM); if (krb5_realm == NULL) { - DEBUG(1, ("Missing krb5_realm option!\n")); + DEBUG(1, "Missing krb5_realm option!\n"); ret = EINVAL; goto done; }
ctx->realm = talloc_strdup(ctx, krb5_realm); if (ctx->realm == NULL) { - DEBUG(1, ("talloc_strdup failed!\n")); + DEBUG(1, "talloc_strdup failed!\n"); ret = ENOMEM; goto done; } @@ -933,7 +933,7 @@ errno_t krb5_install_offline_callback(struct be_ctx *be_ctx, ret = be_add_offline_cb(ctx, be_ctx, remove_krb5_info_files_callback, ctx, NULL); if (ret != EOK) { - DEBUG(1, ("be_add_offline_cb failed.\n")); + DEBUG(1, "be_add_offline_cb failed.\n"); goto done; }
@@ -958,20 +958,20 @@ errno_t krb5_install_sigterm_handler(struct tevent_context *ev,
krb5_realm = dp_opt_get_cstring(krb5_ctx->opts, KRB5_REALM); if (krb5_realm == NULL) { - DEBUG(1, ("Missing krb5_realm option!\n")); + DEBUG(1, "Missing krb5_realm option!\n"); return EINVAL; }
sig_realm = talloc_strdup(krb5_ctx, krb5_realm); if (sig_realm == NULL) { - DEBUG(1, ("talloc_strdup failed!\n")); + DEBUG(1, "talloc_strdup failed!\n"); return ENOMEM; }
sige = tevent_add_signal(ev, krb5_ctx, SIGTERM, SA_SIGINFO, krb5_finalize, sig_realm); if (sige == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); talloc_free(sig_realm); return ENOMEM; } @@ -994,7 +994,7 @@ errno_t krb5_get_simple_upn(TALLOC_CTX *mem_ctx, struct krb5_ctx *krb5_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -1002,14 +1002,14 @@ errno_t krb5_get_simple_upn(TALLOC_CTX *mem_ctx, struct krb5_ctx *krb5_ctx, strcasecmp(dom->name, user_dom) != 0) { uc_dom = get_uppercase_realm(tmp_ctx, user_dom); if (uc_dom == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("get_uppercase_realm failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_uppercase_realm failed.\n"); ret = ENOMEM; goto done; } } else { realm = dp_opt_get_cstring(krb5_ctx->opts, KRB5_REALM); if (realm == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing Kerberos realm.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing Kerberos realm.\n"); ret = ENOMEM; goto done; } @@ -1021,8 +1021,8 @@ errno_t krb5_get_simple_upn(TALLOC_CTX *mem_ctx, struct krb5_ctx *krb5_ctx, ret = sss_parse_name(tmp_ctx, dom->names, username, &domname, &name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not parse [%s] into name and " - "domain components, login might fail\n", username)); + "Could not parse [%s] into name and " + "domain components, login might fail\n", username); name = discard_const(username); }
@@ -1030,12 +1030,12 @@ errno_t krb5_get_simple_upn(TALLOC_CTX *mem_ctx, struct krb5_ctx *krb5_ctx, upn = talloc_asprintf(tmp_ctx, "%s@%s", name, realm != NULL ? realm : uc_dom); if (upn == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; }
- DEBUG(9, ("Using simple UPN [%s].\n", upn)); + DEBUG(9, "Using simple UPN [%s].\n", upn);
*_upn = talloc_steal(mem_ctx, upn); ret = EOK; diff --git a/src/providers/krb5/krb5_delayed_online_authentication.c b/src/providers/krb5/krb5_delayed_online_authentication.c index 46ed6f6..05d80af 100644 --- a/src/providers/krb5/krb5_delayed_online_authentication.c +++ b/src/providers/krb5/krb5_delayed_online_authentication.c @@ -80,7 +80,7 @@ static void authenticate_user(struct tevent_context *ev, keysize = keyctl_read_alloc(pd->key_serial, (void **)&password); if (keysize == -1) { ret = errno; - DEBUG(1, ("keyctl_read failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "keyctl_read failed [%d][%s].\n", ret, strerror(ret)); return; }
@@ -88,22 +88,22 @@ static void authenticate_user(struct tevent_context *ev, safezero(password, keysize); free(password); if (ret) { - DEBUG(1, ("failed to set password in auth token [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "failed to set password in auth token [%d][%s].\n", + ret, strerror(ret)); return; }
keyrevoke = keyctl_revoke(pd->key_serial); if (keyrevoke == -1) { ret = errno; - DEBUG(1, ("keyctl_revoke failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "keyctl_revoke failed [%d][%s].\n", ret, strerror(ret)); } #endif
req = krb5_auth_send(auth_data, ev, auth_data->be_ctx, auth_data->pd, auth_data->krb5_ctx); if (req == NULL) { - DEBUG(1, ("krb5_auth_send failed.\n")); + DEBUG(1, "krb5_auth_send failed.\n"); talloc_free(auth_data); return; } @@ -121,14 +121,14 @@ static void authenticate_user_done(struct tevent_req *req) { ret = krb5_auth_recv(req, &pam_status, &dp_err); talloc_free(req); if (ret) { - DEBUG(1, ("krb5_auth request failed.\n")); + DEBUG(1, "krb5_auth request failed.\n"); } else { if (pam_status == PAM_SUCCESS) { - DEBUG(4, ("Successfully authenticated user [%s].\n", - auth_data->pd->user)); + DEBUG(4, "Successfully authenticated user [%s].\n", + auth_data->pd->user); } else { - DEBUG(1, ("Failed to authenticate user [%s].\n", - auth_data->pd->user)); + DEBUG(1, "Failed to authenticate user [%s].\n", + auth_data->pd->user); } }
@@ -150,13 +150,13 @@ static errno_t authenticate_stored_users(
ret = get_uid_table(deferred_auth_ctx, &uid_table); if (ret != HASH_SUCCESS) { - DEBUG(1, ("get_uid_table failed.\n")); + DEBUG(1, "get_uid_table failed.\n"); return ret; }
iter = new_hash_iter_context(deferred_auth_ctx->user_table); if (iter == NULL) { - DEBUG(1, ("new_hash_iter_context failed.\n")); + DEBUG(1, "new_hash_iter_context failed.\n"); return EINVAL; }
@@ -168,13 +168,13 @@ static errno_t authenticate_stored_users( ret = hash_lookup(uid_table, &key, &value);
if (ret == HASH_SUCCESS) { - DEBUG(1, ("User [%s] is still logged in, " - "trying online authentication.\n", pd->user)); + DEBUG(1, "User [%s] is still logged in, " + "trying online authentication.\n", pd->user);
auth_data = talloc_zero(deferred_auth_ctx->be_ctx, struct auth_data); if (auth_data == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); } else { auth_data->pd = talloc_steal(auth_data, pd); auth_data->krb5_ctx = deferred_auth_ctx->krb5_ctx; @@ -184,20 +184,20 @@ static errno_t authenticate_stored_users( auth_data, tevent_timeval_current(), authenticate_user, auth_data); if (te == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); } } } else { - DEBUG(1, ("User [%s] is not logged in anymore, " - "discarding online authentication.\n", pd->user)); + DEBUG(1, "User [%s] is not logged in anymore, " + "discarding online authentication.\n", pd->user); talloc_free(pd); }
ret = hash_delete(deferred_auth_ctx->user_table, &entry->key); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_delete failed [%s].\n", - hash_error_string(ret))); + DEBUG(1, "hash_delete failed [%s].\n", + hash_error_string(ret)); } }
@@ -213,15 +213,15 @@ static void delayed_online_authentication_callback(void *private_data) int ret;
if (deferred_auth_ctx->user_table == NULL) { - DEBUG(1, ("Delayed online authentication activated, " - "but user table does not exists.\n")); + DEBUG(1, "Delayed online authentication activated, " + "but user table does not exists.\n"); return; }
- DEBUG(5, ("Backend is online, starting delayed online authentication.\n")); + DEBUG(5, "Backend is online, starting delayed online authentication.\n"); ret = authenticate_stored_users(deferred_auth_ctx); if (ret != EOK) { - DEBUG(1, ("authenticate_stored_users failed.\n")); + DEBUG(1, "authenticate_stored_users failed.\n"); }
return; @@ -237,23 +237,23 @@ errno_t add_user_to_delayed_online_authentication(struct krb5_ctx *krb5_ctx, struct pam_data *new_pd;
if (krb5_ctx->deferred_auth_ctx == NULL) { - DEBUG(1, ("Missing context for delayed online authentication.\n")); + DEBUG(1, "Missing context for delayed online authentication.\n"); return EINVAL; }
if (krb5_ctx->deferred_auth_ctx->user_table == NULL) { - DEBUG(1, ("user_table not available.\n")); + DEBUG(1, "user_table not available.\n"); return EINVAL; }
if (sss_authtok_get_type(pd->authtok) != SSS_AUTHTOK_TYPE_PASSWORD) { - DEBUG(1, ("Invalid authtok for user [%s].\n", pd->user)); + DEBUG(1, "Invalid authtok for user [%s].\n", pd->user); return EINVAL; }
ret = copy_pam_data(krb5_ctx->deferred_auth_ctx, pd, &new_pd); if (ret != EOK) { - DEBUG(1, ("copy_pam_data failed\n")); + DEBUG(1, "copy_pam_data failed\n"); return ENOMEM; }
@@ -264,7 +264,7 @@ errno_t add_user_to_delayed_online_authentication(struct krb5_ctx *krb5_ctx,
ret = sss_authtok_get_password(new_pd->authtok, &password, &len); if (ret) { - DEBUG(1, ("Failed to get password [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "Failed to get password [%d][%s].\n", ret, strerror(ret)); sss_authtok_set_empty(new_pd->authtok); talloc_free(new_pd); return ret; @@ -274,14 +274,14 @@ errno_t add_user_to_delayed_online_authentication(struct krb5_ctx *krb5_ctx, KEY_SPEC_SESSION_KEYRING); if (new_pd->key_serial == -1) { ret = errno; - DEBUG(1, ("add_key failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "add_key failed [%d][%s].\n", ret, strerror(ret)); sss_authtok_set_empty(new_pd->authtok); talloc_free(new_pd); return ret; } DEBUG(SSSDBG_TRACE_ALL, - ("Saved authtok of user [%s] with serial [%"SPRIkey_ser"].\n", - new_pd->user, new_pd->key_serial)); + "Saved authtok of user [%s] with serial [%"SPRIkey_ser"].\n", + new_pd->user, new_pd->key_serial); sss_authtok_set_empty(new_pd->authtok); #endif
@@ -293,15 +293,15 @@ errno_t add_user_to_delayed_online_authentication(struct krb5_ctx *krb5_ctx, ret = hash_enter(krb5_ctx->deferred_auth_ctx->user_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(1, ("Cannot add user [%s] to table [%s], " + DEBUG(1, "Cannot add user [%s] to table [%s], " "delayed online authentication not possible.\n", - pd->user, hash_error_string(ret))); + pd->user, hash_error_string(ret)); talloc_free(new_pd); return ENOMEM; }
- DEBUG(9, ("Added user [%s] successfully to " - "delayed online authentication.\n", pd->user)); + DEBUG(9, "Added user [%s] successfully to " + "delayed online authentication.\n", pd->user);
return EOK; } @@ -316,24 +316,24 @@ errno_t init_delayed_online_authentication(struct krb5_ctx *krb5_ctx, ret = get_uid_table(krb5_ctx, &tmp_table); if (ret != EOK) { if (ret == ENOSYS) { - DEBUG(0, ("Delayed online auth was requested " - "on an unsupported system.\n")); + DEBUG(0, "Delayed online auth was requested " + "on an unsupported system.\n"); } else { - DEBUG(0, ("Delayed online auth was requested " - "but initialisation failed.\n")); + DEBUG(0, "Delayed online auth was requested " + "but initialisation failed.\n"); } return ret; } ret = hash_destroy(tmp_table); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_destroy failed [%s].\n", hash_error_string(ret))); + DEBUG(1, "hash_destroy failed [%s].\n", hash_error_string(ret)); return EFAULT; }
krb5_ctx->deferred_auth_ctx = talloc_zero(krb5_ctx, struct deferred_auth_ctx); if (krb5_ctx->deferred_auth_ctx == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; }
@@ -343,7 +343,7 @@ errno_t init_delayed_online_authentication(struct krb5_ctx *krb5_ctx, krb5_ctx->deferred_auth_ctx, NULL, NULL); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_create_ex failed [%s]\n", hash_error_string(ret))); + DEBUG(1, "hash_create_ex failed [%s]\n", hash_error_string(ret)); ret = ENOMEM; goto fail; } @@ -356,7 +356,7 @@ errno_t init_delayed_online_authentication(struct krb5_ctx *krb5_ctx, delayed_online_authentication_callback, krb5_ctx->deferred_auth_ctx, NULL); if (ret != EOK) { - DEBUG(1, ("be_add_online_cb failed.\n")); + DEBUG(1, "be_add_online_cb failed.\n"); goto fail; }
diff --git a/src/providers/krb5/krb5_init.c b/src/providers/krb5/krb5_init.c index 91f701a..71a97c1 100644 --- a/src/providers/krb5/krb5_init.c +++ b/src/providers/krb5/krb5_init.c @@ -72,13 +72,13 @@ int sssm_krb5_auth_init(struct be_ctx *bectx, if (krb5_options == NULL) { krb5_options = talloc_zero(bectx, struct krb5_options); if (krb5_options == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; } ret = krb5_get_options(krb5_options, bectx->cdb, bectx->conf_path, &krb5_options->opts); if (ret != EOK) { - DEBUG(1, ("krb5_get_options failed.\n")); + DEBUG(1, "krb5_get_options failed.\n"); return ret; } } @@ -91,7 +91,7 @@ int sssm_krb5_auth_init(struct be_ctx *bectx,
ctx = talloc_zero(bectx, struct krb5_ctx); if (!ctx) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; } krb5_options->auth_ctx = ctx; @@ -105,7 +105,7 @@ int sssm_krb5_auth_init(struct be_ctx *bectx,
krb5_realm = dp_opt_get_string(ctx->opts, KRB5_REALM); if (krb5_realm == NULL) { - DEBUG(0, ("Missing krb5_realm option!\n")); + DEBUG(0, "Missing krb5_realm option!\n"); return EINVAL; }
@@ -116,7 +116,7 @@ int sssm_krb5_auth_init(struct be_ctx *bectx, KRB5_USE_KDCINFO), &ctx->service); if (ret != EOK) { - DEBUG(0, ("Failed to init KRB5 failover service!\n")); + DEBUG(0, "Failed to init KRB5 failover service!\n"); return ret; }
@@ -124,15 +124,15 @@ int sssm_krb5_auth_init(struct be_ctx *bectx, krb5_backup_kpasswd_servers = dp_opt_get_string(ctx->opts, KRB5_BACKUP_KPASSWD); if (krb5_kpasswd_servers == NULL && krb5_backup_kpasswd_servers != NULL) { - DEBUG(SSSDBG_CONF_SETTINGS, ("kpasswd server wasn't specified but " - "backup kpasswd given. Using it as primary\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "kpasswd server wasn't specified but " + "backup kpasswd given. Using it as primary\n"); krb5_kpasswd_servers = krb5_backup_kpasswd_servers; krb5_backup_kpasswd_servers = NULL; }
if (krb5_kpasswd_servers == NULL && krb5_servers != NULL) { - DEBUG(0, ("Missing krb5_kpasswd option and KDC set explicitly, " - "will use KDC for pasword change operations!\n")); + DEBUG(0, "Missing krb5_kpasswd option and KDC set explicitly, " + "will use KDC for pasword change operations!\n"); ctx->kpasswd_service = NULL; } else { ret = krb5_service_init(ctx, bectx, @@ -142,7 +142,7 @@ int sssm_krb5_auth_init(struct be_ctx *bectx, KRB5_USE_KDCINFO), &ctx->kpasswd_service); if (ret != EOK) { - DEBUG(0, ("Failed to init KRB5KPASSWD failover service!\n")); + DEBUG(0, "Failed to init KRB5KPASSWD failover service!\n"); return ret; } } @@ -151,16 +151,16 @@ int sssm_krb5_auth_init(struct be_ctx *bectx, ret = krb5_child_init(ctx, bectx); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not initialize krb5_child settings: [%s]\n", - strerror(ret))); + "Could not initialize krb5_child settings: [%s]\n", + strerror(ret)); goto fail; }
ctx->illegal_path_re = pcre_compile2(ILLEGAL_PATH_PATTERN, 0, &errval, &errstr, &errpos, NULL); if (ctx->illegal_path_re == NULL) { - DEBUG(1, ("Invalid Regular Expression pattern at position %d. " - "(Error: %d [%s])\n", errpos, errval, errstr)); + DEBUG(1, "Invalid Regular Expression pattern at position %d. " + "(Error: %d [%s])\n", errpos, errval, errstr); ret = EFAULT; goto fail; } diff --git a/src/providers/krb5/krb5_init_shared.c b/src/providers/krb5/krb5_init_shared.c index 4573d75..619237b 100644 --- a/src/providers/krb5/krb5_init_shared.c +++ b/src/providers/krb5/krb5_init_shared.c @@ -39,7 +39,7 @@ errno_t krb5_child_init(struct krb5_ctx *krb5_auth_ctx, ret = init_delayed_online_authentication(krb5_auth_ctx, bectx, bectx->ev); if (ret != EOK) { - DEBUG(1, ("init_delayed_online_authentication failed.\n")); + DEBUG(1, "init_delayed_online_authentication failed.\n"); goto done; } } @@ -49,7 +49,7 @@ errno_t krb5_child_init(struct krb5_ctx *krb5_auth_ctx, ret = krb5_string_to_deltat(renew_interval_str, &renew_interval_delta); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Reading krb5_renew_interval failed.\n")); + "Reading krb5_renew_interval failed.\n"); renew_interval_delta = 0; } renew_intv = renew_interval_delta; @@ -58,7 +58,7 @@ errno_t krb5_child_init(struct krb5_ctx *krb5_auth_ctx, if (renew_intv > 0) { ret = init_renew_tgt(krb5_auth_ctx, bectx, bectx->ev, renew_intv); if (ret != EOK) { - DEBUG(1, ("init_renew_tgt failed.\n")); + DEBUG(1, "init_renew_tgt failed.\n"); goto done; } } @@ -66,33 +66,33 @@ errno_t krb5_child_init(struct krb5_ctx *krb5_auth_ctx, ret = check_and_export_options(krb5_auth_ctx->opts, bectx->domain, krb5_auth_ctx); if (ret != EOK) { - DEBUG(1, ("check_and_export_opts failed.\n")); + DEBUG(1, "check_and_export_opts failed.\n"); goto done; }
ret = krb5_install_offline_callback(bectx, krb5_auth_ctx); if (ret != EOK) { - DEBUG(1, ("krb5_install_offline_callback failed.\n")); + DEBUG(1, "krb5_install_offline_callback failed.\n"); goto done; }
ret = krb5_install_sigterm_handler(bectx->ev, krb5_auth_ctx); if (ret != EOK) { - DEBUG(1, ("krb5_install_sigterm_handler failed.\n")); + DEBUG(1, "krb5_install_sigterm_handler failed.\n"); goto done; }
if (debug_to_file != 0) { ret = open_debug_file_ex(KRB5_CHILD_LOG_FILE, &debug_filep, false); if (ret != EOK) { - DEBUG(0, ("Error setting up logging (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(0, "Error setting up logging (%d) [%s]\n", + ret, strerror(ret)); goto done; }
krb5_auth_ctx->child_debug_fd = fileno(debug_filep); if (krb5_auth_ctx->child_debug_fd == -1) { - DEBUG(0, ("fileno failed [%d][%s]\n", errno, strerror(errno))); + DEBUG(0, "fileno failed [%d][%s]\n", errno, strerror(errno)); ret = errno; goto done; } diff --git a/src/providers/krb5/krb5_renew_tgt.c b/src/providers/krb5/krb5_renew_tgt.c index 5d5a25b..2577d98 100644 --- a/src/providers/krb5/krb5_renew_tgt.c +++ b/src/providers/krb5/krb5_renew_tgt.c @@ -68,7 +68,7 @@ static void renew_tgt(struct tevent_context *ev, struct tevent_timer *te, req = krb5_auth_send(auth_data, ev, auth_data->be_ctx, auth_data->pd, auth_data->krb5_ctx); if (req == NULL) { - DEBUG(1, ("krb5_auth_send failed.\n")); + DEBUG(1, "krb5_auth_send failed.\n"); /* Give back the pam data to the renewal item to be able to retry at the next * time the renewals re run. */ auth_data->renew_data->pd = talloc_steal(auth_data->renew_data, @@ -92,17 +92,17 @@ static void renew_tgt_done(struct tevent_req *req) ret = krb5_auth_recv(req, &pam_status, &dp_err); talloc_free(req); if (ret) { - DEBUG(1, ("krb5_auth request failed.\n")); + DEBUG(1, "krb5_auth request failed.\n"); if (auth_data->renew_data != NULL) { - DEBUG(5, ("Giving back pam data.\n")); + DEBUG(5, "Giving back pam data.\n"); auth_data->renew_data->pd = talloc_steal(auth_data->renew_data, auth_data->pd); } } else { switch (pam_status) { case PAM_SUCCESS: - DEBUG(4, ("Successfully renewed TGT for user [%s].\n", - auth_data->pd->user)); + DEBUG(4, "Successfully renewed TGT for user [%s].\n", + auth_data->pd->user); /* In general a successful renewal will update the renewal item and free the * old data. But if the TGT has reached the end of his renewable lifetime it * will not be put into the list of renewable tickets again. In this case the @@ -114,33 +114,33 @@ static void renew_tgt_done(struct tevent_req *req) if (value.type == HASH_VALUE_PTR && auth_data->renew_data == talloc_get_type(value.ptr, struct renew_data)) { - DEBUG(5, ("New TGT was not added for renewal, " + DEBUG(5, "New TGT was not added for renewal, " "removing list entry for user [%s].\n", - auth_data->pd->user)); + auth_data->pd->user); ret = hash_delete(auth_data->table, &auth_data->key); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_delete failed.\n")); + DEBUG(1, "hash_delete failed.\n"); } } } break; case PAM_AUTHINFO_UNAVAIL: case PAM_AUTHTOK_LOCK_BUSY: - DEBUG(4, ("Cannot renewed TGT for user [%s] while offline, " + DEBUG(4, "Cannot renewed TGT for user [%s] while offline, " "will retry later.\n", - auth_data->pd->user)); + auth_data->pd->user); if (auth_data->renew_data != NULL) { - DEBUG(5, ("Giving back pam data.\n")); + DEBUG(5, "Giving back pam data.\n"); auth_data->renew_data->pd = talloc_steal(auth_data->renew_data, auth_data->pd); } break; default: - DEBUG(1, ("Failed to renew TGT for user [%s].\n", - auth_data->pd->user)); + DEBUG(1, "Failed to renew TGT for user [%s].\n", + auth_data->pd->user); ret = hash_delete(auth_data->table, &auth_data->key); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_delete failed.\n")); + DEBUG(1, "hash_delete failed.\n"); } } } @@ -161,7 +161,7 @@ static errno_t renew_all_tgts(struct renew_tgt_ctx *renew_tgt_ctx)
ret = hash_entries(renew_tgt_ctx->tgt_table, &count, &entries); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_entries failed.\n")); + DEBUG(1, "hash_entries failed.\n"); return ENOMEM; }
@@ -169,14 +169,14 @@ static errno_t renew_all_tgts(struct renew_tgt_ctx *renew_tgt_ctx)
for (c = 0; c < count; c++) { renew_data = talloc_get_type(entries[c].value.ptr, struct renew_data); - DEBUG(9, ("Checking [%s] for renewal at [%.24s].\n", renew_data->ccfile, - ctime(&renew_data->start_renew_at))); + DEBUG(9, "Checking [%s] for renewal at [%.24s].\n", renew_data->ccfile, + ctime(&renew_data->start_renew_at)); /* If renew_data->pd == NULL a renewal request for this data is * currently running so we skip it. */ if (renew_data->start_renew_at < now && renew_data->pd != NULL) { auth_data = talloc_zero(renew_tgt_ctx, struct auth_data); if (auth_data == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); } else { /* We need to steal the pam_data here, because a successful renewal of the * ticket might add a new renewal item to the list with the same key (upn). @@ -196,22 +196,22 @@ static errno_t renew_all_tgts(struct renew_tgt_ctx *renew_tgt_ctx) auth_data->key.str = talloc_strdup(auth_data, entries[c].key.str); if (auth_data->key.str == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); } else { te = tevent_add_timer(renew_tgt_ctx->ev, auth_data, tevent_timeval_current(), renew_tgt, auth_data); if (te == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); } } }
if (auth_data == NULL || te == NULL) { - DEBUG(1, ("Failed to renew TGT in [%s].\n", renew_data->ccfile)); + DEBUG(1, "Failed to renew TGT in [%s].\n", renew_data->ccfile); ret = hash_delete(renew_tgt_ctx->tgt_table, &entries[c].key); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_delete failed.\n")); + DEBUG(1, "hash_delete failed.\n"); } } } @@ -259,25 +259,25 @@ static void renew_handler(struct renew_tgt_ctx *renew_tgt_ctx) int ret;
if (be_is_offline(renew_tgt_ctx->be_ctx)) { - DEBUG(4, ("Offline, disable renew timer.\n")); + DEBUG(4, "Offline, disable renew timer.\n"); return; }
ret = renew_all_tgts(renew_tgt_ctx); if (ret != EOK) { - DEBUG(1, ("renew_all_tgts failed. " - "Disabling automatic TGT renewal\n")); + DEBUG(1, "renew_all_tgts failed. " + "Disabling automatic TGT renewal\n"); sss_log(SSS_LOG_ERR, "Disabling automatic TGT renewal."); talloc_zfree(renew_tgt_ctx); return; }
if (renew_tgt_ctx->te != NULL) { - DEBUG(7, ("There is an active renewal timer, doing nothing.\n")); + DEBUG(7, "There is an active renewal timer, doing nothing.\n"); return; }
- DEBUG(7, ("Adding new renew timer.\n")); + DEBUG(7, "Adding new renew timer.\n");
next = tevent_timeval_current_ofs(renew_tgt_ctx->timer_interval, 0); @@ -285,7 +285,7 @@ static void renew_handler(struct renew_tgt_ctx *renew_tgt_ctx) next, renew_tgt_timer_handler, renew_tgt_ctx); if (renew_tgt_ctx->te == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); sss_log(SSS_LOG_ERR, "Disabling automatic TGT renewal."); talloc_zfree(renew_tgt_ctx); } @@ -303,7 +303,7 @@ static void renew_del_cb(hash_entry_t *entry, hash_destroy_enum type, void *pvt) return; }
- DEBUG(1, ("Unexpected value type [%d].\n", entry->value.type)); + DEBUG(1, "Unexpected value type [%d].\n", entry->value.type); }
static errno_t check_ccache_file(struct renew_tgt_ctx *renew_tgt_ctx, @@ -318,10 +318,10 @@ static errno_t check_ccache_file(struct renew_tgt_ctx *renew_tgt_ctx, const char *filename;
if (ccache_file == NULL || upn == NULL || user_name == NULL) { - DEBUG(6, ("Missing one of the needed attributes: [%s][%s][%s].\n", + DEBUG(6, "Missing one of the needed attributes: [%s][%s][%s].\n", ccache_file == NULL ? "cache file missing" : ccache_file, upn == NULL ? "principal missing" : upn, - user_name == NULL ? "user name missing" : user_name)); + user_name == NULL ? "user name missing" : user_name); return EINVAL; }
@@ -339,12 +339,12 @@ static errno_t check_ccache_file(struct renew_tgt_ctx *renew_tgt_ctx, return ret; }
- DEBUG(9, ("Found ccache file [%s].\n", ccache_file)); + DEBUG(9, "Found ccache file [%s].\n", ccache_file);
memset(&tgtt, 0, sizeof(tgtt)); ret = get_ccache_file_data(ccache_file, upn, &tgtt); if (ret != EOK) { - DEBUG(1, ("get_ccache_file_data failed.\n")); + DEBUG(1, "get_ccache_file_data failed.\n"); return ret; }
@@ -354,15 +354,15 @@ static errno_t check_ccache_file(struct renew_tgt_ctx *renew_tgt_ctx, now = time(NULL); if (tgtt.renew_till > tgtt.endtime && tgtt.renew_till > now && tgtt.endtime > now) { - DEBUG(7, ("Adding [%s] for automatic renewal.\n", ccache_file)); + DEBUG(7, "Adding [%s] for automatic renewal.\n", ccache_file); ret = add_tgt_to_renew_table(renew_tgt_ctx->krb5_ctx, ccache_file, &tgtt, &pd, upn); if (ret != EOK) { - DEBUG(1, ("add_tgt_to_renew_table failed, " - "automatic renewal not possible.\n")); + DEBUG(1, "add_tgt_to_renew_table failed, " + "automatic renewal not possible.\n"); } } else { - DEBUG(9, ("TGT in [%s] for [%s] is too old.\n", ccache_file, upn)); + DEBUG(9, "TGT in [%s] for [%s] is too old.\n", ccache_file, upn); }
return EOK; @@ -388,13 +388,13 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed.\n")); + DEBUG(1, "talloc_new failed.\n"); return ENOMEM; }
base_dn = sysdb_base_dn(renew_tgt_ctx->be_ctx->domain->sysdb, tmp_ctx); if (base_dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_base_dn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_base_dn failed.\n"); ret = ENOMEM; goto done; } @@ -403,23 +403,23 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx) LDB_SCOPE_SUBTREE, ccache_filter, ccache_attrs, &msgs_count, &msgs); if (ret != EOK) { - DEBUG(1, ("sysdb_search_entry failed.\n")); + DEBUG(1, "sysdb_search_entry failed.\n"); goto done; }
if (msgs_count == 0) { - DEBUG(9, ("No entries with ccache file found in cache.\n")); + DEBUG(9, "No entries with ccache file found in cache.\n"); ret = EOK; goto done; } DEBUG(SSSDBG_TRACE_ALL, - ("Found [%zu] entries with ccache file in cache.\n", msgs_count)); + "Found [%zu] entries with ccache file in cache.\n", msgs_count);
for (c = 0; c < msgs_count; c++) { user_name = ldb_msg_find_attr_as_string(msgs[c], SYSDB_NAME, NULL); if (user_name == NULL) { - DEBUG(1, ("No user name found, this is a severe error, " - "but we ignore it here.\n")); + DEBUG(1, "No user name found, this is a severe error, " + "but we ignore it here.\n"); continue; }
@@ -429,15 +429,15 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
user_dom_val = ldb_dn_get_component_val(msgs[c]->dn, 2); if (user_dom_val == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid user DN [%s].\n", - ldb_dn_get_linearized(msgs[c]->dn))); + DEBUG(SSSDBG_OP_FAILURE, "Invalid user DN [%s].\n", + ldb_dn_get_linearized(msgs[c]->dn)); ret = EINVAL; goto done; } user_dom = talloc_strndup(tmp_ctx, (char *) user_dom_val->data, user_dom_val->length); if (user_dom == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strndup failed,\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strndup failed,\n"); ret = ENOMEM; goto done; } @@ -446,7 +446,7 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx) renew_tgt_ctx->be_ctx->domain, user_name, user_dom, &upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("find_or_guess_upn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_or_guess_upn failed.\n"); goto done; }
@@ -455,7 +455,7 @@ static errno_t check_ccache_files(struct renew_tgt_ctx *renew_tgt_ctx)
ret = check_ccache_file(renew_tgt_ctx, ccache_file, upn, user_name); if (ret != EOK) { - DEBUG(5, ("Failed to check ccache file [%s].\n", ccache_file)); + DEBUG(5, "Failed to check ccache file [%s].\n", ccache_file); } }
@@ -475,7 +475,7 @@ errno_t init_renew_tgt(struct krb5_ctx *krb5_ctx, struct be_ctx *be_ctx,
krb5_ctx->renew_tgt_ctx = talloc_zero(krb5_ctx, struct renew_tgt_ctx); if (krb5_ctx->renew_tgt_ctx == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; }
@@ -483,7 +483,7 @@ errno_t init_renew_tgt(struct krb5_ctx *krb5_ctx, struct be_ctx *be_ctx, &krb5_ctx->renew_tgt_ctx->tgt_table, 0, 0, 0, 0, renew_del_cb, NULL); if (ret != EOK) { - DEBUG(1, ("sss_hash_create failed.\n")); + DEBUG(1, "sss_hash_create failed.\n"); goto fail; }
@@ -494,7 +494,7 @@ errno_t init_renew_tgt(struct krb5_ctx *krb5_ctx, struct be_ctx *be_ctx,
ret = check_ccache_files(krb5_ctx->renew_tgt_ctx); if (ret != EOK) { - DEBUG(1, ("Failed to read ccache files, continuing ...\n")); + DEBUG(1, "Failed to read ccache files, continuing ...\n"); }
next = tevent_timeval_current_ofs(krb5_ctx->renew_tgt_ctx->timer_interval, @@ -503,26 +503,26 @@ errno_t init_renew_tgt(struct krb5_ctx *krb5_ctx, struct be_ctx *be_ctx, next, renew_tgt_timer_handler, krb5_ctx->renew_tgt_ctx); if (krb5_ctx->renew_tgt_ctx->te == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); ret = ENOMEM; goto fail; }
- DEBUG(7, ("Adding offline callback to remove renewal timer.\n")); + DEBUG(7, "Adding offline callback to remove renewal timer.\n"); ret = be_add_offline_cb(krb5_ctx->renew_tgt_ctx, be_ctx, renew_tgt_offline_callback, krb5_ctx->renew_tgt_ctx, NULL); if (ret != EOK) { - DEBUG(1, ("Failed to add offline callback.\n")); + DEBUG(1, "Failed to add offline callback.\n"); goto fail; }
- DEBUG(7, ("Adding renewal task to online callbacks.\n")); + DEBUG(7, "Adding renewal task to online callbacks.\n"); ret = be_add_online_cb(krb5_ctx->renew_tgt_ctx, be_ctx, renew_tgt_online_callback, krb5_ctx->renew_tgt_ctx, NULL); if (ret != EOK) { - DEBUG(1, ("Failed to add renewal task to online callbacks.\n")); + DEBUG(1, "Failed to add renewal task to online callbacks.\n"); goto fail; }
@@ -543,19 +543,19 @@ errno_t add_tgt_to_renew_table(struct krb5_ctx *krb5_ctx, const char *ccfile, struct renew_data *renew_data = NULL;
if (krb5_ctx->renew_tgt_ctx == NULL) { - DEBUG(7 ,("Renew context not initialized, " - "automatic renewal not available.\n")); + DEBUG(7 ,"Renew context not initialized, " + "automatic renewal not available.\n"); return EOK; }
if (pd->cmd != SSS_PAM_AUTHENTICATE && pd->cmd != SSS_CMD_RENEW && pd->cmd != SSS_PAM_CHAUTHTOK) { - DEBUG(1, ("Unexpected pam task [%d].\n", pd->cmd)); + DEBUG(1, "Unexpected pam task [%d].\n", pd->cmd); return EINVAL; }
if (upn == NULL) { - DEBUG(1, ("Missing user principal name.\n")); + DEBUG(1, "Missing user principal name.\n"); return EINVAL; }
@@ -566,7 +566,7 @@ errno_t add_tgt_to_renew_table(struct krb5_ctx *krb5_ctx, const char *ccfile,
renew_data = talloc_zero(krb5_ctx->renew_tgt_ctx, struct renew_data); if (renew_data == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto done; } @@ -574,7 +574,7 @@ errno_t add_tgt_to_renew_table(struct krb5_ctx *krb5_ctx, const char *ccfile, if (ccfile[0] == '/') { renew_data->ccfile = talloc_asprintf(renew_data, "FILE:%s", ccfile); if (renew_data->ccfile == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -589,7 +589,7 @@ errno_t add_tgt_to_renew_table(struct krb5_ctx *krb5_ctx, const char *ccfile,
ret = copy_pam_data(renew_data, pd, &renew_data->pd); if (ret != EOK) { - DEBUG(1, ("copy_pam_data failed.\n")); + DEBUG(1, "copy_pam_data failed.\n"); goto done; }
@@ -597,7 +597,7 @@ errno_t add_tgt_to_renew_table(struct krb5_ctx *krb5_ctx, const char *ccfile,
ret = sss_authtok_set_ccfile(renew_data->pd->authtok, renew_data->ccfile, 0); if (ret) { - DEBUG(1, ("Failed to store ccfile in auth token.\n")); + DEBUG(1, "Failed to store ccfile in auth token.\n"); goto done; }
@@ -608,13 +608,13 @@ errno_t add_tgt_to_renew_table(struct krb5_ctx *krb5_ctx, const char *ccfile,
ret = hash_enter(krb5_ctx->renew_tgt_ctx->tgt_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_enter failed.\n")); + DEBUG(1, "hash_enter failed.\n"); ret = EFAULT; goto done; }
- DEBUG(7, ("Added [%s] for renewal at [%.24s].\n", renew_data->ccfile, - ctime(&renew_data->start_renew_at))); + DEBUG(7, "Added [%s] for renewal at [%.24s].\n", renew_data->ccfile, + ctime(&renew_data->start_renew_at));
ret = EOK;
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c index cf6d72a..114767a 100644 --- a/src/providers/krb5/krb5_utils.c +++ b/src/providers/krb5/krb5_utils.c @@ -59,7 +59,7 @@ errno_t find_or_guess_upn(TALLOC_CTX *mem_ctx, struct ldb_message *msg, ret = krb5_get_simple_upn(mem_ctx, krb5_ctx, dom, user, user_dom, _upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_get_simple_upn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_get_simple_upn failed.\n"); return ret; }
@@ -67,7 +67,7 @@ done: if (ret == EOK && upn != NULL) { *_upn = talloc_strdup(mem_ctx, upn); if (*_upn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); return ENOMEM; } } @@ -96,19 +96,19 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
ret = sysdb_get_user_attr(tmp_ctx, sysdb, domain, user, attrs, &res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_get_user_attr failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_get_user_attr failed.\n"); goto done; }
if (res->count != 1) { - DEBUG(SSSDBG_OP_FAILURE, ("[%d] user objects for name [%s] found, " \ - "expected 1.\n", res->count, user)); + DEBUG(SSSDBG_OP_FAILURE, "[%d] user objects for name [%s] found, " \ + "expected 1.\n", res->count, user); ret = EINVAL; goto done; } @@ -116,8 +116,8 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb, cached_upn = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_UPN, NULL);
if (cached_upn != NULL && strcmp(cached_upn, upn) == 0) { - DEBUG(SSSDBG_TRACE_ALL, ("Cached UPN and new one match, " - "nothing to do.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Cached UPN and new one match, " + "nothing to do.\n"); ret = EOK; goto done; } @@ -128,35 +128,35 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb,
if (cached_canonical_upn != NULL && strcmp(cached_canonical_upn, upn) == 0) { - DEBUG(SSSDBG_TRACE_ALL, ("Cached canonical UPN and new one match, " - "nothing to do.\n")); + DEBUG(SSSDBG_TRACE_ALL, "Cached canonical UPN and new one match, " + "nothing to do.\n"); ret = EOK; goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Replacing canonical UPN [%s] with [%s] " \ + DEBUG(SSSDBG_TRACE_LIBS, "Replacing canonical UPN [%s] with [%s] " \ "for user [%s].\n", cached_canonical_upn == NULL ? "empty" : cached_canonical_upn, - upn, user)); + upn, user);
new_attrs = sysdb_new_attrs(tmp_ctx); if (new_attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; }
ret = sysdb_attrs_add_string(new_attrs, SYSDB_CANONICAL_UPN, upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error %d starting transaction (%s)\n", ret, strerror(ret))); + "Error %d starting transaction (%s)\n", ret, strerror(ret)); goto done; } in_transaction = true; @@ -165,14 +165,14 @@ errno_t check_if_cached_upn_needs_update(struct sysdb_ctx *sysdb, cached_canonical_upn == NULL ? SYSDB_MOD_ADD : SYSDB_MOD_REP); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_set_entry_attr failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_set_entry_attr failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -183,7 +183,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } }
@@ -218,7 +218,7 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, bool rerun;
if (template == NULL) { - DEBUG(1, ("Missing template.\n")); + DEBUG(1, "Missing template.\n"); return NULL; }
@@ -227,13 +227,13 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
copy = talloc_strdup(tmp_ctx, template); if (copy == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); goto done; }
result = talloc_strdup(tmp_ctx, ""); if (result == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); goto done; }
@@ -242,7 +242,7 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, *n = '\0'; n++; if ( *n == '\0' ) { - DEBUG(1, ("format error, single %% at the end of the template.\n")); + DEBUG(1, "format error, single %% at the end of the template.\n"); goto done; }
@@ -253,15 +253,15 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, switch (action) { case 'u': if (kr->pd->user == NULL) { - DEBUG(1, ("Cannot expand user name template " - "because user name is empty.\n")); + DEBUG(1, "Cannot expand user name template " + "because user name is empty.\n"); goto done; } name = sss_get_cased_name(tmp_ctx, kr->pd->user, case_sensitive); if (!name) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_get_cased_name failed\n")); + "sss_get_cased_name failed\n"); goto done; }
@@ -270,8 +270,8 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, break; case 'U': if (kr->uid <= 0) { - DEBUG(1, ("Cannot expand uid template " - "because uid is invalid.\n")); + DEBUG(1, "Cannot expand uid template " + "because uid is invalid.\n"); goto done; } result = talloc_asprintf_append(result, "%s%"SPRIuid, p, @@ -279,8 +279,8 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, break; case 'p': if (kr->upn == NULL) { - DEBUG(1, ("Cannot expand user principal name template " - "because upn is empty.\n")); + DEBUG(1, "Cannot expand user principal name template " + "because upn is empty.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s", p, kr->upn); @@ -291,15 +291,15 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, case 'r': dummy = dp_opt_get_string(kr->krb5_ctx->opts, KRB5_REALM); if (dummy == NULL) { - DEBUG(1, ("Missing kerberos realm.\n")); + DEBUG(1, "Missing kerberos realm.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s", p, dummy); break; case 'h': if (kr->homedir == NULL) { - DEBUG(1, ("Cannot expand home directory template " - "because the path is not available.\n")); + DEBUG(1, "Cannot expand home directory template " + "because the path is not available.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s", p, kr->homedir); @@ -309,32 +309,32 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, cache_dir_tmpl = dp_opt_get_string(kr->krb5_ctx->opts, KRB5_CCACHEDIR); if (cache_dir_tmpl == NULL) { - DEBUG(1, ("Missing credential cache directory.\n")); + DEBUG(1, "Missing credential cache directory.\n"); goto done; }
dummy = expand_ccname_template(tmp_ctx, kr, cache_dir_tmpl, false, case_sensitive); if (dummy == NULL) { - DEBUG(1, ("Expanding credential cache directory " - "template failed.\n")); + DEBUG(1, "Expanding credential cache directory " + "template failed.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s", p, dummy); talloc_zfree(dummy); } else { - DEBUG(1, ("'%%d' is not allowed in this template.\n")); + DEBUG(1, "'%%d' is not allowed in this template.\n"); goto done; } break; case 'P': if (!file_mode) { - DEBUG(1, ("'%%P' is not allowed in this template.\n")); + DEBUG(1, "'%%P' is not allowed in this template.\n"); goto done; } if (kr->pd->cli_pid == 0) { - DEBUG(1, ("Cannot expand PID template " - "because PID is not available.\n")); + DEBUG(1, "Cannot expand PID template " + "because PID is not available.\n"); goto done; } result = talloc_asprintf_append(result, "%s%d", p, @@ -371,10 +371,10 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, name = n; n = strchr(name, '}'); if (!n) { - DEBUG(SSSDBG_CRIT_FAILURE, ( + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid substitution sequence in cache " "template. Missing closing '}' in [%s].\n", - template)); + template); goto done; } result = talloc_asprintf_append(result, "%s%%%.*s", p, @@ -382,13 +382,13 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr, } break; default: - DEBUG(1, ("format error, unknown template [%%%c].\n", *n)); + DEBUG(1, "format error, unknown template [%%%c].\n", *n); goto done; } }
if (result == NULL) { - DEBUG(1, ("talloc_asprintf_append failed.\n")); + DEBUG(1, "talloc_asprintf_append failed.\n"); goto done; }
@@ -397,7 +397,7 @@ char *expand_ccname_template(TALLOC_CTX *mem_ctx, struct krb5child_req *kr,
result = talloc_asprintf_append(result, "%s", p); if (result == NULL) { - DEBUG(1, ("talloc_asprintf_append failed.\n")); + DEBUG(1, "talloc_asprintf_append failed.\n"); goto done; }
@@ -413,24 +413,24 @@ static errno_t check_parent_stat(struct stat *parent_stat, if (!((parent_stat->st_uid == 0 && parent_stat->st_gid == 0) || parent_stat->st_uid == uid)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Private directory can only be created below a directory " + "Private directory can only be created below a directory " "belonging to root or to [%"SPRIuid"][%"SPRIgid"].\n", - uid, gid)); + uid, gid); return EINVAL; }
if (parent_stat->st_uid == uid) { if (!(parent_stat->st_mode & S_IXUSR)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Parent directory does not have the search bit set for " - "the owner.\n")); + "Parent directory does not have the search bit set for " + "the owner.\n"); return EINVAL; } } else { if (!(parent_stat->st_mode & S_IXOTH)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Parent directory does not have the search bit set for " - "others.\n")); + "Parent directory does not have the search bit set for " + "others.\n"); return EINVAL; } } @@ -458,7 +458,7 @@ static errno_t find_ccdir_parent_data(TALLOC_CTX *mem_ctx, if (ret == EOK) { if ( !S_ISDIR(parent_stat->st_mode) ) { DEBUG(SSSDBG_MINOR_FAILURE, - ("[%s] is not a directory.\n", ccdirname)); + "[%s] is not a directory.\n", ccdirname); return EINVAL; } return EOK; @@ -466,8 +466,8 @@ static errno_t find_ccdir_parent_data(TALLOC_CTX *mem_ctx, if (errno != ENOENT) { ret = errno; DEBUG(SSSDBG_MINOR_FAILURE, - ("stat for [%s] failed: [%d][%s].\n", ccdirname, ret, - strerror(ret))); + "stat for [%s] failed: [%d][%s].\n", ccdirname, ret, + strerror(ret)); return ret; } } @@ -475,14 +475,14 @@ static errno_t find_ccdir_parent_data(TALLOC_CTX *mem_ctx, li = talloc_zero(mem_ctx, struct string_list); if (li == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("talloc_zero failed.\n")); + "talloc_zero failed.\n"); return ENOMEM; }
li->s = talloc_strdup(li, ccdirname); if (li->s == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("talloc_strdup failed.\n")); + "talloc_strdup failed.\n"); return ENOMEM; }
@@ -491,7 +491,7 @@ static errno_t find_ccdir_parent_data(TALLOC_CTX *mem_ctx, parent = talloc_strdup(mem_ctx, ccdirname); if (parent == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("talloc_strdup failed.\n")); + "talloc_strdup failed.\n"); return ENOMEM; }
@@ -502,8 +502,8 @@ static errno_t find_ccdir_parent_data(TALLOC_CTX *mem_ctx, end = strrchr(parent, '/'); if (end == NULL || end == parent) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot find parent directory of [%s], / is not allowed.\n", - ccdirname)); + "Cannot find parent directory of [%s], / is not allowed.\n", + ccdirname); ret = EINVAL; goto done; } @@ -526,16 +526,16 @@ check_ccache_re(const char *filename, pcre *illegal_re) 0, 0, NULL, 0); if (ret == 0) { DEBUG(SSSDBG_OP_FAILURE, - ("Illegal pattern in ccache directory name [%s].\n", filename)); + "Illegal pattern in ccache directory name [%s].\n", filename); return EINVAL; } else if (ret == PCRE_ERROR_NOMATCH) { DEBUG(SSSDBG_TRACE_LIBS, - ("Ccache directory name [%s] does not contain " - "illegal patterns.\n", filename)); + "Ccache directory name [%s] does not contain " + "illegal patterns.\n", filename); return EOK; }
- DEBUG(SSSDBG_CRIT_FAILURE, ("pcre_exec failed [%d].\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "pcre_exec failed [%d].\n", ret); return EFAULT; }
@@ -554,13 +554,13 @@ create_ccache_dir(const char *ccdirname, pcre *illegal_re, tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("talloc_new failed.\n")); + "talloc_new failed.\n"); return ENOMEM; }
if (*ccdirname != '/') { DEBUG(SSSDBG_MINOR_FAILURE, - ("Only absolute paths are allowed, not [%s] .\n", ccdirname)); + "Only absolute paths are allowed, not [%s] .\n", ccdirname); ret = EINVAL; goto done; } @@ -576,20 +576,20 @@ create_ccache_dir(const char *ccdirname, pcre *illegal_re, &missing_parents); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("find_ccdir_parent_data failed.\n")); + "find_ccdir_parent_data failed.\n"); goto done; }
ret = check_parent_stat(&parent_stat, uid, gid); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("check_parent_stat failed for directory [%s].\n", ccdirname)); + "check_parent_stat failed for directory [%s].\n", ccdirname); goto done; }
DLIST_FOR_EACH(li, missing_parents) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Creating directory [%s].\n", li->s)); + "Creating directory [%s].\n", li->s); new_dir_mode = 0700;
old_umask = umask(0000); @@ -598,15 +598,15 @@ create_ccache_dir(const char *ccdirname, pcre *illegal_re, if (ret != EOK) { ret = errno; DEBUG(SSSDBG_MINOR_FAILURE, - ("mkdir [%s] failed: [%d][%s].\n", li->s, ret, - strerror(ret))); + "mkdir [%s] failed: [%d][%s].\n", li->s, ret, + strerror(ret)); goto done; } ret = chown(li->s, uid, gid); if (ret != EOK) { ret = errno; DEBUG(SSSDBG_MINOR_FAILURE, - ("chown failed [%d][%s].\n", ret, strerror(ret))); + "chown failed [%d][%s].\n", ret, strerror(ret)); goto done; } } @@ -634,14 +634,14 @@ errno_t get_ccache_file_data(const char *ccache_file, const char *client_name,
kerr = krb5_init_context(&ctx); if (kerr != 0) { - DEBUG(1, ("krb5_init_context failed.\n")); + DEBUG(1, "krb5_init_context failed.\n"); goto done; }
kerr = krb5_parse_name(ctx, client_name, &client_princ); if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, ctx, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_parse_name failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_parse_name failed.\n"); goto done; }
@@ -652,7 +652,7 @@ errno_t get_ccache_file_data(const char *ccache_file, const char *client_name, realm_length, realm_name); if (server_name == NULL) { kerr = KRB5_CC_NOMEM; - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); goto done; }
@@ -660,14 +660,14 @@ errno_t get_ccache_file_data(const char *ccache_file, const char *client_name, talloc_free(server_name); if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, ctx, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_parse_name failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_parse_name failed.\n"); goto done; }
kerr = krb5_cc_resolve(ctx, ccache_file, &cc); if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, ctx, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_cc_resolve failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_cc_resolve failed.\n"); goto done; }
@@ -680,7 +680,7 @@ errno_t get_ccache_file_data(const char *ccache_file, const char *client_name, kerr = krb5_cc_retrieve_cred(ctx, cc, 0, &mcred, &cred); if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, ctx, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_cc_retrieve_cred failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_cc_retrieve_cred failed.\n"); goto done; }
@@ -694,7 +694,7 @@ errno_t get_ccache_file_data(const char *ccache_file, const char *client_name, kerr = krb5_cc_close(ctx, cc); if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, ctx, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_cc_close failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_cc_close failed.\n"); goto done; } cc = NULL; @@ -751,7 +751,7 @@ errno_t sss_krb5_precreate_ccache(const char *ccname, pcre *illegal_re,
ccdirname = talloc_strdup(tmp_ctx, filename); if (ccdirname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -762,8 +762,8 @@ errno_t sss_krb5_precreate_ccache(const char *ccname, pcre *illegal_re, do { end = strrchr(ccdirname, '/'); if (end == NULL || end == ccdirname) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot find parent directory of [%s], " - "/ is not allowed.\n", ccdirname)); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot find parent directory of [%s], " + "/ is not allowed.\n", ccdirname); ret = EINVAL; goto done; } @@ -823,12 +823,12 @@ static errno_t sss_open_ccache_as_user(TALLOC_CTX *mem_ctx,
kerr = krb5_cc_resolve(cc->context, ccname, &cc->ccache); if (kerr == KRB5_FCC_NOFILE || cc->ccache == NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("ccache %s is missing or empty\n", ccname)); + DEBUG(SSSDBG_TRACE_FUNC, "ccache %s is missing or empty\n", ccname); ret = ERR_NOT_FOUND; goto done; } else if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, cc->context, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_cc_resolve failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_cc_resolve failed.\n"); ret = ERR_INTERNAL; goto done; } @@ -852,7 +852,7 @@ static errno_t sss_destroy_ccache(struct sss_krb5_ccache *cc) kerr = krb5_cc_destroy(cc->context, cc->ccache); if (kerr) { KRB5_DEBUG(SSSDBG_OP_FAILURE, cc->context, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_cc_destroy failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_cc_destroy failed.\n"); ret = EIO; } else { ret = EOK; @@ -872,7 +872,7 @@ errno_t sss_krb5_cc_destroy(const char *ccname, uid_t uid, gid_t gid)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -904,7 +904,7 @@ errno_t sss_krb5_check_ccache_princ(uid_t uid, gid_t gid,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -916,12 +916,12 @@ errno_t sss_krb5_check_ccache_princ(uid_t uid, gid_t gid, cc_type = krb5_cc_get_type(cc->context, cc->ccache);
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Searching for [%s] in cache of type [%s]\n", principal, cc_type)); + "Searching for [%s] in cache of type [%s]\n", principal, cc_type);
kerr = krb5_parse_name(cc->context, principal, &kprinc); if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, cc->context, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_parse_name failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_parse_name failed.\n"); ret = ERR_INTERNAL; goto done; } @@ -929,7 +929,7 @@ errno_t sss_krb5_check_ccache_princ(uid_t uid, gid_t gid, kerr = krb5_cc_get_principal(cc->context, cc->ccache, &ccprinc); if (kerr != 0) { KRB5_DEBUG(SSSDBG_OP_FAILURE, cc->context, kerr); - DEBUG(SSSDBG_CRIT_FAILURE, ("krb5_cc_get_principal failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "krb5_cc_get_principal failed.\n"); }
if (ccprinc) { @@ -1021,7 +1021,7 @@ errno_t sss_krb5_cc_verify_ccache(const char *ccname, uid_t uid, gid_t gid,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -1032,7 +1032,7 @@ errno_t sss_krb5_cc_verify_ccache(const char *ccname, uid_t uid, gid_t gid,
tgt_name = talloc_asprintf(tmp_ctx, "krbtgt/%s@%s", realm, realm); if (!tgt_name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n"); ret = ENOMEM; goto done; } @@ -1061,7 +1061,7 @@ errno_t sss_krb5_cc_verify_ccache(const char *ccname, uid_t uid, gid_t gid, KRB5_TC_MATCH_TIMES, &mcred, &cred); if (kerr) { if (kerr == KRB5_CC_NOTFOUND || kerr == KRB5_FCC_NOFILE) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("TGT not found or expired.\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "TGT not found or expired.\n"); ret = EINVAL; } else { KRB5_DEBUG(SSSDBG_CRIT_FAILURE, cc->context, kerr); @@ -1087,7 +1087,7 @@ errno_t get_domain_or_subdomain(struct be_ctx *be_ctx, strcasecmp(domain_name, be_ctx->domain->name) != 0) { *dom = find_subdomain_by_name(be_ctx->domain, domain_name, true); if (*dom == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("find_subdomain_by_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_subdomain_by_name failed.\n"); return ENOMEM; } } else { diff --git a/src/providers/krb5/krb5_wait_queue.c b/src/providers/krb5/krb5_wait_queue.c index 8b7b9a3..23a6081 100644 --- a/src/providers/krb5/krb5_wait_queue.c +++ b/src/providers/krb5/krb5_wait_queue.c @@ -47,7 +47,7 @@ static void wait_queue_auth(struct tevent_context *ev, struct tevent_timer *te,
req = krb5_auth_send(qe->be_req, be_ctx->ev, be_ctx, qe->pd, qe->krb5_ctx); if (req == NULL) { - DEBUG(1, ("krb5_auth_send failed.\n")); + DEBUG(1, "krb5_auth_send failed.\n"); } else { tevent_req_set_callback(req, krb5_pam_handler_auth_done, qe->be_req); } @@ -66,7 +66,7 @@ static void wait_queue_del_cb(hash_entry_t *entry, hash_destroy_enum type, return; }
- DEBUG(1, ("Unexpected value type [%d].\n", entry->value.type)); + DEBUG(1, "Unexpected value type [%d].\n", entry->value.type); }
errno_t add_to_wait_queue(struct be_req *be_req, struct pam_data *pd, @@ -83,7 +83,7 @@ errno_t add_to_wait_queue(struct be_req *be_req, struct pam_data *pd, &krb5_ctx->wait_queue_hash, 0, 0, 0, 0, wait_queue_del_cb, NULL); if (ret != EOK) { - DEBUG(1, ("sss_hash_create failed")); + DEBUG(1, "sss_hash_create failed"); return ret; } } @@ -95,7 +95,7 @@ errno_t add_to_wait_queue(struct be_req *be_req, struct pam_data *pd, switch (ret) { case HASH_SUCCESS: if (value.type != HASH_VALUE_PTR) { - DEBUG(1, ("Unexpected hash value type.\n")); + DEBUG(1, "Unexpected hash value type.\n"); return EINVAL; }
@@ -103,7 +103,7 @@ errno_t add_to_wait_queue(struct be_req *be_req, struct pam_data *pd,
queue_entry = talloc_zero(head, struct queue_entry); if (queue_entry == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; }
@@ -118,21 +118,21 @@ errno_t add_to_wait_queue(struct be_req *be_req, struct pam_data *pd, value.type = HASH_VALUE_PTR; head = talloc_zero(krb5_ctx->wait_queue_hash, struct queue_entry); if (head == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; } value.ptr = head;
ret = hash_enter(krb5_ctx->wait_queue_hash, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_enter failed.\n")); + DEBUG(1, "hash_enter failed.\n"); talloc_free(head); return EIO; }
break; default: - DEBUG(1, ("hash_lookup failed.\n")); + DEBUG(1, "hash_lookup failed.\n"); return EIO; }
@@ -154,7 +154,7 @@ void check_wait_queue(struct krb5_ctx *krb5_ctx, char *username) struct be_ctx *be_ctx;
if (krb5_ctx->wait_queue_hash == NULL) { - DEBUG(1, ("No wait queue available.\n")); + DEBUG(1, "No wait queue available.\n"); return; }
@@ -166,14 +166,14 @@ void check_wait_queue(struct krb5_ctx *krb5_ctx, char *username) switch (ret) { case HASH_SUCCESS: if (value.type != HASH_VALUE_PTR) { - DEBUG(1, ("Unexpected hash value type.\n")); + DEBUG(1, "Unexpected hash value type.\n"); return; }
head = talloc_get_type(value.ptr, struct queue_entry);
if (head->next == NULL) { - DEBUG(7, ("Wait queue for user [%s] is empty.\n", username)); + DEBUG(7, "Wait queue for user [%s] is empty.\n", username); } else { queue_entry = head->next;
@@ -184,7 +184,7 @@ void check_wait_queue(struct krb5_ctx *krb5_ctx, char *username) tevent_timeval_current(), wait_queue_auth, queue_entry); if (te == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); } else { return; } @@ -192,16 +192,16 @@ void check_wait_queue(struct krb5_ctx *krb5_ctx, char *username)
ret = hash_delete(krb5_ctx->wait_queue_hash, &key); if (ret != HASH_SUCCESS) { - DEBUG(1, ("Failed to remove wait queue for user [%s].\n", - username)); + DEBUG(1, "Failed to remove wait queue for user [%s].\n", + username); }
break; case HASH_ERROR_KEY_NOT_FOUND: - DEBUG(1, ("No wait queue for user [%s] found.\n", username)); + DEBUG(1, "No wait queue for user [%s] found.\n", username); break; default: - DEBUG(1, ("hash_lookup failed.\n")); + DEBUG(1, "hash_lookup failed.\n"); }
return; diff --git a/src/providers/ldap/ldap_access.c b/src/providers/ldap/ldap_access.c index 8d5b5e2..06b81c3 100644 --- a/src/providers/ldap/ldap_access.c +++ b/src/providers/ldap/ldap_access.c @@ -60,7 +60,7 @@ void sdap_pam_access_handler(struct be_req *breq) req = sdap_access_send(breq, be_ctx->ev, be_ctx, be_ctx->domain, access_ctx, pd); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to start sdap_access request\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to start sdap_access request\n"); sdap_access_reply(breq, PAM_SYSTEM_ERR); return; } @@ -88,7 +88,7 @@ static void sdap_access_done(struct tevent_req *req) pam_status = PAM_ACCT_EXPIRED; break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Error retrieving access check result.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error retrieving access check result.\n"); pam_status = PAM_SYSTEM_ERR; break; } diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c index f9bab4b..1622f38 100644 --- a/src/providers/ldap/ldap_auth.c +++ b/src/providers/ldap/ldap_auth.c @@ -62,13 +62,13 @@ static errno_t add_expired_warning(struct pam_data *pd, long exp_time) uint32_t *data;
if (exp_time < 0 || exp_time > UINT32_MAX) { - DEBUG(1, ("Time to expire out of range.\n")); + DEBUG(1, "Time to expire out of range.\n"); return EINVAL; }
data = talloc_array(pd, uint32_t, 2); if (data == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return ENOMEM; }
@@ -78,7 +78,7 @@ static errno_t add_expired_warning(struct pam_data *pd, long exp_time) ret = pam_add_response(pd, SSS_PAM_USER_INFO, 2 * sizeof(uint32_t), (uint8_t *) data); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return EOK; @@ -98,30 +98,30 @@ static errno_t check_pwexpire_kerberos(const char *expire_date, time_t now,
end = strptime(expire_date, "%Y%m%d%H%M%SZ", &tm); if (end == NULL) { - DEBUG(1, ("Kerberos expire date [%s] invalid.\n", expire_date)); + DEBUG(1, "Kerberos expire date [%s] invalid.\n", expire_date); return EINVAL; } if (*end != '\0') { - DEBUG(1, ("Kerberos expire date [%s] contains extra characters.\n", - expire_date)); + DEBUG(1, "Kerberos expire date [%s] contains extra characters.\n", + expire_date); return EINVAL; }
expire_time = mktime(&tm); if (expire_time == -1) { - DEBUG(1, ("mktime failed to convert [%s].\n", expire_date)); + DEBUG(1, "mktime failed to convert [%s].\n", expire_date); return EINVAL; }
tzset(); expire_time -= timezone; DEBUG(SSSDBG_TRACE_ALL, - ("Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " + "Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " "daylight [%d] now [%ld] expire_time [%ld].\n", tzname[0], - tzname[1], timezone, daylight, now, expire_time)); + tzname[1], timezone, daylight, now, expire_time);
if (difftime(now, expire_time) > 0.0) { - DEBUG(4, ("Kerberos password expired.\n")); + DEBUG(4, "Kerberos password expired.\n"); ret = ERR_PASSWORD_EXPIRED; } else { if (pwd_exp_warning >= 0) { @@ -134,7 +134,7 @@ static errno_t check_pwexpire_kerberos(const char *expire_date, time_t now, expiration_warning == 0)) { ret = add_expired_warning(pd, (long) difftime(expire_time, now)); if (ret != EOK) { - DEBUG(1, ("add_expired_warning failed.\n")); + DEBUG(1, "add_expired_warning failed.\n"); } } ret = EOK; @@ -152,14 +152,14 @@ static errno_t check_pwexpire_shadow(struct spwd *spwd, time_t now, int ret;
if (spwd->sp_lstchg <= 0) { - DEBUG(4, ("Last change day is not set, new password needed.\n")); + DEBUG(4, "Last change day is not set, new password needed.\n"); return ERR_PASSWORD_EXPIRED; }
today = (long) (now / (60 * 60 *24)); password_age = today - spwd->sp_lstchg; if (password_age < 0) { - DEBUG(2, ("The last password change time is in the future!.\n")); + DEBUG(2, "The last password change time is in the future!.\n"); return EOK; }
@@ -167,12 +167,12 @@ static errno_t check_pwexpire_shadow(struct spwd *spwd, time_t now, (spwd->sp_max != -1 && spwd->sp_inact != -1 && password_age > spwd->sp_max + spwd->sp_inact)) { - DEBUG(4, ("Account expired.\n")); + DEBUG(4, "Account expired.\n"); return ERR_ACCOUNT_EXPIRED; }
if (spwd->sp_max != -1 && password_age > spwd->sp_max) { - DEBUG(4, ("Password expired.\n")); + DEBUG(4, "Password expired.\n"); return ERR_PASSWORD_EXPIRED; }
@@ -188,7 +188,7 @@ static errno_t check_pwexpire_shadow(struct spwd *spwd, time_t now,
ret = add_expired_warning(pd, exp); if (ret != EOK) { - DEBUG(1, ("add_expired_warning failed.\n")); + DEBUG(1, "add_expired_warning failed.\n"); } }
@@ -211,7 +211,7 @@ static errno_t check_pwexpire_ldap(struct pam_data *pd,
data = talloc_size(pd, 2* sizeof(uint32_t)); if (data == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return ENOMEM; }
@@ -235,7 +235,7 @@ static errno_t check_pwexpire_ldap(struct pam_data *pd, ret = pam_add_response(pd, SSS_PAM_USER_INFO, 2* sizeof(uint32_t), (uint8_t*)data); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } }
@@ -259,23 +259,23 @@ static errno_t find_password_expiration_attributes(TALLOC_CTX *mem_ctx,
pwd_policy = dp_opt_get_string(opts, SDAP_PWD_POLICY); if (pwd_policy == NULL) { - DEBUG(1, ("Missing password policy.\n")); + DEBUG(1, "Missing password policy.\n"); return EINVAL; }
if (strcasecmp(pwd_policy, PWD_POL_OPT_NONE) == 0) { - DEBUG(9, ("No password policy requested.\n")); + DEBUG(9, "No password policy requested.\n"); return EOK; } else if (strcasecmp(pwd_policy, PWD_POL_OPT_MIT) == 0) { mark = ldb_msg_find_attr_as_string(msg, SYSDB_KRBPW_LASTCHANGE, NULL); if (mark != NULL) { - DEBUG(9, ("Found Kerberos password expiration attributes.\n")); + DEBUG(9, "Found Kerberos password expiration attributes.\n"); val = ldb_msg_find_attr_as_string(msg, SYSDB_KRBPW_EXPIRATION, NULL); if (val != NULL) { *data = talloc_strdup(mem_ctx, val); if (*data == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); return ENOMEM; } *type = PWEXPIRE_KERBEROS; @@ -283,18 +283,18 @@ static errno_t find_password_expiration_attributes(TALLOC_CTX *mem_ctx, return EOK; } } else { - DEBUG(1, ("No Kerberos password expiration attributes found, " + DEBUG(1, "No Kerberos password expiration attributes found, " "but MIT Kerberos password policy was requested. " - "Access will be denied.\n")); + "Access will be denied.\n"); return EACCES; } } else if (strcasecmp(pwd_policy, PWD_POL_OPT_SHADOW) == 0) { mark = ldb_msg_find_attr_as_string(msg, SYSDB_SHADOWPW_LASTCHANGE, NULL); if (mark != NULL) { - DEBUG(9, ("Found shadow password expiration attributes.\n")); + DEBUG(9, "Found shadow password expiration attributes.\n"); spwd = talloc_zero(mem_ctx, struct spwd); if (spwd == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; }
@@ -327,14 +327,14 @@ static errno_t find_password_expiration_attributes(TALLOC_CTX *mem_ctx,
return EOK; } else { - DEBUG(1, ("No shadow password attributes found, " + DEBUG(1, "No shadow password attributes found, " "but shadow password policy was requested. " - "Access will be denied.\n")); + "Access will be denied.\n"); return EACCES; } }
- DEBUG(9, ("No password expiration attributes found.\n")); + DEBUG(9, "No password expiration attributes found.\n"); return EOK;
shadow_fail: @@ -421,13 +421,13 @@ static int get_user_dn(TALLOC_CTX *memctx, &pw_expire_type, &pw_expire_data); if (ret != EOK) { - DEBUG(1, ("find_password_expiration_attributes failed.\n")); + DEBUG(1, "find_password_expiration_attributes failed.\n"); } break;
default: - DEBUG(1, ("User search by name (%s) returned > 1 results!\n", - username)); + DEBUG(1, "User search by name (%s) returned > 1 results!\n", + username); ret = EFAULT; break; } @@ -524,7 +524,7 @@ static struct tevent_req *auth_get_server(struct tevent_req *req) state->sdap_service->name, state->srv == NULL ? true : false); if (!next_req) { - DEBUG(1, ("be_resolve_server_send failed.\n")); + DEBUG(1, "be_resolve_server_send failed.\n"); return NULL; }
@@ -552,8 +552,8 @@ static void auth_resolve_done(struct tevent_req *subreq)
/* Determine whether we need to use TLS */ if (sdap_is_secure_uri(state->ctx->service->uri)) { - DEBUG(8, ("[%s] is a secure channel. No need to run START_TLS\n", - state->ctx->service->uri)); + DEBUG(8, "[%s] is a secure channel. No need to run START_TLS\n", + state->ctx->service->uri); use_tls = false; } else {
@@ -638,8 +638,8 @@ static void auth_bind_user_done(struct tevent_req *subreq) ret = sdap_auth_recv(subreq, state, &ppolicy); talloc_zfree(subreq); if (ppolicy != NULL) { - DEBUG(9,("Found ppolicy data, " - "assuming LDAP password policies are active.\n")); + DEBUG(9,"Found ppolicy data, " + "assuming LDAP password policies are active.\n"); state->pw_expire_type = PWEXPIRE_LDAP_PASSWORD_POLICY; state->pw_expire_data = ppolicy; } @@ -716,7 +716,7 @@ void sdap_pam_chpass_handler(struct be_req *breq) pd = talloc_get_type(be_req_get_data(breq), struct pam_data);
if (be_is_offline(ctx->be)) { - DEBUG(4, ("Backend is marked offline, retry later!\n")); + DEBUG(4, "Backend is marked offline, retry later!\n"); pd->pam_status = PAM_AUTHINFO_UNAVAIL; dp_err = DP_ERR_OFFLINE; goto done; @@ -724,18 +724,18 @@ void sdap_pam_chpass_handler(struct be_req *breq)
if ((pd->priv == 1) && (pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM) && (sss_authtok_get_type(pd->authtok) != SSS_AUTHTOK_TYPE_PASSWORD)) { - DEBUG(4, ("Password reset by root is not supported.\n")); + DEBUG(4, "Password reset by root is not supported.\n"); pd->pam_status = PAM_PERM_DENIED; dp_err = DP_ERR_OK; goto done; }
- DEBUG(2, ("starting password change request for user [%s].\n", pd->user)); + DEBUG(2, "starting password change request for user [%s].\n", pd->user);
pd->pam_status = PAM_SYSTEM_ERR;
if (pd->cmd != SSS_PAM_CHAUTHTOK && pd->cmd != SSS_PAM_CHAUTHTOK_PRELIM) { - DEBUG(2, ("chpass target was called by wrong pam command.\n")); + DEBUG(2, "chpass target was called by wrong pam command.\n"); goto done; }
@@ -777,8 +777,8 @@ static void sdap_auth4chpass_done(struct tevent_req *req) talloc_zfree(req); if ((ret == EOK || ret == ERR_PASSWORD_EXPIRED) && state->pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM) { - DEBUG(9, ("Initial authentication for change password operation " - "successful.\n")); + DEBUG(9, "Initial authentication for change password operation " + "successful.\n"); state->pd->pam_status = PAM_SUCCESS; dp_err = DP_ERR_OK; goto done; @@ -794,8 +794,8 @@ static void sdap_auth4chpass_done(struct tevent_req *req) be_ctx->domain->pwd_expiration_warning);
if (ret == ERR_PASSWORD_EXPIRED) { - DEBUG(1, ("LDAP provider cannot change kerberos " - "passwords.\n")); + DEBUG(1, "LDAP provider cannot change kerberos " + "passwords.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -804,7 +804,7 @@ static void sdap_auth4chpass_done(struct tevent_req *req) case PWEXPIRE_NONE: break; default: - DEBUG(1, ("Unknow pasword expiration type.\n")); + DEBUG(1, "Unknow pasword expiration type.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -813,10 +813,10 @@ static void sdap_auth4chpass_done(struct tevent_req *req) switch (ret) { case EOK: case ERR_PASSWORD_EXPIRED: - DEBUG(7, ("user [%s] successfully authenticated.\n", state->dn)); + DEBUG(7, "user [%s] successfully authenticated.\n", state->dn); if (pw_expire_type == PWEXPIRE_SHADOW) { /* TODO: implement async ldap modify request */ - DEBUG(1, ("Changing shadow password attributes not implemented.\n")); + DEBUG(1, "Changing shadow password attributes not implemented.\n"); state->pd->pam_status = PAM_MODULE_UNKNOWN; goto done; } else { @@ -840,7 +840,7 @@ static void sdap_auth4chpass_done(struct tevent_req *req) state->sh, state->dn, password, new_password); if (!subreq) { - DEBUG(2, ("Failed to change password for %s\n", state->username)); + DEBUG(2, "Failed to change password for %s\n", state->username); goto done; } tevent_req_set_callback(subreq, sdap_pam_chpass_done, state); @@ -854,12 +854,12 @@ static void sdap_auth4chpass_done(struct tevent_req *req) &msg_len, &msg); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("pack_user_info_chpass_error failed.\n")); + "pack_user_info_chpass_error failed.\n"); } else { ret = pam_add_response(state->pd, SSS_PAM_USER_INFO, msg_len, msg); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("pam_add_response failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "pam_add_response failed.\n"); } }
@@ -914,12 +914,12 @@ static void sdap_pam_chpass_done(struct tevent_req *req) ret = pack_user_info_chpass_error(state->pd, user_error_message, &msg_len, &msg); if (ret != EOK) { - DEBUG(1, ("pack_user_info_chpass_error failed.\n")); + DEBUG(1, "pack_user_info_chpass_error failed.\n"); } else { ret = pam_add_response(state->pd, SSS_PAM_USER_INFO, msg_len, msg); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } } } @@ -988,7 +988,7 @@ void sdap_pam_auth_handler(struct be_req *breq) pd = talloc_get_type(be_req_get_data(breq), struct pam_data);
if (be_is_offline(ctx->be)) { - DEBUG(4, ("Backend is marked offline, retry later!\n")); + DEBUG(4, "Backend is marked offline, retry later!\n"); pd->pam_status = PAM_AUTHINFO_UNAVAIL; dp_err = DP_ERR_OFFLINE; goto done; @@ -1053,7 +1053,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) case PWEXPIRE_SHADOW: ret = check_pwexpire_shadow(pw_expire_data, time(NULL), state->pd); if (ret != EOK) { - DEBUG(1, ("check_pwexpire_shadow failed.\n")); + DEBUG(1, "check_pwexpire_shadow failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1063,7 +1063,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) state->pd, be_ctx->domain->pwd_expiration_warning); if (ret != EOK) { - DEBUG(1, ("check_pwexpire_kerberos failed.\n")); + DEBUG(1, "check_pwexpire_kerberos failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1072,7 +1072,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) ret = check_pwexpire_ldap(state->pd, pw_expire_data, be_ctx->domain->pwd_expiration_warning); if (ret != EOK) { - DEBUG(1, ("check_pwexpire_ldap failed.\n")); + DEBUG(1, "check_pwexpire_ldap failed.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1080,7 +1080,7 @@ static void sdap_pam_auth_done(struct tevent_req *req) case PWEXPIRE_NONE: break; default: - DEBUG(1, ("Unknow pasword expiration type.\n")); + DEBUG(1, "Unknow pasword expiration type.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -1127,11 +1127,11 @@ static void sdap_pam_auth_done(struct tevent_req *req)
/* password caching failures are not fatal errors */ if (ret != EOK) { - DEBUG(2, ("Failed to cache password for %s\n", - state->pd->user)); + DEBUG(2, "Failed to cache password for %s\n", + state->pd->user); } else { - DEBUG(4, ("Password successfully cached for %s\n", - state->pd->user)); + DEBUG(4, "Password successfully cached for %s\n", + state->pd->user); } }
diff --git a/src/providers/ldap/ldap_child.c b/src/providers/ldap/ldap_child.c index 19c838d..7c60c0f 100644 --- a/src/providers/ldap/ldap_child.c +++ b/src/providers/ldap/ldap_child.c @@ -57,16 +57,16 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, size_t p = 0; uint32_t len;
- DEBUG(SSSDBG_TRACE_LIBS, ("total buffer size: %zu\n", size)); + DEBUG(SSSDBG_TRACE_LIBS, "total buffer size: %zu\n", size);
/* realm_str size and length */ SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p);
- DEBUG(SSSDBG_TRACE_LIBS, ("realm_str size: %d\n", len)); + DEBUG(SSSDBG_TRACE_LIBS, "realm_str size: %d\n", len); if (len) { if ((p + len ) > size) return EINVAL; ibuf->realm_str = talloc_strndup(ibuf, (char *)(buf + p), len); - DEBUG(SSSDBG_TRACE_LIBS, ("got realm_str: %s\n", ibuf->realm_str)); + DEBUG(SSSDBG_TRACE_LIBS, "got realm_str: %s\n", ibuf->realm_str); if (ibuf->realm_str == NULL) return ENOMEM; p += len; } @@ -74,11 +74,11 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, /* princ_str size and length */ SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p);
- DEBUG(SSSDBG_TRACE_LIBS, ("princ_str size: %d\n", len)); + DEBUG(SSSDBG_TRACE_LIBS, "princ_str size: %d\n", len); if (len) { if ((p + len ) > size) return EINVAL; ibuf->princ_str = talloc_strndup(ibuf, (char *)(buf + p), len); - DEBUG(SSSDBG_TRACE_LIBS, ("got princ_str: %s\n", ibuf->princ_str)); + DEBUG(SSSDBG_TRACE_LIBS, "got princ_str: %s\n", ibuf->princ_str); if (ibuf->princ_str == NULL) return ENOMEM; p += len; } @@ -86,18 +86,18 @@ static errno_t unpack_buffer(uint8_t *buf, size_t size, /* keytab_name size and length */ SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p);
- DEBUG(SSSDBG_TRACE_LIBS, ("keytab_name size: %d\n", len)); + DEBUG(SSSDBG_TRACE_LIBS, "keytab_name size: %d\n", len); if (len) { if ((p + len ) > size) return EINVAL; ibuf->keytab_name = talloc_strndup(ibuf, (char *)(buf + p), len); - DEBUG(SSSDBG_TRACE_LIBS, ("got keytab_name: %s\n", ibuf->keytab_name)); + DEBUG(SSSDBG_TRACE_LIBS, "got keytab_name: %s\n", ibuf->keytab_name); if (ibuf->keytab_name == NULL) return ENOMEM; p += len; }
/* ticket lifetime */ SAFEALIGN_COPY_INT32_CHECK(&ibuf->lifetime, buf + p, size, &p); - DEBUG(SSSDBG_TRACE_LIBS, ("lifetime: %d\n", ibuf->lifetime)); + DEBUG(SSSDBG_TRACE_LIBS, "lifetime: %d\n", ibuf->lifetime);
return EOK; } @@ -112,7 +112,7 @@ static int pack_buffer(struct response *r, int result, krb5_error_code krberr, r->size = 2 * sizeof(uint32_t) + sizeof(krb5_error_code) + len + sizeof(time_t);
- DEBUG(SSSDBG_TRACE_INTERNAL, ("response size: %zu\n",r->size)); + DEBUG(SSSDBG_TRACE_INTERNAL, "response size: %zu\n",r->size);
r->buf = talloc_array(r, uint8_t, r->size); if(!r->buf) { @@ -120,8 +120,8 @@ static int pack_buffer(struct response *r, int result, krb5_error_code krberr, }
DEBUG(SSSDBG_TRACE_LIBS, - ("result [%d] krberr [%d] msgsize [%d] msg [%s]\n", - result, krberr, len, msg)); + "result [%d] krberr [%d] msgsize [%d] msg [%s]\n", + result, krberr, len, msg);
/* result */ SAFEALIGN_SET_UINT32(&r->buf[p], result, &p); @@ -187,21 +187,21 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx,
krberr = krb5_init_context(&context); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to init kerberos context\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to init kerberos context\n"); return krberr; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Kerberos context initialized\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Kerberos context initialized\n");
krberr = set_child_debugging(context); if (krberr != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot set krb5_child debugging\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cannot set krb5_child debugging\n"); }
if (!realm_str) { krberr = krb5_get_default_realm(context, &default_realm); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get default realm name: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get default realm name: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; }
@@ -219,7 +219,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, } }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("got realm_name: [%s]\n", realm_name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "got realm_name: [%s]\n", realm_name);
if (princ_str) { if (!strchr(princ_str, '@')) { @@ -238,7 +238,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, } hostname[511] = '\0';
- DEBUG(SSSDBG_TRACE_LIBS, ("got hostname: [%s]\n", hostname)); + DEBUG(SSSDBG_TRACE_LIBS, "got hostname: [%s]\n", hostname);
ret = select_principal_from_keytab(memctx, hostname, realm_name, keytab_name, &full_princ, NULL, NULL); @@ -251,12 +251,12 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, krberr = KRB5KRB_ERR_GENERIC; goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Principal name is: [%s]\n", full_princ)); + DEBUG(SSSDBG_CONF_SETTINGS, "Principal name is: [%s]\n", full_princ);
krberr = krb5_parse_name(context, full_princ, &kprinc); if (krberr) { - DEBUG(2, ("Unable to build principal: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(2, "Unable to build principal: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; }
@@ -265,12 +265,12 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, } else { krberr = krb5_kt_default(context, &keytab); } - DEBUG(SSSDBG_CONF_SETTINGS, ("Using keytab [%s]\n", KEYTAB_CLEAN_NAME)); + DEBUG(SSSDBG_CONF_SETTINGS, "Using keytab [%s]\n", KEYTAB_CLEAN_NAME); if (krberr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to read keytab file [%s]: %s\n", + "Failed to read keytab file [%s]: %s\n", KEYTAB_CLEAN_NAME, - sss_krb5_get_error_message(context, krberr))); + sss_krb5_get_error_message(context, krberr)); goto done; }
@@ -278,7 +278,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, ret = sss_krb5_verify_keytab_ex(full_princ, keytab_name, context, keytab); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to verify principal is present in the keytab\n")); + "Unable to verify principal is present in the keytab\n"); krberr = KRB5_KT_IOERR; goto done; } @@ -288,12 +288,12 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, krberr = KRB5KRB_ERR_GENERIC; goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("keytab ccname: [%s]\n", ccname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "keytab ccname: [%s]\n", ccname);
krberr = krb5_cc_resolve(context, ccname, &ccache); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to set cache name: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to set cache name: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; }
@@ -307,7 +307,7 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx,
tmp_str = getenv("KRB5_CANONICALIZE"); if (tmp_str != NULL && strcasecmp(tmp_str, "true") == 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Will canonicalize principals\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "Will canonicalize principals\n"); canonicalize = 1; } sss_krb5_get_init_creds_opt_set_canonicalize(&options, canonicalize); @@ -316,8 +316,8 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, keytab, 0, NULL, &options); if (krberr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to init credentials: %s\n", - sss_krb5_get_error_message(context, krberr))); + "Failed to init credentials: %s\n", + sss_krb5_get_error_message(context, krberr)); sss_log(SSS_LOG_ERR, "Failed to initialize credentials using keytab [%s]: %s. " "Unable to create GSSAPI-encrypted LDAP connection.", @@ -325,37 +325,37 @@ static krb5_error_code ldap_child_get_tgt_sync(TALLOC_CTX *memctx, sss_krb5_get_error_message(context, krberr)); goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("credentials initialized\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "credentials initialized\n");
/* Use updated principal if changed due to canonicalization. */ krberr = krb5_cc_initialize(context, ccache, my_creds.client); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to init ccache: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to init ccache: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; }
krberr = krb5_cc_store_cred(context, ccache, &my_creds); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store creds: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store creds: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("credentials stored\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "credentials stored\n");
#ifdef HAVE_KRB5_GET_TIME_OFFSETS krberr = krb5_get_time_offsets(context, &kdc_time_offset, &kdc_time_offset_usec); if (krberr) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get KDC time offset: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get KDC time offset: %s\n", + sss_krb5_get_error_message(context, krberr)); kdc_time_offset = 0; } else { if (kdc_time_offset_usec > 0) { kdc_time_offset++; } } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Got KDC time offset\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Got KDC time offset\n"); #else /* If we don't have this function, just assume no offset */ kdc_time_offset = 0; @@ -388,7 +388,7 @@ static int prepare_response(TALLOC_CTX *mem_ctx, r->buf = NULL; r->size = 0;
- DEBUG(SSSDBG_TRACE_FUNC, ("Building response for result [%d]\n", kerr)); + DEBUG(SSSDBG_TRACE_FUNC, "Building response for result [%d]\n", kerr);
if (kerr == 0) { ret = pack_buffer(r, EOK, kerr, ccname, expire_time); @@ -396,7 +396,7 @@ static int prepare_response(TALLOC_CTX *mem_ctx, krb5_msg = sss_krb5_get_error_message(krb5_error_ctx, kerr); if (krb5_msg == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_krb5_get_error_message failed.\n")); + "sss_krb5_get_error_message failed.\n"); return ENOMEM; }
@@ -405,7 +405,7 @@ static int prepare_response(TALLOC_CTX *mem_ctx, }
if (ret != EOK) { - DEBUG(1, ("pack_buffer failed\n")); + DEBUG(1, "pack_buffer failed\n"); return ret; }
@@ -462,22 +462,22 @@ int main(int argc, const char *argv[])
debug_prg_name = talloc_asprintf(NULL, "[sssd[ldap_child[%d]]]", getpid()); if (!debug_prg_name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n"); goto fail; }
if (debug_fd != -1) { ret = set_debug_file_from_fd(debug_fd); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("set_debug_file_from_fd failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "set_debug_file_from_fd failed.\n"); } }
- DEBUG(SSSDBG_TRACE_FUNC, ("ldap_child started.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "ldap_child started.\n");
main_ctx = talloc_new(NULL); if (main_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n"); talloc_free(discard_const(debug_prg_name)); goto fail; } @@ -485,23 +485,23 @@ int main(int argc, const char *argv[])
buf = talloc_size(main_ctx, sizeof(uint8_t)*IN_BUF_SIZE); if (buf == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); goto fail; }
ibuf = talloc_zero(main_ctx, struct input_buffer); if (ibuf == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("context initialized\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "context initialized\n");
errno = 0; len = sss_atomic_read_s(STDIN_FILENO, buf, IN_BUF_SIZE); if (len == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("read failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "read failed [%d][%s].\n", ret, strerror(ret)); goto fail; }
@@ -509,24 +509,24 @@ int main(int argc, const char *argv[])
ret = unpack_buffer(buf, len, ibuf); if (ret != EOK) { - DEBUG(1, ("unpack_buffer failed.[%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "unpack_buffer failed.[%d][%s].\n", ret, strerror(ret)); goto fail; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("getting TGT sync\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "getting TGT sync\n"); kerr = ldap_child_get_tgt_sync(main_ctx, ibuf->realm_str, ibuf->princ_str, ibuf->keytab_name, ibuf->lifetime, &ccname, &expire_time); if (kerr != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("ldap_child_get_tgt_sync failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ldap_child_get_tgt_sync failed.\n"); /* Do not return, must report failure */ }
ret = prepare_response(main_ctx, ccname, expire_time, kerr, &resp); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("prepare_response failed. [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "prepare_response failed. [%d][%s].\n", + ret, strerror(ret)); goto fail; }
@@ -534,24 +534,24 @@ int main(int argc, const char *argv[]) written = sss_atomic_write_s(STDOUT_FILENO, resp->buf, resp->size); if (written == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("write failed [%d][%s].\n", ret, - strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "write failed [%d][%s].\n", ret, + strerror(ret)); goto fail; }
if (written != resp->size) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Expected to write %zu bytes, wrote %zu\n", - resp->size, written)); + DEBUG(SSSDBG_CRIT_FAILURE, "Expected to write %zu bytes, wrote %zu\n", + resp->size, written); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("ldap_child completed successfully\n")); + DEBUG(SSSDBG_TRACE_FUNC, "ldap_child completed successfully\n"); close(STDOUT_FILENO); talloc_free(main_ctx); _exit(0);
fail: - DEBUG(SSSDBG_CRIT_FAILURE, ("ldap_child failed!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ldap_child failed!\n"); close(STDOUT_FILENO); talloc_free(main_ctx); _exit(-1); diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c index b3a048c..2434123 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -106,14 +106,14 @@ sdap_domain_subdom_add(struct sdap_id_ctx *sdap_id_ctx,
if (sditer == NULL) { /* New sdap domain */ - DEBUG(SSSDBG_TRACE_FUNC, ("subdomain %s is a new one, will " - "create a new sdap domain object\n", dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "subdomain %s is a new one, will " + "create a new sdap domain object\n", dom->name);
ret = sdap_domain_add(sdap_id_ctx->opts, dom, &sdom); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot add new sdap domain for domain %s [%d]: %s\n", - parent->name, ret, strerror(ret))); + "Cannot add new sdap domain for domain %s [%d]: %s\n", + parent->name, ret, strerror(ret)); return ret; } } else { @@ -124,8 +124,8 @@ sdap_domain_subdom_add(struct sdap_id_ctx *sdap_id_ctx, ret = domain_to_basedn(sdom, sdom->dom->name, &basedn); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot convert domain name [%s] to base DN [%d]: %s\n", - dom->name, ret, strerror(ret))); + "Cannot convert domain name [%s] to base DN [%d]: %s\n", + dom->name, ret, strerror(ret)); talloc_free(basedn); return ret; } @@ -142,7 +142,7 @@ sdap_domain_subdom_add(struct sdap_id_ctx *sdap_id_ctx, &sdom->search_bases[0]); talloc_free(basedn); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot create new sdap search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot create new sdap search base\n"); return ret; }
@@ -226,15 +226,15 @@ int ldap_get_options(TALLOC_CTX *memctx, if (ret != EOK) { goto done; } - DEBUG(6, ("Option %s set to %s\n", + DEBUG(6, "Option %s set to %s\n", opts->basic[search_base_options[o]].opt_name, dp_opt_get_string(opts->basic, - search_base_options[o]))); + search_base_options[o])); } } } else { - DEBUG(5, ("Search base not set, trying to discover it later when " - "connecting to the LDAP server.\n")); + DEBUG(5, "Search base not set, trying to discover it later when " + "connecting to the LDAP server.\n"); }
/* Default search */ @@ -269,14 +269,14 @@ int ldap_get_options(TALLOC_CTX *memctx,
pwd_policy = dp_opt_get_string(opts->basic, SDAP_PWD_POLICY); if (pwd_policy == NULL) { - DEBUG(1, ("Missing password policy, this may not happen.\n")); + DEBUG(1, "Missing password policy, this may not happen.\n"); ret = EINVAL; goto done; } if (strcasecmp(pwd_policy, PWD_POL_OPT_NONE) != 0 && strcasecmp(pwd_policy, PWD_POL_OPT_SHADOW) != 0 && strcasecmp(pwd_policy, PWD_POL_OPT_MIT) != 0) { - DEBUG(1, ("Unsupported password policy [%s].\n", pwd_policy)); + DEBUG(1, "Unsupported password policy [%s].\n", pwd_policy); ret = EINVAL; goto done; } @@ -286,8 +286,8 @@ int ldap_get_options(TALLOC_CTX *memctx, CONFDB_PAM_CRED_TIMEOUT, 0, &offline_credentials_expiration); if (ret != EOK) { - DEBUG(1, ("Cannot get value of %s from confdb \n", - CONFDB_PAM_CRED_TIMEOUT)); + DEBUG(1, "Cannot get value of %s from confdb \n", + CONFDB_PAM_CRED_TIMEOUT); goto done; }
@@ -303,22 +303,22 @@ int ldap_get_options(TALLOC_CTX *memctx, * entries must not be purged from cache. */ if (!offline_credentials_expiration && account_cache_expiration) { - DEBUG(1, ("Conflicting values for options %s (unlimited) " + DEBUG(1, "Conflicting values for options %s (unlimited) " "and %s (%d)\n", opts->basic[SDAP_ACCOUNT_CACHE_EXPIRATION].opt_name, CONFDB_PAM_CRED_TIMEOUT, - offline_credentials_expiration)); + offline_credentials_expiration); ret = EINVAL; goto done; } if (offline_credentials_expiration && account_cache_expiration && offline_credentials_expiration > account_cache_expiration) { - DEBUG(1, ("Value of %s (now %d) must be larger " + DEBUG(1, "Value of %s (now %d) must be larger " "than value of %s (now %d)\n", opts->basic[SDAP_ACCOUNT_CACHE_EXPIRATION].opt_name, account_cache_expiration, CONFDB_PAM_CRED_TIMEOUT, - offline_credentials_expiration)); + offline_credentials_expiration); ret = EINVAL; goto done; } @@ -327,7 +327,7 @@ int ldap_get_options(TALLOC_CTX *memctx, if (ldap_deref != NULL) { ret = deref_string_to_val(ldap_deref, &ldap_deref_val); if (ret != EOK) { - DEBUG(1, ("Failed to verify ldap_deref option.\n")); + DEBUG(1, "Failed to verify ldap_deref option.\n"); goto done; } } @@ -337,8 +337,8 @@ int ldap_get_options(TALLOC_CTX *memctx,
ldap_referrals = dp_opt_get_bool(opts->basic, SDAP_REFERRALS); if (ldap_referrals) { - DEBUG(1, ("LDAP referrals are not supported, because the LDAP library " - "is too old, see sssd-ldap(5) for details.\n")); + DEBUG(1, "LDAP referrals are not supported, because the LDAP library " + "is too old, see sssd-ldap(5) for details.\n"); ret = dp_opt_set_bool(opts->basic, SDAP_REFERRALS, false); } #endif @@ -377,7 +377,7 @@ int ldap_get_options(TALLOC_CTX *memctx, default_netgroup_map = netgroup_map; default_service_map = service_map; } else { - DEBUG(0, ("Unrecognized schema type: %s\n", schema)); + DEBUG(0, "Unrecognized schema type: %s\n", schema); ret = EINVAL; goto done; } @@ -426,27 +426,27 @@ int ldap_get_options(TALLOC_CTX *memctx, /* FIXME - this can be removed in a future version */ ret = krb5_try_kdcip(cdb, conf_path, opts->basic, SDAP_KRB5_KDC); if (ret != EOK) { - DEBUG(1, ("sss_krb5_try_kdcip failed.\n")); + DEBUG(1, "sss_krb5_try_kdcip failed.\n"); goto done; }
authtok_type = dp_opt_get_string(opts->basic, SDAP_DEFAULT_AUTHTOK_TYPE); if (authtok_type != NULL && strcasecmp(authtok_type,"obfuscated_password") == 0) { - DEBUG(9, ("Found obfuscated password, " - "trying to convert to cleartext.\n")); + DEBUG(9, "Found obfuscated password, " + "trying to convert to cleartext.\n");
authtok_blob = dp_opt_get_blob(opts->basic, SDAP_DEFAULT_AUTHTOK); if (authtok_blob.data == NULL || authtok_blob.length == 0) { - DEBUG(1, ("Missing obfuscated password string.\n")); + DEBUG(1, "Missing obfuscated password string.\n"); return EINVAL; }
ret = sss_password_decrypt(memctx, (char *) authtok_blob.data, &cleartext); if (ret != EOK) { - DEBUG(1, ("Cannot convert the obfuscated " - "password back to cleartext\n")); + DEBUG(1, "Cannot convert the obfuscated " + "password back to cleartext\n"); return ret; }
@@ -455,14 +455,14 @@ int ldap_get_options(TALLOC_CTX *memctx, ret = dp_opt_set_blob(opts->basic, SDAP_DEFAULT_AUTHTOK, authtok_blob); talloc_free(cleartext); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); return ret; }
ret = dp_opt_set_string(opts->basic, SDAP_DEFAULT_AUTHTOK_TYPE, "password"); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); return ret; } } @@ -496,25 +496,25 @@ int ldap_get_sudo_options(TALLOC_CTX *memctx, ret = dp_opt_set_string(opts->basic, SDAP_SUDO_SEARCH_BASE, search_base); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set SUDO search base" - "to default value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set SUDO search base" + "to default value\n"); return ret; }
- DEBUG(SSSDBG_FUNC_DATA, ("Option %s set to %s\n", + DEBUG(SSSDBG_FUNC_DATA, "Option %s set to %s\n", opts->basic[SDAP_SUDO_SEARCH_BASE].opt_name, - dp_opt_get_string(opts->basic, SDAP_SUDO_SEARCH_BASE))); + dp_opt_get_string(opts->basic, SDAP_SUDO_SEARCH_BASE)); } } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Search base not set, trying to discover it later " - "connecting to the LDAP server.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Search base not set, trying to discover it later " + "connecting to the LDAP server.\n"); }
ret = sdap_parse_search_base(opts, opts->basic, SDAP_SUDO_SEARCH_BASE, &opts->sdom->sudo_search_bases); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not parse SUDO search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not parse SUDO search base\n"); return ret; }
@@ -524,7 +524,7 @@ int ldap_get_sudo_options(TALLOC_CTX *memctx, SDAP_OPTS_SUDO, &opts->sudorule_map); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get SUDO attribute map\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not get SUDO attribute map\n"); return ret; }
@@ -554,25 +554,25 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, ret = dp_opt_set_string(opts->basic, SDAP_AUTOFS_SEARCH_BASE, search_base); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set autofs search base" - "to default value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set autofs search base" + "to default value\n"); return ret; }
- DEBUG(SSSDBG_FUNC_DATA, ("Option %s set to %s\n", + DEBUG(SSSDBG_FUNC_DATA, "Option %s set to %s\n", opts->basic[SDAP_AUTOFS_SEARCH_BASE].opt_name, - dp_opt_get_string(opts->basic, SDAP_AUTOFS_SEARCH_BASE))); + dp_opt_get_string(opts->basic, SDAP_AUTOFS_SEARCH_BASE)); } } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Search base not set, trying to discover it later " - "connecting to the LDAP server.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Search base not set, trying to discover it later " + "connecting to the LDAP server.\n"); }
ret = sdap_parse_search_base(opts, opts->basic, SDAP_AUTOFS_SEARCH_BASE, &opts->sdom->autofs_search_bases); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not parse autofs search base\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not parse autofs search base\n"); return ret; }
@@ -589,7 +589,7 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, default_entry_map = rfc2307bis_autofs_entry_map; break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown LDAP schema!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown LDAP schema!\n"); return EINVAL; }
@@ -599,7 +599,7 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, &opts->autofs_mobject_map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get autofs map object attribute map\n")); + "Could not get autofs map object attribute map\n"); return ret; }
@@ -609,7 +609,7 @@ int ldap_get_autofs_options(TALLOC_CTX *memctx, &opts->autofs_entry_map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get autofs entry object attribute map\n")); + "Could not get autofs entry object attribute map\n"); return ret; }
@@ -652,7 +652,7 @@ errno_t sdap_parse_search_base(TALLOC_CTX *mem_ctx, break; default: DEBUG(SSSDBG_CONF_SETTINGS, - ("Unknown search base type: [%d]\n", class)); + "Unknown search base type: [%d]\n", class); class_name = "UNKNOWN"; /* Non-fatal */ break; @@ -713,8 +713,8 @@ sdap_create_search_base(TALLOC_CTX *mem_ctx,
if (!ldb_dn_validate(ldn)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid base DN [%s]\n", - unparsed_base)); + "Invalid base DN [%s]\n", + unparsed_base); ret = EINVAL; goto done; } @@ -770,7 +770,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, */ if (count > 1 && (count % 3)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unparseable search base: [%s][%d]\n", unparsed_base, count)); + "Unparseable search base: [%s][%d]\n", unparsed_base, count); ret = EINVAL; goto done; } @@ -784,10 +784,10 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx,
if (old_filter != NULL) { /* Using a deprecated ldap_{user,group}_search_filter */ - DEBUG(SSSDBG_IMPORTANT_INFO, ("WARNING: Using a deprecated filter " + DEBUG(SSSDBG_IMPORTANT_INFO, "WARNING: Using a deprecated filter " "option for %s. Please see the documentation on LDAP search " "bases to see how the obsolete option can be migrated\n", - class_name)); + class_name); sss_log(SSS_LOG_NOTICE, "WARNING: Using a deprecated filter option" "for %s. Please see the documentation on LDAP search bases " "to see how the obsolete option can be migrated\n", @@ -803,11 +803,11 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Search base added: [%s][%s][%s][%s]\n", + "Search base added: [%s][%s][%s][%s]\n", class_name, search_bases[0]->basedn, "SUBTREE", - search_bases[0]->filter ? search_bases[0]->filter : "")); + search_bases[0]->filter ? search_bases[0]->filter : "");
search_bases[1] = NULL; } else { @@ -829,7 +829,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx,
if (split_bases[c][0] == '\0') { DEBUG(SSSDBG_CRIT_FAILURE, - ("Zero-length search base: [%s]\n", unparsed_base)); + "Zero-length search base: [%s]\n", unparsed_base); ret = EINVAL; goto done; } @@ -843,8 +843,8 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx,
if (!ldb_dn_validate(ldn)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid base DN [%s]\n", - split_bases[c])); + "Invalid base DN [%s]\n", + split_bases[c]); ret = EINVAL; goto done; } @@ -871,7 +871,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, search_bases[i]->scope = LDAP_SCOPE_BASE; } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unknown search scope: [%s]\n", split_bases[c+1])); + "Unknown search scope: [%s]\n", split_bases[c+1]); ret = EINVAL; goto done; } @@ -897,7 +897,7 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, tree = ldb_parse_tree(tmp_ctx, filter); if(!tree) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid search filter: [%s]\n", filter)); + "Invalid search filter: [%s]\n", filter); ret = EINVAL; goto done; } @@ -908,11 +908,11 @@ errno_t common_parse_search_base(TALLOC_CTX *mem_ctx, }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Search base added: [%s][%s][%s][%s]\n", + "Search base added: [%s][%s][%s][%s]\n", class_name, search_bases[i]->basedn, split_bases[c+1][0] ? split_bases[c+1] : "SUBTREE", - search_bases[i]->filter ? search_bases[i]->filter : "")); + search_bases[i]->filter ? search_bases[i]->filter : "");
i++; } @@ -957,7 +957,7 @@ int sdap_id_setup_tasks(struct sdap_id_ctx *ctx,
/* set up enumeration task */ if (sdom->dom->enumerate) { - DEBUG(SSSDBG_TRACE_FUNC, ("Setting up enumeration for %s\n", sdom->dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Setting up enumeration for %s\n", sdom->dom->name); ret = ldap_setup_enumeration(ctx, conn, sdom, send_fn, recv_fn); } else { /* the enumeration task, runs the cleanup process by itself, @@ -991,7 +991,7 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed\n")); + DEBUG(1, "talloc_new failed\n"); return; }
@@ -1005,8 +1005,8 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server)
srvaddr = fo_get_server_hostent(server); if (!srvaddr) { - DEBUG(1, ("FATAL: No hostent available for server (%s)\n", - fo_get_server_str_name(server))); + DEBUG(1, "FATAL: No hostent available for server (%s)\n", + fo_get_server_str_name(server)); talloc_free(tmp_ctx); return; } @@ -1014,20 +1014,20 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server) sockaddr = resolv_get_sockaddr_address(tmp_ctx, srvaddr, fo_get_server_port(server)); if (sockaddr == NULL) { - DEBUG(1, ("resolv_get_sockaddr_address failed.\n")); + DEBUG(1, "resolv_get_sockaddr_address failed.\n"); talloc_free(tmp_ctx); return; }
if (fo_is_srv_lookup(server)) { if (!tmp) { - DEBUG(1, ("Unknown service, using ldap\n")); + DEBUG(1, "Unknown service, using ldap\n"); tmp = SSS_LDAP_SRV_NAME; }
srv_name = fo_get_server_name(server); if (srv_name == NULL) { - DEBUG(1, ("Could not get server host name\n")); + DEBUG(1, "Could not get server host name\n"); talloc_free(tmp_ctx); return; } @@ -1040,12 +1040,12 @@ static void sdap_uri_callback(void *private_data, struct fo_server *server) }
if (!new_uri) { - DEBUG(2, ("Failed to copy URI ...\n")); + DEBUG(2, "Failed to copy URI ...\n"); talloc_free(tmp_ctx); return; }
- DEBUG(6, ("Constructed uri '%s'\n", new_uri)); + DEBUG(6, "Constructed uri '%s'\n", new_uri);
/* free old one and replace with new one */ talloc_zfree(service->uri); @@ -1067,7 +1067,7 @@ static void sdap_finalize(struct tevent_context *ev,
ret = remove_krb5_info_files(se, realm); if (ret != EOK) { - DEBUG(1, ("remove_krb5_info_files failed.\n")); + DEBUG(1, "remove_krb5_info_files failed.\n"); }
sig_term(signum); @@ -1084,14 +1084,14 @@ errno_t sdap_install_sigterm_handler(TALLOC_CTX *mem_ctx,
sig_realm = talloc_strdup(mem_ctx, realm); if (sig_realm == NULL) { - DEBUG(1, ("talloc_strdup failed!\n")); + DEBUG(1, "talloc_strdup failed!\n"); return ENOMEM; }
sige = tevent_add_signal(ev, mem_ctx, SIGTERM, SA_SIGINFO, sdap_finalize, sig_realm); if (sige == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); talloc_free(sig_realm); return ENOMEM; } @@ -1110,21 +1110,21 @@ void sdap_remove_kdcinfo_files_callback(void *pvt) ret = be_fo_run_callbacks_at_next_request(ctx->be_ctx, ctx->kdc_service_name); if (ret != EOK) { - DEBUG(1, ("be_fo_run_callbacks_at_next_request failed, " + DEBUG(1, "be_fo_run_callbacks_at_next_request failed, " "krb5 info files will not be removed, because " - "it is unclear if they will be recreated properly.\n")); + "it is unclear if they will be recreated properly.\n"); return; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed, cannot remove krb5 info files.\n")); + DEBUG(1, "talloc_new failed, cannot remove krb5 info files.\n"); return; }
ret = remove_krb5_info_files(tmp_ctx, ctx->realm); if (ret != EOK) { - DEBUG(1, ("remove_krb5_info_files failed.\n")); + DEBUG(1, "remove_krb5_info_files failed.\n"); }
talloc_zfree(tmp_ctx); @@ -1141,7 +1141,7 @@ errno_t sdap_install_offline_callback(TALLOC_CTX *mem_ctx,
ctx = talloc_zero(mem_ctx, struct remove_info_files_ctx); if (ctx == NULL) { - DEBUG(1, ("talloc_zfree failed.\n")); + DEBUG(1, "talloc_zfree failed.\n"); return ENOMEM; }
@@ -1149,7 +1149,7 @@ errno_t sdap_install_offline_callback(TALLOC_CTX *mem_ctx, ctx->realm = talloc_strdup(ctx, realm); ctx->kdc_service_name = talloc_strdup(ctx, service_name); if (ctx->realm == NULL || ctx->kdc_service_name == NULL) { - DEBUG(1, ("talloc_strdup failed!\n")); + DEBUG(1, "talloc_strdup failed!\n"); ret = ENOMEM; goto done; } @@ -1158,7 +1158,7 @@ errno_t sdap_install_offline_callback(TALLOC_CTX *mem_ctx, sdap_remove_kdcinfo_files_callback, ctx, NULL); if (ret != EOK) { - DEBUG(1, ("be_add_offline_cb failed.\n")); + DEBUG(1, "be_add_offline_cb failed.\n"); goto done; }
@@ -1200,7 +1200,7 @@ sdap_set_sasl_options(struct sdap_options *id_opts, *primary_realm = '\0'; desired_realm = primary_realm+1; DEBUG(SSSDBG_TRACE_INTERNAL, - ("authid contains realm [%s]\n", desired_realm)); + "authid contains realm [%s]\n", desired_realm); } else { desired_realm = dp_opt_get_string(id_opts->basic, SDAP_SASL_REALM); if (!desired_realm) { @@ -1209,9 +1209,9 @@ sdap_set_sasl_options(struct sdap_options *id_opts, } }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Will look for %s@%s in %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Will look for %s@%s in %s\n", desired_primary, desired_realm, - keytab_path ? keytab_path : "default keytab")); + keytab_path ? keytab_path : "default keytab");
ret = select_principal_from_keytab(tmp_ctx, desired_primary, desired_realm, @@ -1223,14 +1223,14 @@ sdap_set_sasl_options(struct sdap_options *id_opts,
if (primary_requested && strcmp(desired_primary, sasl_primary) != 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Configured SASL auth ID not found in keytab. " - "Requested %s, found %s\n", desired_primary, sasl_primary)); + "Configured SASL auth ID not found in keytab. " + "Requested %s, found %s\n", desired_primary, sasl_primary); }
if (realm_requested && strcmp(desired_realm, sasl_realm) != 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Configured SASL realm not found in keytab. " - "Requested %s, found %s\n", desired_realm, sasl_realm)); + "Configured SASL realm not found in keytab. " + "Requested %s, found %s\n", desired_realm, sasl_realm); }
ret = dp_opt_set_string(id_opts->basic, @@ -1238,9 +1238,9 @@ sdap_set_sasl_options(struct sdap_options *id_opts, if (ret != EOK) { goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", id_opts->basic[SDAP_SASL_AUTHID].opt_name, - dp_opt_get_string(id_opts->basic, SDAP_SASL_AUTHID))); + dp_opt_get_string(id_opts->basic, SDAP_SASL_AUTHID));
ret = dp_opt_set_string(id_opts->basic, SDAP_SASL_REALM, sasl_realm); @@ -1248,9 +1248,9 @@ sdap_set_sasl_options(struct sdap_options *id_opts, goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Option %s set to %s\n", + DEBUG(SSSDBG_CONF_SETTINGS, "Option %s set to %s\n", id_opts->basic[SDAP_SASL_REALM].opt_name, - dp_opt_get_string(id_opts->basic, SDAP_SASL_REALM))); + dp_opt_get_string(id_opts->basic, SDAP_SASL_REALM));
ret = EOK; done: @@ -1268,25 +1268,25 @@ sdap_gssapi_get_default_realm(TALLOC_CTX *mem_ctx)
krberr = krb5_init_context(&context); if (krberr) { - DEBUG(2, ("Failed to init kerberos context\n")); + DEBUG(2, "Failed to init kerberos context\n"); goto done; }
krberr = krb5_get_default_realm(context, &krb5_realm); if (krberr) { - DEBUG(2, ("Failed to get default realm name: %s\n", - sss_krb5_get_error_message(context, krberr))); + DEBUG(2, "Failed to get default realm name: %s\n", + sss_krb5_get_error_message(context, krberr)); goto done; }
realm = talloc_strdup(mem_ctx, krb5_realm); krb5_free_default_realm(context, krb5_realm); if (!realm) { - DEBUG(0, ("Out of memory\n")); + DEBUG(0, "Out of memory\n"); goto done; }
- DEBUG(7, ("Will use default realm %s\n", realm)); + DEBUG(7, "Will use default realm %s\n", realm); done: if (context) krb5_free_context(context); return realm; @@ -1314,10 +1314,10 @@ int sdap_gssapi_init(TALLOC_CTX *mem_ctx,
krb5_opt_realm = dp_opt_get_string(opts, SDAP_KRB5_REALM); if (krb5_opt_realm == NULL) { - DEBUG(2, ("Missing krb5_realm option, will use libkrb default\n")); + DEBUG(2, "Missing krb5_realm option, will use libkrb default\n"); krb5_realm = sdap_gssapi_get_default_realm(tmp_ctx); if (krb5_realm == NULL) { - DEBUG(0, ("Cannot determine the Kerberos realm, aborting\n")); + DEBUG(0, "Cannot determine the Kerberos realm, aborting\n"); ret = EIO; goto done; } @@ -1336,20 +1336,20 @@ int sdap_gssapi_init(TALLOC_CTX *mem_ctx, SDAP_KRB5_USE_KDCINFO), &service); if (ret != EOK) { - DEBUG(0, ("Failed to init KRB5 failover service!\n")); + DEBUG(0, "Failed to init KRB5 failover service!\n"); goto done; }
ret = sdap_install_sigterm_handler(mem_ctx, bectx->ev, krb5_realm); if (ret != EOK) { - DEBUG(0, ("Failed to install sigterm handler\n")); + DEBUG(0, "Failed to install sigterm handler\n"); goto done; }
ret = sdap_install_offline_callback(mem_ctx, bectx, krb5_realm, SSS_KRB5KDC_FO_SRV); if (ret != EOK) { - DEBUG(0, ("Failed to install sigterm handler\n")); + DEBUG(0, "Failed to install sigterm handler\n"); goto done; }
@@ -1391,7 +1391,7 @@ static errno_t _sdap_urls_init(struct be_ctx *ctx, /* split server parm into a list */ ret = split_on_separator(tmp_ctx, urls, ',', true, true, &list, NULL); if (ret != EOK) { - DEBUG(1, ("Failed to parse server list!\n")); + DEBUG(1, "Failed to parse server list!\n"); goto done; }
@@ -1400,15 +1400,15 @@ static errno_t _sdap_urls_init(struct be_ctx *ctx, if (be_fo_is_srv_identifier(list[i])) { if (!primary) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add server [%s] to failover service: " + "Failed to add server [%s] to failover service: " "SRV resolution only allowed for primary servers!\n", - list[i])); + list[i]); continue; }
if (!dns_service_name) { - DEBUG(0, ("Missing DNS service name for service [%s].\n", - service_name)); + DEBUG(0, "Missing DNS service name for service [%s].\n", + service_name); ret = EINVAL; goto done; } @@ -1422,29 +1422,29 @@ static errno_t _sdap_urls_init(struct be_ctx *ctx, dns_service_name, NULL, BE_FO_PROTO_TCP, false, srv_user_data); if (ret) { - DEBUG(0, ("Failed to add server\n")); + DEBUG(0, "Failed to add server\n"); goto done; }
- DEBUG(6, ("Added service lookup\n")); + DEBUG(6, "Added service lookup\n"); continue; }
ret = ldap_url_parse(list[i], &lud); if (ret != LDAP_SUCCESS) { - DEBUG(0, ("Failed to parse ldap URI (%s)!\n", list[i])); + DEBUG(0, "Failed to parse ldap URI (%s)!\n", list[i]); ret = EINVAL; goto done; }
if (lud->lud_host == NULL) { - DEBUG(2, ("The LDAP URI (%s) did not contain a host name\n", - list[i])); + DEBUG(2, "The LDAP URI (%s) did not contain a host name\n", + list[i]); ldap_free_urldesc(lud); continue; }
- DEBUG(6, ("Added URI %s\n", list[i])); + DEBUG(6, "Added URI %s\n", list[i]);
talloc_steal(service, list[i]);
@@ -1514,7 +1514,7 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
ret = be_fo_add_service(ctx, service_name, ldap_user_data_cmp); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to create failover service!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to create failover service!\n"); goto done; }
@@ -1526,7 +1526,7 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
if (!urls) { DEBUG(SSSDBG_CONF_SETTINGS, - ("No primary servers defined, using service discovery\n")); + "No primary servers defined, using service discovery\n"); urls = BE_SRV_IDENTIFIER; }
@@ -1547,7 +1547,7 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx, ret = be_fo_service_add_callback(memctx, ctx, service->name, sdap_uri_callback, service); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to add failover callback!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to add failover callback!\n"); goto done; }
@@ -1574,19 +1574,19 @@ errno_t string_to_shadowpw_days(const char *s, long *d) errno = 0; l = strtol(s, &endptr, 10); if (errno != 0) { - DEBUG(1, ("strtol failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "strtol failed [%d][%s].\n", errno, strerror(errno)); return errno; }
if (*endptr != '\0') { - DEBUG(1, ("Input string [%s] is invalid.\n", s)); + DEBUG(1, "Input string [%s] is invalid.\n", s); return EINVAL; }
if (l < -1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Input string contains not allowed negative value [%ld].\n", - l)); + "Input string contains not allowed negative value [%ld].\n", + l); return EINVAL; }
@@ -1772,8 +1772,8 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_el(sysdb_attrs, sid_attr, &el); if (ret != EOK || el->num_values != 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No [%s] attribute while id-mapping. [%d][%s]\n", - sid_attr, el->num_values, strerror(ret))); + "No [%s] attribute while id-mapping. [%d][%s]\n", + sid_attr, el->num_values, strerror(ret)); return ENOENT; }
@@ -1783,7 +1783,7 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx, sid_str = talloc_strndup(mem_ctx, (char *) el->values[0].data, el->values[0].length); if (sid_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strndup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strndup failed.\n"); return ENOMEM; } } else { @@ -1793,8 +1793,8 @@ sdap_attrs_get_sid_str(TALLOC_CTX *mem_ctx, &sid_str); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert SID: [%s]\n", - idmap_error_string(err))); + "Could not convert SID: [%s]\n", + idmap_error_string(err)); return EIO; } } diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c index 162d987..de2ae86 100644 --- a/src/providers/ldap/ldap_id.c +++ b/src/providers/ldap/ldap_id.c @@ -93,7 +93,7 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -130,8 +130,8 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx, uid, &sid); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Mapping ID [%s] to SID failed: [%s]\n", - name, idmap_error_string(err))); + "Mapping ID [%s] to SID failed: [%s]\n", + name, idmap_error_string(err)); ret = EIO; goto fail; } @@ -164,7 +164,7 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx, }
if (attr_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing search attribute name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing search attribute name.\n"); ret = EINVAL; goto fail; } @@ -193,7 +193,7 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx,
talloc_zfree(clean_name); if (!state->filter) { - DEBUG(2, ("Failed to build the base filter\n")); + DEBUG(2, "Failed to build the base filter\n"); ret = ENOMEM; goto fail; } @@ -454,7 +454,7 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -493,8 +493,8 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx, gid, &sid); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Mapping ID [%s] to SID failed: [%s]\n", - name, idmap_error_string(err))); + "Mapping ID [%s] to SID failed: [%s]\n", + name, idmap_error_string(err)); ret = EIO; goto fail; } @@ -527,7 +527,7 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx, }
if (attr_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing search attribute name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing search attribute name.\n"); ret = EINVAL; goto fail; } @@ -554,7 +554,7 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx,
talloc_zfree(clean_name); if (!state->filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } @@ -770,7 +770,7 @@ static struct tevent_req *groups_by_user_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -934,7 +934,7 @@ void sdap_do_online_check(struct be_req *be_req, struct sdap_id_ctx *ctx) check_ctx = talloc_zero(be_req, struct sdap_online_check_ctx); if (!check_ctx) { ret = ENOMEM; - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed\n"); goto fail; } check_ctx->id_ctx = ctx; @@ -944,7 +944,7 @@ void sdap_do_online_check(struct be_req *be_req, struct sdap_id_ctx *ctx) be_ctx, ctx->conn->service, false, CON_TLS_DFL, false); if (req == NULL) { - DEBUG(1, ("sdap_cli_connect_send failed.\n")); + DEBUG(1, "sdap_cli_connect_send failed.\n"); ret = EIO; goto fail; } @@ -1007,12 +1007,12 @@ static void sdap_check_online_done(struct tevent_req *req) talloc_free(check_ctx);
if (reinit) { - DEBUG(SSSDBG_TRACE_FUNC, ("Server reinitialization detected. " - "Cleaning cache.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Server reinitialization detected. " + "Cleaning cache.\n"); reinit_req = sdap_reinit_cleanup_send(be_req, be_ctx, id_ctx); if (reinit_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up.\n"); /* not fatal */ goto done; } @@ -1035,11 +1035,11 @@ static void sdap_check_online_reinit_done(struct tevent_req *req) ret = sdap_reinit_cleanup_recv(req); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up [%d]: %s\n", ret, strerror(ret)); /* not fatal */ } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Reinitialization clean up completed\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reinitialization clean up completed\n"); }
sdap_handler_done(be_req, DP_ERR_OK, 0, NULL); @@ -1073,7 +1073,7 @@ void sdap_account_info_handler(struct be_req *breq)
ctx = talloc_get_type(be_ctx->bet_info[BET_ID].pvt_bet_data, struct sdap_id_ctx); if (!ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get sdap ctx\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not get sdap ctx\n"); return sdap_handler_done(breq, DP_ERR_FATAL, EINVAL, "Invalid request data\n"); } @@ -1128,7 +1128,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx, /* skip enumerations on demand */ if (ar->filter_type == BE_FILTER_ENUM) { DEBUG(SSSDBG_TRACE_LIBS, - ("Skipping user enumeration on demand\n")); + "Skipping user enumeration on demand\n"); state->err = "Success"; ret = EOK; goto done; @@ -1147,7 +1147,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx, /* skip enumerations on demand */ if (ar->filter_type == BE_FILTER_ENUM) { DEBUG(SSSDBG_TRACE_LIBS, - ("Skipping group enumeration on demand\n")); + "Skipping group enumeration on demand\n"); state->err = "Success"; ret = EOK; goto done; @@ -1196,7 +1196,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx, /* skip enumerations on demand */ if (ar->filter_type == BE_FILTER_ENUM) { DEBUG(SSSDBG_TRACE_LIBS, - ("Skipping service enumeration on demand\n")); + "Skipping service enumeration on demand\n"); state->err = "Success"; ret = EOK; goto done; @@ -1391,7 +1391,7 @@ static void sdap_account_info_complete(struct tevent_req *req) error_text = NULL; } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Bug: dp_error is OK on failed request")); + "Bug: dp_error is OK on failed request"); dp_error = DP_ERR_FATAL; error_text = req_error_text; } @@ -1447,7 +1447,7 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx,
req = tevent_req_create(memctx, &state, struct get_user_and_group_state); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("tevent_req_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "tevent_req_create failed.\n"); return NULL; }
@@ -1460,7 +1460,7 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -1476,7 +1476,7 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx, state->filter_val, state->filter_type, state->attrs_type, state->noexist_delete); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("users_get_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "users_get_send failed.\n"); ret = ENOMEM; goto fail; } @@ -1522,7 +1522,7 @@ static void get_user_and_group_groups_done(struct tevent_req *subreq) state->filter_val, state->filter_type, state->attrs_type, state->noexist_delete); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("groups_get_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "groups_get_send failed.\n"); tevent_req_error(req, ENOMEM); return; } diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c index 06cdae0..004b53f 100644 --- a/src/providers/ldap/ldap_id_cleanup.c +++ b/src/providers/ldap/ldap_id_cleanup.c @@ -51,7 +51,7 @@ static void ldap_id_cleanup_timer(struct tevent_context *ev, errno_t ret;
if (be_is_offline(cctx->ctx->be)) { - DEBUG(SSSDBG_TRACE_FUNC, ("Backend is marked offline, retry later!\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Backend is marked offline, retry later!\n"); /* schedule starting from now, not the last run */ delay = dp_opt_get_int(cctx->ctx->opts->basic, SDAP_CACHE_PURGE_TIMEOUT); @@ -81,7 +81,7 @@ static errno_t ldap_id_cleanup_set_timer(struct ldap_id_cleanup_ctx *cctx, cleanup_task = tevent_add_timer(cctx->ctx->be->ev, cctx->ctx, tv, ldap_id_cleanup_timer, cctx); if (cleanup_task == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("FATAL: failed to setup cleanup task!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "FATAL: failed to setup cleanup task!\n"); return EFAULT; }
@@ -95,8 +95,8 @@ int ldap_id_cleanup_create_timer(struct sdap_id_ctx *ctx, struct ldap_id_cleanup_ctx *cctx;
DEBUG(SSSDBG_FUNC_DATA, - ("Scheduling next cleanup at %ld.%ld\n", - (long)tv.tv_sec, (long)tv.tv_usec)); + "Scheduling next cleanup at %ld.%ld\n", + (long)tv.tv_sec, (long)tv.tv_usec);
cctx = talloc(ctx, struct ldap_id_cleanup_ctx); if (cctx == NULL) { @@ -128,7 +128,7 @@ errno_t ldap_id_cleanup(struct sdap_options *opts,
ret = sysdb_transaction_start(sdom->dom->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -145,7 +145,7 @@ errno_t ldap_id_cleanup(struct sdap_options *opts,
ret = sysdb_transaction_commit(sdom->dom->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -156,7 +156,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(sdom->dom->sysdb); if (tret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -191,8 +191,8 @@ static int cleanup_users(struct sdap_options *opts, }
account_cache_expiration = dp_opt_get_int(opts->basic, SDAP_ACCOUNT_CACHE_EXPIRATION); - DEBUG(9, ("Cache expiration is set to %d days\n", - account_cache_expiration)); + DEBUG(9, "Cache expiration is set to %d days\n", + account_cache_expiration);
if (account_cache_expiration > 0) { subfilter = talloc_asprintf(tmpctx, @@ -212,7 +212,7 @@ static int cleanup_users(struct sdap_options *opts, SYSDB_LAST_LOGIN); } if (!subfilter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto done; } @@ -226,7 +226,7 @@ static int cleanup_users(struct sdap_options *opts, goto done; }
- DEBUG(SSSDBG_FUNC_DATA, ("Found %zu expired user entries!\n", count)); + DEBUG(SSSDBG_FUNC_DATA, "Found %zu expired user entries!\n", count);
if (count == 0) { ret = EOK; @@ -244,8 +244,8 @@ static int cleanup_users(struct sdap_options *opts, for (i = 0; i < count; i++) { name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (!name) { - DEBUG(2, ("Entry %s has no Name Attribute ?!?\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(2, "Entry %s has no Name Attribute ?!?\n", + ldb_dn_get_linearized(msgs[i]->dn)); ret = EFAULT; goto done; } @@ -254,8 +254,8 @@ static int cleanup_users(struct sdap_options *opts, ret = cleanup_users_logged_in(uid_table, msgs[i]); if (ret == EOK) { /* If the user is logged in, proceed to the next one */ - DEBUG(5, ("User %s is still logged in or a dummy entry, " - "keeping data\n", name)); + DEBUG(5, "User %s is still logged in or a dummy entry, " + "keeping data\n", name); continue; } else if (ret != ENOENT) { goto done; @@ -263,7 +263,7 @@ static int cleanup_users(struct sdap_options *opts, }
/* If not logged in or cannot check the table, delete him */ - DEBUG(9, ("About to delete user %s\n", name)); + DEBUG(9, "About to delete user %s\n", name); ret = sysdb_delete_user(sysdb, dom, name, 0); if (ret) { goto done; @@ -286,8 +286,8 @@ static int cleanup_users_logged_in(hash_table_t *table, uid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); if (!uid) { - DEBUG(SSSDBG_OP_FAILURE, ("Entry %s has no UID Attribute!\n", - ldb_dn_get_linearized(msg->dn))); + DEBUG(SSSDBG_OP_FAILURE, "Entry %s has no UID Attribute!\n", + ldb_dn_get_linearized(msg->dn)); return ENOENT; }
@@ -334,7 +334,7 @@ static int cleanup_groups(TALLOC_CTX *memctx, SYSDB_CACHE_EXPIRE, SYSDB_CACHE_EXPIRE, (long)now); if (!subfilter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto done; } @@ -348,7 +348,7 @@ static int cleanup_groups(TALLOC_CTX *memctx, goto done; }
- DEBUG(SSSDBG_FUNC_DATA, ("Found %zu expired group entries!\n", count)); + DEBUG(SSSDBG_FUNC_DATA, "Found %zu expired group entries!\n", count);
if (count == 0) { ret = EOK; @@ -377,14 +377,14 @@ static int cleanup_groups(TALLOC_CTX *memctx, subfilter = talloc_asprintf(tmpctx, "(%s=%s)", SYSDB_MEMBEROF, dn); } if (!subfilter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto done; }
base_dn = sysdb_base_dn(sysdb, tmpctx); if (base_dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to build base dn\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to build base dn\n"); ret = ENOMEM; goto done; } @@ -397,17 +397,17 @@ static int cleanup_groups(TALLOC_CTX *memctx,
name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (!name) { - DEBUG(2, ("Entry %s has no Name Attribute ?!?\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(2, "Entry %s has no Name Attribute ?!?\n", + ldb_dn_get_linearized(msgs[i]->dn)); ret = EFAULT; goto done; }
- DEBUG(8, ("About to delete group %s\n", name)); + DEBUG(8, "About to delete group %s\n", name); ret = sysdb_delete_group(sysdb, domain, name, 0); if (ret) { - DEBUG(2, ("Group delete returned %d (%s)\n", - ret, strerror(ret))); + DEBUG(2, "Group delete returned %d (%s)\n", + ret, strerror(ret)); goto done; } } diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c index 8cccaa9..c83cc2a 100644 --- a/src/providers/ldap/ldap_id_enum.c +++ b/src/providers/ldap/ldap_id_enum.c @@ -80,7 +80,7 @@ errno_t ldap_setup_enumeration(struct sdap_id_ctx *ctx, ectx, "enumeration", &sdom->enum_task); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Unable to initialize enumeration periodic task\n")); + "Unable to initialize enumeration periodic task\n"); talloc_free(ectx); return ret; } @@ -112,7 +112,7 @@ ldap_enumeration_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct ldap_enumeration_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -130,7 +130,7 @@ ldap_enumeration_send(TALLOC_CTX *mem_ctx, /* The ptask API will reschedule the enumeration on its own on * failure */ DEBUG(SSSDBG_OP_FAILURE, - ("Failed to schedule enumeration, retrying later!\n")); + "Failed to schedule enumeration, retrying later!\n"); ret = EIO; goto fail; } diff --git a/src/providers/ldap/ldap_id_netgroup.c b/src/providers/ldap/ldap_id_netgroup.c index e48a7da..1effaa5 100644 --- a/src/providers/ldap/ldap_id_netgroup.c +++ b/src/providers/ldap/ldap_id_netgroup.c @@ -82,7 +82,7 @@ struct tevent_req *ldap_netgroup_get_send(TALLOC_CTX *memctx,
state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -102,7 +102,7 @@ struct tevent_req *ldap_netgroup_get_send(TALLOC_CTX *memctx, clean_name, ctx->opts->netgroup_map[SDAP_OC_NETGROUP].name); if (!state->filter) { - DEBUG(2, ("Failed to build filter\n")); + DEBUG(2, "Failed to build filter\n"); ret = ENOMEM; goto fail; } @@ -208,8 +208,8 @@ static void ldap_netgroup_get_done(struct tevent_req *subreq) }
if (ret == EOK && state->count > 1) { - DEBUG(1, ("Found more than one netgroup with the name [%s].\n", - state->name)); + DEBUG(1, "Found more than one netgroup with the name [%s].\n", + state->name); tevent_req_error(req, EINVAL); return; } diff --git a/src/providers/ldap/ldap_id_services.c b/src/providers/ldap/ldap_id_services.c index 1f3fd80..793f3e3 100644 --- a/src/providers/ldap/ldap_id_services.c +++ b/src/providers/ldap/ldap_id_services.c @@ -94,7 +94,7 @@ services_get_send(TALLOC_CTX *mem_ctx,
state->op = sdap_id_op_create(state, state->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_MINOR_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto error; } @@ -136,13 +136,13 @@ services_get_send(TALLOC_CTX *mem_ctx, talloc_zfree(clean_protocol); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build the base filter\n")); + "Failed to build the base filter\n"); ret = ENOMEM; goto error; } DEBUG(SSSDBG_TRACE_LIBS, - ("Preparing to search for services with filter [%s]\n", - state->filter)); + "Preparing to search for services with filter [%s]\n", + state->filter);
ret = build_attrs_from_map(state, id_ctx->opts->service_map, SDAP_OPTS_SERVICES, NULL, diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c index 341338c..bef0ac1 100644 --- a/src/providers/ldap/ldap_init.c +++ b/src/providers/ldap/ldap_init.c @@ -75,7 +75,7 @@ errno_t check_order_list_for_duplicates(char **list, cmp = strcasecmp(list[c], list[d]); } if (cmp == 0) { - DEBUG(1, ("Duplicate string [%s] found.\n", list[c])); + DEBUG(1, "Duplicate string [%s] found.\n", list[c]); return EINVAL; } } @@ -100,7 +100,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx, /* If we're already set up, just return that */ if(bectx->bet_info[BET_ID].mod_name && strcmp("ldap", bectx->bet_info[BET_ID].mod_name) == 0) { - DEBUG(8, ("Re-using sdap_id_ctx for this provider\n")); + DEBUG(8, "Re-using sdap_id_ctx for this provider\n"); *ops = bectx->bet_info[BET_ID].bet_ops; *pvt_data = bectx->bet_info[BET_ID].pvt_bet_data; return EOK; @@ -115,7 +115,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx, dns_service_name = dp_opt_get_string(opts->basic, SDAP_DNS_SERVICE_NAME); DEBUG(SSSDBG_CONF_SETTINGS, - ("Service name for discovery set to %s\n", dns_service_name)); + "Service name for discovery set to %s\n", dns_service_name);
urls = dp_opt_get_string(opts->basic, SDAP_URI); backup_urls = dp_opt_get_string(opts->basic, SDAP_BACKUP_URI); @@ -124,7 +124,7 @@ int sssm_ldap_id_init(struct be_ctx *bectx, dns_service_name, urls, backup_urls, &sdap_service); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to initialize failover service!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to initialize failover service!\n"); goto done; }
@@ -142,8 +142,8 @@ int sssm_ldap_id_init(struct be_ctx *bectx, ctx->be, ctx->conn->service, &ctx->krb5_service); if (ret != EOK) { - DEBUG(1, ("sdap_gssapi_init failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "sdap_gssapi_init failed [%d][%s].\n", + ret, strerror(ret)); goto done; } } @@ -151,8 +151,8 @@ int sssm_ldap_id_init(struct be_ctx *bectx,
ret = setup_tls_config(ctx->opts->basic); if (ret != EOK) { - DEBUG(1, ("setup_tls_config failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "setup_tls_config failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
@@ -167,16 +167,16 @@ int sssm_ldap_id_init(struct be_ctx *bectx,
ret = sdap_setup_child(); if (ret != EOK) { - DEBUG(1, ("setup_child failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "setup_child failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
/* setup SRV lookup plugin */ ret = be_fo_set_dns_srv_lookup_plugin(bectx, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to set SRV lookup plugin " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to set SRV lookup plugin " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -186,8 +186,8 @@ int sssm_ldap_id_init(struct be_ctx *bectx, sdap_refresh_netgroups_recv, ctx); if (ret != EOK && ret != EEXIST) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Periodical refresh of netgroups " - "will not work [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Periodical refresh of netgroups " + "will not work [%d]: %s\n", ret, strerror(ret)); }
*ops = &sdap_id_ops; @@ -243,7 +243,7 @@ int sssm_ldap_chpass_init(struct be_ctx *bectx,
ret = sssm_ldap_auth_init(bectx, ops, &data); if (ret != EOK) { - DEBUG(1, ("sssm_ldap_auth_init failed.\n")); + DEBUG(1, "sssm_ldap_auth_init failed.\n"); goto done; }
@@ -252,21 +252,21 @@ int sssm_ldap_chpass_init(struct be_ctx *bectx, dns_service_name = dp_opt_get_string(ctx->opts->basic, SDAP_CHPASS_DNS_SERVICE_NAME); if (dns_service_name) { - DEBUG(7, ("Service name for chpass discovery set to %s\n", - dns_service_name)); + DEBUG(7, "Service name for chpass discovery set to %s\n", + dns_service_name); }
urls = dp_opt_get_string(ctx->opts->basic, SDAP_CHPASS_URI); backup_urls = dp_opt_get_string(ctx->opts->basic, SDAP_CHPASS_BACKUP_URI); if (!urls && !backup_urls && !dns_service_name) { - DEBUG(9, ("ldap_chpass_uri and ldap_chpass_dns_service_name not set, " - "using ldap_uri.\n")); + DEBUG(9, "ldap_chpass_uri and ldap_chpass_dns_service_name not set, " + "using ldap_uri.\n"); ctx->chpass_service = NULL; } else { ret = sdap_service_init(ctx, ctx->be, "LDAP_CHPASS", dns_service_name, urls, backup_urls, &ctx->chpass_service); if (ret != EOK) { - DEBUG(1, ("Failed to initialize failover service!\n")); + DEBUG(1, "Failed to initialize failover service!\n"); goto done; } } @@ -304,34 +304,34 @@ int sssm_ldap_access_init(struct be_ctx *bectx,
ret = sssm_ldap_id_init(bectx, ops, (void **)&access_ctx->id_ctx); if (ret != EOK) { - DEBUG(1, ("sssm_ldap_id_init failed.\n")); + DEBUG(1, "sssm_ldap_id_init failed.\n"); goto done; }
order = dp_opt_get_cstring(access_ctx->id_ctx->opts->basic, SDAP_ACCESS_ORDER); if (order == NULL) { - DEBUG(1, ("ldap_access_order not given, using 'filter'.\n")); + DEBUG(1, "ldap_access_order not given, using 'filter'.\n"); order = "filter"; }
ret = split_on_separator(access_ctx, order, ',', true, true, &order_list, &order_list_len); if (ret != EOK) { - DEBUG(1, ("split_on_separator failed.\n")); + DEBUG(1, "split_on_separator failed.\n"); goto done; }
ret = check_order_list_for_duplicates(order_list, false); if (ret != EOK) { - DEBUG(1, ("check_order_list_for_duplicates failed.\n")); + DEBUG(1, "check_order_list_for_duplicates failed.\n"); goto done; }
if (order_list_len > LDAP_ACCESS_LAST) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Currently only [%d] different access rules are supported.\n", - LDAP_ACCESS_LAST)); + "Currently only [%d] different access rules are supported.\n", + LDAP_ACCESS_LAST); ret = EINVAL; goto done; } @@ -346,9 +346,9 @@ int sssm_ldap_access_init(struct be_ctx *bectx, /* It's okay if this is NULL. In that case we will simply act * like the 'deny' provider. */ - DEBUG(0, ("Warning: LDAP access rule 'filter' is set, " + DEBUG(0, "Warning: LDAP access rule 'filter' is set, " "but no ldap_access_filter configured. " - "All domain users will be denied access.\n")); + "All domain users will be denied access.\n"); } else { if (filter[0] == '(') { @@ -373,9 +373,9 @@ int sssm_ldap_access_init(struct be_ctx *bectx, dummy = dp_opt_get_cstring(access_ctx->id_ctx->opts->basic, SDAP_ACCOUNT_EXPIRE_POLICY); if (dummy == NULL) { - DEBUG(0, ("Warning: LDAP access rule 'expire' is set, " + DEBUG(0, "Warning: LDAP access rule 'expire' is set, " "but no ldap_account_expire_policy configured. " - "All domain users will be denied access.\n")); + "All domain users will be denied access.\n"); } else { if (strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_SHADOW) != 0 && strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_AD) != 0 && @@ -383,8 +383,8 @@ int sssm_ldap_access_init(struct be_ctx *bectx, strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_RHDS) != 0 && strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_IPA) != 0 && strcasecmp(dummy, LDAP_ACCOUNT_EXPIRE_389DS) != 0) { - DEBUG(1, ("Unsupported LDAP account expire policy [%s].\n", - dummy)); + DEBUG(1, "Unsupported LDAP account expire policy [%s].\n", + dummy); ret = EINVAL; goto done; } @@ -394,16 +394,16 @@ int sssm_ldap_access_init(struct be_ctx *bectx, } else if (strcasecmp(order_list[c], LDAP_ACCESS_HOST_NAME) == 0) { access_ctx->access_rule[c] = LDAP_ACCESS_HOST; } else { - DEBUG(1, ("Unexpected access rule name [%s].\n", order_list[c])); + DEBUG(1, "Unexpected access rule name [%s].\n", order_list[c]); ret = EINVAL; goto done; } } access_ctx->access_rule[c] = LDAP_ACCESS_EMPTY; if (c == 0) { - DEBUG(0, ("Warning: access_provider=ldap set, " + DEBUG(0, "Warning: access_provider=ldap set, " "but ldap_access_order is empty. " - "All domain users will be denied access.\n")); + "All domain users will be denied access.\n"); }
*ops = &sdap_access_ops; @@ -429,21 +429,21 @@ int sssm_ldap_sudo_init(struct be_ctx *be_ctx,
ret = sssm_ldap_id_init(be_ctx, ops, &data); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot init LDAP ID provider [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot init LDAP ID provider [%d]: %s\n", + ret, strerror(ret)); return ret; }
id_ctx = talloc_get_type(data, struct sdap_id_ctx); if (!id_ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No ID provider?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No ID provider?\n"); return EIO; }
return sdap_sudo_init(be_ctx, id_ctx, ops, pvt_data); #else - DEBUG(SSSDBG_MINOR_FAILURE, ("Sudo init handler called but SSSD is " - "built without sudo support, ignoring\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Sudo init handler called but SSSD is " + "built without sudo support, ignoring\n"); return EOK; #endif } @@ -459,21 +459,21 @@ int sssm_ldap_autofs_init(struct be_ctx *be_ctx,
ret = sssm_ldap_id_init(be_ctx, ops, &data); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot init LDAP ID provider [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot init LDAP ID provider [%d]: %s\n", + ret, strerror(ret)); return ret; }
id_ctx = talloc_get_type(data, struct sdap_id_ctx); if (!id_ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No ID provider?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No ID provider?\n"); return EIO; }
return sdap_autofs_init(be_ctx, id_ctx, ops, pvt_data); #else - DEBUG(SSSDBG_MINOR_FAILURE, ("Autofs init handler called but SSSD is " - "built without autofs support, ignoring\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Autofs init handler called but SSSD is " + "built without autofs support, ignoring\n"); return EOK; #endif } diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index 078326a..b74b573 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -59,9 +59,9 @@ int sdap_copy_map(TALLOC_CTX *memctx, map[i].name = NULL; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", map[i].opt_name, map[i].name ? "" : " no", - map[i].name ? map[i].name : "")); + map[i].name ? map[i].name : ""); }
*_map = map; @@ -96,7 +96,7 @@ int sdap_get_map(TALLOC_CTX *memctx, &name); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for %s\n", map[i].opt_name)); + "Failed to retrieve value for %s\n", map[i].opt_name); talloc_zfree(map); return EINVAL; } @@ -105,7 +105,7 @@ int sdap_get_map(TALLOC_CTX *memctx, ret = sss_filter_sanitize(map, name, &map[i].name); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not sanitize attribute [%s]\n", name)); + "Could not sanitize attribute [%s]\n", name); talloc_zfree(map); return EINVAL; } @@ -116,14 +116,14 @@ int sdap_get_map(TALLOC_CTX *memctx,
if (map[i].def_name && !map[i].name) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for %s\n", map[i].opt_name)); + "Failed to retrieve value for %s\n", map[i].opt_name); talloc_zfree(map); return EINVAL; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", map[i].opt_name, map[i].name ? "" : " no", - map[i].name ? map[i].name : "")); + map[i].name ? map[i].name : ""); }
*_map = map; @@ -157,8 +157,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx, lerrno = 0; ret = ldap_set_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed [%s], ignored.\n", - sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed [%s], ignored.\n", + sss_ldap_err2string(ret)); }
attrs = sysdb_new_attrs(tmp_ctx); @@ -170,13 +170,13 @@ int sdap_parse_entry(TALLOC_CTX *memctx, str = ldap_get_dn(sh->ldap, sm->msg); if (!str) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); - DEBUG(1, ("ldap_get_dn failed: %d(%s)\n", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "ldap_get_dn failed: %d(%s)\n", + lerrno, sss_ldap_err2string(lerrno)); ret = EIO; goto done; }
- DEBUG(9, ("OriginalDN: [%s].\n", str)); + DEBUG(9, "OriginalDN: [%s].\n", str); ret = sysdb_attrs_add_string(attrs, SYSDB_ORIG_DN, str); if (ret) goto done; if (_dn) { @@ -192,7 +192,7 @@ int sdap_parse_entry(TALLOC_CTX *memctx, if (map) { vals = ldap_get_values_len(sh->ldap, sm->msg, "objectClass"); if (!vals) { - DEBUG(1, ("Unknown entry type, no objectClasses found!\n")); + DEBUG(1, "Unknown entry type, no objectClasses found!\n"); ret = EINVAL; goto done; } @@ -206,8 +206,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx, } } if (!vals[i]) { - DEBUG(1, ("objectClass not matching: %s\n", - map[0].name)); + DEBUG(1, "objectClass not matching: %s\n", + map[0].name); ldap_value_free_len(vals); ret = EINVAL; goto done; @@ -221,8 +221,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx, DEBUG(lerrno == LDAP_SUCCESS ? SSSDBG_TRACE_INTERNAL : SSSDBG_MINOR_FAILURE, - ("Entry has no attributes [%d(%s)]!?\n", - lerrno, sss_ldap_err2string(lerrno))); + "Entry has no attributes [%d(%s)]!?\n", + lerrno, sss_ldap_err2string(lerrno)); if (map) { ret = EINVAL; goto done; @@ -248,7 +248,7 @@ int sdap_parse_entry(TALLOC_CTX *memctx, break; default: DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine if attribute [%s] was ranged\n", str)); + "Could not determine if attribute [%s] was ranged\n", str); goto done; }
@@ -285,25 +285,25 @@ int sdap_parse_entry(TALLOC_CTX *memctx, if (!vals) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (lerrno != LDAP_SUCCESS) { - DEBUG(1, ("LDAP Library error: %d(%s)", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "LDAP Library error: %d(%s)", + lerrno, sss_ldap_err2string(lerrno)); ret = EIO; goto done; }
- DEBUG(5, ("Attribute [%s] has no values, skipping.\n", str)); + DEBUG(5, "Attribute [%s] has no values, skipping.\n", str);
} else { if (!vals[0]) { - DEBUG(1, ("Missing value after ldap_get_values() ??\n")); + DEBUG(1, "Missing value after ldap_get_values() ??\n"); ret = EINVAL; goto done; } for (i = 0; vals[i]; i++) { if (vals[i]->bv_len == 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Value of attribute [%s] is empty. " - "Skipping this value.\n", str)); + "Value of attribute [%s] is empty. " + "Skipping this value.\n", str); continue; } if (base64) { @@ -334,8 +334,8 @@ int sdap_parse_entry(TALLOC_CTX *memctx,
ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (lerrno) { - DEBUG(1, ("LDAP Library error: %d(%s)", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "LDAP Library error: %d(%s)", + lerrno, sss_ldap_err2string(lerrno)); ret = EIO; goto done; } @@ -390,19 +390,19 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, }
if (!dref->derefVal.bv_val) { - DEBUG(2, ("Entry has no DN?\n")); + DEBUG(2, "Entry has no DN?\n"); ret = EINVAL; goto done; }
orig_dn = dref->derefVal.bv_val; DEBUG(SSSDBG_TRACE_LIBS, - ("Dereferenced DN: %s\n", orig_dn)); + "Dereferenced DN: %s\n", orig_dn);
if (!dref->attrVals) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Dereferenced entry [%s] has no attributes\n", - orig_dn)); + "Dereferenced entry [%s] has no attributes\n", + orig_dn); ret = EINVAL; goto done; } @@ -411,7 +411,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, for (dval = dref->attrVals; dval != NULL; dval = dval->next) { if (strcasecmp("objectClass", dval->type) == 0) { if (dval->vals == NULL) { - DEBUG(4, ("No value for objectClass, skipping\n")); + DEBUG(4, "No value for objectClass, skipping\n"); continue; }
@@ -424,8 +424,8 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, }
for (i=0; i<len; i++) { - DEBUG(9, ("Dereferenced objectClass value: %s\n", - dval->vals[i].bv_val)); + DEBUG(9, "Dereferenced objectClass value: %s\n", + dval->vals[i].bv_val); ocs[i] = talloc_strdup(ocs, dval->vals[i].bv_val); if (!ocs[i]) { ret = ENOMEM; @@ -437,7 +437,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, } } if (!ocs) { - DEBUG(1, ("Unknown entry type, no objectClasses found!\n")); + DEBUG(1, "Unknown entry type, no objectClasses found!\n"); ret = EINVAL; goto done; } @@ -448,7 +448,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, for (i=0; ocs[i]; i++) { /* the objectclass is always the first name in the map */ if (strcasecmp(minfo[mi].map[0].name, ocs[i]) == 0) { - DEBUG(9, ("Found map for objectclass '%s'\n", ocs[i])); + DEBUG(9, "Found map for objectclass '%s'\n", ocs[i]); map = minfo[mi].map; num_attrs = minfo[mi].num_attrs; break; @@ -469,7 +469,7 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, }
for (dval = dref->attrVals; dval != NULL; dval = dval->next) { - DEBUG(8, ("Dereferenced attribute: %s\n", dval->type)); + DEBUG(8, "Dereferenced attribute: %s\n", dval->type);
for (a = 1; a < num_attrs; a++) { /* check if this attr is valid with the chosen schema */ @@ -486,13 +486,13 @@ errno_t sdap_parse_deref(TALLOC_CTX *mem_ctx, }
if (dval->vals == NULL) { - DEBUG(4, ("No value for attribute %s, skipping\n", name)); + DEBUG(4, "No value for attribute %s, skipping\n", name); continue; }
for (i=0; dval->vals[i].bv_val; i++) { - DEBUG(9, ("Dereferenced attribute value: %s\n", - dval->vals[i].bv_val)); + DEBUG(9, "Dereferenced attribute value: %s\n", + dval->vals[i].bv_val); ret = sysdb_attrs_add_mem(res[mi]->attrs, name, dval->vals[i].bv_val, dval->vals[i].bv_len); @@ -521,15 +521,15 @@ int sdap_get_msg_dn(TALLOC_CTX *memctx, struct sdap_handle *sh, lerrno = 0; ret = ldap_set_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed [%s], ignored.\n", - sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed [%s], ignored.\n", + sss_ldap_err2string(ret)); }
str = ldap_get_dn(sh->ldap, sm->msg); if (!str) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &lerrno); - DEBUG(1, ("ldap_get_dn failed: %d(%s)\n", - lerrno, sss_ldap_err2string(lerrno))); + DEBUG(1, "ldap_get_dn failed: %d(%s)\n", + lerrno, sss_ldap_err2string(lerrno)); return EIO; }
@@ -563,7 +563,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) ldap_opt_x_tls_require_cert = LDAP_OPT_X_TLS_HARD; } else { - DEBUG(1, ("Unknown value for tls_reqcert.\n")); + DEBUG(1, "Unknown value for tls_reqcert.\n"); return EINVAL; } /* LDAP_OPT_X_TLS_REQUIRE_CERT has to be set as a global option, @@ -571,7 +571,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &ldap_opt_x_tls_require_cert); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -580,7 +580,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTFILE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -589,7 +589,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTDIR, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -598,7 +598,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CERTFILE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -607,7 +607,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_KEYFILE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -616,7 +616,7 @@ errno_t setup_tls_config(struct dp_option *basic_opts) if (tls_opt) { ret = ldap_set_option(NULL, LDAP_OPT_X_TLS_CIPHER_SUITE, tls_opt); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_set_option failed: %s\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_set_option failed: %s\n", sss_ldap_err2string(ret)); return EIO; } } @@ -710,15 +710,15 @@ static char *get_single_value_as_string(TALLOC_CTX *mem_ctx, char *str = NULL;
if (el->num_values == 0) { - DEBUG(3, ("Missing value.\n")); + DEBUG(3, "Missing value.\n"); } else if (el->num_values == 1) { str = talloc_strndup(mem_ctx, (char *) el->values[0].data, el->values[0].length); if (str == NULL) { - DEBUG(1, ("talloc_strndup failed.\n")); + DEBUG(1, "talloc_strndup failed.\n"); } } else { - DEBUG(3, ("More than one value found.\n")); + DEBUG(3, "More than one value found.\n"); }
return str; @@ -743,19 +743,19 @@ static char *get_naming_context(TALLOC_CTX *mem_ctx, }
if (dnc == NULL && nc == NULL) { - DEBUG(3, ("No attributes [%s] or [%s] found in rootDSE.\n", + DEBUG(3, "No attributes [%s] or [%s] found in rootDSE.\n", SDAP_ROOTDSE_ATTR_NAMING_CONTEXTS, - SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT)); + SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT); } else { if (dnc != NULL) { - DEBUG(5, ("Using value from [%s] as naming context.\n", - SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT)); + DEBUG(5, "Using value from [%s] as naming context.\n", + SDAP_ROOTDSE_ATTR_DEFAULT_NAMING_CONTEXT); naming_context = get_single_value_as_string(mem_ctx, dnc); }
if (naming_context == NULL && nc != NULL) { - DEBUG(5, ("Using value from [%s] as naming context.\n", - SDAP_ROOTDSE_ATTR_NAMING_CONTEXTS)); + DEBUG(5, "Using value from [%s] as naming context.\n", + SDAP_ROOTDSE_ATTR_NAMING_CONTEXTS); naming_context = get_single_value_as_string(mem_ctx, nc); } } @@ -806,12 +806,12 @@ static errno_t sdap_set_search_base(struct sdap_options *opts, }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Setting option [%s] to [%s].\n", - opts->basic[class].opt_name, naming_context)); + "Setting option [%s] to [%s].\n", + opts->basic[class].opt_name, naming_context);
ret = dp_opt_set_string(opts->basic, class, naming_context); if (ret != EOK) { - DEBUG(1, ("dp_opt_set_string failed.\n")); + DEBUG(1, "dp_opt_set_string failed.\n"); goto done; }
@@ -838,7 +838,7 @@ errno_t sdap_set_config_options_with_rootdse(struct sysdb_attrs *rootdse, || !sdom->autofs_search_bases) { naming_context = get_naming_context(opts->basic, rootdse); if (naming_context == NULL) { - DEBUG(1, ("get_naming_context failed.\n")); + DEBUG(1, "get_naming_context failed.\n");
/* This has to be non-fatal, since some servers offer * multiple namingContexts entries. We will just @@ -952,29 +952,29 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, if (ret != EOK) { switch (ret) { case ENOENT: - DEBUG(1, ("%s configured but not found in rootdse!\n", - opts->gen_map[SDAP_AT_LAST_USN].opt_name)); + DEBUG(1, "%s configured but not found in rootdse!\n", + opts->gen_map[SDAP_AT_LAST_USN].opt_name); break; case ERANGE: - DEBUG(1, ("Multiple values of %s found in rootdse!\n", - opts->gen_map[SDAP_AT_LAST_USN].opt_name)); + DEBUG(1, "Multiple values of %s found in rootdse!\n", + opts->gen_map[SDAP_AT_LAST_USN].opt_name); break; default: - DEBUG(1, ("Unkown error (%d) checking rootdse!\n", ret)); + DEBUG(1, "Unkown error (%d) checking rootdse!\n", ret); } } else { if (!entry_usn_name) { - DEBUG(1, ("%s found in rootdse but %s is not set!\n", + DEBUG(1, "%s found in rootdse but %s is not set!\n", last_usn_name, - opts->gen_map[SDAP_AT_ENTRY_USN].opt_name)); + opts->gen_map[SDAP_AT_ENTRY_USN].opt_name); } else { so->supports_usn = true; so->last_usn = strtoul(last_usn_value, &endptr, 10); if (endptr != NULL && (*endptr != '\0' || endptr == last_usn_value)) { - DEBUG(3, ("USN is not valid (value: %s)\n", last_usn_value)); + DEBUG(3, "USN is not valid (value: %s)\n", last_usn_value); so->last_usn = 0; } else { - DEBUG(9, ("USN value: %s (int: %lu)\n", last_usn_value, so->last_usn)); + DEBUG(9, "USN value: %s (int: %lu)\n", last_usn_value, so->last_usn); } } } @@ -993,10 +993,10 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, so->supports_usn = true; so->last_usn = strtoul(last_usn_value, &endptr, 10); if (endptr != NULL && (*endptr != '\0' || endptr == last_usn_value)) { - DEBUG(3, ("USN is not valid (value: %s)\n", last_usn_value)); + DEBUG(3, "USN is not valid (value: %s)\n", last_usn_value); so->last_usn = 0; } else { - DEBUG(9, ("USN value: %s (int: %lu)\n", last_usn_value, so->last_usn)); + DEBUG(9, "USN value: %s (int: %lu)\n", last_usn_value, so->last_usn); } last_usn_name = usn_attrs[i].last_name; break; @@ -1018,26 +1018,26 @@ int sdap_get_server_opts_from_rootdse(TALLOC_CTX *memctx, case DS_BEHAVIOR_WIN2012: opts->dc_functional_level = dc_level; DEBUG(SSSDBG_CONF_SETTINGS, - ("Setting AD compatibility level to [%d]\n", - opts->dc_functional_level)); + "Setting AD compatibility level to [%d]\n", + opts->dc_functional_level); break; default: DEBUG(SSSDBG_MINOR_FAILURE, - ("Received invalid value for AD compatibility level. " - "Continuing without AD performance enhancements\n")); + "Received invalid value for AD compatibility level. " + "Continuing without AD performance enhancements\n"); } } else if (ret != ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error detecting Active Directory compatibility level " + "Error detecting Active Directory compatibility level " "(%s). Continuing without AD performance enhancements\n", - strerror(ret))); + strerror(ret)); } }
if (!last_usn_name) { - DEBUG(5, ("No known USN scheme is supported by this server!\n")); + DEBUG(5, "No known USN scheme is supported by this server!\n"); if (!entry_usn_name) { - DEBUG(5, ("Will use modification timestamp as usn!\n")); + DEBUG(5, "Will use modification timestamp as usn!\n"); opts->gen_map[SDAP_AT_ENTRY_USN].name = talloc_strdup(opts->gen_map, "modifyTimestamp"); } @@ -1168,11 +1168,11 @@ int sdap_control_create(struct sdap_handle *sh, const char *oid, int iscritical, if (sdap_is_control_supported(sh, oid)) { ret = sss_ldap_control_create(oid, iscritical, value, dupval, ctrlp); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("sss_ldap_control_create failed [%d][%s].\n", - ret, sss_ldap_err2string(ret))); + DEBUG(1, "sss_ldap_control_create failed [%d][%s].\n", + ret, sss_ldap_err2string(ret)); } } else { - DEBUG(3, ("Server does not support the requested control [%s].\n", oid)); + DEBUG(3, "Server does not support the requested control [%s].\n", oid); ret = LDAP_NOT_SUPPORTED; }
@@ -1189,13 +1189,13 @@ int sdap_replace_id(struct sysdb_attrs *entry, const char *attr, id_t val) if (ret == ENOENT) { return sysdb_attrs_add_uint32(entry, attr, val); } else if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get attribute [%s]\n", attr)); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get attribute [%s]\n", attr); return ret; }
if (el->num_values != 1) { DEBUG(SSSDBG_OP_FAILURE, - ("Expected 1 value for %s, got %d\n", attr, el->num_values)); + "Expected 1 value for %s, got %d\n", attr, el->num_values); return EINVAL; }
@@ -1223,17 +1223,17 @@ sdap_get_primary_name(TALLOC_CTX *memctx,
ret = sysdb_attrs_primary_name(dom->sysdb, attrs, attr_name, &orig_name); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The object has no name attribute\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The object has no name attribute\n"); return EINVAL; }
name = sss_get_domain_name(memctx, orig_name, dom); if (name == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to format original name [%s]\n", orig_name)); + "Failed to format original name [%s]\n", orig_name); return ENOMEM; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing object %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing object %s\n", name);
*_primary_name = name; return EOK; diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c index 9d1315f..9a9bc69 100644 --- a/src/providers/ldap/sdap_access.c +++ b/src/providers/ldap/sdap_access.c @@ -89,7 +89,7 @@ sdap_access_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct sdap_access_req_ctx); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; }
@@ -100,10 +100,10 @@ sdap_access_send(TALLOC_CTX *mem_ctx, state->access_ctx = access_ctx; state->current_rule = 0;
- DEBUG(6, ("Performing access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing access check for user [%s]\n", pd->user);
if (access_ctx->access_rule[0] == LDAP_ACCESS_EMPTY) { - DEBUG(3, ("No access rules defined, access denied.\n")); + DEBUG(3, "No access rules defined, access denied.\n"); ret = ERR_ACCESS_DENIED; goto done; } @@ -112,7 +112,7 @@ sdap_access_send(TALLOC_CTX *mem_ctx, if (strcasecmp(pd->domain, be_ctx->domain->name) != 0) { user_dom = find_subdomain_by_name(be_ctx->domain, pd->domain, true); if (user_dom == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("find_subdomain_by_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_subdomain_by_name failed.\n"); ret = ENOMEM; goto done; } @@ -138,7 +138,7 @@ sdap_access_send(TALLOC_CTX *mem_ctx, }
if (res->count != 1) { - DEBUG(1, ("Invalid response from sysdb_get_user_attr\n")); + DEBUG(1, "Invalid response from sysdb_get_user_attr\n"); ret = EINVAL; goto done; } @@ -180,7 +180,7 @@ static errno_t check_next_rule(struct sdap_access_req_ctx *state, state->pd->user, state->user_entry); if (subreq == NULL) { - DEBUG(1, ("sdap_access_filter_send failed.\n")); + DEBUG(1, "sdap_access_filter_send failed.\n"); return ENOMEM; }
@@ -201,7 +201,7 @@ static errno_t check_next_rule(struct sdap_access_req_ctx *state, break;
default: - DEBUG(1, ("Unexpected access rule type. Access denied.\n")); + DEBUG(1, "Unexpected access rule type. Access denied.\n"); ret = ERR_ACCESS_DENIED; }
@@ -221,7 +221,7 @@ static void sdap_access_filter_done(struct tevent_req *subreq) ret = sdap_access_filter_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("Error retrieving access check result.\n")); + DEBUG(1, "Error retrieving access check result.\n"); tevent_req_error(req, ret); return; } @@ -259,17 +259,17 @@ static errno_t sdap_account_expired_shadow(struct pam_data *pd, long sp_expire; long today;
- DEBUG(6, ("Performing access shadow check for user [%s]\n", pd->user)); + DEBUG(6, "Performing access shadow check for user [%s]\n", pd->user);
val = ldb_msg_find_attr_as_string(user_entry, SYSDB_SHADOWPW_EXPIRE, NULL); if (val == NULL) { - DEBUG(3, ("Shadow expire attribute not found. " - "Access will be granted.\n")); + DEBUG(3, "Shadow expire attribute not found. " + "Access will be granted.\n"); return EOK; } ret = string_to_shadowpw_days(val, &sp_expire); if (ret != EOK) { - DEBUG(1, ("Failed to retrieve shadow expire date.\n")); + DEBUG(1, "Failed to retrieve shadow expire date.\n"); return ret; }
@@ -280,7 +280,7 @@ static errno_t sdap_account_expired_shadow(struct pam_data *pd, sizeof(SHADOW_EXPIRE_MSG), (const uint8_t *) SHADOW_EXPIRE_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCOUNT_EXPIRED; @@ -308,7 +308,7 @@ static bool ad_account_expired(uint64_t expiration_time) now = time(NULL); if (now == ((time_t) -1)) { err = errno; - DEBUG(1, ("time failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "time failed [%d][%s].\n", err, strerror(err)); return true; }
@@ -329,18 +329,18 @@ static errno_t sdap_account_expired_ad(struct pam_data *pd, uint64_t expiration_time; int ret;
- DEBUG(6, ("Performing AD access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing AD access check for user [%s]\n", pd->user);
uac = ldb_msg_find_attr_as_uint(user_entry, SYSDB_AD_USER_ACCOUNT_CONTROL, 0); - DEBUG(9, ("User account control for user [%s] is [%X].\n", - pd->user, uac)); + DEBUG(9, "User account control for user [%s] is [%X].\n", + pd->user, uac);
expiration_time = ldb_msg_find_attr_as_uint64(user_entry, SYSDB_AD_ACCOUNT_EXPIRES, 0); DEBUG(SSSDBG_TRACE_ALL, - ("Expiration time for user [%s] is [%"PRIu64"].\n", - pd->user, expiration_time)); + "Expiration time for user [%s] is [%"PRIu64"].\n", + pd->user, expiration_time);
if (uac & UAC_ACCOUNTDISABLE) {
@@ -348,7 +348,7 @@ static errno_t sdap_account_expired_ad(struct pam_data *pd, sizeof(AD_DISABLE_MESSAGE), (const uint8_t *) AD_DISABLE_MESSAGE); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCESS_DENIED; @@ -359,7 +359,7 @@ static errno_t sdap_account_expired_ad(struct pam_data *pd, sizeof(AD_EXPIRED_MESSAGE), (const uint8_t *) AD_EXPIRED_MESSAGE); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCOUNT_EXPIRED; @@ -376,18 +376,18 @@ static errno_t sdap_account_expired_rhds(struct pam_data *pd, bool locked; int ret;
- DEBUG(6, ("Performing RHDS access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing RHDS access check for user [%s]\n", pd->user);
locked = ldb_msg_find_attr_as_bool(user_entry, SYSDB_NS_ACCOUNT_LOCK, false); - DEBUG(9, ("Account for user [%s] is%s locked.\n", pd->user, - locked ? "" : " not" )); + DEBUG(9, "Account for user [%s] is%s locked.\n", pd->user, + locked ? "" : " not" );
if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(RHDS_LOCK_MSG), (const uint8_t *) RHDS_LOCK_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCESS_DENIED; @@ -408,7 +408,7 @@ static bool nds_check_expired(const char *exp_time_str) time_t now;
if (exp_time_str == NULL) { - DEBUG(9, ("ndsLoginExpirationTime is not set, access granted.\n")); + DEBUG(9, "ndsLoginExpirationTime is not set, access granted.\n"); return false; }
@@ -416,18 +416,18 @@ static bool nds_check_expired(const char *exp_time_str)
end = strptime(exp_time_str, "%Y%m%d%H%M%SZ", &tm); if (end == NULL) { - DEBUG(1, ("NDS expire date [%s] invalid.\n", exp_time_str)); + DEBUG(1, "NDS expire date [%s] invalid.\n", exp_time_str); return true; } if (*end != '\0') { - DEBUG(1, ("NDS expire date [%s] contains extra characters.\n", - exp_time_str)); + DEBUG(1, "NDS expire date [%s] contains extra characters.\n", + exp_time_str); return true; }
expire_time = mktime(&tm); if (expire_time == -1) { - DEBUG(1, ("mktime failed to convert [%s].\n", exp_time_str)); + DEBUG(1, "mktime failed to convert [%s].\n", exp_time_str); return true; }
@@ -435,12 +435,12 @@ static bool nds_check_expired(const char *exp_time_str) expire_time -= timezone; now = time(NULL); DEBUG(SSSDBG_TRACE_ALL, - ("Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " + "Time info: tzname[0] [%s] tzname[1] [%s] timezone [%ld] " "daylight [%d] now [%ld] expire_time [%ld].\n", tzname[0], - tzname[1], timezone, daylight, now, expire_time)); + tzname[1], timezone, daylight, now, expire_time);
if (difftime(now, expire_time) > 0.0) { - DEBUG(4, ("NDS account expired.\n")); + DEBUG(4, "NDS account expired.\n"); return true; }
@@ -460,14 +460,14 @@ static bool nds_check_time_map(const struct ldb_val *time_map) uint8_t mask = 0;
if (time_map == NULL) { - DEBUG(9, ("loginAllowedTimeMap is missing, access granted.\n")); + DEBUG(9, "loginAllowedTimeMap is missing, access granted.\n"); return false; }
if (time_map->length != 42) { DEBUG(SSSDBG_FUNC_DATA, - ("Allowed time map has the wrong size, " - "got [%zu], expected 42.\n", time_map->length)); + "Allowed time map has the wrong size, " + "got [%zu], expected 42.\n", time_map->length); return true; }
@@ -479,7 +479,7 @@ static bool nds_check_time_map(const struct ldb_val *time_map)
if (map_index > 335) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected index value [%zu] for time map.\n", map_index)); + "Unexpected index value [%zu] for time map.\n", map_index); return true; }
@@ -487,8 +487,8 @@ static bool nds_check_time_map(const struct ldb_val *time_map)
if (q.quot > 41 || q.quot < 0 || q.rem > 7 || q.rem < 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected result of div(), [%zu][%d][%d].\n", - map_index, q.quot, q.rem)); + "Unexpected result of div(), [%zu][%d][%d].\n", + map_index, q.quot, q.rem); return true; }
@@ -497,7 +497,7 @@ static bool nds_check_time_map(const struct ldb_val *time_map) }
if (time_map->data[q.quot] & mask) { - DEBUG(4, ("Access allowed by time map.\n")); + DEBUG(4, "Access allowed by time map.\n"); return false; }
@@ -512,19 +512,19 @@ static errno_t sdap_account_expired_nds(struct pam_data *pd, const char *exp_time_str; const struct ldb_val *time_map;
- DEBUG(6, ("Performing NDS access check for user [%s]\n", pd->user)); + DEBUG(6, "Performing NDS access check for user [%s]\n", pd->user);
locked = ldb_msg_find_attr_as_bool(user_entry, SYSDB_NDS_LOGIN_DISABLED, false); - DEBUG(9, ("Account for user [%s] is%s disabled.\n", pd->user, - locked ? "" : " not")); + DEBUG(9, "Account for user [%s] is%s disabled.\n", pd->user, + locked ? "" : " not");
if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(NDS_DISABLE_MSG), (const uint8_t *) NDS_DISABLE_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCESS_DENIED; @@ -535,15 +535,15 @@ static errno_t sdap_account_expired_nds(struct pam_data *pd, NULL); locked = nds_check_expired(exp_time_str);
- DEBUG(9, ("Account for user [%s] is%s expired.\n", pd->user, - locked ? "" : " not")); + DEBUG(9, "Account for user [%s] is%s expired.\n", pd->user, + locked ? "" : " not");
if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(NDS_EXPIRED_MSG), (const uint8_t *) NDS_EXPIRED_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCESS_DENIED; @@ -554,15 +554,15 @@ static errno_t sdap_account_expired_nds(struct pam_data *pd,
locked = nds_check_time_map(time_map);
- DEBUG(9, ("Account for user [%s] is%s locked at this time.\n", - pd->user, locked ? "" : " not")); + DEBUG(9, "Account for user [%s] is%s locked at this time.\n", + pd->user, locked ? "" : " not");
if (locked) { ret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(NDS_TIME_MAP_MSG), (const uint8_t *) NDS_TIME_MAP_MSG); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCESS_DENIED; @@ -584,34 +584,34 @@ static errno_t sdap_account_expired(struct sdap_access_ctx *access_ctx, expire = dp_opt_get_cstring(access_ctx->id_ctx->opts->basic, SDAP_ACCOUNT_EXPIRE_POLICY); if (expire == NULL) { - DEBUG(1, ("Missing account expire policy. Access denied\n")); + DEBUG(1, "Missing account expire policy. Access denied\n"); return ERR_ACCESS_DENIED; } else { if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_SHADOW) == 0) { ret = sdap_account_expired_shadow(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_shadow failed.\n")); + DEBUG(1, "sdap_account_expired_shadow failed.\n"); } } else if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_AD) == 0) { ret = sdap_account_expired_ad(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_ad failed.\n")); + DEBUG(1, "sdap_account_expired_ad failed.\n"); } } else if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_RHDS) == 0 || strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_IPA) == 0 || strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_389DS) == 0) { ret = sdap_account_expired_rhds(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_rhds failed.\n")); + DEBUG(1, "sdap_account_expired_rhds failed.\n"); } } else if (strcasecmp(expire, LDAP_ACCOUNT_EXPIRE_NDS) == 0) { ret = sdap_account_expired_nds(pd, user_entry); if (ret != EOK) { - DEBUG(1, ("sdap_account_expired_nds failed.\n")); + DEBUG(1, "sdap_account_expired_nds failed.\n"); } } else { - DEBUG(1, ("Unsupported LDAP account expire policy [%s]. " - "Access denied.\n", expire)); + DEBUG(1, "Unsupported LDAP account expire policy [%s]. " + "Access denied.\n", expire); ret = ERR_ACCESS_DENIED; } } @@ -657,7 +657,7 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx,
if (access_ctx->filter == NULL || *access_ctx->filter == '\0') { /* If no filter is set, default to restrictive */ - DEBUG(6, ("No filter set. Access is denied.\n")); + DEBUG(6, "No filter set. Access is denied.\n"); ret = ERR_ACCESS_DENIED; goto done; } @@ -669,7 +669,7 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, state->access_ctx = access_ctx; state->domain = domain;
- DEBUG(6, ("Performing access filter check for user [%s]\n", username)); + DEBUG(6, "Performing access filter check for user [%s]\n", username);
state->cached_access = ldb_msg_find_attr_as_bool(user_entry, SYSDB_LDAP_ACCESS_FILTER, @@ -684,15 +684,15 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, /* Perform online operation */ basedn = ldb_msg_find_attr_as_string(user_entry, SYSDB_ORIG_DN, NULL); if (basedn == NULL) { - DEBUG(1,("Could not find originalDN for user [%s]\n", - state->username)); + DEBUG(1,"Could not find originalDN for user [%s]\n", + state->username); ret = EINVAL; goto done; }
state->basedn = talloc_strdup(state, basedn); if (state->basedn == NULL) { - DEBUG(1, ("Could not allocate memory for originalDN\n")); + DEBUG(1, "Could not allocate memory for originalDN\n"); ret = ENOMEM; goto done; } @@ -712,18 +712,18 @@ static struct tevent_req *sdap_access_filter_send(TALLOC_CTX *mem_ctx, state->sdap_ctx->opts->user_map[SDAP_OC_USER].name, state->access_ctx->filter); if (state->filter == NULL) { - DEBUG(0, ("Could not construct access filter\n")); + DEBUG(0, "Could not construct access filter\n"); ret = ENOMEM; goto done; } talloc_zfree(clean_username);
- DEBUG(6, ("Checking filter against LDAP\n")); + DEBUG(6, "Checking filter against LDAP\n");
state->sdap_op = sdap_id_op_create(state, state->sdap_ctx->conn->conn_cache); if (!state->sdap_op) { - DEBUG(2, ("sdap_id_op_create failed\n")); + DEBUG(2, "sdap_id_op_create failed\n"); ret = ENOMEM; goto done; } @@ -751,10 +751,10 @@ static errno_t sdap_access_filter_decide_offline(struct tevent_req *req) tevent_req_data(req, struct sdap_access_filter_req_ctx);
if (state->cached_access) { - DEBUG(6, ("Access granted by cached credentials\n")); + DEBUG(6, "Access granted by cached credentials\n"); return EOK; } else { - DEBUG(6, ("Access denied by cached credentials\n")); + DEBUG(6, "Access denied by cached credentials\n"); return ERR_ACCESS_DENIED; } } @@ -768,7 +768,7 @@ static int sdap_access_filter_retry(struct tevent_req *req)
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (!subreq) { - DEBUG(2, ("sdap_id_op_connect_send failed: %d (%s)\n", ret, strerror(ret))); + DEBUG(2, "sdap_id_op_connect_send failed: %d (%s)\n", ret, strerror(ret)); return ret; }
@@ -815,7 +815,7 @@ static void sdap_access_filter_connect_done(struct tevent_req *subreq) SDAP_SEARCH_TIMEOUT), false); if (subreq == NULL) { - DEBUG(1, ("Could not start LDAP communication\n")); + DEBUG(1, "Could not start LDAP communication\n"); tevent_req_error(req, EIO); return; } @@ -850,8 +850,8 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) } else if (dp_error == DP_ERR_OFFLINE) { ret = sdap_access_filter_decide_offline(req); } else { - DEBUG(1, ("sdap_get_generic_send() returned error [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "sdap_get_generic_send() returned error [%d][%s]\n", + ret, strerror(ret)); }
goto done; @@ -863,12 +863,12 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) * Anything else is an error */ if (num_results < 1) { - DEBUG(4, ("User [%s] was not found with the specified filter. " - "Denying access.\n", state->username)); + DEBUG(4, "User [%s] was not found with the specified filter. " + "Denying access.\n", state->username); found = false; } else if (results == NULL) { - DEBUG(1, ("num_results > 0, but results is NULL\n")); + DEBUG(1, "num_results > 0, but results is NULL\n"); ret = ERR_INTERNAL; goto done; } @@ -876,7 +876,7 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* It should not be possible to get more than one reply * here, since we're doing a base-scoped search */ - DEBUG(1, ("Received multiple replies\n")); + DEBUG(1, "Received multiple replies\n"); ret = ERR_INTERNAL; goto done; } @@ -888,21 +888,21 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* Save "allow" to the cache for future offline :q* access checks. */ - DEBUG(6, ("Access granted by online lookup\n")); + DEBUG(6, "Access granted by online lookup\n"); ret = EOK; } else { /* Save "disallow" to the cache for future offline * access checks. */ - DEBUG(6, ("Access denied by online lookup\n")); + DEBUG(6, "Access denied by online lookup\n"); ret = ERR_ACCESS_DENIED; }
attrs = sysdb_new_attrs(state); if (attrs == NULL) { ret = ENOMEM; - DEBUG(1, ("Could not set up attrs\n")); + DEBUG(1, "Could not set up attrs\n"); goto done; }
@@ -912,7 +912,7 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* Failing to save to the cache is non-fatal. * Just return the result. */ - DEBUG(1, ("Could not set up attrs\n")); + DEBUG(1, "Could not set up attrs\n"); goto done; }
@@ -922,7 +922,7 @@ static void sdap_access_filter_get_access_done(struct tevent_req *subreq) /* Failing to save to the cache is non-fatal. * Just return the result. */ - DEBUG(1, ("Failed to set user access attribute\n")); + DEBUG(1, "Failed to set user access attribute\n"); goto done; }
@@ -959,13 +959,13 @@ static errno_t sdap_access_service(struct pam_data *pd,
el = ldb_msg_find_element(user_entry, SYSDB_AUTHORIZED_SERVICE); if (!el || el->num_values == 0) { - DEBUG(1, ("Missing authorized services. Access denied\n")); + DEBUG(1, "Missing authorized services. Access denied\n");
tret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(AUTHR_SRV_MISSING_MSG), (const uint8_t *) AUTHR_SRV_MISSING_MSG); if (tret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
return ERR_ACCESS_DENIED; @@ -978,13 +978,13 @@ static errno_t sdap_access_service(struct pam_data *pd, if (service[0] == '!' && strcasecmp(pd->service, service+1) == 0) { /* This service is explicitly denied */ - DEBUG(4, ("Access denied by [%s]\n", service)); + DEBUG(4, "Access denied by [%s]\n", service);
tret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(AUTHR_SRV_DENY_MSG), (const uint8_t *) AUTHR_SRV_DENY_MSG); if (tret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
/* A denial trumps all. Break here */ @@ -992,14 +992,14 @@ static errno_t sdap_access_service(struct pam_data *pd,
} else if (strcasecmp(pd->service, service) == 0) { /* This service is explicitly allowed */ - DEBUG(4, ("Access granted for [%s]\n", service)); + DEBUG(4, "Access granted for [%s]\n", service); /* We still need to loop through to make sure * that it's not also explicitly denied */ ret = EOK; } else if (strcmp("*", service) == 0) { /* This user has access to all services */ - DEBUG(4, ("Access granted to all services\n")); + DEBUG(4, "Access granted to all services\n"); /* We still need to loop through to make sure * that it's not also explicitly denied */ @@ -1008,13 +1008,13 @@ static errno_t sdap_access_service(struct pam_data *pd, }
if (ret == ENOENT) { - DEBUG(4, ("No matching service rule found\n")); + DEBUG(4, "No matching service rule found\n");
tret = pam_add_response(pd, SSS_PAM_SYSTEM_INFO, sizeof(AUTHR_SRV_NO_MATCH_MSG), (const uint8_t *) AUTHR_SRV_NO_MATCH_MSG); if (tret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); }
ret = ERR_ACCESS_DENIED; @@ -1033,12 +1033,12 @@ static errno_t sdap_access_host(struct ldb_message *user_entry)
el = ldb_msg_find_element(user_entry, SYSDB_AUTHORIZED_HOST); if (!el || el->num_values == 0) { - DEBUG(1, ("Missing hosts. Access denied\n")); + DEBUG(1, "Missing hosts. Access denied\n"); return ERR_ACCESS_DENIED; }
if (gethostname(hostname, sizeof(hostname)) == -1) { - DEBUG(1, ("Unable to get system hostname. Access denied\n")); + DEBUG(1, "Unable to get system hostname. Access denied\n"); return ERR_ACCESS_DENIED; }
@@ -1055,20 +1055,20 @@ static errno_t sdap_access_host(struct ldb_message *user_entry) if (host[0] == '!' && strcasecmp(hostname, host+1) == 0) { /* This host is explicitly denied */ - DEBUG(4, ("Access denied by [%s]\n", host)); + DEBUG(4, "Access denied by [%s]\n", host); /* A denial trumps all. Break here */ return ERR_ACCESS_DENIED;
} else if (strcasecmp(hostname, host) == 0) { /* This host is explicitly allowed */ - DEBUG(4, ("Access granted for [%s]\n", host)); + DEBUG(4, "Access granted for [%s]\n", host); /* We still need to loop through to make sure * that it's not also explicitly denied */ ret = EOK; } else if (strcmp("*", host) == 0) { /* This user has access to all hosts */ - DEBUG(4, ("Access granted to all hosts\n")); + DEBUG(4, "Access granted to all hosts\n"); /* We still need to loop through to make sure * that it's not also explicitly denied */ @@ -1077,7 +1077,7 @@ static errno_t sdap_access_host(struct ldb_message *user_entry) }
if (ret == ENOENT) { - DEBUG(4, ("No matching host rule found\n")); + DEBUG(4, "No matching host rule found\n"); ret = ERR_ACCESS_DENIED; }
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c index 09275dd..8c0dfe3 100644 --- a/src/providers/ldap/sdap_async.c +++ b/src/providers/ldap/sdap_async.c @@ -32,7 +32,7 @@ void make_realm_upper_case(const char *upn)
c = strchr(upn, REALM_SEPARATOR); if (c == NULL) { - DEBUG(9, ("No realm delimiter found in upn [%s].\n", upn)); + DEBUG(9, "No realm delimiter found in upn [%s].\n", upn); return; }
@@ -99,10 +99,10 @@ static void sdap_handle_release(struct sdap_handle *sh) { struct sdap_op *op;
- DEBUG(8, ("Trace: sh[%p], connected[%d], ops[%p], ldap[%p], " + DEBUG(8, "Trace: sh[%p], connected[%d], ops[%p], ldap[%p], " "destructor_lock[%d], release_memory[%d]\n", sh, (int)sh->connected, sh->ops, sh->ldap, - (int)sh->destructor_lock, (int)sh->release_memory)); + (int)sh->destructor_lock, (int)sh->release_memory);
if (sh->destructor_lock) return; sh->destructor_lock = true; @@ -167,11 +167,11 @@ static void sdap_process_result(struct tevent_context *ev, void *pvt) LDAPMessage *msg; int ret;
- DEBUG(8, ("Trace: sh[%p], connected[%d], ops[%p], ldap[%p]\n", - sh, (int)sh->connected, sh->ops, sh->ldap)); + DEBUG(8, "Trace: sh[%p], connected[%d], ops[%p], ldap[%p]\n", + sh, (int)sh->connected, sh->ops, sh->ldap);
if (!sh->connected || !sh->ldap) { - DEBUG(2, ("ERROR: LDAP connection is not connected!\n")); + DEBUG(2, "ERROR: LDAP connection is not connected!\n"); sdap_handle_release(sh); return; } @@ -180,14 +180,14 @@ static void sdap_process_result(struct tevent_context *ev, void *pvt) if (ret == 0) { /* this almost always means we have reached the end of * the list of received messages */ - DEBUG(8, ("Trace: ldap_result found nothing!\n")); + DEBUG(8, "Trace: ldap_result found nothing!\n"); return; }
if (ret == -1) { ldap_get_option(sh->ldap, LDAP_OPT_RESULT_CODE, &ret); DEBUG(SSSDBG_OP_FAILURE, - ("ldap_result error: [%s]\n", ldap_err2string(ret))); + "ldap_result error: [%s]\n", ldap_err2string(ret)); sdap_handle_release(sh); return; } @@ -202,7 +202,7 @@ static void sdap_process_result(struct tevent_context *ev, void *pvt)
te = tevent_add_timer(ev, sh, no_timeout, sdap_ldap_next_result, sh); if (!te) { - DEBUG(1, ("Failed to add critical timer to fetch next result!\n")); + DEBUG(1, "Failed to add critical timer to fetch next result!\n"); }
/* now process this message */ @@ -280,7 +280,7 @@ static void sdap_process_message(struct tevent_context *ev,
msgid = ldap_msgid(msg); if (msgid == -1) { - DEBUG(2, ("can't fire callback, message id invalid!\n")); + DEBUG(2, "can't fire callback, message id invalid!\n"); ldap_msgfree(msg); return; } @@ -292,20 +292,20 @@ static void sdap_process_message(struct tevent_context *ev, }
if (op == NULL) { - DEBUG(2, ("Unmatched msgid, discarding message (type: %0x)\n", - msgtype)); + DEBUG(2, "Unmatched msgid, discarding message (type: %0x)\n", + msgtype); ldap_msgfree(msg); return; }
/* shouldn't happen */ if (op->done) { - DEBUG(2, ("Operation [%p] already handled (type: %0x)\n", op, msgtype)); + DEBUG(2, "Operation [%p] already handled (type: %0x)\n", op, msgtype); ldap_msgfree(msg); return; }
- DEBUG(9, ("Message type: [%s]\n", sdap_ldap_result_str(msgtype))); + DEBUG(9, "Message type: [%s]\n", sdap_ldap_result_str(msgtype));
switch (msgtype) { case LDAP_RES_SEARCH_ENTRY: @@ -333,7 +333,7 @@ static void sdap_process_message(struct tevent_context *ev,
default: /* unkwon msg type ?? */ - DEBUG(1, ("Couldn't figure out the msg type! [%0x]\n", msgtype)); + DEBUG(1, "Couldn't figure out the msg type! [%0x]\n", msgtype); ldap_msgfree(msg); return; } @@ -394,7 +394,7 @@ static void sdap_unlock_next_reply(struct sdap_op *op) te = tevent_add_timer(op->ev, op, tv, sdap_process_next_reply, op); if (!te) { - DEBUG(1, ("Failed to add critical timer for next reply!\n")); + DEBUG(1, "Failed to add critical timer for next reply!\n"); op->callback(op, NULL, EFAULT, op->data); } } @@ -434,7 +434,7 @@ static void sdap_op_timeout(struct tevent_req *req)
/* should never happen, but just in case */ if (op->done) { - DEBUG(2, ("Timeout happened after op was finished !?\n")); + DEBUG(2, "Timeout happened after op was finished !?\n"); return; }
@@ -522,7 +522,7 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx,
ber = ber_alloc_t( LBER_USE_DER ); if (ber == NULL) { - DEBUG(7, ("ber_alloc_t failed.\n")); + DEBUG(7, "ber_alloc_t failed.\n"); talloc_zfree(req); return NULL; } @@ -532,7 +532,7 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx, LDAP_TAG_EXOP_MODIFY_PASSWD_OLD, password, LDAP_TAG_EXOP_MODIFY_PASSWD_NEW, new_password); if (ret == -1) { - DEBUG(1, ("ber_printf failed.\n")); + DEBUG(1, "ber_printf failed.\n"); ber_free(ber, 1); talloc_zfree(req); return NULL; @@ -541,7 +541,7 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx, ret = ber_flatten(ber, &bv); ber_free(ber, 1); if (ret == -1) { - DEBUG(1, ("ber_flatten failed.\n")); + DEBUG(1, "ber_flatten failed.\n"); talloc_zfree(req); return NULL; } @@ -549,31 +549,31 @@ struct tevent_req *sdap_exop_modify_passwd_send(TALLOC_CTX *memctx, ret = sdap_control_create(state->sh, LDAP_CONTROL_PASSWORDPOLICYREQUEST, 0, NULL, 0, &ctrls[0]); if (ret != LDAP_SUCCESS && ret != LDAP_NOT_SUPPORTED) { - DEBUG(1, ("sdap_control_create failed to create " - "Password Policy control.\n")); + DEBUG(1, "sdap_control_create failed to create " + "Password Policy control.\n"); ret = ERR_INTERNAL; goto fail; } request_controls = ctrls;
- DEBUG(4, ("Executing extended operation\n")); + DEBUG(4, "Executing extended operation\n");
ret = ldap_extended_operation(state->sh->ldap, LDAP_EXOP_MODIFY_PASSWD, bv, request_controls, NULL, &msgid); ber_bvfree(bv); if (ctrls[0]) ldap_control_free(ctrls[0]); if (ret == -1 || msgid == -1) { - DEBUG(1, ("ldap_extended_operation failed\n")); + DEBUG(1, "ldap_extended_operation failed\n"); ret = ERR_NETWORK_IO; goto fail; } - DEBUG(8, ("ldap_extended_operation sent, msgid = %d\n", msgid)); + DEBUG(8, "ldap_extended_operation sent, msgid = %d\n", msgid);
/* FIXME: get timeouts from configuration, for now 5 secs. */ ret = sdap_op_add(state, ev, state->sh, msgid, sdap_exop_modify_passwd_done, req, 5, &state->op); if (ret) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); ret = ERR_INTERNAL; goto fail; } @@ -611,17 +611,17 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, &result, NULL, &errmsg, NULL, &response_controls, 0); if (ret != LDAP_SUCCESS) { - DEBUG(2, ("ldap_parse_result failed (%d)\n", state->op->msgid)); + DEBUG(2, "ldap_parse_result failed (%d)\n", state->op->msgid); ret = ERR_INTERNAL; goto done; }
if (response_controls == NULL) { - DEBUG(5, ("Server returned no controls.\n")); + DEBUG(5, "Server returned no controls.\n"); } else { for (c = 0; response_controls[c] != NULL; c++) { - DEBUG(9, ("Server returned control [%s].\n", - response_controls[c]->ldctl_oid)); + DEBUG(9, "Server returned control [%s].\n", + response_controls[c]->ldctl_oid); if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) == 0) { ret = ldap_parse_passwordpolicy_control(state->sh->ldap, @@ -629,20 +629,20 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, &pp_expire, &pp_grace, &pp_error); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("ldap_parse_passwordpolicy_control failed.\n")); + DEBUG(1, "ldap_parse_passwordpolicy_control failed.\n"); ret = ERR_NETWORK_IO; goto done; }
- DEBUG(7, ("Password Policy Response: expire [%d] grace [%d] " + DEBUG(7, "Password Policy Response: expire [%d] grace [%d] " "error [%s].\n", pp_expire, pp_grace, - ldap_passwordpolicy_err2txt(pp_error))); + ldap_passwordpolicy_err2txt(pp_error)); } } }
- DEBUG(3, ("ldap_extended_operation result: %s(%d), %s\n", - sss_ldap_err2string(result), result, errmsg)); + DEBUG(3, "ldap_extended_operation result: %s(%d), %s\n", + sss_ldap_err2string(result), result, errmsg);
switch (result) { case LDAP_SUCCESS: @@ -652,7 +652,7 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, state->user_error_message = talloc_strdup(state, "Please make sure the password meets the complexity constraints."); if (state->user_error_message == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed\n"); ret = ENOMEM; goto done; } @@ -663,7 +663,7 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op, if (errmsg) { state->user_error_message = talloc_strdup(state, errmsg); if (state->user_error_message == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -762,14 +762,14 @@ sdap_modify_shadow_lastchange_send(TALLOC_CTX *mem_ctx, ret = ldap_modify_ext(state->sh->ldap, state->dn, state->mods, NULL, NULL, &msgid); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to send operation!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to send operation!\n"); goto done; }
ret = sdap_op_add(state, state->ev, state->sh, msgid, sdap_modify_shadow_lastchange_done, req, 5, &state->op); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set up operation!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set up operation!\n"); goto done; }
@@ -802,15 +802,15 @@ static void sdap_modify_shadow_lastchange_done(struct sdap_op *op, &result, NULL, &errmsg, NULL, NULL, 0); if (lret != LDAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("ldap_parse_result failed (%d)\n", - state->op->msgid)); + DEBUG(SSSDBG_OP_FAILURE, "ldap_parse_result failed (%d)\n", + state->op->msgid); ret = EIO; goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Updating lastPwdChange result: %s(%d), %s\n", + DEBUG(SSSDBG_TRACE_LIBS, "Updating lastPwdChange result: %s(%d), %s\n", sss_ldap_err2string(result), - result, errmsg)); + result, errmsg);
done: ldap_memfree(errmsg); @@ -865,7 +865,7 @@ struct tevent_req *sdap_get_rootdse_send(TALLOC_CTX *memctx, NULL };
- DEBUG(9, ("Getting rootdse\n")); + DEBUG(9, "Getting rootdse\n");
req = tevent_req_create(memctx, &state, struct sdap_get_rootdse_state); if (!req) return NULL; @@ -915,15 +915,15 @@ static void sdap_get_rootdse_done(struct tevent_req *subreq) }
if (num_results == 0 || !results) { - DEBUG(2, ("RootDSE could not be retrieved. " + DEBUG(2, "RootDSE could not be retrieved. " "Please check that anonymous access to RootDSE is allowed\n" - )); + ); tevent_req_error(req, ENOENT); return; }
if (num_results > 1) { - DEBUG(2, ("Multiple replies when searching for RootDSE ??\n")); + DEBUG(2, "Multiple replies when searching for RootDSE ??\n"); tevent_req_error(req, EIO); return; } @@ -931,7 +931,7 @@ static void sdap_get_rootdse_done(struct tevent_req *subreq) state->rootdse = talloc_steal(state, results[0]); talloc_zfree(results);
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Got rootdse\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Got rootdse\n");
/* Auto-detect the ldap matching rule if requested */ if ((!dp_opt_get_bool(state->opts->basic, @@ -943,13 +943,13 @@ static void sdap_get_rootdse_done(struct tevent_req *subreq) * lookup. */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("Skipping auto-detection of match rule\n")); + "Skipping auto-detection of match rule\n"); tevent_req_done(req); return; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Auto-detecting support for match rule\n")); + "Auto-detecting support for match rule\n");
/* Create a filter using the matching rule. It need not point * at any valid data. We're only going to be looking for the @@ -996,16 +996,16 @@ static void sdap_get_matching_rule_done(struct tevent_req *subreq) state->opts->support_matching_rule = false; } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("Unexpected error while testing for matching rule support\n")); + "Unexpected error while testing for matching rule support\n"); tevent_req_error(req, ret); return; }
DEBUG(SSSDBG_CONF_SETTINGS, - ("LDAP server %s the matching rule extension\n", + "LDAP server %s the matching rule extension\n", state->opts->support_matching_rule ? "supports" - : "does not support")); + : "does not support");
tevent_req_done(req); } @@ -1041,7 +1041,7 @@ static errno_t add_to_reply(TALLOC_CTX *mem_ctx, struct sysdb_attrs *, sreply->reply_max); if (sreply->reply == NULL) { - DEBUG(1, ("talloc_realloc failed.\n")); + DEBUG(1, "talloc_realloc failed.\n"); return ENOMEM; } } @@ -1074,7 +1074,7 @@ static errno_t add_to_deref_reply(TALLOC_CTX *mem_ctx, struct sdap_deref_attrs *, dreply->reply_max); if (dreply->reply == NULL) { - DEBUG(1, ("talloc_realloc failed.\n")); + DEBUG(1, "talloc_realloc failed.\n"); return ENOMEM; } } @@ -1244,15 +1244,15 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req) talloc_zfree(state->op);
DEBUG(SSSDBG_TRACE_FUNC, - ("calling ldap_search_ext with [%s][%s].\n", + "calling ldap_search_ext with [%s][%s].\n", state->filter ? state->filter : "no filter", - state->search_base)); + state->search_base); if (DEBUG_IS_SET(SSSDBG_TRACE_LIBS)) { int i;
if (state->attrs) { for (i = 0; state->attrs[i]; i++) { - DEBUG(7, ("Requesting attrs: [%s]\n", state->attrs[i])); + DEBUG(7, "Requesting attrs: [%s]\n", state->attrs[i]); } } } @@ -1286,13 +1286,13 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req) ldap_control_free(page_control); state->serverctrls[state->nserverctrls] = NULL; if (lret != LDAP_SUCCESS) { - DEBUG(3, ("ldap_search_ext failed: %s\n", sss_ldap_err2string(lret))); + DEBUG(3, "ldap_search_ext failed: %s\n", sss_ldap_err2string(lret)); if (lret == LDAP_SERVER_DOWN) { ret = ETIMEDOUT; optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &errmsg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("Connection error: %s\n", errmsg)); + DEBUG(3, "Connection error: %s\n", errmsg); sss_log(SSS_LOG_ERR, "LDAP connection error: %s", errmsg); } else { @@ -1306,14 +1306,14 @@ static errno_t sdap_get_generic_ext_step(struct tevent_req *req) } goto done; } - DEBUG(8, ("ldap_search_ext called, msgid = %d\n", msgid)); + DEBUG(8, "ldap_search_ext called, msgid = %d\n", msgid);
ret = sdap_op_add(state, state->ev, state->sh, msgid, sdap_get_generic_ext_done, req, state->timeout, &state->op); if (ret != EOK) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); goto done; }
@@ -1354,7 +1354,7 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, case LDAP_RES_SEARCH_ENTRY: ret = state->parse_cb(state->sh, reply, state->cb_data); if (ret != EOK) { - DEBUG(1, ("reply parsing callback failed.\n")); + DEBUG(1, "reply parsing callback failed.\n"); tevent_req_error(req, ret); return; } @@ -1367,19 +1367,19 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, &result, NULL, &errmsg, NULL, &returned_controls, 0); if (ret != LDAP_SUCCESS) { - DEBUG(2, ("ldap_parse_result failed (%d)\n", state->op->msgid)); + DEBUG(2, "ldap_parse_result failed (%d)\n", state->op->msgid); tevent_req_error(req, EIO); return; }
- DEBUG(6, ("Search result: %s(%d), %s\n", + DEBUG(6, "Search result: %s(%d), %s\n", sss_ldap_err2string(result), result, - errmsg ? errmsg : "no errmsg set")); + errmsg ? errmsg : "no errmsg set");
if (result == LDAP_SIZELIMIT_EXCEEDED) { /* Try to return what we've got */ DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP sizelimit was exceeded, returning incomplete data\n")); + "LDAP sizelimit was exceeded, returning incomplete data\n"); } else if (result == LDAP_INAPPROPRIATE_MATCHING) { /* This error should only occur when we're testing for * specialized functionality like the ldap matching rule @@ -1387,8 +1387,8 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, * level and return EIO. */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("LDAP_INAPPROPRIATE_MATCHING: %s\n", - errmsg ? errmsg : "no errmsg set")); + "LDAP_INAPPROPRIATE_MATCHING: %s\n", + errmsg ? errmsg : "no errmsg set"); ldap_memfree(errmsg); tevent_req_error(req, EIO); return; @@ -1398,9 +1398,9 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, return; } else if (result != LDAP_SUCCESS && result != LDAP_NO_SUCH_OBJECT) { DEBUG(SSSDBG_OP_FAILURE, - ("Unexpected result from ldap: %s(%d), %s\n", + "Unexpected result from ldap: %s(%d), %s\n", sss_ldap_err2string(result), result, - errmsg ? errmsg : "no errmsg set")); + errmsg ? errmsg : "no errmsg set"); ldap_memfree(errmsg); tevent_req_error(req, EIO); return; @@ -1420,11 +1420,11 @@ static void sdap_get_generic_ext_done(struct sdap_op *op, &total_count, &cookie); ldap_controls_free(returned_controls); if (lret != LDAP_SUCCESS) { - DEBUG(1, ("Could not determine page control")); + DEBUG(1, "Could not determine page control"); tevent_req_error(req, EIO); return; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Total count [%d]\n", total_count)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Total count [%d]\n", total_count);
if (cookie.bv_val != NULL && cookie.bv_len > 0) { /* Cookie contains data, which means there are more requests @@ -1538,14 +1538,14 @@ static errno_t sdap_get_generic_parse_entry(struct sdap_handle *sh, state->map, state->map_num_attrs, &attrs, NULL, disable_range_rtrvl); if (ret != EOK) { - DEBUG(3, ("sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(3, "sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret)); return ret; }
ret = add_to_reply(state, &state->sreply, attrs); if (ret != EOK) { talloc_free(attrs); - DEBUG(1, ("add_to_reply failed.\n")); + DEBUG(1, "add_to_reply failed.\n"); return ret; }
@@ -1562,8 +1562,8 @@ static void sdap_get_generic_done(struct tevent_req *subreq) ret = sdap_get_generic_ext_recv(subreq); talloc_zfree(subreq); if (ret) { - DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(4, "sdap_get_generic_ext_recv failed [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -1639,12 +1639,12 @@ sdap_x_deref_search_send(TALLOC_CTX *memctx, struct tevent_context *ev, ret = sdap_x_deref_create_control(sh, deref_attr, attrs, &state->ctrls[0]); if (ret != EOK) { - DEBUG(1, ("Could not create OpenLDAP deref control\n")); + DEBUG(1, "Could not create OpenLDAP deref control\n"); talloc_zfree(req); return NULL; }
- DEBUG(6, ("Dereferencing entry [%s] using OpenLDAP deref\n", base_dn)); + DEBUG(6, "Dereferencing entry [%s] using OpenLDAP deref\n", base_dn); subreq = sdap_get_generic_ext_send(state, ev, opts, sh, base_dn, LDAP_SCOPE_BASE, NULL, attrs, false, state->ctrls, NULL, 0, timeout, @@ -1675,8 +1675,8 @@ static int sdap_x_deref_create_control(struct sdap_handle *sh,
ret = ldap_create_deref_control_value(sh->ldap, ds, &derefval); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("sss_ldap_control_create failed: %s\n", - ldap_err2string(ret))); + DEBUG(1, "sss_ldap_control_create failed: %s\n", + ldap_err2string(ret)); return ret; }
@@ -1684,7 +1684,7 @@ static int sdap_x_deref_create_control(struct sdap_handle *sh, 1, &derefval, 1, ctrl); ldap_memfree(derefval.bv_val); if (ret != EOK) { - DEBUG(1, ("sss_ldap_control_create failed\n")); + DEBUG(1, "sss_ldap_control_create failed\n"); return ret; }
@@ -1712,12 +1712,12 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh, ret = ldap_get_entry_controls(state->sh->ldap, msg->msg, &ctrls); if (ret != LDAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("ldap_parse_result failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldap_parse_result failed\n"); goto done; }
if (!ctrls) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No controls found for entry\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No controls found for entry\n"); ret = ENOENT; goto done; } @@ -1726,20 +1726,20 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh,
derefctrl = ldap_control_find(LDAP_CONTROL_X_DEREF, ctrls, NULL); if (!derefctrl) { - DEBUG(SSSDBG_FUNC_DATA, ("No deref controls found\n")); + DEBUG(SSSDBG_FUNC_DATA, "No deref controls found\n"); ret = EOK; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Got deref control\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Got deref control\n");
ret = ldap_parse_derefresponse_control(state->sh->ldap, derefctrl, &deref_res); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_OP_FAILURE, - ("ldap_parse_derefresponse_control failed: %s\n", - ldap_err2string(ret))); + "ldap_parse_derefresponse_control failed: %s\n", + ldap_err2string(ret)); goto done; }
@@ -1747,21 +1747,21 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh, ret = sdap_parse_deref(tmp_ctx, state->maps, state->num_maps, dref, &res); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_parse_deref failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_parse_deref failed [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = add_to_deref_reply(state, state->num_maps, &state->dreply, res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("add_to_deref_reply failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "add_to_deref_reply failed.\n"); goto done; } }
DEBUG(SSSDBG_TRACE_FUNC, - ("All deref results from a single control parsed\n")); + "All deref results from a single control parsed\n"); ldap_derefresponse_free(deref_res); deref_res = NULL;
@@ -1782,8 +1782,8 @@ static void sdap_x_deref_search_done(struct tevent_req *subreq) ret = sdap_get_generic_ext_recv(subreq); talloc_zfree(subreq); if (ret) { - DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(4, "sdap_get_generic_ext_recv failed [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -1867,11 +1867,11 @@ sdap_asq_search_send(TALLOC_CTX *memctx, struct tevent_context *ev, ret = sdap_asq_search_create_control(sh, deref_attr, &state->ctrls[0]); if (ret != EOK) { talloc_zfree(req); - DEBUG(1, ("Could not create ASQ control\n")); + DEBUG(1, "Could not create ASQ control\n"); return NULL; }
- DEBUG(6, ("Dereferencing entry [%s] using ASQ\n", base_dn)); + DEBUG(6, "Dereferencing entry [%s] using ASQ\n", base_dn); subreq = sdap_get_generic_ext_send(state, ev, opts, sh, base_dn, LDAP_SCOPE_BASE, NULL, attrs, false, state->ctrls, NULL, 0, timeout, @@ -1897,13 +1897,13 @@ static int sdap_asq_search_create_control(struct sdap_handle *sh,
ber = ber_alloc_t(LBER_USE_DER); if (ber == NULL) { - DEBUG(2, ("ber_alloc_t failed.\n")); + DEBUG(2, "ber_alloc_t failed.\n"); return ENOMEM; }
ret = ber_printf(ber, "{s}", attr); if (ret == -1) { - DEBUG(2, ("ber_printf failed.\n")); + DEBUG(2, "ber_printf failed.\n"); ber_free(ber, 1); return EIO; } @@ -1911,14 +1911,14 @@ static int sdap_asq_search_create_control(struct sdap_handle *sh, ret = ber_flatten(ber, &asqval); ber_free(ber, 1); if (ret == -1) { - DEBUG(1, ("ber_flatten failed.\n")); + DEBUG(1, "ber_flatten failed.\n"); return EIO; }
ret = sdap_control_create(sh, LDAP_SERVER_ASQ_OID, 1, asqval, 1, ctrl); ber_bvfree(asqval); if (ret != EOK) { - DEBUG(1, ("sdap_control_create failed\n")); + DEBUG(1, "sdap_control_create failed\n"); return ret; }
@@ -1980,7 +1980,7 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, vals = ldap_get_values_len(sh->ldap, msg->msg, "objectClass"); if (!vals) { DEBUG(SSSDBG_OP_FAILURE, - ("Unknown entry type, no objectClass found for DN [%s]!\n", dn)); + "Unknown entry type, no objectClass found for DN [%s]!\n", dn); ret = EINVAL; goto done; } @@ -1992,8 +1992,8 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, vals[i]->bv_val, vals[i]->bv_len) == 0) { /* it's an entry of the right type */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("Matched objectclass [%s] on DN [%s], will use associated map\n", - state->maps[mi].map[0].name, dn)); + "Matched objectclass [%s] on DN [%s], will use associated map\n", + state->maps[mi].map[0].name, dn); map = state->maps[mi].map; num_attrs = state->maps[mi].num_attrs; break; @@ -2001,8 +2001,8 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, } if (!map) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("DN [%s] did not match the objectClass [%s]\n", - dn, state->maps[mi].map[0].name)); + "DN [%s] did not match the objectClass [%s]\n", + dn, state->maps[mi].map[0].name); continue; }
@@ -2013,7 +2013,7 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, map, num_attrs, &res[mi]->attrs, NULL, disable_range_rtrvl); if (ret != EOK) { - DEBUG(3, ("sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(3, "sdap_parse_entry failed [%d]: %s\n", ret, strerror(ret)); goto done; } } @@ -2022,7 +2022,7 @@ static errno_t sdap_asq_search_parse_entry(struct sdap_handle *sh, ret = add_to_deref_reply(state, state->num_maps, &state->dreply, res); if (ret != EOK) { - DEBUG(1, ("add_to_deref_reply failed.\n")); + DEBUG(1, "add_to_deref_reply failed.\n"); goto done; }
@@ -2041,8 +2041,8 @@ static void sdap_asq_search_done(struct tevent_req *subreq) ret = sdap_get_generic_ext_recv(subreq); talloc_zfree(subreq); if (ret) { - DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(4, "sdap_get_generic_ext_recv failed [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -2115,29 +2115,29 @@ sdap_deref_search_send(TALLOC_CTX *memctx, state->reply = NULL;
if (sdap_is_control_supported(sh, LDAP_SERVER_ASQ_OID)) { - DEBUG(8, ("Server supports ASQ\n")); + DEBUG(8, "Server supports ASQ\n"); state->deref_type = SDAP_DEREF_ASQ;
subreq = sdap_asq_search_send(state, ev, opts, sh, base_dn, deref_attr, attrs, maps, num_maps, timeout); if (!subreq) { - DEBUG(2, ("Cannot start ASQ search\n")); + DEBUG(2, "Cannot start ASQ search\n"); goto fail; } } else if (sdap_is_control_supported(sh, LDAP_CONTROL_X_DEREF)) { - DEBUG(8, ("Server supports OpenLDAP deref\n")); + DEBUG(8, "Server supports OpenLDAP deref\n"); state->deref_type = SDAP_DEREF_OPENLDAP;
subreq = sdap_x_deref_search_send(state, ev, opts, sh, base_dn, deref_attr, attrs, maps, num_maps, timeout); if (!subreq) { - DEBUG(2, ("Cannot start OpenLDAP deref search\n")); + DEBUG(2, "Cannot start OpenLDAP deref search\n"); goto fail; } } else { - DEBUG(2, ("Server does not support any known deref method!\n")); + DEBUG(2, "Server does not support any known deref method!\n"); goto fail; }
@@ -2167,14 +2167,14 @@ static void sdap_deref_search_done(struct tevent_req *subreq) &state->reply_count, &state->reply); break; default: - DEBUG(1, ("Unknown deref method\n")); + DEBUG(1, "Unknown deref method\n"); tevent_req_error(req, EINVAL); return; }
talloc_zfree(subreq); if (ret != EOK) { - DEBUG(2, ("dereference processing failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(2, "dereference processing failed [%d]: %s\n", ret, strerror(ret)); if (ret == ENOTSUP) { sss_log(SSS_LOG_WARNING, "LDAP server claims to support deref, but deref search failed. " @@ -2227,8 +2227,8 @@ bool sdap_has_deref_support(struct sdap_handle *sh, struct sdap_options *opts)
for (i=0; deref_oids[i][0]; i++) { if (sdap_is_control_supported(sh, deref_oids[i][0])) { - DEBUG(6, ("The server supports deref method %s\n", - deref_oids[i][1])); + DEBUG(6, "The server supports deref method %s\n", + deref_oids[i][1]); return true; } } @@ -2252,20 +2252,20 @@ sdap_attrs_add_ldap_attr(struct sysdb_attrs *ldap_attrs,
ret = sysdb_attrs_get_el(ldap_attrs, attr_name, &el); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get %s from the " + DEBUG(SSSDBG_OP_FAILURE, "Could not get %s from the " "list of the LDAP attributes [%d]: %s\n", - attr_name, ret, strerror(ret))); + attr_name, ret, strerror(ret)); return ret; }
if (el->num_values == 0) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("%s is not available " - "for [%s].\n", desc, objname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "%s is not available " + "for [%s].\n", desc, objname); } else { num_values = multivalued ? el->num_values : 1; for (i = 0; i < num_values; i++) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding %s [%s] to attributes " - "of [%s].\n", desc, el->values[i].data, objname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Adding %s [%s] to attributes " + "of [%s].\n", desc, el->values[i].data, objname);
ret = sysdb_attrs_add_mem(attrs, attr_name, el->values[i].data, el->values[i].length); @@ -2300,7 +2300,7 @@ sdap_save_all_names(const char *name, ret = sysdb_attrs_get_aliases(tmp_ctx, ldap_attrs, name, lowercase, &aliases); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get the alias list")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get the alias list"); goto done; }
@@ -2313,8 +2313,8 @@ sdap_save_all_names(const char *name,
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, domname); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to add alias [%s] into the " - "attribute list\n", aliases[i])); + DEBUG(SSSDBG_OP_FAILURE, "Failed to add alias [%s] into the " + "attribute list\n", aliases[i]); goto done; } } diff --git a/src/providers/ldap/sdap_async_autofs.c b/src/providers/ldap/sdap_async_autofs.c index 4d5e953..e4dfb73 100644 --- a/src/providers/ldap/sdap_async_autofs.c +++ b/src/providers/ldap/sdap_async_autofs.c @@ -63,7 +63,7 @@ get_autofs_entry_attr(struct sysdb_attrs *entry, struct sdap_options *opts, if (ret) return NULL; if (el->num_values != 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Expected one entry got %d\n", el->num_values)); + "Expected one entry got %d\n", el->num_values); return NULL; }
@@ -94,13 +94,13 @@ add_autofs_entry(struct sysdb_ctx *sysdb,
key = get_autofs_entry_key(entry, opts); if (!key) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get autofs entry key\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not get autofs entry key\n"); return EINVAL; }
value = get_autofs_entry_value(entry, opts); if (!value) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get autofs entry value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not get autofs entry value\n"); return EINVAL; }
@@ -133,30 +133,30 @@ save_autofs_entries(struct sysdb_ctx *sysdb, hret = hash_lookup(entry_hash, &key, &value); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot retrieve entry [%s] from hash\n", add_dn_list[i])); + "Cannot retrieve entry [%s] from hash\n", add_dn_list[i]); continue; }
entry = talloc_get_type(value.ptr, struct sysdb_attrs); if (!entry) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot retrieve entry [%s] from ptr\n", add_dn_list[i])); + "Cannot retrieve entry [%s] from ptr\n", add_dn_list[i]); continue; }
DEBUG(SSSDBG_TRACE_FUNC, - ("Saving autofs entry [%s]\n", add_dn_list[i])); + "Saving autofs entry [%s]\n", add_dn_list[i]); ret = add_autofs_entry(sysdb, domain, map, opts, entry); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot save entry [%s] to cache\n", add_dn_list[i])); + "Cannot save entry [%s] to cache\n", add_dn_list[i]); continue; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Saved entry [%s]\n", add_dn_list[i])); + DEBUG(SSSDBG_TRACE_FUNC, "Saved entry [%s]\n", add_dn_list[i]); }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("All entries saved\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "All entries saved\n"); return EOK; }
@@ -171,17 +171,17 @@ del_autofs_entries(struct sysdb_ctx *sysdb,
for (i=0; del_dn_list[i]; i++) { DEBUG(SSSDBG_TRACE_FUNC, - ("Removing autofs entry [%s]\n", del_dn_list[i])); + "Removing autofs entry [%s]\n", del_dn_list[i]);
ret = sysdb_del_autofsentry(sysdb, del_dn_list[i]); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot delete entry %s\n", del_dn_list[i])); + "Cannot delete entry %s\n", del_dn_list[i]); continue; } }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("All entries removed\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "All entries removed\n"); return EOK; }
@@ -268,7 +268,7 @@ automntmaps_process_members_send(TALLOC_CTX *mem_ctx, opts->autofs_entry_map[SDAP_AT_AUTOFS_ENTRY_KEY].name, opts->autofs_entry_map[SDAP_OC_AUTOFS_ENTRY].name); if (!state->base_filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build filter\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build filter\n"); ret = ENOMEM; goto immediate; } @@ -277,7 +277,7 @@ automntmaps_process_members_send(TALLOC_CTX *mem_ctx, SDAP_OPTS_AUTOFS_ENTRY, NULL, &state->attrs, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build attributes from map\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build attributes from map\n"); ret = ENOMEM; goto immediate; } @@ -285,17 +285,17 @@ automntmaps_process_members_send(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_get_string(state->map, SYSDB_ORIG_DN, &state->orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot get originalDN\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot get originalDN\n"); goto immediate; }
DEBUG(SSSDBG_TRACE_FUNC, - ("Examining autofs map [%s]\n", state->orig_dn)); + "Examining autofs map [%s]\n", state->orig_dn);
ret = automntmaps_process_members_next_base(req); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("search failed [%d]: %s\n", ret, strerror(ret))); + "search failed [%d]: %s\n", ret, strerror(ret)); goto immediate; }
@@ -327,8 +327,8 @@ automntmaps_process_members_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for automount map entries with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for automount map entries with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, state->orig_dn, @@ -338,7 +338,7 @@ automntmaps_process_members_next_base(struct tevent_req *req) SDAP_OPTS_AUTOFS_ENTRY, state->timeout, true); if (!subreq) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot start search for entries\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot start search for entries\n"); return EIO; } tevent_req_set_callback(subreq, automntmaps_process_members_done, req); @@ -392,11 +392,11 @@ automntmaps_process_members_done(struct tevent_req *subreq) } }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("No more search bases to try\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No more search bases to try\n");
DEBUG(SSSDBG_TRACE_FUNC, - ("Search for autofs entries, returned %zu results.\n", - state->entries_count)); + "Search for autofs entries, returned %zu results.\n", + state->entries_count);
tevent_req_done(req); return; @@ -510,8 +510,8 @@ sdap_get_automntmap_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for automount maps with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for automount maps with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -550,7 +550,7 @@ sdap_get_automntmap_process(struct tevent_req *subreq) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Search for autofs maps, returned %zu results.\n", state->count)); + "Search for autofs maps, returned %zu results.\n", state->count);
if (state->count == 0) { /* No maps found in this search */ @@ -568,12 +568,12 @@ sdap_get_automntmap_process(struct tevent_req *subreq) return; } else if (state->count > 1) { DEBUG(SSSDBG_OP_FAILURE, - ("The search yielded more than one autofs map\n")); + "The search yielded more than one autofs map\n"); tevent_req_error(req, EIO); return; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Processing autofs maps\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Processing autofs maps\n"); subreq = automntmaps_process_members_send(state, state->ev, state->opts, state->sh, state->dom, state->search_bases, @@ -605,7 +605,7 @@ sdap_get_automntmap_done(struct tevent_req *subreq) return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("automount map members received\n")); + DEBUG(SSSDBG_TRACE_FUNC, "automount map members received\n"); tevent_req_done(req); return; } @@ -678,7 +678,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, if (!req) return NULL;
if (!mapname) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No map name given\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No map name given\n"); ret = EINVAL; goto fail; } @@ -700,7 +700,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, clean_mapname, state->opts->autofs_mobject_map[SDAP_OC_AUTOFS_MAP].name); if (!state->filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build filter\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build filter\n"); ret = ENOMEM; goto fail; } @@ -710,7 +710,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, SDAP_OPTS_AUTOFS_MAP, NULL, &state->attrs, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build attributes from map\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build attributes from map\n"); ret = ENOMEM; goto fail; } @@ -723,7 +723,7 @@ sdap_autofs_setautomntent_send(TALLOC_CTX *memctx, dp_opt_get_int(state->opts->basic, SDAP_SEARCH_TIMEOUT)); if (!subreq) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); ret = ENOMEM; goto fail; } @@ -753,11 +753,11 @@ sdap_autofs_setautomntent_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { if (ret == ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not find automount map\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not find automount map\n"); } else { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_get_automntmap_recv failed [%d]: %s\n", - ret, strerror(ret))); + "sdap_get_automntmap_recv failed [%d]: %s\n", + ret, strerror(ret)); } tevent_req_error(req, ret); return; @@ -765,7 +765,7 @@ sdap_autofs_setautomntent_done(struct tevent_req *subreq)
ret = sdap_autofs_setautomntent_save(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not save automount map\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not save automount map\n"); tevent_req_error(req, ret); return; } @@ -802,7 +802,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) if (!tmp_ctx) return ENOMEM;
DEBUG(SSSDBG_TRACE_LIBS, - ("Got %zu map entries from LDAP\n", state->entries_count)); + "Got %zu map entries from LDAP\n", state->entries_count); if (state->entries_count == 0) { /* No entries for this map in LDAP. * We need to ensure that there are no entries @@ -827,7 +827,7 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) key = get_autofs_entry_key(state->entries[i], state->opts); val = get_autofs_entry_value(state->entries[i], state->opts); if (!key || !val) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Malformed entry, skipping\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Malformed entry, skipping\n"); continue; }
@@ -862,12 +862,12 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) &count, &entries); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("cache lookup for the map failed [%d]: %s\n", - ret, strerror(ret))); + "cache lookup for the map failed [%d]: %s\n", + ret, strerror(ret)); goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Got %zu map entries from sysdb\n", count)); + DEBUG(SSSDBG_TRACE_LIBS, "Got %zu map entries from sysdb\n", count); if (count == 0) { /* No map members for this map in sysdb currently */ sysdb_entrylist = NULL; @@ -900,8 +900,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot start sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot start sysdb transaction [%d]: %s\n", + ret, strerror(ret)); goto done; } in_transaction = true; @@ -910,8 +910,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) ret = save_autofs_map(state->sysdb, state->dom, state->opts, state->map); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save autofs map entry [%d]: %s\n", - ret, strerror(ret))); + "Cannot save autofs map entry [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -922,8 +922,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) entry_hash); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save autofs entries [%d]: %s\n", - ret, strerror(ret))); + "Cannot save autofs entries [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -934,8 +934,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) state->mapname, del_entries); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot delete autofs entries [%d]: %s\n", - ret, strerror(ret))); + "Cannot delete autofs entries [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -944,8 +944,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot commit sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot commit sysdb transaction [%d]: %s\n", + ret, strerror(ret)); goto done; } in_transaction = false; @@ -956,8 +956,8 @@ done: tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot cancel sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot cancel sysdb transaction [%d]: %s\n", + ret, strerror(ret)); } } talloc_zfree(tmp_ctx); diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index 0a77460..2494837 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -41,7 +41,7 @@ errno_t deref_string_to_val(const char *str, int *val) } else if (strcasecmp(str, "always") == 0) { *val = LDAP_DEREF_ALWAYS; } else { - DEBUG(1, ("Illegal deref option [%s].\n", str)); + DEBUG(1, "Illegal deref option [%s].\n", str); return EINVAL; }
@@ -125,7 +125,7 @@ struct tevent_req *sdap_connect_send(TALLOC_CTX *memctx, timeout); if (subreq == NULL) { ret = ENOMEM; - DEBUG(1, ("sss_ldap_init_send failed.\n")); + DEBUG(1, "sss_ldap_init_send failed.\n"); goto fail; }
@@ -164,14 +164,14 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) ret = sss_ldap_init_recv(subreq, &state->sh->ldap, &sd); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("sdap_async_connect_call request failed.\n")); + DEBUG(1, "sdap_async_connect_call request failed.\n"); tevent_req_error(req, ret); return; }
ret = setup_ldap_connection_callbacks(state->sh, state->ev); if (ret != EOK) { - DEBUG(1, ("setup_ldap_connection_callbacks failed.\n")); + DEBUG(1, "setup_ldap_connection_callbacks failed.\n"); goto fail; }
@@ -181,7 +181,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) if (sd != -1) { ret = sdap_call_conn_cb(state->uri, sd, state->sh); if (ret != EOK) { - DEBUG(1, ("sdap_call_conn_cb failed.\n")); + DEBUG(1, "sdap_call_conn_cb failed.\n"); goto fail; } } @@ -190,7 +190,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) ver = LDAP_VERSION3; lret = ldap_set_option(state->sh->ldap, LDAP_OPT_PROTOCOL_VERSION, &ver); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set ldap version to 3\n")); + DEBUG(1, "Failed to set ldap version to 3\n"); goto fail; }
@@ -198,7 +198,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) * to handle EINTR during poll(). */ ret = ldap_set_option(state->sh->ldap, LDAP_OPT_RESTART, LDAP_OPT_ON); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set restart option.\n")); + DEBUG(1, "Failed to set restart option.\n"); }
/* Set Network Timeout */ @@ -206,8 +206,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) tv.tv_usec = 0; lret = ldap_set_option(state->sh->ldap, LDAP_OPT_NETWORK_TIMEOUT, &tv); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set network timeout to %d\n", - dp_opt_get_int(state->opts->basic, SDAP_NETWORK_TIMEOUT))); + DEBUG(1, "Failed to set network timeout to %d\n", + dp_opt_get_int(state->opts->basic, SDAP_NETWORK_TIMEOUT)); goto fail; }
@@ -216,8 +216,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) tv.tv_usec = 0; lret = ldap_set_option(state->sh->ldap, LDAP_OPT_TIMEOUT, &tv); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set default timeout to %d\n", - dp_opt_get_int(state->opts->basic, SDAP_OPT_TIMEOUT))); + DEBUG(1, "Failed to set default timeout to %d\n", + dp_opt_get_int(state->opts->basic, SDAP_OPT_TIMEOUT)); goto fail; }
@@ -226,8 +226,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) lret = ldap_set_option(state->sh->ldap, LDAP_OPT_REFERRALS, (ldap_referrals ? LDAP_OPT_ON : LDAP_OPT_OFF)); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set referral chasing to %s\n", - (ldap_referrals ? "LDAP_OPT_ON" : "LDAP_OPT_OFF"))); + DEBUG(1, "Failed to set referral chasing to %s\n", + (ldap_referrals ? "LDAP_OPT_ON" : "LDAP_OPT_OFF")); goto fail; }
@@ -235,7 +235,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) rebind_proc_params = talloc_zero(state->sh, struct sdap_rebind_proc_params); if (rebind_proc_params == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; } @@ -247,7 +247,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) lret = ldap_set_rebind_proc(state->sh->ldap, sdap_rebind_proc, rebind_proc_params); if (lret != LDAP_SUCCESS) { - DEBUG(1, ("ldap_set_rebind_proc failed.\n")); + DEBUG(1, "ldap_set_rebind_proc failed.\n"); goto fail; } } @@ -257,13 +257,13 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) if (ldap_deref != NULL) { ret = deref_string_to_val(ldap_deref, &ldap_deref_val); if (ret != EOK) { - DEBUG(1, ("deref_string_to_val failed.\n")); + DEBUG(1, "deref_string_to_val failed.\n"); goto fail; }
lret = ldap_set_option(state->sh->ldap, LDAP_OPT_DEREF, &ldap_deref_val); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set deref option to %d\n", ldap_deref_val)); + DEBUG(1, "Failed to set deref option to %d\n", ldap_deref_val); goto fail; }
@@ -276,9 +276,9 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) if (lret != LDAP_OPT_SUCCESS) { /* Do not fail, just warn into both debug logs and syslog */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to set LDAP SASL nocanon option to %s. If your system " + "Failed to set LDAP SASL nocanon option to %s. If your system " "is configured to use SASL, LDAP operations might fail.\n", - sasl_nocanon ? "true" : "false")); + sasl_nocanon ? "true" : "false"); sss_log(SSS_LOG_INFO, "Failed to set LDAP SASL nocanon option to %s. If your system " "is configured to use SASL, LDAP operations might fail.\n", @@ -293,8 +293,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) lret = ldap_set_option(state->sh->ldap, LDAP_OPT_X_SASL_SSF_MIN, &ber_sasl_minssf); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set LDAP MIN SSF option " - "to %d\n", sasl_minssf)); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set LDAP MIN SSF option " + "to %d\n", sasl_minssf); goto fail; } } @@ -307,21 +307,21 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) return; }
- DEBUG(4, ("Executing START TLS\n")); + DEBUG(4, "Executing START TLS\n");
lret = ldap_start_tls(state->sh->ldap, NULL, NULL, &msgid); if (lret != LDAP_SUCCESS) { optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &errmsg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_start_tls failed: [%s] [%s]\n", + DEBUG(3, "ldap_start_tls failed: [%s] [%s]\n", sss_ldap_err2string(lret), - errmsg)); + errmsg); sss_log(SSS_LOG_ERR, "Could not start TLS. %s", errmsg); } else { - DEBUG(3, ("ldap_start_tls failed: [%s]\n", - sss_ldap_err2string(lret))); + DEBUG(3, "ldap_start_tls failed: [%s]\n", + sss_ldap_err2string(lret)); sss_log(SSS_LOG_ERR, "Could not start TLS. " "Check for certificate issues."); } @@ -335,7 +335,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq) ret = sdap_op_add(state, state->ev, state->sh, msgid, sdap_connect_done, req, 5, &state->op); if (ret) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); goto fail; }
@@ -376,17 +376,17 @@ static void sdap_connect_done(struct sdap_op *op, ret = ldap_parse_result(state->sh->ldap, state->reply->msg, &state->result, NULL, &errmsg, NULL, NULL, 0); if (ret != LDAP_SUCCESS) { - DEBUG(2, ("ldap_parse_result failed (%d)\n", state->op->msgid)); + DEBUG(2, "ldap_parse_result failed (%d)\n", state->op->msgid); tevent_req_error(req, EIO); return; }
- DEBUG(3, ("START TLS result: %s(%d), %s\n", - sss_ldap_err2string(state->result), state->result, errmsg)); + DEBUG(3, "START TLS result: %s(%d), %s\n", + sss_ldap_err2string(state->result), state->result, errmsg); ldap_memfree(errmsg);
if (ldap_tls_inplace(state->sh->ldap)) { - DEBUG(9, ("SSL/TLS handler already in place.\n")); + DEBUG(9, "SSL/TLS handler already in place.\n"); tevent_req_done(req); return; } @@ -398,14 +398,14 @@ static void sdap_connect_done(struct sdap_op *op, optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &tlserr); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_install_tls failed: [%s] [%s]\n", + DEBUG(3, "ldap_install_tls failed: [%s] [%s]\n", sss_ldap_err2string(ret), - tlserr)); + tlserr); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. %s", tlserr); } else { - DEBUG(3, ("ldap_install_tls failed: [%s]\n", - sss_ldap_err2string(ret))); + DEBUG(3, "ldap_install_tls failed: [%s]\n", + sss_ldap_err2string(ret)); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. " "Check for certificate issues."); } @@ -468,7 +468,7 @@ struct tevent_req *sdap_connect_host_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_connect_host_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -495,7 +495,7 @@ struct tevent_req *sdap_connect_host_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Resolving host %s\n", host)); + DEBUG(SSSDBG_TRACE_FUNC, "Resolving host %s\n", host);
subreq = resolv_gethostbyname_send(state, state->ev, resolv_ctx, host, family_order, host_db); @@ -534,19 +534,19 @@ static void sdap_connect_host_resolv_done(struct tevent_req *subreq) ret = resolv_gethostbyname_recv(subreq, state, &status, NULL, &hostent); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to resolve host %s: %s\n", - state->host, resolv_strerror(status))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to resolve host %s: %s\n", + state->host, resolv_strerror(status)); goto done; }
sockaddr = resolv_get_sockaddr_address(state, hostent, state->port); if (sockaddr == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("resolv_get_sockaddr_address() failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "resolv_get_sockaddr_address() failed\n"); ret = EIO; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Connecting to %s\n", state->uri)); + DEBUG(SSSDBG_TRACE_FUNC, "Connecting to %s\n", state->uri);
subreq = sdap_connect_send(state, state->ev, state->opts, state->uri, sockaddr, state->use_start_tls); @@ -589,12 +589,12 @@ static void sdap_connect_host_done(struct tevent_req *subreq) /* we need to mark handle as connected to allow anonymous bind */ ret = sdap_set_connected(state->sh, state->ev); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_set_connected() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_set_connected() failed\n"); goto done; } }
- DEBUG(SSSDBG_TRACE_FUNC, ("Successful connection to %s\n", state->uri)); + DEBUG(SSSDBG_TRACE_FUNC, "Successful connection to %s\n", state->uri);
done: if (ret != EOK) { @@ -669,13 +669,13 @@ static struct tevent_req *simple_bind_send(TALLOC_CTX *memctx, ret = sss_ldap_control_create(LDAP_CONTROL_PASSWORDPOLICYREQUEST, 0, NULL, 0, &ctrls[0]); if (ret != LDAP_SUCCESS && ret != LDAP_NOT_SUPPORTED) { - DEBUG(1, ("sss_ldap_control_create failed to create " - "Password Policy control.\n")); + DEBUG(1, "sss_ldap_control_create failed to create " + "Password Policy control.\n"); goto fail; } request_controls = ctrls;
- DEBUG(4, ("Executing simple bind as: %s\n", state->user_dn)); + DEBUG(4, "Executing simple bind as: %s\n", state->user_dn);
ret = ldap_sasl_bind(state->sh->ldap, state->user_dn, LDAP_SASL_SIMPLE, pw, request_controls, NULL, &msgid); @@ -684,16 +684,16 @@ static struct tevent_req *simple_bind_send(TALLOC_CTX *memctx, ret = ldap_get_option(state->sh->ldap, LDAP_OPT_RESULT_CODE, &ldap_err); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("ldap_bind failed (couldn't get ldap error)\n")); + DEBUG(1, "ldap_bind failed (couldn't get ldap error)\n"); ret = LDAP_LOCAL_ERROR; } else { - DEBUG(1, ("ldap_bind failed (%d)[%s]\n", - ldap_err, sss_ldap_err2string(ldap_err))); + DEBUG(1, "ldap_bind failed (%d)[%s]\n", + ldap_err, sss_ldap_err2string(ldap_err)); ret = ldap_err; } goto fail; } - DEBUG(8, ("ldap simple bind sent, msgid = %d\n", msgid)); + DEBUG(8, "ldap simple bind sent, msgid = %d\n", msgid);
if (!sh->connected) { ret = sdap_set_connected(sh, ev); @@ -704,7 +704,7 @@ static struct tevent_req *simple_bind_send(TALLOC_CTX *memctx, ret = sdap_op_add(state, ev, sh, msgid, simple_bind_done, req, 5, &state->op); if (ret) { - DEBUG(1, ("Failed to set up operation!\n")); + DEBUG(1, "Failed to set up operation!\n"); goto fail; }
@@ -750,7 +750,7 @@ static void simple_bind_done(struct sdap_op *op, &response_controls, 0); if (lret != LDAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldap_parse_result failed (%d)\n", state->op->msgid)); + "ldap_parse_result failed (%d)\n", state->op->msgid); ret = ERR_INTERNAL; goto done; } @@ -762,13 +762,13 @@ static void simple_bind_done(struct sdap_op *op, }
if (response_controls == NULL) { - DEBUG(SSSDBG_TRACE_LIBS, ("Server returned no controls.\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Server returned no controls.\n"); state->ppolicy = NULL; } else { for (c = 0; response_controls[c] != NULL; c++) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Server returned control [%s].\n", - response_controls[c]->ldctl_oid)); + "Server returned control [%s].\n", + response_controls[c]->ldctl_oid); if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) == 0) { lret = ldap_parse_passwordpolicy_control(state->sh->ldap, @@ -777,14 +777,14 @@ static void simple_bind_done(struct sdap_op *op, &pp_error); if (lret != LDAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("ldap_parse_passwordpolicy_control failed.\n")); + "ldap_parse_passwordpolicy_control failed.\n"); ret = ERR_INTERNAL; goto done; }
- DEBUG(7, ("Password Policy Response: expire [%d] grace [%d] " + DEBUG(7, "Password Policy Response: expire [%d] grace [%d] " "error [%s].\n", pp_expire, pp_grace, - ldap_passwordpolicy_err2txt(pp_error))); + ldap_passwordpolicy_err2txt(pp_error)); if (!state->ppolicy) state->ppolicy = talloc_zero(state, struct sdap_ppolicy_data); @@ -798,29 +798,29 @@ static void simple_bind_done(struct sdap_op *op,
if (pp_error == PP_changeAfterReset) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password was reset. " - "User must set a new password.\n")); + "Password was reset. " + "User must set a new password.\n"); ret = ERR_PASSWORD_EXPIRED; } else if (pp_grace >= 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password expired. " + "Password expired. " "[%d] grace logins remaining.\n", - pp_grace)); + pp_grace); } else if (pp_expire > 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password will expire in [%d] seconds.\n", - pp_expire)); + "Password will expire in [%d] seconds.\n", + pp_expire); } } else if (result == LDAP_INVALID_CREDENTIALS && pp_error == PP_passwordExpired) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password expired user must set a new password.\n")); + "Password expired user must set a new password.\n"); ret = ERR_PASSWORD_EXPIRED; } } else if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PWEXPIRED) == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Password expired user must set a new password.\n")); + "Password expired user must set a new password.\n"); ret = ERR_PASSWORD_EXPIRED; } else if (strcmp(response_controls[c]->ldctl_oid, LDAP_CONTROL_PWEXPIRING) == 0) { @@ -850,21 +850,21 @@ static void simple_bind_done(struct sdap_op *op, talloc_zfree(nval); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Couldn't convert control response " - "to an integer [%s].\n", strerror(ret))); + "Couldn't convert control response " + "to an integer [%s].\n", strerror(ret)); goto done; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Password will expire in [%d] seconds.\n", - state->ppolicy->expire)); + "Password will expire in [%d] seconds.\n", + state->ppolicy->expire); } } }
- DEBUG(SSSDBG_TRACE_FUNC, ("Bind result: %s(%d), %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Bind result: %s(%d), %s\n", sss_ldap_err2string(result), result, - errmsg ? errmsg : "no errmsg set")); + errmsg ? errmsg : "no errmsg set");
if (result != LDAP_SUCCESS && ret == EOK) { ret = ERR_AUTH_FAILED; @@ -933,8 +933,8 @@ static struct tevent_req *sasl_bind_send(TALLOC_CTX *memctx, state->sasl_user = sasl_user; state->sasl_cred = sasl_cred;
- DEBUG(4, ("Executing sasl bind mech: %s, user: %s\n", - sasl_mech, sasl_user)); + DEBUG(4, "Executing sasl bind mech: %s, user: %s\n", + sasl_mech, sasl_user);
/* FIXME: Warning, this is a sync call! * No async variant exist in openldap libraries yet */ @@ -945,14 +945,14 @@ static struct tevent_req *sasl_bind_send(TALLOC_CTX *memctx, (*sdap_sasl_interact), state); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("ldap_sasl_bind failed (%d)[%s]\n", - ret, sss_ldap_err2string(ret))); + "ldap_sasl_bind failed (%d)[%s]\n", + ret, sss_ldap_err2string(ret));
optret = sss_ldap_get_diagnostic_msg(state, state->sh->ldap, &diag_msg); if (optret == EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Extended failure message: [%s]\n", diag_msg)); + "Extended failure message: [%s]\n", diag_msg); } talloc_zfree(diag_msg);
@@ -1075,12 +1075,12 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx, struct sdap_kinit_state *state; int ret;
- DEBUG(6, ("Attempting kinit (%s, %s, %s, %d)\n", + DEBUG(6, "Attempting kinit (%s, %s, %s, %d)\n", keytab ? keytab : "default", - principal, realm, lifetime)); + principal, realm, lifetime);
if (lifetime < 0 || lifetime > INT32_MAX) { - DEBUG(1, ("Ticket lifetime out of range.\n")); + DEBUG(1, "Ticket lifetime out of range.\n"); return NULL; }
@@ -1099,7 +1099,7 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx, if (keytab) { ret = setenv("KRB5_KTNAME", keytab, 1); if (ret == -1) { - DEBUG(2, ("Failed to set KRB5_KTNAME to %s\n", keytab)); + DEBUG(2, "Failed to set KRB5_KTNAME to %s\n", keytab); talloc_free(req); return NULL; } @@ -1111,8 +1111,8 @@ struct tevent_req *sdap_kinit_send(TALLOC_CTX *memctx, ret = setenv("KRB5_CANONICALIZE", "false", 1); } if (ret == -1) { - DEBUG(2, ("Failed to set KRB5_CANONICALIZE to %s\n", - ((canonicalize)?"true":"false"))); + DEBUG(2, "Failed to set KRB5_CANONICALIZE to %s\n", + ((canonicalize)?"true":"false")); talloc_free(req); return NULL; } @@ -1132,14 +1132,14 @@ static struct tevent_req *sdap_kinit_next_kdc(struct tevent_req *req) struct sdap_kinit_state *state = tevent_req_data(req, struct sdap_kinit_state);
- DEBUG(7, ("Resolving next KDC for service %s\n", state->krb_service_name)); + DEBUG(7, "Resolving next KDC for service %s\n", state->krb_service_name);
next_req = be_resolve_server_send(state, state->ev, state->be, state->krb_service_name, state->kdc_srv == NULL ? true : false); if (next_req == NULL) { - DEBUG(1, ("be_resolve_server_send failed.\n")); + DEBUG(1, "be_resolve_server_send failed.\n"); return NULL; } tevent_req_set_callback(next_req, sdap_kinit_kdc_resolved, req); @@ -1165,7 +1165,7 @@ static void sdap_kinit_kdc_resolved(struct tevent_req *subreq) return; }
- DEBUG(7, ("KDC resolved, attempting to get TGT...\n")); + DEBUG(7, "KDC resolved, attempting to get TGT...\n");
tgtreq = sdap_get_tgt_send(state, state->ev, state->realm, state->principal, state->keytab, @@ -1198,7 +1198,7 @@ static void sdap_kinit_done(struct tevent_req *subreq) /* The child didn't even respond. Perhaps the KDC is too busy, * retry with another KDC */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Communication with KDC timed out, trying the next one\n")); + "Communication with KDC timed out, trying the next one\n"); be_fo_set_port_status(state->be, state->krb_service_name, state->kdc_srv, PORT_NOT_WORKING); nextreq = sdap_kinit_next_kdc(req); @@ -1208,7 +1208,7 @@ static void sdap_kinit_done(struct tevent_req *subreq) return; } else if (ret != EOK) { /* A severe error while executing the child. Abort the operation. */ - DEBUG(1, ("child failed (%d [%s])\n", ret, strerror(ret))); + DEBUG(1, "child failed (%d [%s])\n", ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -1216,7 +1216,7 @@ static void sdap_kinit_done(struct tevent_req *subreq) if (result == EOK) { ret = setenv("KRB5CCNAME", ccname, 1); if (ret == -1) { - DEBUG(2, ("Unable to set env. variable KRB5CCNAME!\n")); + DEBUG(2, "Unable to set env. variable KRB5CCNAME!\n"); tevent_req_error(req, ERR_AUTH_FAILED); }
@@ -1236,7 +1236,7 @@ static void sdap_kinit_done(struct tevent_req *subreq)
}
- DEBUG(4, ("Could not get TGT: %d [%s]\n", result, sss_strerror(result))); + DEBUG(4, "Could not get TGT: %d [%s]\n", result, sss_strerror(result)); tevent_req_error(req, ERR_AUTH_FAILED); }
@@ -1298,7 +1298,7 @@ struct tevent_req *sdap_auth_send(TALLOC_CTX *memctx,
ret = sss_authtok_get_password(authtok, &password, &pwlen); if (ret != EOK) { - DEBUG(1, ("Cannot parse authtok.\n")); + DEBUG(1, "Cannot parse authtok.\n"); tevent_req_error(req, ret); return tevent_req_post(req, ev); } @@ -1333,8 +1333,8 @@ static int sdap_auth_get_authtok(const char *authtok_type, pw->bv_len = authtok.length; pw->bv_val = (char *) authtok.data; } else { - DEBUG(1, ("Authentication token type [%s] is not supported\n", - authtok_type)); + DEBUG(1, "Authentication token type [%s] is not supported\n", + authtok_type); return EINVAL; }
@@ -1503,8 +1503,8 @@ static void sdap_cli_resolve_done(struct tevent_req *subreq) }
if (use_tls && sdap_is_secure_uri(state->service->uri)) { - DEBUG(8, ("[%s] is a secure channel. No need to run START_TLS\n", - state->service->uri)); + DEBUG(8, "[%s] is a secure channel. No need to run START_TLS\n", + state->service->uri); use_tls = false; }
@@ -1628,7 +1628,7 @@ static void sdap_cli_rootdse_done(struct tevent_req *subreq)
ret = sdap_cli_use_rootdse(state); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_cli_use_rootdse failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_cli_use_rootdse failed\n"); tevent_req_error(req, ret); return; } @@ -1662,7 +1662,7 @@ static errno_t sdap_cli_use_rootdse(struct sdap_cli_connect_state *state) ret = sdap_set_rootdse_supported_lists(state->rootdse, state->sh); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_set_rootdse_supported_lists failed\n")); + "sdap_set_rootdse_supported_lists failed\n"); return ret; }
@@ -1670,7 +1670,7 @@ static errno_t sdap_cli_use_rootdse(struct sdap_cli_connect_state *state) state->opts->sdom); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_set_config_options_with_rootdse failed.\n")); + "sdap_set_config_options_with_rootdse failed.\n"); return ret; }
@@ -1682,7 +1682,7 @@ static errno_t sdap_cli_use_rootdse(struct sdap_cli_connect_state *state) state->opts, &state->srv_opts); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_get_server_opts_from_rootdse failed.\n")); + "sdap_get_server_opts_from_rootdse failed.\n"); return ret; }
@@ -1738,7 +1738,7 @@ static void sdap_cli_kinit_done(struct tevent_req *subreq) /* We're not able to authenticate to the LDAP server. * There's not much we can do except for going offline */ DEBUG(SSSDBG_TRACE_FUNC, - ("Cannot get a TGT: ret [%d](%s)\n", ret, sss_strerror(ret))); + "Cannot get a TGT: ret [%d](%s)\n", ret, sss_strerror(ret)); tevent_req_error(req, EACCES); return; } @@ -1768,18 +1768,18 @@ static void sdap_cli_auth_step(struct tevent_req *req) */ now = time(NULL); expire_timeout = dp_opt_get_int(state->opts->basic, SDAP_EXPIRE_TIMEOUT); - DEBUG(SSSDBG_CONF_SETTINGS, ("expire timeout is %d\n", expire_timeout)); + DEBUG(SSSDBG_CONF_SETTINGS, "expire timeout is %d\n", expire_timeout); if (!state->sh->expire_time || (state->sh->expire_time > (now + expire_timeout))) { state->sh->expire_time = now + expire_timeout; DEBUG(SSSDBG_TRACE_LIBS, - ("the connection will expire at %ld\n", state->sh->expire_time)); + "the connection will expire at %ld\n", state->sh->expire_time); }
if (!state->do_auth || (sasl_mech == NULL && user_dn == NULL)) { DEBUG(SSSDBG_TRACE_LIBS, - ("No authentication requested or SASL auth forced off\n")); + "No authentication requested or SASL auth forced off\n"); tevent_req_done(req); return; } @@ -1794,7 +1794,7 @@ static void sdap_cli_auth_step(struct tevent_req *req)
if (authtok_type != NULL) { if (strcasecmp(authtok_type, "password") != 0) { - DEBUG(SSSDBG_TRACE_LIBS, ("Invalid authtoken type\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Invalid authtoken type\n"); tevent_req_error(req, EINVAL); return; } @@ -1893,7 +1893,7 @@ static void sdap_cli_rootdse_auth_done(struct tevent_req *subreq) /* We were able to get rootDSE after authentication */ ret = sdap_cli_use_rootdse(state); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_cli_use_rootdse failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_cli_use_rootdse failed\n"); tevent_req_error(req, ret); return; } @@ -1965,7 +1965,7 @@ static int synchronous_tls_setup(LDAP *ldap) LDAPMessage *result = NULL; TALLOC_CTX *tmp_ctx;
- DEBUG(4, ("Executing START TLS\n")); + DEBUG(4, "Executing START TLS\n");
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) return LDAP_NO_MEMORY; @@ -1974,11 +1974,11 @@ static int synchronous_tls_setup(LDAP *ldap) if (lret != LDAP_SUCCESS) { optret = sss_ldap_get_diagnostic_msg(tmp_ctx, ldap, &diag_msg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_start_tls failed: [%s] [%s]\n", - sss_ldap_err2string(lret), diag_msg)); + DEBUG(3, "ldap_start_tls failed: [%s] [%s]\n", + sss_ldap_err2string(lret), diag_msg); sss_log(SSS_LOG_ERR, "Could not start TLS. %s", diag_msg); } else { - DEBUG(3, ("ldap_start_tls failed: [%s]\n", sss_ldap_err2string(lret))); + DEBUG(3, "ldap_start_tls failed: [%s]\n", sss_ldap_err2string(lret)); sss_log(SSS_LOG_ERR, "Could not start TLS. " "Check for certificate issues."); } @@ -1988,8 +1988,8 @@ static int synchronous_tls_setup(LDAP *ldap) lret = ldap_result(ldap, msgid, 1, NULL, &result); if (lret != LDAP_RES_EXTENDED) { DEBUG(SSSDBG_OP_FAILURE, - ("Unexpected ldap_result, expected [%lu] got [%d].\n", - LDAP_RES_EXTENDED, lret)); + "Unexpected ldap_result, expected [%lu] got [%d].\n", + LDAP_RES_EXTENDED, lret); lret = LDAP_PARAM_ERROR; goto done; } @@ -1997,16 +1997,16 @@ static int synchronous_tls_setup(LDAP *ldap) lret = ldap_parse_result(ldap, result, &ldaperr, NULL, &errmsg, NULL, NULL, 0); if (lret != LDAP_SUCCESS) { - DEBUG(2, ("ldap_parse_result failed (%d) [%d][%s]\n", msgid, lret, - sss_ldap_err2string(lret))); + DEBUG(2, "ldap_parse_result failed (%d) [%d][%s]\n", msgid, lret, + sss_ldap_err2string(lret)); goto done; }
- DEBUG(3, ("START TLS result: %s(%d), %s\n", - sss_ldap_err2string(ldaperr), ldaperr, errmsg)); + DEBUG(3, "START TLS result: %s(%d), %s\n", + sss_ldap_err2string(ldaperr), ldaperr, errmsg);
if (ldap_tls_inplace(ldap)) { - DEBUG(9, ("SSL/TLS handler already in place.\n")); + DEBUG(9, "SSL/TLS handler already in place.\n"); lret = LDAP_SUCCESS; goto done; } @@ -2016,12 +2016,12 @@ static int synchronous_tls_setup(LDAP *ldap)
optret = sss_ldap_get_diagnostic_msg(tmp_ctx, ldap, &diag_msg); if (optret == LDAP_SUCCESS) { - DEBUG(3, ("ldap_install_tls failed: [%s] [%s]\n", - sss_ldap_err2string(lret), diag_msg)); + DEBUG(3, "ldap_install_tls failed: [%s] [%s]\n", + sss_ldap_err2string(lret), diag_msg); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. %s", diag_msg); } else { - DEBUG(3, ("ldap_install_tls failed: [%s]\n", - sss_ldap_err2string(lret))); + DEBUG(3, "ldap_install_tls failed: [%s]\n", + sss_ldap_err2string(lret)); sss_log(SSS_LOG_ERR, "Could not start TLS encryption. " "Check for certificate issues."); } @@ -2054,14 +2054,14 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, if (p->use_start_tls) { ret = synchronous_tls_setup(ldap); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("synchronous_tls_setup failed.\n")); + DEBUG(1, "synchronous_tls_setup failed.\n"); return ret; } }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(1, ("talloc_new failed.\n")); + DEBUG(1, "talloc_new failed.\n"); return LDAP_NO_MEMORY; }
@@ -2071,8 +2071,8 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, ret = sss_ldap_control_create(LDAP_CONTROL_PASSWORDPOLICYREQUEST, 0, NULL, 0, &ctrls[0]); if (ret != LDAP_SUCCESS && ret != LDAP_NOT_SUPPORTED) { - DEBUG(1, ("sss_ldap_control_create failed to create " - "Password Policy control.\n")); + DEBUG(1, "sss_ldap_control_create failed to create " + "Password Policy control.\n"); goto done; } request_controls = ctrls; @@ -2086,7 +2086,7 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, &password); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sdap_auth_get_authtok failed.\n")); + "sdap_auth_get_authtok failed.\n"); ret = LDAP_LOCAL_ERROR; goto done; } @@ -2096,13 +2096,13 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, request_controls, NULL, NULL); if (ret != LDAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("ldap_sasl_bind_s failed (%d)[%s]\n", ret, - sss_ldap_err2string(ret))); + "ldap_sasl_bind_s failed (%d)[%s]\n", ret, + sss_ldap_err2string(ret)); } } else { sasl_bind_state = talloc_zero(tmp_ctx, struct sasl_bind_state); if (sasl_bind_state == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = LDAP_NO_MEMORY; goto done; } @@ -2114,13 +2114,13 @@ static int sdap_rebind_proc(LDAP *ldap, LDAP_CONST char *url, ber_tag_t request, (*sdap_sasl_interact), sasl_bind_state); if (ret != LDAP_SUCCESS) { - DEBUG(1, ("ldap_sasl_interactive_bind_s failed (%d)[%s]\n", ret, - sss_ldap_err2string(ret))); + DEBUG(1, "ldap_sasl_interactive_bind_s failed (%d)[%s]\n", ret, + sss_ldap_err2string(ret)); } }
- DEBUG(7, ("%s bind to [%s].\n", - (ret == LDAP_SUCCESS ? "Successfully" : "Failed to"), url)); + DEBUG(7, "%s bind to [%s].\n", + (ret == LDAP_SUCCESS ? "Successfully" : "Failed to"), url);
done: if (ctrls[0]) ldap_control_free(ctrls[0]); diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c index b03c19a..da7c4ec 100644 --- a/src/providers/ldap/sdap_async_enum.c +++ b/src/providers/ldap/sdap_async_enum.c @@ -86,7 +86,7 @@ sdap_dom_enum_send(TALLOC_CTX *memctx, state->conn = conn; state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_create failed\n"); ret = EIO; goto fail; } @@ -100,7 +100,7 @@ sdap_dom_enum_send(TALLOC_CTX *memctx,
ret = sdap_dom_enum_retry(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("ldap_id_enumerate_retry failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldap_id_enumerate_retry failed\n"); goto fail; }
@@ -122,7 +122,7 @@ static errno_t sdap_dom_enum_retry(struct tevent_req *req) subreq = sdap_id_op_connect_send(state->op, state, &ret); if (subreq == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_id_op_connect_send failed: %d\n", ret)); + "sdap_id_op_connect_send failed: %d\n", ret); return ret; }
@@ -143,12 +143,12 @@ static void sdap_dom_enum_conn_done(struct tevent_req *subreq) if (ret != EOK) { if (dp_error == DP_ERR_OFFLINE) { DEBUG(SSSDBG_TRACE_FUNC, - ("Backend is marked offline, retry later!\n")); + "Backend is marked offline, retry later!\n"); tevent_req_done(req); } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("Domain enumeration failed to connect to " \ - "LDAP server: (%d)[%s]\n", ret, strerror(ret))); + "Domain enumeration failed to connect to " \ + "LDAP server: (%d)[%s]\n", ret, strerror(ret)); tevent_req_error(req, ret); } return; @@ -193,8 +193,8 @@ static void sdap_dom_enum_users_done(struct tevent_req *subreq) tevent_req_done(req); } else { DEBUG(SSSDBG_OP_FAILURE, - ("User enumeration failed with: (%d)[%s]\n", - ret, strerror(ret))); + "User enumeration failed with: (%d)[%s]\n", + ret, strerror(ret)); tevent_req_error(req, ret); } return; @@ -240,8 +240,8 @@ static void sdap_dom_enum_groups_done(struct tevent_req *subreq) tevent_req_done(req); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Group enumeration failed with: (%d)[%s]\n", - ret, strerror(ret))); + "Group enumeration failed with: (%d)[%s]\n", + ret, strerror(ret)); tevent_req_error(req, ret); }
@@ -290,8 +290,8 @@ static void sdap_dom_enum_services_done(struct tevent_req *subreq) tevent_req_done(req); } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("Service enumeration failed with: (%d)[%s]\n", - ret, strerror(ret))); + "Service enumeration failed with: (%d)[%s]\n", + ret, strerror(ret)); tevent_req_error(req, ret); }
@@ -307,7 +307,7 @@ static void sdap_dom_enum_services_done(struct tevent_req *subreq) state->sdom->dom, true); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not mark domain as having enumerated.\n")); + "Could not mark domain as having enumerated.\n"); /* This error is non-fatal, so continue */ }
@@ -317,7 +317,7 @@ static void sdap_dom_enum_services_done(struct tevent_req *subreq) /* Not fatal, worst case we'll have stale entries that would be * removed on a subsequent online lookup */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Cleanup failed: %d\n", ret)); + DEBUG(SSSDBG_MINOR_FAILURE, "Cleanup failed: %d\n", ret); } }
@@ -375,7 +375,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, ctx->opts->user_map[SDAP_AT_USER_NAME].name); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -396,7 +396,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, } if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -415,7 +415,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx,
if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -424,7 +424,7 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, /* Terminate the search filter */ state->filter = talloc_asprintf_append_buffer(state->filter, ")"); if (!state->filter) { - DEBUG(2, ("Failed to build base filter\n")); + DEBUG(2, "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -492,8 +492,8 @@ static void enum_users_done(struct tevent_req *subreq) } }
- DEBUG(4, ("Users higher USN value: [%s]\n", - state->ctx->srv_opts->max_user_value)); + DEBUG(4, "Users higher USN value: [%s]\n", + state->ctx->srv_opts->max_user_value);
tevent_req_done(req); } @@ -549,7 +549,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, ctx->opts->group_map[SDAP_AT_GROUP_NAME].name); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -570,7 +570,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, } if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -585,7 +585,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, ctx->srv_opts->max_group_value); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -595,7 +595,7 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, state->filter = talloc_asprintf_append_buffer(state->filter, ")"); if (!state->filter) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to build base filter\n")); + "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -660,8 +660,8 @@ static void enum_groups_done(struct tevent_req *subreq) } }
- DEBUG(4, ("Groups higher USN value: [%s]\n", - state->ctx->srv_opts->max_group_value)); + DEBUG(4, "Groups higher USN value: [%s]\n", + state->ctx->srv_opts->max_group_value);
tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c index b111895..74258fa 100644 --- a/src/providers/ldap/sdap_async_groups.c +++ b/src/providers/ldap/sdap_async_groups.c @@ -67,7 +67,7 @@ static int sdap_find_entry_by_origDN(TALLOC_CTX *memctx, goto done; }
- DEBUG(9, ("Searching cache for [%s].\n", sanitized_dn)); + DEBUG(9, "Searching cache for [%s].\n", sanitized_dn); ret = sysdb_search_entry(tmpctx, ctx, base_dn, LDB_SCOPE_SUBTREE, filter, no_attrs, &num_msgs, &msgs); @@ -222,17 +222,17 @@ static int sdap_fill_memberships(struct sysdb_attrs *group_attrs, if (ret == ENOENT) { /* member may be outside of the configured search bases * or out of scope of nesting limit */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Member [%s] was not found in " - "cache. Is it out of scope?\n", (char *)values[i].data)); + DEBUG(SSSDBG_MINOR_FAILURE, "Member [%s] was not found in " + "cache. Is it out of scope?\n", (char *)values[i].data); continue; } if (ret != EOK) { goto done; }
- DEBUG(7, (" member #%d (%s): [%s]\n", + DEBUG(7, " member #%d (%s): [%s]\n", i, (char *)values[i].data, - (char *)el->values[j].data)); + (char *)el->values[j].data);
el->values[j].length = strlen((char *)el->values[j].data); j++; @@ -281,7 +281,7 @@ sdap_store_group_with_gid(struct sysdb_ctx *ctx, if (!posix_group) { ret = sysdb_attrs_add_uint32(group_attrs, SYSDB_GIDNUM, 0); if (ret) { - DEBUG(2, ("Could not set explicit GID 0 for %s\n", name)); + DEBUG(2, "Could not set explicit GID 0 for %s\n", name); return ret; } } @@ -289,7 +289,7 @@ sdap_store_group_with_gid(struct sysdb_ctx *ctx, ret = sysdb_store_group(ctx, domain, name, gid, group_attrs, cache_timeout, now); if (ret) { - DEBUG(2, ("Could not store group %s\n", name)); + DEBUG(2, "Could not store group %s\n", name); return ret; }
@@ -318,8 +318,8 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, ret = sysdb_attrs_get_el(attrs, SYSDB_GHOST, &gh); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading ghost attributes: [%s]\n", - strerror(ret))); + "Error reading ghost attributes: [%s]\n", + strerror(ret)); return ret; }
@@ -338,18 +338,18 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, memberel->values = NULL; } else if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading members: [%s]\n", strerror(ret))); + "Error reading members: [%s]\n", strerror(ret)); return ret; }
if (store_original_member) { - DEBUG(SSSDBG_TRACE_FUNC, ("The group has %d members\n", memberel->num_values)); + DEBUG(SSSDBG_TRACE_FUNC, "The group has %d members\n", memberel->num_values); for (i = 0; i < memberel->num_values; i++) { ret = sysdb_attrs_add_string(sysdb_attrs, SYSDB_ORIG_MEMBER, (const char *) memberel->values[i].data); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add member [%s]\n", - (const char *) memberel->values[i].data)); + DEBUG(SSSDBG_OP_FAILURE, "Could not add member [%s]\n", + (const char *) memberel->values[i].data); return ret; } } @@ -359,8 +359,8 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, ret = sysdb_attrs_get_el(sysdb_attrs, SYSDB_MEMBER, &sysdb_memberel); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading group members from group_attrs: [%s]\n", - strerror(ret))); + "Error reading group members from group_attrs: [%s]\n", + strerror(ret)); return ret; } sysdb_memberel->values = memberel->values; @@ -370,14 +370,14 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, ret = sysdb_attrs_get_el(sysdb_attrs, SYSDB_GHOST, &ghostel); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error getting ghost element: [%s]\n", strerror(ret))); + "Error getting ghost element: [%s]\n", strerror(ret)); return ret; } ghostel->values = gh->values; ghostel->num_values = gh->num_values;
cnt = ghostel->num_values + memberel->num_values; - DEBUG(SSSDBG_TRACE_FUNC, ("Group has %zu members\n", cnt)); + DEBUG(SSSDBG_TRACE_FUNC, "Group has %zu members\n", cnt);
/* Now process RFC2307bis ghost hash table */ if (ghosts && cnt > 0) { @@ -395,13 +395,13 @@ sdap_process_ghost_members(struct sysdb_attrs *attrs, continue; } else if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error checking hash table: [%s]\n", - hash_error_string(hret))); + "Error checking hash table: [%s]\n", + hash_error_string(hret)); return EFAULT; }
DEBUG(SSSDBG_TRACE_FUNC, - ("Adding ghost member for group [%s]\n", (char *) value.ptr)); + "Adding ghost member for group [%s]\n", (char *) value.ptr); ghostel->values[ghostel->num_values].data = \ (uint8_t *) talloc_strdup(ghostel->values, value.ptr); if (ghostel->values[ghostel->num_values].data == NULL) { @@ -451,10 +451,10 @@ static int sdap_save_group(TALLOC_CTX *memctx,
ret = sdap_get_group_primary_name(tmpctx, opts, attrs, dom, &group_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get group name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get group name\n"); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing group %s\n", group_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing group %s\n", group_name);
/* Always store SID string if available */ ret = sdap_attrs_get_sid_str(tmpctx, opts->idmap_ctx, attrs, @@ -463,17 +463,17 @@ static int sdap_save_group(TALLOC_CTX *memctx, if (ret == EOK) { ret = sysdb_attrs_add_string(group_attrs, SYSDB_SID_STR, sid_str); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not add SID string: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not add SID string: [%s]\n", + strerror(ret)); goto done; } } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_ALL, ("objectSID: not available for group [%s].\n", - group_name)); + DEBUG(SSSDBG_TRACE_ALL, "objectSID: not available for group [%s].\n", + group_name); sid_str = NULL; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not identify objectSID: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not identify objectSID: [%s]\n", + strerror(ret)); sid_str = NULL; }
@@ -483,28 +483,28 @@ static int sdap_save_group(TALLOC_CTX *memctx, posix_group = true;
if (sid_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("SID not available, cannot map a " \ - "unix ID to group [%s].\n", group_name)); + DEBUG(SSSDBG_MINOR_FAILURE, "SID not available, cannot map a " \ + "unix ID to group [%s].\n", group_name); ret = ENOENT; goto done; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping group [%s] objectSID [%s] to unix ID\n", - group_name, sid_str)); + "Mapping group [%s] objectSID [%s] to unix ID\n", + group_name, sid_str);
/* Convert the SID into a UNIX group ID */ ret = sdap_idmap_sid_to_unix(opts->idmap_ctx, sid_str, &gid); if (ret == ENOTSUP) { /* ENOTSUP is returned if built-in SID was provided * => do not store the group, but return EOK */ - DEBUG(SSSDBG_TRACE_FUNC, ("Skipping built-in object.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Skipping built-in object.\n"); ret = EOK; goto done; } else if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert SID string: [%s]\n", - strerror(ret))); + "Could not convert SID string: [%s]\n", + strerror(ret)); goto done; }
@@ -513,7 +513,7 @@ static int sdap_save_group(TALLOC_CTX *memctx, */ ret = sdap_replace_id(attrs, SYSDB_GIDNUM, gid); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the id-mapped GID\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set the id-mapped GID\n"); goto done; } } else { @@ -522,17 +522,17 @@ static int sdap_save_group(TALLOC_CTX *memctx, posix_group = true; } else if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error reading posix attribute: [%s]\n", - strerror(ret))); + "Error reading posix attribute: [%s]\n", + strerror(ret)); goto done; }
- DEBUG(8, ("This is%s a posix group\n", (posix_group)?"":" not")); + DEBUG(8, "This is%s a posix group\n", (posix_group)?"":" not"); ret = sysdb_attrs_add_bool(group_attrs, SYSDB_POSIX, posix_group); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting posix attribute: [%s]\n", - strerror(ret))); + "Error setting posix attribute: [%s]\n", + strerror(ret)); goto done; }
@@ -540,8 +540,8 @@ static int sdap_save_group(TALLOC_CTX *memctx, opts->group_map[SDAP_AT_GROUP_GID].sys_name, &gid); if (ret != EOK) { - DEBUG(1, ("no gid provided for [%s] in domain [%s].\n", - group_name, dom->name)); + DEBUG(1, "no gid provided for [%s] in domain [%s].\n", + group_name, dom->name); ret = EINVAL; goto done; } @@ -551,7 +551,7 @@ static int sdap_save_group(TALLOC_CTX *memctx, if (posix_group) { if (OUT_OF_ID_RANGE(gid, dom->id_min, dom->id_max)) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Group [%s] filtered out! (id out of range)\n", group_name)); + "Group [%s] filtered out! (id out of range)\n", group_name); ret = EINVAL; goto done; } @@ -562,8 +562,8 @@ static int sdap_save_group(TALLOC_CTX *memctx, group_name, group_attrs); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting original DN: [%s]\n", - strerror(ret))); + "Error setting original DN: [%s]\n", + strerror(ret)); goto done; }
@@ -573,8 +573,8 @@ static int sdap_save_group(TALLOC_CTX *memctx, group_name, group_attrs); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting mod timestamp: [%s]\n", - strerror(ret))); + "Error setting mod timestamp: [%s]\n", + strerror(ret)); goto done; }
@@ -582,21 +582,21 @@ static int sdap_save_group(TALLOC_CTX *memctx, opts->group_map[SDAP_AT_GROUP_USN].sys_name, &el); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error looking up group USN: [%s]\n", - strerror(ret))); + "Error looking up group USN: [%s]\n", + strerror(ret)); goto done; } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("Original USN value is not available for [%s].\n", group_name)); + "Original USN value is not available for [%s].\n", group_name); } else { ret = sysdb_attrs_add_string(group_attrs, opts->group_map[SDAP_AT_GROUP_USN].sys_name, (const char*)el->values[0].data); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error setting group USN: [%s]\n", - strerror(ret))); + "Error setting group USN: [%s]\n", + strerror(ret)); goto done; } usn_value = talloc_strdup(tmpctx, (const char*)el->values[0].data); @@ -610,16 +610,16 @@ static int sdap_save_group(TALLOC_CTX *memctx, populate_members, store_original_member, group_attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to save ghost members\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to save ghost members\n"); goto done; }
ret = sdap_save_all_names(group_name, attrs, dom, group_attrs); if (ret != EOK) { - DEBUG(1, ("Failed to save group names\n")); + DEBUG(1, "Failed to save group names\n"); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Storing info for group %s\n", group_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Storing info for group %s\n", group_name);
ret = sdap_store_group_with_gid(ctx, dom, group_name, gid, group_attrs, @@ -627,8 +627,8 @@ static int sdap_save_group(TALLOC_CTX *memctx, posix_group, now); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not store group with GID: [%s]\n", - strerror(ret))); + "Could not store group with GID: [%s]\n", + strerror(ret)); goto done; }
@@ -642,9 +642,9 @@ static int sdap_save_group(TALLOC_CTX *memctx, done: if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to save group [%s]: [%s]\n", + "Failed to save group [%s]: [%s]\n", group_name ? group_name : "Unknown", - strerror(ret))); + strerror(ret)); } talloc_free(tmpctx); return ret; @@ -673,10 +673,10 @@ static int sdap_save_grpmem(TALLOC_CTX *memctx,
ret = sdap_get_group_primary_name(memctx, opts, attrs, dom, &group_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get group name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get group name\n"); goto fail; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing group %s\n", group_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing group %s\n", group_name);
/* With AD we also want to merge in parent groups of primary GID as they * are reported with tokenGroups, too @@ -697,10 +697,10 @@ static int sdap_save_grpmem(TALLOC_CTX *memctx,
if (el->num_values == 0 && nuserdns == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("No members for group [%s]\n", group_name)); + "No members for group [%s]\n", group_name); } else { DEBUG(SSSDBG_TRACE_FUNC, - ("Adding member users to group [%s]\n", group_name)); + "Adding member users to group [%s]\n", group_name);
group_attrs = sysdb_new_attrs(memctx); if (!group_attrs) { @@ -724,7 +724,7 @@ static int sdap_save_grpmem(TALLOC_CTX *memctx,
fail: DEBUG(SSSDBG_OP_FAILURE, - ("Failed to save members of group %s\n", group_name)); + "Failed to save members of group %s\n", group_name); return ret; }
@@ -777,7 +777,7 @@ static int sdap_save_groups(TALLOC_CTX *memctx,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -804,9 +804,9 @@ static int sdap_save_groups(TALLOC_CTX *memctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ if (ret) { - DEBUG(2, ("Failed to store group %d. Ignoring.\n", i)); + DEBUG(2, "Failed to store group %d. Ignoring.\n", i); } else { - DEBUG(9, ("Group %d processed!\n", i)); + DEBUG(9, "Group %d processed!\n", i); if (twopass && !populate_members) { saved_groups[nsaved_groups] = groups[i]; nsaved_groups++; @@ -837,16 +837,16 @@ static int sdap_save_groups(TALLOC_CTX *memctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ if (ret) { - DEBUG(2, ("Failed to store group %d members.\n", i)); + DEBUG(2, "Failed to store group %d members.\n", i); } else { - DEBUG(9, ("Group %d members processed!\n", i)); + DEBUG(9, "Group %d members processed!\n", i); } } }
ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -859,7 +859,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } talloc_zfree(tmpctx); @@ -982,7 +982,7 @@ struct tevent_req *sdap_process_group_send(TALLOC_CTX *memctx,
/* Group without members */ if (el->num_values == 0) { - DEBUG(2, ("No Members. Done!\n")); + DEBUG(2, "No Members. Done!\n"); ret = EOK; goto done; } @@ -1032,7 +1032,7 @@ struct tevent_req *sdap_process_group_send(TALLOC_CTX *memctx, break;
default: - DEBUG(1, ("Unknown schema type %d\n", opts->schema_type)); + DEBUG(1, "Unknown schema type %d\n", opts->schema_type); ret = EINVAL; break; } @@ -1041,7 +1041,7 @@ done: /* We managed to process all the entries */ /* EBUSY means we need to wait for entries in LDAP */ if (ret == EOK) { - DEBUG(7, ("All group members processed\n")); + DEBUG(7, "All group members processed\n"); tevent_req_done(req); tevent_req_post(req, ev); } @@ -1070,11 +1070,11 @@ sdap_process_missing_member_2307bis(struct tevent_req *req, * connection. */ if (grp_state->check_count > GROUPMEMBER_REQ_PARALLEL) { - DEBUG(7, (" queueing search for: %s\n", user_dn)); + DEBUG(7, " queueing search for: %s\n", user_dn); if (!grp_state->queued_members) { DEBUG(SSSDBG_TRACE_LIBS, - ("Allocating queue for %zu members\n", - num_users - grp_state->check_count)); + "Allocating queue for %zu members\n", + num_users - grp_state->check_count);
grp_state->queued_members = talloc_array(grp_state, char *, num_users - grp_state->check_count + 1); @@ -1131,7 +1131,7 @@ sdap_process_group_members_2307bis(struct tevent_req *req, * User already cached in sysdb. Remember the sysdb DN for later * use by sdap_save_groups() */ - DEBUG(7, ("sysdbdn: %s\n", strdn)); + DEBUG(7, "sysdbdn: %s\n", strdn); state->sysdb_dns->values[state->sysdb_dns->num_values].data = (uint8_t*) strdn; state->sysdb_dns->values[state->sysdb_dns->num_values].length = @@ -1146,19 +1146,19 @@ sdap_process_group_members_2307bis(struct tevent_req *req, * Also, we don't want to be holding the sysdb * transaction while we're performing LDAP lookups. */ - DEBUG(7, ("Searching LDAP for missing user entry\n")); + DEBUG(7, "Searching LDAP for missing user entry\n"); ret = sdap_process_missing_member_2307bis(req, member_dn, memberel->num_values); if (ret != EOK) { - DEBUG(1, ("Error processing missing member #%d (%s):\n", - i, member_dn)); + DEBUG(1, "Error processing missing member #%d (%s):\n", + i, member_dn); return ret; } } } else { - DEBUG(1, ("Error checking cache for member #%d (%s):\n", - i, (char *)memberel->values[i].data)); + DEBUG(1, "Error checking cache for member #%d (%s):\n", + i, (char *)memberel->values[i].data); return ret; } } @@ -1231,7 +1231,7 @@ sdap_process_missing_member_2307(struct sdap_process_group_state *state, /* Entry exists but the group references it with an alias. */
if (count != 1) { - DEBUG(1, ("More than one entry with this alias?\n")); + DEBUG(1, "More than one entry with this alias?\n"); ret = EIO; goto done; } @@ -1240,8 +1240,8 @@ sdap_process_missing_member_2307(struct sdap_process_group_state *state, username = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (username == NULL) { ret = EINVAL; - DEBUG(SSSDBG_MINOR_FAILURE, ("Inconsistent sysdb: user " - "without primary name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Inconsistent sysdb: user " + "without primary name?\n"); goto done; } user_dn = sysdb_user_strdn(tmp_ctx, state->dom->name, username); @@ -1251,14 +1251,14 @@ sdap_process_missing_member_2307(struct sdap_process_group_state *state,
ret = sdap_add_group_member_2307(state->sysdb_dns, state->dom, user_dn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group member %s\n", username)); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group member %s\n", username); } } else if (ret == ENOENT || count == 0) { /* The entry really does not exist, add a ghost */ - DEBUG(SSSDBG_TRACE_FUNC, ("Adding a ghost entry\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Adding a ghost entry\n"); ret = sdap_add_group_member_2307(state->ghost_dns, state->dom, member_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group member %s\n", member_name)); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group member %s\n", member_name); } } else { ret = EIO; @@ -1295,7 +1295,7 @@ sdap_process_group_members_2307(struct sdap_process_group_state *state, * User already cached in sysdb. Remember the sysdb DN for later * use by sdap_save_groups() */ - DEBUG(7, ("Member already cached in sysdb: %s\n", member_name)); + DEBUG(7, "Member already cached in sysdb: %s\n", member_name);
userdn = sysdb_user_strdn(state->sysdb_dns, state->dom->name, member_name); if (userdn == NULL) { @@ -1304,23 +1304,23 @@ sdap_process_group_members_2307(struct sdap_process_group_state *state,
ret = sdap_add_group_member_2307(state->sysdb_dns, state->dom, userdn); if (ret != EOK) { - DEBUG(1, ("Could not add member %s into sysdb\n", member_name)); + DEBUG(1, "Could not add member %s into sysdb\n", member_name); goto done; } } else if (ret == ENOENT) { /* The user is not in sysdb, need to add it */ - DEBUG(7, ("member #%d (%s): not found in sysdb\n", - i, member_name)); + DEBUG(7, "member #%d (%s): not found in sysdb\n", + i, member_name);
ret = sdap_process_missing_member_2307(state, member_name, now); if (ret != EOK) { - DEBUG(1, ("Error processing missing member #%d (%s):\n", - i, member_name)); + DEBUG(1, "Error processing missing member #%d (%s):\n", + i, member_name); goto done; } } else { - DEBUG(1, ("Error checking cache for member #%d (%s):\n", - i, (char *) memberel->values[i].data)); + DEBUG(1, "Error checking cache for member #%d (%s):\n", + i, (char *) memberel->values[i].data); goto done; } } @@ -1350,7 +1350,7 @@ static void sdap_process_group_members(struct tevent_req *subreq) uint8_t* name_string;
state->check_count--; - DEBUG(SSSDBG_TRACE_ALL, ("Members remaining: %zu\n", state->check_count)); + DEBUG(SSSDBG_TRACE_ALL, "Members remaining: %zu\n", state->check_count);
ret = sdap_get_generic_recv(subreq, state, &count, &usr_attrs); talloc_zfree(subreq); @@ -1360,7 +1360,7 @@ static void sdap_process_group_members(struct tevent_req *subreq) if (count != 1) { ret = EINVAL; DEBUG(SSSDBG_TRACE_LIBS, - ("Expected one user entry and got %zu\n", count)); + "Expected one user entry and got %zu\n", count); goto next; } ret = sysdb_attrs_get_el(usr_attrs[0], @@ -1369,7 +1369,7 @@ static void sdap_process_group_members(struct tevent_req *subreq) ret = EINVAL; } if (ret) { - DEBUG(2, ("Failed to get the member's name\n")); + DEBUG(2, "Failed to get the member's name\n"); goto next; }
@@ -1383,8 +1383,8 @@ static void sdap_process_group_members(struct tevent_req *subreq) next: if (ret) { DEBUG(SSSDBG_TRACE_FUNC, - ("Error reading group member[%d]: %s. Skipping\n", - ret, strerror(ret))); + "Error reading group member[%d]: %s. Skipping\n", + ret, strerror(ret)); state->count--; } /* Are there more searches for uncached users to submit ? */ @@ -1420,8 +1420,8 @@ next: &el); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get the group member attribute [%d]: %s\n", - ret, strerror(ret))); + "Failed to get the group member attribute [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -1435,7 +1435,7 @@ next: } el->values = talloc_steal(state->group, state->ghost_dns->values); el->num_values = state->ghost_dns->num_values; - DEBUG(9, ("Processed Group - Done\n")); + DEBUG(9, "Processed Group - Done\n"); tevent_req_done(req); } } @@ -1514,7 +1514,7 @@ struct tevent_req *sdap_get_groups_send(TALLOC_CTX *memctx,
if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Group lookup request without a search base\n")); + "Group lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -1546,8 +1546,8 @@ static errno_t sdap_get_groups_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for groups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for groups with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -1589,11 +1589,11 @@ static void sdap_get_groups_process(struct tevent_req *subreq) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Search for groups, returned %zu results.\n", count)); + "Search for groups, returned %zu results.\n", count);
if (!state->enumeration && count > 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Individual group search returned multiple results\n")); + "Individual group search returned multiple results\n"); tevent_req_error(req, EINVAL); return; } @@ -1696,7 +1696,7 @@ static void sdap_get_groups_process(struct tevent_req *subreq)
ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(0, ("Failed to start transaction\n")); + DEBUG(0, "Failed to start transaction\n"); tevent_req_error(req, ret); return; } @@ -1704,13 +1704,13 @@ static void sdap_get_groups_process(struct tevent_req *subreq) if (state->enumeration && state->opts->schema_type != SDAP_SCHEMA_RFC2307 && dp_opt_get_int(state->opts->basic, SDAP_NESTING_LEVEL) != 0) { - DEBUG(9, ("Saving groups without members first " - "to allow unrolling of nested groups.\n")); + DEBUG(9, "Saving groups without members first " + "to allow unrolling of nested groups.\n"); ret = sdap_save_groups(state, state->sysdb, state->dom, state->opts, state->groups, state->count, false, NULL, NULL); if (ret) { - DEBUG(2, ("Failed to store groups.\n")); + DEBUG(2, "Failed to store groups.\n"); tevent_req_error(req, ret); return; } @@ -1745,18 +1745,18 @@ static void sdap_get_groups_done(struct tevent_req *subreq) if (ret) { sysret = sysdb_transaction_cancel(state->sysdb); if (sysret != EOK) { - DEBUG(0, ("Could not cancel sysdb transaction\n")); + DEBUG(0, "Could not cancel sysdb transaction\n"); } tevent_req_error(req, ret); return; }
state->check_count--; - DEBUG(SSSDBG_TRACE_ALL, ("Groups remaining: %zu\n", state->check_count)); + DEBUG(SSSDBG_TRACE_ALL, "Groups remaining: %zu\n", state->check_count);
if (state->check_count == 0) { - DEBUG(9, ("All groups processed\n")); + DEBUG(9, "All groups processed\n");
/* If ignore_group_members is set for the domain, don't update * group memberships in the cache. @@ -1766,14 +1766,14 @@ static void sdap_get_groups_done(struct tevent_req *subreq) !state->dom->ignore_group_members, NULL, &state->higher_usn); if (ret) { - DEBUG(2, ("Failed to store groups.\n")); + DEBUG(2, "Failed to store groups.\n"); tevent_req_error(req, ret); return; } - DEBUG(SSSDBG_TRACE_ALL, ("Saving %zu Groups - Done\n", state->count)); + DEBUG(SSSDBG_TRACE_ALL, "Saving %zu Groups - Done\n", state->count); sysret = sysdb_transaction_commit(state->sysdb); if (sysret != EOK) { - DEBUG(0, ("Couldn't commit transaction\n")); + DEBUG(0, "Couldn't commit transaction\n"); tevent_req_error(req, sysret); } else { tevent_req_done(req); @@ -1810,8 +1810,8 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not retrieve members using AD match rule. [%s]\n", - strerror(ret))); + "Could not retrieve members using AD match rule. [%s]\n", + strerror(ret));
goto done; } @@ -1845,8 +1845,8 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) &ghosts); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine which users are ghosts: [%s]\n", - strerror(ret))); + "Could not determine which users are ghosts: [%s]\n", + strerror(ret)); goto done; }
@@ -1872,7 +1872,7 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) * an originalDN. */ DEBUG(SSSDBG_MINOR_FAILURE, - ("BUG: Missing originalDN for user?\n")); + "BUG: Missing originalDN for user?\n"); goto done; }
@@ -1890,8 +1890,8 @@ static void sdap_ad_match_rule_members_process(struct tevent_req *subreq) false, ghosts, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not save group to the cache: [%s]\n", - strerror(ret))); + "Could not save group to the cache: [%s]\n", + strerror(ret)); goto done; }
@@ -1940,8 +1940,8 @@ static void sdap_nested_done(struct tevent_req *subreq) &group_count, &groups); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("Nested group processing failed: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Nested group processing failed: [%d][%s]\n", + ret, strerror(ret)); goto fail; }
@@ -1950,7 +1950,7 @@ static void sdap_nested_done(struct tevent_req *subreq) */ ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -1971,7 +1971,7 @@ static void sdap_nested_done(struct tevent_req *subreq)
ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -1984,7 +1984,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -2038,7 +2038,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction!\n"); goto done; } in_transaction = true; @@ -2048,7 +2048,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, domain, &username); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("User entry %d has no name attribute. Skipping\n", i)); + "User entry %d has no name attribute. Skipping\n", i); continue; }
@@ -2058,7 +2058,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("User entry %d has no originalDN attribute\n", i)); + "User entry %d has no originalDN attribute\n", i); goto done; } original_dn = (const char *) el->values[0].data; @@ -2067,7 +2067,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, &clean_orig_dn); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot sanitize originalDN [%s]\n", original_dn)); + "Cannot sanitize originalDN [%s]\n", original_dn); goto done; }
@@ -2084,13 +2084,13 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx, talloc_zfree(filter); talloc_zfree(clean_orig_dn); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("Error checking cache for user entry\n")); + DEBUG(1, "Error checking cache for user entry\n"); goto done; } else if (ret == EOK) { /* The entry is cached but expired. Update the username * if needed. */ if (count != 1) { - DEBUG(1, ("More than one entry with this origDN? Skipping\n")); + DEBUG(1, "More than one entry with this origDN? Skipping\n"); continue; }
@@ -2128,7 +2128,7 @@ static errno_t sdap_nested_group_populate_users(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -2138,7 +2138,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } }
diff --git a/src/providers/ldap/sdap_async_groups_ad.c b/src/providers/ldap/sdap_async_groups_ad.c index 9b61c69..28a509e 100644 --- a/src/providers/ldap/sdap_async_groups_ad.c +++ b/src/providers/ldap/sdap_async_groups_ad.c @@ -76,8 +76,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, NULL, &state->attrs, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not build attribute map: [%s]\n", - strerror(ret))); + "Could not build attribute map: [%s]\n", + strerror(ret)); goto immediate; }
@@ -85,8 +85,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(group, SYSDB_ORIG_DN, &group_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not retrieve originalDN for group: %s\n", - strerror(ret))); + "Could not retrieve originalDN for group: %s\n", + strerror(ret)); goto immediate; }
@@ -94,8 +94,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, ret = sss_filter_sanitize(state, group_dn, &sanitized_group_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not sanitize group DN: %s\n", - strerror(ret))); + "Could not sanitize group DN: %s\n", + strerror(ret)); goto immediate; }
@@ -119,8 +119,8 @@ sdap_get_ad_match_rule_members_send(TALLOC_CTX *mem_ctx, ret = sdap_get_ad_match_rule_members_next_base(req); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("sdap_get_ad_match_rule_members_next_base failed: [%s]\n", - strerror(ret))); + "sdap_get_ad_match_rule_members_next_base failed: [%s]\n", + strerror(ret)); goto immediate; }
@@ -149,8 +149,8 @@ sdap_get_ad_match_rule_members_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for users with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for users with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -183,13 +183,13 @@ sdap_get_ad_match_rule_members_step(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP search failed: [%s]\n", strerror(ret))); + "LDAP search failed: [%s]\n", strerror(ret)); tevent_req_error(req, ret); return; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Search for users returned %zu results\n", count)); + "Search for users returned %zu results\n", count);
/* Add this batch of users to the list */ if (count > 0) { @@ -225,7 +225,7 @@ sdap_get_ad_match_rule_members_step(struct tevent_req *subreq) /* No more search bases. We're done here. */ if (state->count == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("No users matched in any search base\n")); + "No users matched in any search base\n"); tevent_req_error(req, ENOENT); return; } diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c index e8de8d5..5ea11a0 100644 --- a/src/providers/ldap/sdap_async_initgroups.c +++ b/src/providers/ldap/sdap_async_initgroups.c @@ -69,7 +69,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, tmp_name = sss_get_domain_name(tmp_ctx, groupnames[i], domain); if (tmp_name == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to format original name [%s]\n", groupnames[i])); + "Failed to format original name [%s]\n", groupnames[i]); ret = ENOMEM; goto done; } @@ -80,14 +80,14 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, continue; } else if (ret == ENOENT) { missing[mi] = talloc_steal(missing, tmp_name); - DEBUG(7, ("Group #%d [%s][%s] is not cached, " \ + DEBUG(7, "Group #%d [%s][%s] is not cached, " \ "need to add a fake entry\n", - i, groupnames[i], missing[mi])); + i, groupnames[i], missing[mi]); mi++; continue; } else if (ret != ENOENT) { - DEBUG(1, ("search for group failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "search for group failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -105,8 +105,8 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, ret = sysdb_transaction_start(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot start sysdb transaction [%d]: %s\n", - ret, strerror(ret))); + "Cannot start sysdb transaction [%d]: %s\n", + ret, strerror(ret)); goto done; } in_transaction = true; @@ -120,7 +120,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, domain, &groupname); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("The group has no name attribute\n")); + "The group has no name attribute\n"); goto done; }
@@ -135,35 +135,35 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
if (use_id_mapping) { if (sid_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No SID for group [%s] " \ + DEBUG(SSSDBG_MINOR_FAILURE, "No SID for group [%s] " \ "while id-mapping.\n", - groupname)); + groupname); ret = EINVAL; goto done; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping group [%s] objectSID to unix ID\n", groupname)); + "Mapping group [%s] objectSID to unix ID\n", groupname);
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Group [%s] has objectSID [%s]\n", - groupname, sid_str)); + "Group [%s] has objectSID [%s]\n", + groupname, sid_str);
/* Convert the SID into a UNIX group ID */ ret = sdap_idmap_sid_to_unix(opts->idmap_ctx, sid_str, &gid); if (ret == EOK) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Group [%s] has mapped gid [%lu]\n", - groupname, (unsigned long)gid)); + "Group [%s] has mapped gid [%lu]\n", + groupname, (unsigned long)gid); } else { posix = false; gid = 0;
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Group [%s] cannot be mapped. " + "Group [%s] cannot be mapped. " "Treating as a non-POSIX group\n", - groupname)); + groupname); }
} else { @@ -171,15 +171,15 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, SYSDB_GIDNUM, &gid); if (ret == ENOENT || (ret == EOK && gid == 0)) { - DEBUG(SSSDBG_TRACE_LIBS, ("The group %s gid was %s\n", - groupname, ret == ENOENT ? "missing" : "zero")); + DEBUG(SSSDBG_TRACE_LIBS, "The group %s gid was %s\n", + groupname, ret == ENOENT ? "missing" : "zero"); DEBUG(SSSDBG_TRACE_FUNC, - ("Marking group %s as non-posix and setting GID=0!\n", - groupname)); + "Marking group %s as non-posix and setting GID=0!\n", + groupname); gid = 0; posix = false; } else if (ret) { - DEBUG(1, ("The GID attribute is malformed\n")); + DEBUG(1, "The GID attribute is malformed\n"); goto done; } } @@ -188,12 +188,12 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, SYSDB_ORIG_DN, &original_dn); if (ret) { - DEBUG(5, ("The group has no name original DN\n")); + DEBUG(5, "The group has no name original DN\n"); original_dn = NULL; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Adding fake group %s to sysdb\n", groupname)); + "Adding fake group %s to sysdb\n", groupname); ret = sysdb_add_incomplete_group(sysdb, domain, groupname, gid, original_dn, sid_str, posix, now); @@ -205,7 +205,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb, }
if (ai == ldap_groups_count) { - DEBUG(2, ("Group %s not present in LDAP\n", missing[i])); + DEBUG(2, "Group %s not present in LDAP\n", missing[i]); ret = EINVAL; goto done; } @@ -213,7 +213,7 @@ static errno_t sdap_add_incomplete_groups(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_transaction_commit failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_transaction_commit failed.\n"); goto done; } in_transaction = false; @@ -223,7 +223,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -262,8 +262,8 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb, opts->group_map[SDAP_AT_GROUP_NAME].name, &ldap_grouplist); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -277,7 +277,7 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -290,24 +290,24 @@ int sdap_initgr_common_store(struct sysdb_ctx *sysdb, add_groups, ldap_groups, ldap_groups_count); if (ret != EOK) { - DEBUG(1, ("Adding incomplete users failed\n")); + DEBUG(1, "Adding incomplete users failed\n"); goto done; } }
- DEBUG(8, ("Updating memberships for %s\n", name)); + DEBUG(8, "Updating memberships for %s\n", name); ret = sysdb_update_members(sysdb, domain, name, type, (const char *const *) add_groups, (const char *const *) del_groups); if (ret != EOK) { - DEBUG(1, ("Membership update failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "Membership update failed [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -317,7 +317,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_zfree(tmp_ctx); @@ -381,7 +381,7 @@ struct tevent_req *sdap_initgr_rfc2307_send(TALLOC_CTX *memctx,
if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups lookup request without a group search base\n")); + "Initgroups lookup request without a group search base\n"); ret = EINVAL; goto done; } @@ -456,8 +456,8 @@ static errno_t sdap_initgr_rfc2307_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for groups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for groups with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -588,15 +588,15 @@ sdap_nested_groups_store(struct sysdb_ctx *sysdb, opts->group_map[SDAP_AT_GROUP_NAME].name, &groupnamelist); if (ret != EOK) { - DEBUG(3, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } }
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -604,14 +604,14 @@ sdap_nested_groups_store(struct sysdb_ctx *sysdb, ret = sdap_add_incomplete_groups(sysdb, domain, opts, groupnamelist, groups, count); if (ret != EOK) { - DEBUG(6, ("Could not add incomplete groups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(6, "Could not add incomplete groups [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -621,7 +621,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } }
@@ -744,13 +744,13 @@ static struct tevent_req *sdap_initgr_nested_send(TALLOC_CTX *memctx,
ret = sdap_get_user_primary_name(memctx, opts, user, dom, &state->username); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("User entry had no username\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "User entry had no username\n"); goto immediate; }
ret = sysdb_attrs_get_el(state->user, SYSDB_MEMBEROF, &state->memberof); if (ret || !state->memberof || state->memberof->num_values == 0) { - DEBUG(4, ("User entry lacks original memberof ?\n")); + DEBUG(4, "User entry lacks original memberof ?\n"); /* We can't find any groups for this user, so we'll * have to assume there aren't any. Just return * success here. @@ -955,8 +955,8 @@ static void sdap_initgr_nested_search(struct tevent_req *subreq) state->groups_cur++; } else { DEBUG(SSSDBG_OP_FAILURE, - ("Search for group %s, returned %zu results. Skipping\n", - state->group_dns[state->cur], count)); + "Search for group %s, returned %zu results. Skipping\n", + state->group_dns[state->cur], count); }
state->cur++; @@ -1002,7 +1002,7 @@ static void sdap_initgr_nested_store(struct tevent_req *req)
ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -1010,30 +1010,30 @@ static void sdap_initgr_nested_store(struct tevent_req *req) /* save the groups if they are not already */ ret = sdap_initgr_store_groups(state); if (ret != EOK) { - DEBUG(3, ("Could not save groups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save groups [%d]: %s\n", + ret, strerror(ret)); goto fail; }
/* save the group memberships */ ret = sdap_initgr_store_group_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save group memberships [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save group memberships [%d]: %s\n", + ret, strerror(ret)); goto fail; }
/* save the user memberships */ ret = sdap_initgr_store_user_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save user memberships [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save user memberships [%d]: %s\n", + ret, strerror(ret)); goto fail; }
ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -1045,7 +1045,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -1101,8 +1101,8 @@ sdap_initgr_store_group_memberships(struct sdap_initgr_nested_state *state) state->groups_cur, &miter); if (ret) { - DEBUG(3, ("Could not compute memberships for group %d [%d]: %s\n", - i, ret, strerror(ret))); + DEBUG(3, "Could not compute memberships for group %d [%d]: %s\n", + i, ret, strerror(ret)); goto done; }
@@ -1111,7 +1111,7 @@ sdap_initgr_store_group_memberships(struct sdap_initgr_nested_state *state)
ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -1122,14 +1122,14 @@ sdap_initgr_store_group_memberships(struct sdap_initgr_nested_state *state) (const char *const *) miter->add, (const char *const *) miter->del); if (ret != EOK) { - DEBUG(3, ("Failed to update memberships\n")); + DEBUG(3, "Failed to update memberships\n"); goto done; } }
ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -1139,7 +1139,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -1174,7 +1174,7 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) /* Get direct LDAP parents */ ret = sysdb_attrs_get_string(state->user, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(2, ("The user has no original DN\n")); + DEBUG(2, "The user has no original DN\n"); goto done; }
@@ -1189,7 +1189,7 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) for (i=0; i < state->groups_cur ; i++) { ret = sysdb_attrs_get_el(state->groups[i], SYSDB_MEMBER, &el); if (ret) { - DEBUG(3, ("A group with no members during initgroups?\n")); + DEBUG(3, "A group with no members during initgroups?\n"); goto done; }
@@ -1203,8 +1203,8 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) } }
- DEBUG(7, ("The user %s is a direct member of %d LDAP groups\n", - state->username, nparents)); + DEBUG(7, "The user %s is a direct member of %d LDAP groups\n", + state->username, nparents);
if (nparents == 0) { ldap_parent_name_list = NULL; @@ -1215,8 +1215,8 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) state->opts->group_map[SDAP_AT_GROUP_NAME].name, &ldap_parent_name_list); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -1225,8 +1225,8 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state) SYSDB_MEMBER_USER, state->username, &sysdb_parent_name_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - state->username, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + state->username, ret, strerror(ret)); goto done; }
@@ -1239,19 +1239,19 @@ sdap_initgr_store_user_memberships(struct sdap_initgr_nested_state *state)
ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true;
- DEBUG(8, ("Updating memberships for %s\n", state->username)); + DEBUG(8, "Updating memberships for %s\n", state->username); ret = sysdb_update_members(state->sysdb, state->dom, state->username, SYSDB_MEMBER_USER, (const char *const *) add_groups, (const char *const *) del_groups); if (ret != EOK) { - DEBUG(1, ("Could not update sysdb memberships for %s: %d [%s]\n", - state->username, ret, strerror(ret))); + DEBUG(1, "Could not update sysdb memberships for %s: %d [%s]\n", + state->username, ret, strerror(ret)); goto done; }
@@ -1266,7 +1266,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_zfree(tmp_ctx); @@ -1311,8 +1311,8 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, SYSDB_MEMBER_GROUP, group_name, &sysdb_parents_names_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - group_name, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + group_name, ret, strerror(ret)); goto done; }
@@ -1324,12 +1324,12 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, &ldap_parentlist, &parents_count); if (ret != EOK) { - DEBUG(1, ("Cannot get parent groups for %s [%d]: %s\n", - group_name, ret, strerror(ret))); + DEBUG(1, "Cannot get parent groups for %s [%d]: %s\n", + group_name, ret, strerror(ret)); goto done; } - DEBUG(7, ("The group %s is a direct member of %d LDAP groups\n", - group_name, parents_count)); + DEBUG(7, "The group %s is a direct member of %d LDAP groups\n", + group_name, parents_count);
if (parents_count > 0) { ret = sysdb_attrs_primary_name_list(sysdb, tmp_ctx, @@ -1338,8 +1338,8 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, opts->group_map[SDAP_AT_GROUP_NAME].name, &ldap_parent_names_list); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_primary_name_list failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "sysdb_attrs_primary_name_list failed [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -1347,8 +1347,8 @@ sdap_initgr_nested_get_membership_diff(TALLOC_CTX *mem_ctx, ret = build_membership_diff(tmp_ctx, group_name, ldap_parent_names_list, sysdb_parents_names_list, &mdiff); if (ret != EOK) { - DEBUG(3, ("Could not build membership diff for %s [%d]: %s\n", - group_name, ret, strerror(ret))); + DEBUG(3, "Could not build membership diff for %s [%d]: %s\n", + group_name, ret, strerror(ret)); goto done; }
@@ -1388,10 +1388,10 @@ static int sdap_initgr_nested_get_direct_parents(TALLOC_CTX *mem_ctx,
ret = sysdb_attrs_get_string(attrs, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(3, ("Missing originalDN\n")); + DEBUG(3, "Missing originalDN\n"); goto done; } - DEBUG(9, ("Looking up direct parents for group [%s]\n", orig_dn)); + DEBUG(9, "Looking up direct parents for group [%s]\n", orig_dn);
/* FIXME - Filter only parents from full set to avoid searching * through all members of huge groups. That requires asking for memberOf @@ -1402,7 +1402,7 @@ static int sdap_initgr_nested_get_direct_parents(TALLOC_CTX *mem_ctx, for (i=0; i < ngroups; i++) { ret = sysdb_attrs_get_el(groups[i], SYSDB_MEMBER, &member); if (ret) { - DEBUG(7, ("A group with no members during initgroups?\n")); + DEBUG(7, "A group with no members during initgroups?\n"); continue; }
@@ -1417,7 +1417,7 @@ static int sdap_initgr_nested_get_direct_parents(TALLOC_CTX *mem_ctx, } direct_groups[ndirect] = NULL;
- DEBUG(9, ("The group [%s] has %d direct parents\n", orig_dn, ndirect)); + DEBUG(9, "The group [%s] has %d direct parents\n", orig_dn, ndirect);
*_direct_parents = talloc_steal(mem_ctx, direct_groups); *_ndirect = ndirect; @@ -1513,7 +1513,7 @@ static struct tevent_req *sdap_initgr_rfc2307bis_send(
if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups lookup request without a group search base\n")); + "Initgroups lookup request without a group search base\n"); ret = EINVAL; goto done; } @@ -1605,8 +1605,8 @@ static errno_t sdap_initgr_rfc2307bis_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for parent groups for user [%s] with base [%s]\n", - state->orig_dn, state->search_bases[state->base_iter]->basedn)); + "Searching for parent groups for user [%s] with base [%s]\n", + state->orig_dn, state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -1646,7 +1646,7 @@ static void sdap_initgr_rfc2307bis_process(struct tevent_req *subreq) return; } DEBUG(SSSDBG_TRACE_LIBS, - ("Found %zu parent groups for user [%s]\n", count, state->name)); + "Found %zu parent groups for user [%s]\n", count, state->name);
/* Add this batch of groups to the list */ if (count > 0) { @@ -1734,7 +1734,7 @@ static void sdap_initgr_rfc2307bis_done(struct tevent_req *subreq)
ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -1742,27 +1742,27 @@ static void sdap_initgr_rfc2307bis_done(struct tevent_req *subreq) /* save the groups if they are not cached */ ret = save_rfc2307bis_groups(state); if (ret != EOK) { - DEBUG(3, ("Could not save groups memberships [%d]", ret)); + DEBUG(3, "Could not save groups memberships [%d]", ret); goto fail; }
/* save the group membership */ ret = save_rfc2307bis_group_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save group memberships [%d]", ret)); + DEBUG(3, "Could not save group memberships [%d]", ret); goto fail; }
/* save the user memberships */ ret = save_rfc2307bis_user_memberships(state); if (ret != EOK) { - DEBUG(3, ("Could not save user memberships [%d]", ret)); + DEBUG(3, "Could not save user memberships [%d]", ret); goto fail; }
ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -1774,7 +1774,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -1835,8 +1835,8 @@ save_rfc2307bis_groups(struct sdap_initgr_rfc2307bis_state *state) ret = sdap_nested_groups_store(state->sysdb, state->dom, state->opts, groups, count); if (ret != EOK) { - DEBUG(3, ("Could not save groups [%d]: %s\n", - ret, strerror(ret))); + DEBUG(3, "Could not save groups [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -1889,7 +1889,7 @@ save_rfc2307bis_group_memberships(struct sdap_initgr_rfc2307bis_state *state)
ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to start transaction\n")); + DEBUG(1, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -1928,14 +1928,14 @@ save_rfc2307bis_group_memberships(struct sdap_initgr_rfc2307bis_state *state) (const char *const *) add, (const char *const *) iter->del); if (ret != EOK) { - DEBUG(3, ("Failed to update memberships\n")); + DEBUG(3, "Failed to update memberships\n"); goto done; } }
ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(1, ("Failed to commit transaction\n")); + DEBUG(1, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -1945,7 +1945,7 @@ done: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -1979,8 +1979,8 @@ rfc2307bis_group_memberships_build(hash_entry_t *item, void *user_data) SYSDB_MEMBER_GROUP, group_name, &sysdb_parents_names_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - group_name, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + group_name, ret, strerror(ret)); goto done; }
@@ -1997,8 +1997,8 @@ rfc2307bis_group_memberships_build(hash_entry_t *item, void *user_data) ret = build_membership_diff(tmp_ctx, group_name, ldap_parents_names_list, sysdb_parents_names_list, &mdiff); if (ret != EOK) { - DEBUG(3, ("Could not build membership diff for %s [%d]: %s\n", - group_name, ret, strerror(ret))); + DEBUG(3, "Could not build membership diff for %s [%d]: %s\n", + group_name, ret, strerror(ret)); goto done; }
@@ -2028,10 +2028,10 @@ errno_t save_rfc2307bis_user_memberships( return ENOMEM; }
- DEBUG(7, ("Save parent groups to sysdb\n")); + DEBUG(7, "Save parent groups to sysdb\n"); ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto error; } in_transaction = true; @@ -2040,8 +2040,8 @@ errno_t save_rfc2307bis_user_memberships( SYSDB_MEMBER_USER, state->name, &sysdb_parent_name_list); if (ret) { - DEBUG(1, ("Could not get direct sysdb parents for %s: %d [%s]\n", - state->name, ret, strerror(ret))); + DEBUG(1, "Could not get direct sysdb parents for %s: %d [%s]\n", + state->name, ret, strerror(ret)); goto error; }
@@ -2063,7 +2063,7 @@ errno_t save_rfc2307bis_user_memberships( tmp_str = sss_tc_fqname(ldap_grouplist, state->dom->names, state->dom, ldap_grouplist[c]); if (tmp_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_tc_fqname failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_tc_fqname failed.\n"); ret = ENOMEM; goto error; } @@ -2084,7 +2084,7 @@ errno_t save_rfc2307bis_user_memberships( goto error; }
- DEBUG(8, ("Updating memberships for %s\n", state->name)); + DEBUG(8, "Updating memberships for %s\n", state->name); ret = sysdb_update_members(state->sysdb, state->dom, state->name, SYSDB_MEMBER_USER, (const char *const *)add_groups, @@ -2095,7 +2095,7 @@ errno_t save_rfc2307bis_user_memberships(
ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto error; } in_transaction = false; @@ -2107,7 +2107,7 @@ error: if (in_transaction) { tret = sysdb_transaction_cancel(state->sysdb); if (tret != EOK) { - DEBUG(1, ("Failed to cancel transaction\n")); + DEBUG(1, "Failed to cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -2155,8 +2155,8 @@ struct tevent_req *rfc2307bis_nested_groups_send( struct sdap_rfc2307bis_nested_ctx *state;
DEBUG(SSSDBG_TRACE_INTERNAL, - ("About to process %zu groups in nesting level %zu\n", - num_groups, nesting)); + "About to process %zu groups in nesting level %zu\n", + num_groups, nesting);
req = tevent_req_create(mem_ctx, &state, struct sdap_rfc2307bis_nested_ctx); @@ -2186,8 +2186,8 @@ struct tevent_req *rfc2307bis_nested_groups_send( state->search_bases = opts->sdom->group_search_bases; if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups nested lookup request " - "without a group search base\n")); + "Initgroups nested lookup request " + "without a group search base\n"); ret = EINVAL; goto done; } @@ -2262,12 +2262,12 @@ static errno_t rfc2307bis_nested_groups_step(struct tevent_req *req) goto done; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Processing group [%s]\n", state->primary_name)); + DEBUG(SSSDBG_TRACE_LIBS, "Processing group [%s]\n", state->primary_name);
ret = hash_lookup(state->group_hash, &key, &value); if (ret == HASH_SUCCESS) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Group [%s] was already processed, " - "taking a shortcut\n", state->primary_name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Group [%s] was already processed, " + "taking a shortcut\n", state->primary_name); state->processed_groups[state->group_iter] = talloc_get_type(value.ptr, struct sdap_nested_group); talloc_free(key.str); @@ -2355,9 +2355,9 @@ static errno_t rfc2307bis_nested_groups_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for parent groups of group [%s] with base [%s]\n", + "Searching for parent groups of group [%s] with base [%s]\n", state->orig_dn, - state->search_bases[state->base_iter]->basedn)); + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -2404,7 +2404,7 @@ static void rfc2307bis_nested_groups_process(struct tevent_req *subreq) }
DEBUG(SSSDBG_TRACE_LIBS, - ("Found %zu parent groups of [%s]\n", count, state->orig_dn)); + "Found %zu parent groups of [%s]\n", count, state->orig_dn); ngr = state->processed_groups[state->group_iter];
/* Add this batch of groups to the list */ @@ -2433,8 +2433,8 @@ static void rfc2307bis_nested_groups_process(struct tevent_req *subreq)
ngr->ldap_parents[ngr->parents_count] = NULL; DEBUG(SSSDBG_TRACE_INTERNAL, - ("Total of %zu direct parents after this iteration\n", - ngr->parents_count)); + "Total of %zu direct parents after this iteration\n", + ngr->parents_count); }
state->base_iter++; @@ -2535,8 +2535,8 @@ static void rfc2307bis_nested_groups_done(struct tevent_req *subreq) ret = rfc2307bis_nested_groups_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(6, ("rfc2307bis_nested failed [%d][%s]\n", - ret, strerror(ret))); + DEBUG(6, "rfc2307bis_nested failed [%d][%s]\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -2609,7 +2609,7 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx, char *clean_name; bool use_id_mapping;
- DEBUG(9, ("Retrieving info for initgroups call\n")); + DEBUG(9, "Retrieving info for initgroups call\n");
req = tevent_req_create(memctx, &state, struct sdap_get_initgr_state); if (!req) return NULL; @@ -2630,7 +2630,7 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx, state->user_search_bases = sdom->user_search_bases; if (!state->user_search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Initgroups lookup request without a user search base\n")); + "Initgroups lookup request without a user search base\n"); ret = EINVAL; goto done; } @@ -2714,8 +2714,8 @@ static errno_t sdap_get_initgr_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for users with base [%s]\n", - state->user_search_bases[state->user_base_iter]->basedn)); + "Searching for users with base [%s]\n", + state->user_search_bases[state->user_base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -2746,7 +2746,7 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) const char *cname; bool in_transaction = false;
- DEBUG(9, ("Receiving info for the user\n")); + DEBUG(9, "Receiving info for the user\n");
ret = sdap_get_generic_recv(subreq, state, &count, &usr_attrs); talloc_zfree(subreq); @@ -2783,7 +2783,7 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) } } else if (count != 1) { DEBUG(SSSDBG_OP_FAILURE, - ("Expected one user entry and got %zu\n", count)); + "Expected one user entry and got %zu\n", count); tevent_req_error(req, EINVAL); return; } @@ -2792,12 +2792,12 @@ static void sdap_get_initgr_user(struct tevent_req *subreq)
ret = sysdb_transaction_start(state->sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; } in_transaction = true;
- DEBUG(9, ("Storing the user\n")); + DEBUG(9, "Storing the user\n");
ret = sdap_save_user(state, state->sysdb, state->opts, state->dom, @@ -2807,11 +2807,11 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) goto fail; }
- DEBUG(9, ("Commit change\n")); + DEBUG(9, "Commit change\n");
ret = sysdb_transaction_commit(state->sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -2819,12 +2819,12 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) ret = sysdb_get_real_name(state, state->sysdb, state->dom, state->name, &cname); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot canonicalize username\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot canonicalize username\n"); tevent_req_error(req, ret); return; }
- DEBUG(9, ("Process user's groups\n")); + DEBUG(9, "Process user's groups\n");
switch (state->opts->schema_type) { case SDAP_SCHEMA_RFC2307: @@ -2909,7 +2909,7 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(state->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } tevent_req_error(req, ret); @@ -2931,7 +2931,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) char *group_sid_str; struct sdap_options *opts = state->opts;
- DEBUG(9, ("Initgroups done\n")); + DEBUG(9, "Initgroups done\n");
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -2971,8 +2971,8 @@ static void sdap_get_initgr_done(struct tevent_req *subreq)
talloc_zfree(subreq); if (ret) { - DEBUG(9, ("Error in initgroups: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(9, "Error in initgroups: [%d][%s]\n", + ret, strerror(ret)); goto fail; }
@@ -2982,7 +2982,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq)
if (state->use_id_mapping) { DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping primary group to unix ID\n")); + "Mapping primary group to unix ID\n");
/* The primary group ID is just the RID part of the objectSID * of the group. Generate the GID by adding this to the domain @@ -3003,7 +3003,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) &dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", sid_str)); + "Could not parse domain SID from [%s]\n", sid_str); goto fail; }
@@ -3013,7 +3013,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) &primary_gid); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("no primary group ID provided\n")); + "no primary group ID provided\n"); ret = EINVAL; goto fail; } @@ -3035,7 +3035,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq) ret = sysdb_attrs_get_uint32_t(state->orig_user, SYSDB_GIDNUM, &primary_gid); if (ret != EOK) { - DEBUG(6, ("Could not find user's primary GID\n")); + DEBUG(6, "Could not find user's primary GID\n"); goto fail; } } @@ -3113,8 +3113,8 @@ static errno_t get_sysdb_grouplist_ex(TALLOC_CTX *mem_ctx, attrs, &msg); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Error searching user [%s] by name: [%s]\n", - name, strerror(ret))); + "Error searching user [%s] by name: [%s]\n", + name, strerror(ret)); goto done; }
@@ -3148,8 +3148,8 @@ static errno_t get_sysdb_grouplist_ex(TALLOC_CTX *mem_ctx, &sysdb_grouplist[i]); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine group name from [%s]: [%s]\n", - (const char *)groups->values[i].data, strerror(ret))); + "Could not determine group name from [%s]: [%s]\n", + (const char *)groups->values[i].data, strerror(ret)); goto done; } } diff --git a/src/providers/ldap/sdap_async_initgroups_ad.c b/src/providers/ldap/sdap_async_initgroups_ad.c index a0841a7..af60246 100644 --- a/src/providers/ldap/sdap_async_initgroups_ad.c +++ b/src/providers/ldap/sdap_async_initgroups_ad.c @@ -104,8 +104,8 @@ sdap_get_ad_match_rule_initgroups_send(TALLOC_CTX *mem_ctx, &state->attrs, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not build attribute map: [%s]\n", - strerror(ret))); + "Could not build attribute map: [%s]\n", + strerror(ret)); goto immediate; }
@@ -113,8 +113,8 @@ sdap_get_ad_match_rule_initgroups_send(TALLOC_CTX *mem_ctx, ret = sss_filter_sanitize(state, state->orig_dn, &sanitized_user_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not sanitize user DN: %s\n", - strerror(ret))); + "Could not sanitize user DN: %s\n", + strerror(ret)); goto immediate; }
@@ -140,8 +140,8 @@ sdap_get_ad_match_rule_initgroups_send(TALLOC_CTX *mem_ctx, ret = sdap_get_ad_match_rule_initgroups_next_base(req); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("sdap_get_ad_match_rule_members_next_base failed: [%s]\n", - strerror(ret))); + "sdap_get_ad_match_rule_members_next_base failed: [%s]\n", + strerror(ret)); goto immediate; }
@@ -170,8 +170,8 @@ sdap_get_ad_match_rule_initgroups_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for groups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for groups with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -207,12 +207,12 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP search failed: [%s]\n", strerror(ret))); + "LDAP search failed: [%s]\n", strerror(ret)); goto error; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Search for users returned %zu results\n", count)); + "Search for users returned %zu results\n", count);
/* Add this batch of groups to the list */ if (count > 0) { @@ -249,7 +249,7 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq)
if (state->count == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("User is not a member of any group in the search bases\n")); + "User is not a member of any group in the search bases\n"); }
/* Get the current sysdb group list for this user @@ -259,9 +259,9 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq) state->name, &sysdb_grouplist); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not get the list of groups for [%s] in the sysdb: " + "Could not get the list of groups for [%s] in the sysdb: " "[%s]\n", - state->name, strerror(ret))); + state->name, strerror(ret)); goto error; }
@@ -279,8 +279,8 @@ sdap_get_ad_match_rule_initgroups_step(struct tevent_req *subreq) state->count); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not store groups for user [%s]: [%s]\n", - state->name, strerror(ret))); + "Could not store groups for user [%s]: [%s]\n", + state->name, strerror(ret)); goto error; }
@@ -391,13 +391,13 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("LDAP search failed: [%s]\n", strerror(ret))); + "LDAP search failed: [%s]\n", strerror(ret)); goto done; }
if (user_count != 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("More than one result on a base search!\n")); + "More than one result on a base search!\n"); ret = EINVAL; goto done; } @@ -408,8 +408,8 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) if (ret != EOK) { if (ret == ENOENT) { DEBUG(SSSDBG_TRACE_LIBS, - ("No tokenGroups entries for [%s]\n", - state->username)); + "No tokenGroups entries for [%s]\n", + state->username); /* No groups in LDAP. We need to ensure that the * sysdb matches. */ @@ -425,8 +425,8 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) */ } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not read tokenGroups attribute: [%s]\n", - strerror(ret))); + "Could not read tokenGroups attribute: [%s]\n", + strerror(ret)); goto done; } } @@ -454,36 +454,36 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) &sid_str); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert binary SID to string: [%s]. Skipping\n", - idmap_error_string(err))); + "Could not convert binary SID to string: [%s]. Skipping\n", + idmap_error_string(err)); continue; } DEBUG(SSSDBG_TRACE_LIBS, - ("Processing membership SID [%s]\n", - sid_str)); + "Processing membership SID [%s]\n", + sid_str); ret = sdap_idmap_sid_to_unix(state->opts->idmap_ctx, sid_str, &gid); if (ret == ENOTSUP) { - DEBUG(SSSDBG_TRACE_FUNC, ("Skipping built-in object.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Skipping built-in object.\n"); ret = EOK; continue; } else if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert SID to GID: [%s]. Skipping\n", - strerror(ret))); + "Could not convert SID to GID: [%s]. Skipping\n", + strerror(ret)); continue; }
group_domain = find_subdomain_by_sid(get_domains_head(state->domain), sid_str); if (group_domain == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Domain not found for SID %s\n", - sid_str)); + DEBUG(SSSDBG_MINOR_FAILURE, "Domain not found for SID %s\n", + sid_str); continue; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Processing membership GID [%"SPRIgid"]\n", gid)); + "Processing membership GID [%"SPRIgid"]\n", gid);
/* Check whether this GID already exists in the sysdb */ ret = sysdb_search_group_by_gid(tmp_ctx, group_domain->sysdb, @@ -492,7 +492,7 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) group_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); if (!group_name) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not retrieve group name from sysdb\n")); + "Could not retrieve group name from sysdb\n"); ret = EINVAL; goto done; } @@ -510,29 +510,29 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) NULL, sid_str, false, now); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not create incomplete group: [%s]\n", - strerror(ret))); + "Could not create incomplete group: [%s]\n", + strerror(ret)); goto done; } } else { /* Unexpected error */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not look up group in sysdb: [%s]\n", - strerror(ret))); + "Could not look up group in sysdb: [%s]\n", + strerror(ret)); goto done; }
group_ldb_dn = sysdb_group_dn(group_domain->sysdb, tmp_ctx, group_domain, group_name); if (group_ldb_dn == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_group_dn() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_group_dn() failed\n"); ret = ENOMEM; goto done; }
group_str_dn = ldb_dn_get_linearized(group_ldb_dn); if (group_str_dn == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("ldb_dn_get_linearized() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "ldb_dn_get_linearized() failed\n"); ret = EINVAL; goto done; } @@ -558,9 +558,9 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) state->username, &sysdb_grouplist); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not get the list of groups for [%s] in the sysdb: " + "Could not get the list of groups for [%s] in the sysdb: " "[%s]\n", - state->username, strerror(ret))); + state->username, strerror(ret)); goto done; }
@@ -572,23 +572,23 @@ sdap_get_ad_tokengroups_initgroups_lookup_done(struct tevent_req *subreq) if (ret != EOK) goto done;
DEBUG(SSSDBG_TRACE_LIBS, - ("Updating memberships for [%s]\n", state->username)); + "Updating memberships for [%s]\n", state->username); ret = sysdb_update_members_dn(state->sysdb, state->domain, state->username, SYSDB_MEMBER_USER, (const char *const *) add_groups, (const char *const *) del_groups); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Membership update failed [%d]: %s\n", - ret, strerror(ret))); + "Membership update failed [%d]: %s\n", + ret, strerror(ret)); goto done; }
ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not commit transaction! [%s]\n", - strerror(ret))); + "Could not commit transaction! [%s]\n", + strerror(ret)); goto done; } in_transaction = false; @@ -597,8 +597,8 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(state->sysdb); DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not cancel transaction! [%s]\n", - strerror(sret))); + "Could not cancel transaction! [%s]\n", + strerror(sret)); }
if (ret == EOK) { diff --git a/src/providers/ldap/sdap_async_nested_groups.c b/src/providers/ldap/sdap_async_nested_groups.c index 7040c6e..b3feacc 100644 --- a/src/providers/ldap/sdap_async_nested_groups.c +++ b/src/providers/ldap/sdap_async_nested_groups.c @@ -197,8 +197,8 @@ static errno_t sdap_nested_group_hash_entry(hash_table_t *table, return ret; }
- DEBUG(SSSDBG_TRACE_ALL, ("Inserting [%s] into hash table [%s]\n", - name, table_name)); + DEBUG(SSSDBG_TRACE_ALL, "Inserting [%s] into hash table [%s]\n", + name, table_name);
key.type = HASH_KEY_STRING; key.str = talloc_strdup(NULL, name); @@ -245,15 +245,15 @@ sdap_nested_group_hash_group(struct sdap_nested_group_ctx *group_ctx, &gid); if (ret == ENOENT || (ret == EOK && gid == 0)) { DEBUG(SSSDBG_TRACE_ALL, - ("The group's gid was %s\n", ret == ENOENT ? "missing" : "zero")); + "The group's gid was %s\n", ret == ENOENT ? "missing" : "zero"); DEBUG(SSSDBG_TRACE_INTERNAL, - ("Marking group as non-posix and setting GID=0!\n")); + "Marking group as non-posix and setting GID=0!\n"); if (ret == ENOENT) { ret = sysdb_attrs_add_uint32(group, map[SDAP_AT_GROUP_GID].sys_name, 0); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to add a GID to non-posix group!\n")); + "Failed to add a GID to non-posix group!\n"); return ret; } } @@ -261,7 +261,7 @@ sdap_nested_group_hash_group(struct sdap_nested_group_ctx *group_ctx, ret = sysdb_attrs_add_bool(group, SYSDB_POSIX, false); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error: Failed to mark group as non-posix!\n")); + "Error: Failed to mark group as non-posix!\n"); return ret; } } else if (ret != EOK) { @@ -297,7 +297,7 @@ static errno_t sdap_nested_group_sysdb_search(struct sss_domain_info *domain, }
if (count != 1) { - DEBUG(SSSDBG_OP_FAILURE, ("More than one entry found?\n")); + DEBUG(SSSDBG_OP_FAILURE, "More than one entry found?\n"); ret = EFAULT; goto done; } @@ -307,7 +307,7 @@ static errno_t sdap_nested_group_sysdb_search(struct sss_domain_info *domain, if (user) { uid = ldb_msg_find_attr_as_uint64(msgs[0], SYSDB_UIDNUM, 0); if (uid == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("User with no UID?\n")); + DEBUG(SSSDBG_OP_FAILURE, "User with no UID?\n"); ret = EINVAL; goto done; } @@ -340,7 +340,7 @@ sdap_nested_group_check_cache(struct sss_domain_info *domain,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -411,7 +411,7 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -457,7 +457,7 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx, ret = sdap_nested_group_check_cache(group_ctx->domain, dn, &type); if (ret == EOK) { /* found and valid */ - DEBUG(SSSDBG_TRACE_ALL, ("[%s] found in cache, skipping\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] found in cache, skipping\n", dn); continue; } else if (ret != EAGAIN && ret != ENOENT) { /* error */ @@ -477,18 +477,18 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx,
if (is_user && is_group) { /* search bases overlap */ - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is unknown object\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is unknown object\n", dn); type = SDAP_NESTED_GROUP_DN_UNKNOWN; } else if (is_user) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is a user\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is a user\n", dn); type = SDAP_NESTED_GROUP_DN_USER; } else if (is_group) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is a group\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is a group\n", dn); type = SDAP_NESTED_GROUP_DN_GROUP; } else { /* dn is outside search bases */ - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is out of scope of configured " - "search bases, skipping\n", dn)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is out of scope of configured " + "search bases, skipping\n", dn); continue; } } @@ -496,8 +496,8 @@ sdap_nested_group_split_members(TALLOC_CTX *mem_ctx, /* check nesting level */ if (type == SDAP_NESTED_GROUP_DN_GROUP) { if (nesting_level >= group_ctx->max_nesting_level) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is outside nesting limit " - "(level %d), skipping\n", dn, nesting_level)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is outside nesting limit " + "(level %d), skipping\n", dn, nesting_level); talloc_zfree(user_filter); talloc_zfree(group_filter); continue; @@ -571,7 +571,7 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -584,15 +584,15 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx,
ret = sss_hash_create(state->group_ctx, 32, &state->group_ctx->users); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to create hash table [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create hash table [%d]: %s\n", + ret, strerror(ret)); goto immediately; }
ret = sss_hash_create(state->group_ctx, 32, &state->group_ctx->groups); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to create hash table [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create hash table [%d]: %s\n", + ret, strerror(ret)); goto immediately; }
@@ -617,8 +617,8 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, if (state->group_ctx->try_deref) { for (i = 0; opts->sdom->user_search_bases[i] != NULL; i++) { if (opts->sdom->user_search_bases[i]->filter != NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("User search base contains filter, " - "dereference will be disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "User search base contains filter, " + "dereference will be disabled\n"); state->group_ctx->try_deref = false; break; } @@ -628,8 +628,8 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, if (state->group_ctx->try_deref) { for (i = 0; opts->sdom->group_search_bases[i] != NULL; i++) { if (opts->sdom->group_search_bases[i]->filter != NULL) { - DEBUG(SSSDBG_TRACE_FUNC, ("Group search base contains filter, " - "dereference will be disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Group search base contains filter, " + "dereference will be disabled\n"); state->group_ctx->try_deref = false; break; } @@ -639,8 +639,8 @@ sdap_nested_group_send(TALLOC_CTX *mem_ctx, /* insert initial group into hash table */ ret = sdap_nested_group_hash_group(state->group_ctx, group); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to insert group into hash table " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to insert group into hash table " + "[%d]: %s\n", ret, strerror(ret)); goto immediately; }
@@ -708,8 +708,8 @@ errno_t sdap_nested_group_recv(TALLOC_CTX *mem_ctx, return ret; }
- DEBUG(SSSDBG_TRACE_FUNC, ("%lu users found in the hash table\n", - num_users)); + DEBUG(SSSDBG_TRACE_FUNC, "%lu users found in the hash table\n", + num_users);
ret = sdap_nested_group_extract_hash_table(state, state->group_ctx->groups, &num_groups, &groups); @@ -717,8 +717,8 @@ errno_t sdap_nested_group_recv(TALLOC_CTX *mem_ctx, return ret; }
- DEBUG(SSSDBG_TRACE_FUNC, ("%lu groups found in the hash table\n", - num_groups)); + DEBUG(SSSDBG_TRACE_FUNC, "%lu groups found in the hash table\n", + num_groups);
if (_num_users != NULL) { *_num_users = num_users; @@ -770,7 +770,7 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_process_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -782,8 +782,8 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, /* get original dn */ ret = sysdb_attrs_get_string(group, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve original dn " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve original dn " + "[%d]: %s\n", ret, strerror(ret)); goto immediately; }
@@ -793,7 +793,7 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("About to process group [%s]\n", orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "About to process group [%s]\n", orig_dn);
/* get member list */ ret = sysdb_attrs_get_el(group, group_map[SDAP_AT_GROUP_MEMBER].sys_name, @@ -802,8 +802,8 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, ret = EOK; /* no members */ goto immediately; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve member list " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve member list " + "[%d]: %s\n", ret, strerror(ret)); goto immediately; }
@@ -814,8 +814,8 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, &state->num_missing_total, &state->num_missing_groups);
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Looking up %d/%d members of group [%s]\n", - state->num_missing_total, members->num_values, orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Looking up %d/%d members of group [%s]\n", + state->num_missing_total, members->num_values, orig_dn);
if (state->num_missing_total == 0) { ret = EOK; /* we're done */ @@ -825,15 +825,15 @@ sdap_nested_group_process_send(TALLOC_CTX *mem_ctx, /* process members */ if (group_ctx->try_deref && state->num_missing_total > group_ctx->deref_treshold) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Dereferencing members of group [%s]\n", - orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Dereferencing members of group [%s]\n", + orig_dn); state->deref = true; subreq = sdap_nested_group_deref_send(state, ev, group_ctx, members, orig_dn, state->nesting_level); } else { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Members of group [%s] will be " - "processed individually\n", orig_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Members of group [%s] will be " + "processed individually\n", orig_dn); state->deref = false; subreq = sdap_nested_group_single_send(state, ev, group_ctx, state->missing, @@ -878,8 +878,8 @@ static void sdap_nested_group_process_done(struct tevent_req *subreq) state->group_ctx->try_deref = false; state->deref = false;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Members of group [%s] will be " - "processed individually\n", state->group_dn)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Members of group [%s] will be " + "processed individually\n", state->group_dn);
subreq = sdap_nested_group_single_send(state, state->ev, @@ -945,7 +945,7 @@ sdap_nested_group_recurse_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_recurse_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -1067,7 +1067,7 @@ sdap_nested_group_single_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_single_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -1191,12 +1191,12 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) /* save user in hash table */ ret = sdap_nested_group_hash_user(state->group_ctx, entry); if (ret == EEXIST) { - DEBUG(SSSDBG_TRACE_FUNC, ("User was looked up twice, " - "this shouldn't have happened.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "User was looked up twice, " + "this shouldn't have happened.\n"); goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to save user in hash table " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save user in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; } break; @@ -1220,12 +1220,12 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) ret = sysdb_attrs_get_string(entry, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The entry has no originalDN\n")); + "The entry has no originalDN\n"); orig_dn = "invalid"; }
- DEBUG(SSSDBG_TRACE_ALL, ("[%s] is outside nesting limit " - "(level %d), skipping\n", orig_dn, state->nesting_level)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is outside nesting limit " + "(level %d), skipping\n", orig_dn, state->nesting_level); break; } } @@ -1233,12 +1233,12 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) /* save group in hash table */ ret = sdap_nested_group_hash_group(state->group_ctx, entry); if (ret == EEXIST) { - DEBUG(SSSDBG_TRACE_FUNC, ("Group was looked up twice, " - "this shouldn't have happened.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Group was looked up twice, " + "this shouldn't have happened.\n"); goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to save group in hash table " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save group in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -1271,8 +1271,8 @@ static void sdap_nested_group_single_step_done(struct tevent_req *subreq) ret = sdap_nested_group_single_step_process(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error processing direct membership " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error processing direct membership " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -1302,7 +1302,7 @@ static void sdap_nested_group_single_step_done(struct tevent_req *subreq) done: if (ret == EOK) { /* tevent_req_error() cannot cope with EOK */ - DEBUG(SSSDBG_CRIT_FAILURE, ("We should not get here with EOK\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "We should not get here with EOK\n"); tevent_req_error(req, EINVAL); } else if (ret != EAGAIN) { tevent_req_error(req, ret); @@ -1322,8 +1322,8 @@ static void sdap_nested_group_single_done(struct tevent_req *subreq) ret = sdap_nested_group_recurse_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error processing nested groups " - "[%d]: %s", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error processing nested groups " + "[%d]: %s", ret, strerror(ret)); tevent_req_error(req, ret); }
@@ -1474,7 +1474,7 @@ sdap_nested_group_lookup_user_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_lookup_user_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -1487,8 +1487,8 @@ sdap_nested_group_lookup_user_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_MINOR_FAILURE, ("Couldn't parse out user information " - "based on DN %s, falling back to an LDAP lookup\n", member->dn)); + DEBUG(SSSDBG_MINOR_FAILURE, "Couldn't parse out user information " + "based on DN %s, falling back to an LDAP lookup\n", member->dn); }
/* only pull down username and originalDN */ @@ -1571,7 +1571,7 @@ static void sdap_nested_group_lookup_user_done(struct tevent_req *subreq) state->user = NULL; } else { DEBUG(SSSDBG_OP_FAILURE, - ("BASE search returned more than one records\n")); + "BASE search returned more than one records\n"); ret = EIO; goto done; } @@ -1627,7 +1627,7 @@ sdap_nested_group_lookup_group_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_lookup_group_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -1707,7 +1707,7 @@ static void sdap_nested_group_lookup_group_done(struct tevent_req *subreq) state->group = NULL; } else { DEBUG(SSSDBG_OP_FAILURE, - ("BASE search returned more than one records\n")); + "BASE search returned more than one records\n"); ret = EIO; goto done; } @@ -1767,7 +1767,7 @@ sdap_nested_group_lookup_unknown_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_lookup_unknown_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -1946,7 +1946,7 @@ sdap_nested_group_deref_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_nested_group_deref_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -2037,8 +2037,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Received %zu dereference results, " - "about to process them\n", num_entries)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Received %zu dereference results, " + "about to process them\n", num_entries);
/* * We don't have any knowledge about possible number of groups when @@ -2056,7 +2056,7 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) ret = sysdb_attrs_get_string(entries[i]->attrs, SYSDB_ORIG_DN, &orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The entry has no originalDN\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The entry has no originalDN\n"); goto done; }
@@ -2113,8 +2113,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) entries[i]->attrs); if (ret != EOK && ret != EEXIST) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to save user in hash table " - "[%d]: %s\n", ret, strerror(ret))); + "Unable to save user in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -2123,8 +2123,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq)
/* skip the group if we have reached the nesting limit */ if (state->nesting_level >= state->group_ctx->max_nesting_level) { - DEBUG(SSSDBG_TRACE_ALL, ("[%s] is outside nesting limit " - "(level %d), skipping\n", orig_dn, state->nesting_level)); + DEBUG(SSSDBG_TRACE_ALL, "[%s] is outside nesting limit " + "(level %d), skipping\n", orig_dn, state->nesting_level); continue; }
@@ -2142,8 +2142,8 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) continue; } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to save group in hash table " - "[%d]: %s\n", ret, strerror(ret))); + "Unable to save group in hash table " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -2154,7 +2154,7 @@ sdap_nested_group_deref_direct_process(struct tevent_req *subreq) } else { /* this should never happen, but if it does, do not loop forever */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Entry does not match any known map, skipping\n")); + "Entry does not match any known map, skipping\n"); continue; } } @@ -2191,8 +2191,8 @@ static void sdap_nested_group_deref_direct_done(struct tevent_req *subreq) ret = sdap_nested_group_deref_direct_process(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error processing direct membership " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Error processing direct membership " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -2215,7 +2215,7 @@ static void sdap_nested_group_deref_direct_done(struct tevent_req *subreq) done: if (ret == EOK) { /* tevent_req_error() cannot cope with EOK */ - DEBUG(SSSDBG_CRIT_FAILURE, ("We should not get here with EOK\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "We should not get here with EOK\n"); tevent_req_error(req, EINVAL); } else if (ret != EAGAIN) { tevent_req_error(req, ret); diff --git a/src/providers/ldap/sdap_async_netgroups.c b/src/providers/ldap/sdap_async_netgroups.c index b47b3e5..9965669 100644 --- a/src/providers/ldap/sdap_async_netgroups.c +++ b/src/providers/ldap/sdap_async_netgroups.c @@ -55,11 +55,11 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx,
ret = sdap_get_netgroup_primary_name(memctx, opts, attrs, dom, &name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get netgroup name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get netgroup name\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Processing netgroup %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing netgroup %s\n", name);
netgroup_attrs = sysdb_new_attrs(memctx); if (!netgroup_attrs) { @@ -81,8 +81,8 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, goto fail; } if (el->num_values == 0) { - DEBUG(7, ("Original mod-Timestamp is not available for [%s].\n", - name)); + DEBUG(7, "Original mod-Timestamp is not available for [%s].\n", + name); } else { ret = sysdb_attrs_add_string(netgroup_attrs, opts->netgroup_map[SDAP_AT_NETGROUP_MODSTAMP].sys_name, @@ -119,12 +119,12 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, goto fail; }
- DEBUG(6, ("Storing info for netgroup %s\n", name)); + DEBUG(6, "Storing info for netgroup %s\n", name);
ret = sdap_save_all_names(name, attrs, dom, netgroup_attrs); if (ret != EOK) { - DEBUG(1, ("Failed to save netgroup names\n")); + DEBUG(1, "Failed to save netgroup names\n"); goto fail; }
@@ -134,7 +134,7 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, ret = list_missing_attrs(attrs, opts->netgroup_map, SDAP_OPTS_NETGROUP, attrs, &missing); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to list missing attributes\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to list missing attributes\n"); goto fail; }
@@ -149,7 +149,7 @@ static errno_t sdap_save_netgroup(TALLOC_CTX *memctx, return EOK;
fail: - DEBUG(2, ("Failed to save netgroup %s\n", name)); + DEBUG(2, "Failed to save netgroup %s\n", name); return ret; }
@@ -172,14 +172,14 @@ errno_t update_dn_list(struct dn_item *dn_list, const size_t count, for(c = 0; c < count; c++) { dn = ldb_msg_find_attr_as_string(res[c], SYSDB_ORIG_DN, NULL); if (dn == NULL) { - DEBUG(1, ("Missing original DN.\n")); + DEBUG(1, "Missing original DN.\n"); return EINVAL; } if (strcmp(dn, dn_item->dn) == 0) { - DEBUG(9, ("Found matching entry for [%s].\n", dn_item->dn)); + DEBUG(9, "Found matching entry for [%s].\n", dn_item->dn); cn = ldb_msg_find_attr_as_string(res[c], SYSDB_NAME, NULL); if (cn == NULL) { - DEBUG(1, ("Missing name.\n")); + DEBUG(1, "Missing name.\n"); return EINVAL; } dn_item->cn = talloc_strdup(dn_item, cn); @@ -258,7 +258,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, SYSDB_ORIG_NETGROUP_MEMBER, state, &member_list); if (ret != EOK) { - DEBUG(7, ("Missing netgroup members.\n")); + DEBUG(7, "Missing netgroup members.\n"); continue; }
@@ -266,12 +266,12 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, if (is_dn(member_list[mc])) { dn_item = talloc_zero(state, struct dn_item); if (dn_item == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); ret = ENOMEM; goto fail; }
- DEBUG(9, ("Adding [%s] to DN list.\n", member_list[mc])); + DEBUG(9, "Adding [%s] to DN list.\n", member_list[mc]); dn_item->netgroup = netgroups[c]; dn_item->dn = member_list[mc]; DLIST_ADD(state->dn_list, dn_item); @@ -279,7 +279,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, ret = sysdb_attrs_add_string(netgroups[c], SYSDB_NETGROUP_MEMBER, member_list[mc]); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); goto fail; } } @@ -287,7 +287,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, }
if (state->dn_list == NULL) { - DEBUG(9, ("No DNs found among netgroup members.\n")); + DEBUG(9, "No DNs found among netgroup members.\n"); tevent_req_done(req); tevent_req_post(req, ev); return req; @@ -295,7 +295,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx,
dn_filter = talloc_strdup(state, "(|"); if (dn_filter == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); ret = ENOMEM;; goto fail; } @@ -304,7 +304,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, dn_filter = talloc_asprintf_append(dn_filter, "(%s=%s)", SYSDB_ORIG_DN, dn_item->dn); if (dn_filter == NULL) { - DEBUG(1, ("talloc_asprintf_append failed.\n")); + DEBUG(1, "talloc_asprintf_append failed.\n"); ret = ENOMEM; goto fail; } @@ -312,14 +312,14 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx,
dn_filter = talloc_asprintf_append(dn_filter, ")"); if (dn_filter == NULL) { - DEBUG(1, ("talloc_asprintf_append failed.\n")); + DEBUG(1, "talloc_asprintf_append failed.\n"); ret = ENOMEM; goto fail; }
sysdb_filter = talloc_asprintf(state, "(&(%s)%s)", SYSDB_NC, dn_filter); if (sysdb_filter == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto fail; } @@ -335,7 +335,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, talloc_zfree(netgr_basedn); talloc_zfree(sysdb_filter); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("sysdb_search_entry failed.\n")); + DEBUG(1, "sysdb_search_entry failed.\n"); goto fail; }
@@ -343,7 +343,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, ret = update_dn_list(state->dn_list, sysdb_count, sysdb_res, &all_resolved); if (ret != EOK) { - DEBUG(1, ("update_dn_list failed.\n")); + DEBUG(1, "update_dn_list failed.\n"); goto fail; }
@@ -353,7 +353,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, SYSDB_NETGROUP_MEMBER, dn_item->cn); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); goto fail; } } @@ -367,7 +367,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx, state->dn_idx = state->dn_list; ret = netgr_translate_members_ldap_step(req); if (ret != EOK && ret != EAGAIN) { - DEBUG(1, ("netgr_translate_members_ldap_step failed.\n")); + DEBUG(1, "netgr_translate_members_ldap_step failed.\n"); goto fail; }
@@ -410,7 +410,7 @@ static errno_t netgr_translate_members_ldap_step(struct tevent_req *req) SYSDB_NETGROUP_MEMBER, state->dn_item->cn); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); tevent_req_error(req, ret); return ret; } @@ -430,14 +430,14 @@ static errno_t netgr_translate_members_ldap_step(struct tevent_req *req)
cn_attr = talloc_array(state, const char *, 3); if (cn_attr == NULL) { - DEBUG(1, ("talloc_array failed.\n")); + DEBUG(1, "talloc_array failed.\n"); return ENOMEM; } cn_attr[0] = state->opts->netgroup_map[SDAP_AT_NETGROUP_NAME].name; cn_attr[1] = "objectclass"; cn_attr[2] = NULL;
- DEBUG(9, ("LDAP base search for [%s].\n", state->dn_item->dn)); + DEBUG(9, "LDAP base search for [%s].\n", state->dn_item->dn); subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, state->dn_item->dn, LDAP_SCOPE_BASE, filter, cn_attr, state->opts->netgroup_map, @@ -446,7 +446,7 @@ static errno_t netgr_translate_members_ldap_step(struct tevent_req *req) SDAP_SEARCH_TIMEOUT), false); if (!subreq) { - DEBUG(1, ("sdap_get_generic_send failed.\n")); + DEBUG(1, "sdap_get_generic_send failed.\n"); return ENOMEM; } talloc_steal(subreq, cn_attr); @@ -469,42 +469,42 @@ static void netgr_translate_members_ldap_done(struct tevent_req *subreq) ret = sdap_get_generic_recv(subreq, state, &count, &netgroups); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("sdap_get_generic request failed.\n")); + DEBUG(1, "sdap_get_generic request failed.\n"); goto fail; }
switch (count) { case 0: - DEBUG(0, ("sdap_get_generic_recv found no entry for [%s].\n", - state->dn_item->dn)); + DEBUG(0, "sdap_get_generic_recv found no entry for [%s].\n", + state->dn_item->dn); break; case 1: ret = sysdb_attrs_get_string(netgroups[0], SYSDB_NAME, &str); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); break; } state->dn_item->cn = talloc_strdup(state->dn_item, str); if (state->dn_item->cn == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); } break; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected number of results [%zu] for base search.\n", - count)); + "Unexpected number of results [%zu] for base search.\n", + count); }
if (state->dn_item->cn == NULL) { - DEBUG(1, ("Failed to resolve netgroup name for DN [%s], using DN.\n", - state->dn_item->dn)); + DEBUG(1, "Failed to resolve netgroup name for DN [%s], using DN.\n", + state->dn_item->dn); state->dn_item->cn = talloc_strdup(state->dn_item, state->dn_item->dn); }
state->dn_idx = state->dn_item->next; ret = netgr_translate_members_ldap_step(req); if (ret != EOK && ret != EAGAIN) { - DEBUG(1, ("netgr_translate_members_ldap_step failed.\n")); + DEBUG(1, "netgr_translate_members_ldap_step failed.\n"); goto fail; }
@@ -593,7 +593,7 @@ struct tevent_req *sdap_get_netgroups_send(TALLOC_CTX *memctx,
if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Netgroup lookup request without a netgroup search base\n")); + "Netgroup lookup request without a netgroup search base\n"); ret = EINVAL; goto done; } @@ -625,8 +625,8 @@ static errno_t sdap_get_netgroups_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for netgroups with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for netgroups with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -661,7 +661,7 @@ static void sdap_get_netgroups_process(struct tevent_req *subreq) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Search for netgroups, returned %zu results.\n", state->count)); + "Search for netgroups, returned %zu results.\n", state->count);
if (state->count == 0) { /* No netgroups found in this search */ @@ -719,13 +719,13 @@ static void netgr_translate_members_done(struct tevent_req *subreq) &state->higher_timestamp, now); if (ret) { - DEBUG(2, ("Failed to store netgroups.\n")); + DEBUG(2, "Failed to store netgroups.\n"); tevent_req_error(req, ret); return; } }
- DEBUG(SSSDBG_TRACE_ALL, ("Saving %zu Netgroups - Done\n", state->count)); + DEBUG(SSSDBG_TRACE_ALL, "Saving %zu Netgroups - Done\n", state->count);
tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_async_services.c b/src/providers/ldap/sdap_async_services.c index c4245f0..8a391c3 100644 --- a/src/providers/ldap/sdap_async_services.c +++ b/src/providers/ldap/sdap_async_services.c @@ -104,7 +104,7 @@ sdap_get_services_send(TALLOC_CTX *memctx,
if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Services lookup request without a search base\n")); + "Services lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -137,8 +137,8 @@ sdap_get_services_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for services with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for services with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -177,8 +177,8 @@ sdap_get_services_process(struct tevent_req *subreq) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Search for services, returned %zu results.\n", - count)); + "Search for services, returned %zu results.\n", + count);
if (state->enumeration || count == 0) { /* No services found in this search or enumerating */ @@ -234,13 +234,13 @@ sdap_get_services_process(struct tevent_req *subreq) &state->higher_usn); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to store services.\n")); + "Failed to store services.\n"); tevent_req_error(req, ret); return; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Saving %zu services - Done\n", state->count)); + "Saving %zu services - Done\n", state->count);
tevent_req_done(req); } @@ -274,7 +274,7 @@ sdap_save_services(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; }
@@ -292,10 +292,10 @@ sdap_save_services(TALLOC_CTX *mem_ctx, * Just report the failure to save and go on */ if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to store service %zu. Ignoring.\n", i)); + "Failed to store service %zu. Ignoring.\n", i); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Service [%zu/%zu] processed!\n", i, num_services)); + "Service [%zu/%zu] processed!\n", i, num_services); }
if (usn_value) { @@ -316,7 +316,7 @@ sdap_save_services(TALLOC_CTX *mem_ctx, ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to commit transaction!\n")); + "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -330,7 +330,7 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to cancel transaction!\n")); + "Failed to cancel transaction!\n"); } } talloc_free(tmp_ctx); @@ -360,7 +360,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx, uint16_t port; uint64_t cache_timeout;
- DEBUG(SSSDBG_TRACE_ALL, ("Saving service\n")); + DEBUG(SSSDBG_TRACE_ALL, "Saving service\n");
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { @@ -381,11 +381,11 @@ sdap_save_service(TALLOC_CTX *mem_ctx, &name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not determine the primary name of the service\n")); + "Could not determine the primary name of the service\n"); goto done; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Primary name: [%s]\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Primary name: [%s]\n", name);
/* Handle any available aliases */ @@ -394,7 +394,7 @@ sdap_save_service(TALLOC_CTX *mem_ctx, &aliases); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify service aliases\n")); + "Failed to identify service aliases\n"); goto done; }
@@ -402,8 +402,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_uint16_t(attrs, SYSDB_SVC_PORT, &port); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify service port: [%s]\n", - strerror(ret))); + "Failed to identify service port: [%s]\n", + strerror(ret)); goto done; }
@@ -412,8 +412,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, tmp_ctx, &protocols); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify service protocols: [%s]\n", - strerror(ret))); + "Failed to identify service protocols: [%s]\n", + strerror(ret)); goto done; }
@@ -423,8 +423,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, dom->case_sensitive, &cased_protocols); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to get case_sensitive protocols names: [%s]\n", - strerror(ret))); + "Failed to get case_sensitive protocols names: [%s]\n", + strerror(ret)); goto done; } } @@ -436,22 +436,22 @@ sdap_save_service(TALLOC_CTX *mem_ctx, opts->service_map[SDAP_AT_SERVICE_USN].sys_name, &el); if (ret && ret != ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to retrieve USN value: [%s]\n", - strerror(ret))); + "Failed to retrieve USN value: [%s]\n", + strerror(ret)); goto done; } if (ret == ENOENT || el->num_values == 0) { DEBUG(SSSDBG_TRACE_LIBS, - ("Original USN value is not available for [%s].\n", - name)); + "Original USN value is not available for [%s].\n", + name); } else { ret = sysdb_attrs_add_string(svc_attrs, opts->service_map[SDAP_AT_SERVICE_USN].sys_name, (const char*)el->values[0].data); if (ret) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to add USN value: [%s]\n", - strerror(ret))); + "Failed to add USN value: [%s]\n", + strerror(ret)); goto done; } usn_value = talloc_strdup(tmp_ctx, (const char*)el->values[0].data); @@ -468,8 +468,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, attrs, &missing); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to identify removed attributes: [%s]\n", - strerror(ret))); + "Failed to identify removed attributes: [%s]\n", + strerror(ret)); goto done; }
@@ -479,8 +479,8 @@ sdap_save_service(TALLOC_CTX *mem_ctx, svc_attrs, missing, cache_timeout, now); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to store service in the sysdb: [%s]\n", - strerror(ret))); + "Failed to store service in the sysdb: [%s]\n", + strerror(ret)); goto done; }
@@ -568,7 +568,7 @@ enum_services_send(TALLOC_CTX *memctx, id_ctx->opts->service_map[SDAP_AT_SERVICE_PROTOCOL].name); } if (!state->filter) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to build base filter\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to build base filter\n"); ret = ENOMEM; goto fail; } @@ -633,8 +633,8 @@ enum_services_op_done(struct tevent_req *subreq) } }
- DEBUG(SSSDBG_FUNC_DATA, ("Services higher USN value: [%s]\n", - state->id_ctx->srv_opts->max_service_value)); + DEBUG(SSSDBG_FUNC_DATA, "Services higher USN value: [%s]\n", + state->id_ctx->srv_opts->max_service_value);
tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_async_sudo.c b/src/providers/ldap/sdap_async_sudo.c index 0d4882b..e91ab34 100644 --- a/src/providers/ldap/sdap_async_sudo.c +++ b/src/providers/ldap/sdap_async_sudo.c @@ -208,7 +208,7 @@ static int sdap_sudo_refresh_retry(struct tevent_req *req) if (state->sdap_op == NULL) { state->sdap_op = sdap_id_op_create(state, state->sdap_conn_cache); if (state->sdap_op == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_id_op_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_id_op_create() failed\n"); state->dp_error = DP_ERR_FATAL; state->error = EIO; return EIO; @@ -218,7 +218,7 @@ static int sdap_sudo_refresh_retry(struct tevent_req *req) subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (subreq == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sdap_id_op_connect_send() failed: %d(%s)\n", ret, strerror(ret))); + "sdap_id_op_connect_send() failed: %d(%s)\n", ret, strerror(ret)); talloc_zfree(state->sdap_op); state->dp_error = DP_ERR_FATAL; state->error = ret; @@ -251,11 +251,11 @@ static void sdap_sudo_refresh_connect_done(struct tevent_req *subreq) return; } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("SUDO LDAP connection failed - %s\n", strerror(ret))); + "SUDO LDAP connection failed - %s\n", strerror(ret)); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("SUDO LDAP connection successful\n")); + DEBUG(SSSDBG_TRACE_FUNC, "SUDO LDAP connection successful\n");
subreq = sdap_sudo_load_sudoers_send(state, state->be_ctx->ev, state->opts, @@ -306,7 +306,7 @@ static struct tevent_req * sdap_sudo_load_sudoers_send(TALLOC_CTX *mem_ctx,
if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("SUDOERS lookup request without a search base\n")); + "SUDOERS lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -345,7 +345,7 @@ static errno_t sdap_sudo_load_sudoers_next_base(struct tevent_req *req) search_base = state->search_bases[state->base_iter]; if (search_base == NULL) { /* should not happen */ - DEBUG(SSSDBG_CRIT_FAILURE, ("search_base is null\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "search_base is null\n"); return EFAULT; }
@@ -358,8 +358,8 @@ static errno_t sdap_sudo_load_sudoers_next_base(struct tevent_req *req)
/* send request */ DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for sudo rules with base [%s]\n", - search_base->basedn)); + "Searching for sudo rules with base [%s]\n", + search_base->basedn);
subreq = sdap_get_generic_send(state, state->ev, @@ -397,8 +397,8 @@ static void sdap_sudo_load_sudoers_process(struct tevent_req *subreq) search_base = state->search_bases[state->base_iter];
DEBUG(SSSDBG_TRACE_FUNC, - ("Receiving sudo rules with base [%s]\n", - search_base->basedn)); + "Receiving sudo rules with base [%s]\n", + search_base->basedn);
ret = sdap_get_generic_recv(subreq, state, &count, &attrs); talloc_zfree(subreq); @@ -477,12 +477,12 @@ static void sdap_sudo_refresh_load_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Received %zu rules\n", rules_count)); + DEBUG(SSSDBG_TRACE_FUNC, "Received %zu rules\n", rules_count);
/* start transaction */ ret = sysdb_transaction_start(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -507,12 +507,12 @@ static void sdap_sudo_refresh_load_done(struct tevent_req *subreq) /* commit transaction */ ret = sysdb_transaction_commit(state->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false;
- DEBUG(SSSDBG_TRACE_FUNC, ("Sudoers is successfuly stored in cache\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Sudoers is successfuly stored in cache\n");
ret = EOK; state->num_rules = rules_count; @@ -521,7 +521,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(state->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } }
@@ -558,15 +558,15 @@ static int sdap_sudo_purge_sudoers(struct sysdb_ctx *sysdb_ctx, &name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to retrieve rule name: [%s]\n", strerror(ret))); + "Failed to retrieve rule name: [%s]\n", strerror(ret)); continue; }
ret = sysdb_sudo_purge_byname(sysdb_ctx, dom, name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to delete rule %s: [%s]\n", - name, strerror(ret))); + "Failed to delete rule %s: [%s]\n", + name, strerror(ret)); continue; } } @@ -582,8 +582,8 @@ static int sdap_sudo_purge_sudoers(struct sysdb_ctx *sysdb_ctx,
done: if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to purge sudo rules [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "failed to purge sudo rules [%d]: %s\n", + ret, strerror(ret)); }
return ret; @@ -611,8 +611,8 @@ static int sdap_sudo_store_sudoers(TALLOC_CTX *mem_ctx, rules_count, cache_timeout, now, _usn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("failed to save sudo rules [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "failed to save sudo rules [%d]: %s\n", + ret, strerror(ret)); return ret; }
diff --git a/src/providers/ldap/sdap_async_sudo_hostinfo.c b/src/providers/ldap/sdap_async_sudo_hostinfo.c index f0c7281..fce4111 100644 --- a/src/providers/ldap/sdap_async_sudo_hostinfo.c +++ b/src/providers/ldap/sdap_async_sudo_hostinfo.c @@ -77,7 +77,7 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_get_hostinfo_state); if (req == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -93,11 +93,11 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, &state->hostnames, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Unable to parse hostnames [%d]: %s\n", ret, strerror(ret))); + "Unable to parse hostnames [%d]: %s\n", ret, strerror(ret)); goto done; } else { DEBUG(SSSDBG_CONF_SETTINGS, - ("Hostnames set to: %s\n", conf_hostnames)); + "Hostnames set to: %s\n", conf_hostnames); } }
@@ -106,12 +106,12 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, &state->ip_addr, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Unable to parse IP addresses [%d]: %s\n", - ret, strerror(ret))); + "Unable to parse IP addresses [%d]: %s\n", + ret, strerror(ret)); goto done; } else { - DEBUG(SSSDBG_CONF_SETTINGS, ("IP addresses set to: %s\n", - conf_ip_addr)); + DEBUG(SSSDBG_CONF_SETTINGS, "IP addresses set to: %s\n", + conf_ip_addr); } }
@@ -120,8 +120,8 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, ret = sdap_sudo_get_ip_addresses(state, &state->ip_addr); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to detect IP addresses [%d]: %s\n", - ret, strerror(ret))); + "Unable to detect IP addresses [%d]: %s\n", + ret, strerror(ret)); } }
@@ -162,8 +162,8 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *subreq) ret = sdap_sudo_get_hostnames_recv(state, subreq, &state->hostnames); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve hostnames [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve hostnames [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -210,7 +210,7 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -218,8 +218,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, ret = getifaddrs(&ifaces); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not read interfaces [%d][%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not read interfaces [%d][%s]\n", + ret, strerror(ret)); goto done; }
@@ -305,8 +305,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, if (inet_ntop(iface->ifa_addr->sa_family, sinx_addr, ip_addr, INET6_ADDRSTRLEN) == NULL) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("inet_ntop() failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "inet_ntop() failed [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -315,8 +315,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, if (inet_ntop(iface->ifa_addr->sa_family, sinx_network, network_addr, INET6_ADDRSTRLEN) == NULL) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("inet_ntop() failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "inet_ntop() failed [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -342,8 +342,8 @@ static int sdap_sudo_get_ip_addresses(TALLOC_CTX *mem_ctx, }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Found IP address: %s in network %s/%d\n", - ip_addr, network_addr, netmask)); + "Found IP address: %s in network %s/%d\n", + ip_addr, network_addr, netmask); }
if (ip_addr_list) { @@ -386,7 +386,7 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, /* hostname, fqdn and NULL */ state->hostnames = talloc_zero_array(state, char*, 3); if (state->hostnames == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero_array() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero_array() failed\n"); ret = ENOMEM; goto done; } @@ -397,15 +397,15 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, ret = gethostname(hostname, HOST_NAME_MAX); if (ret != EOK) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve machine hostname " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve machine hostname " + "[%d]: %s\n", ret, strerror(ret)); goto done; } hostname[HOST_NAME_MAX] = '\0';
state->hostnames[0] = talloc_strdup(state->hostnames, hostname); if (state->hostnames[0] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto done; } @@ -413,14 +413,14 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, dot = strchr(hostname, '.'); if (dot != NULL) { /* already a fqdn, determine hostname and finish */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found fqdn: %s\n", hostname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found fqdn: %s\n", hostname);
*dot = '\0'; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found hostname: %s\n", hostname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found hostname: %s\n", hostname);
state->hostnames[1] = talloc_strdup(state->hostnames, hostname); if (state->hostnames[1] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto done; } @@ -428,7 +428,7 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, ret = EOK; goto done; } else { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found hostname: %s\n", hostname)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found hostname: %s\n", hostname); }
state->resolv_ctx = be_ctx->be_res->resolv; @@ -476,30 +476,30 @@ static void sdap_sudo_get_hostnames_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret == ENOENT) { /* Empty result, just quit */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("No hostent found\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "No hostent found\n"); goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not resolve fqdn for this machine, error [%d]: %s, " + "Could not resolve fqdn for this machine, error [%d]: %s, " "resolver returned: [%d]: %s\n", ret, strerror(ret), - resolv_status, resolv_strerror(resolv_status))); + resolv_status, resolv_strerror(resolv_status)); tevent_req_error(req, ret); return; }
/* EOK */
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Found fqdn: %s\n", rhostent->name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found fqdn: %s\n", rhostent->name);
if (state->hostnames == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("state->hostnames is NULL\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "state->hostnames is NULL\n"); ret = EINVAL; goto done; }
state->hostnames[1] = talloc_strdup(state->hostnames, rhostent->name); if (state->hostnames[1] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto done; } diff --git a/src/providers/ldap/sdap_async_sudo_timer.c b/src/providers/ldap/sdap_async_sudo_timer.c index 27dd41f..0353419 100644 --- a/src/providers/ldap/sdap_async_sudo_timer.c +++ b/src/providers/ldap/sdap_async_sudo_timer.c @@ -63,7 +63,7 @@ struct tevent_req * sdap_sudo_timer_send(TALLOC_CTX *mem_ctx, /* create request */ req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_timer_state); if (req == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -75,7 +75,7 @@ struct tevent_req * sdap_sudo_timer_send(TALLOC_CTX *mem_ctx, /* set timer */ timer = tevent_add_timer(ev, req, when, sdap_sudo_timer, req); if (timer == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("tevent_add_timer() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "tevent_add_timer() failed\n"); ret = ENOMEM; goto immediately; } @@ -120,7 +120,7 @@ static void sdap_sudo_timer(struct tevent_context *ev, /* issue request */ state->subreq = state->fn(state, state->sudo_ctx); if (state->subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to issue timed request!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to issue timed request!\n"); tevent_req_error(req, ENOMEM); return; } @@ -137,8 +137,8 @@ static void sdap_sudo_timer(struct tevent_context *ev, * the possibility of starting another * concurrently */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set timeout, " - "canceling request!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set timeout, " + "canceling request!\n"); talloc_zfree(state->subreq); tevent_req_error(req, ENOMEM); } @@ -169,8 +169,8 @@ static void sdap_sudo_timer_timeout(struct tevent_context *ev, req = talloc_get_type(pvt, struct tevent_req); state = tevent_req_data(req, struct sdap_sudo_timer_state);
- DEBUG(SSSDBG_CRIT_FAILURE, ("Request timed out. Is timeout too small?" - " (%lds)!\n", state->timeout)); + DEBUG(SSSDBG_CRIT_FAILURE, "Request timed out. Is timeout too small?" + " (%lds)!\n", state->timeout);
talloc_zfree(state->subreq);
diff --git a/src/providers/ldap/sdap_async_users.c b/src/providers/ldap/sdap_async_users.c index 860e8fe..ed09280 100644 --- a/src/providers/ldap/sdap_async_users.c +++ b/src/providers/ldap/sdap_async_users.c @@ -53,7 +53,7 @@ sdap_get_idmap_primary_gid(struct sdap_options *opts, opts->user_map[SDAP_AT_USER_PRIMARY_GROUP].sys_name, &primary_gid); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("no primary group ID provided\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "no primary group ID provided\n"); ret = EINVAL; goto done; } @@ -69,7 +69,7 @@ sdap_get_idmap_primary_gid(struct sdap_options *opts, &dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", sid_str)); + "Could not parse domain SID from [%s]\n", sid_str); goto done; } } @@ -125,7 +125,7 @@ int sdap_save_user(TALLOC_CTX *memctx, char *sid_str; char *dom_sid_str = NULL;
- DEBUG(SSSDBG_TRACE_FUNC, ("Save user\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Save user\n");
tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -141,10 +141,10 @@ int sdap_save_user(TALLOC_CTX *memctx,
ret = sdap_get_user_primary_name(memctx, opts, attrs, dom, &user_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get user name\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get user name\n"); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Processing user %s\n", user_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Processing user %s\n", user_name);
if (opts->schema_type == SDAP_SCHEMA_AD) { ret = sysdb_attrs_get_string(attrs, @@ -199,17 +199,17 @@ int sdap_save_user(TALLOC_CTX *memctx, if (ret == EOK) { ret = sysdb_attrs_add_string(user_attrs, SYSDB_SID_STR, sid_str); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not add SID string: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not add SID string: [%s]\n", + strerror(ret)); goto done; } } else if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_ALL, ("objectSID: not available for group [%s].\n", - user_name)); + DEBUG(SSSDBG_TRACE_ALL, "objectSID: not available for group [%s].\n", + user_name); sid_str = NULL; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not identify objectSID: [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not identify objectSID: [%s]\n", + strerror(ret)); sid_str = NULL; }
@@ -221,19 +221,19 @@ int sdap_save_user(TALLOC_CTX *memctx, if (use_id_mapping) {
if (sid_str == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("SID not available, cannot map a " \ - "unix ID to user [%s].\n", user_name)); + DEBUG(SSSDBG_MINOR_FAILURE, "SID not available, cannot map a " \ + "unix ID to user [%s].\n", user_name); ret = ENOENT; goto done; }
DEBUG(SSSDBG_TRACE_LIBS, - ("Mapping user [%s] objectSID [%s] to unix ID\n", user_name, sid_str)); + "Mapping user [%s] objectSID [%s] to unix ID\n", user_name, sid_str);
/* Convert the SID into a UNIX user ID */ ret = sdap_idmap_sid_to_unix(opts->idmap_ctx, sid_str, &uid); if (ret == ENOTSUP) { - DEBUG(SSSDBG_TRACE_FUNC, ("Skipping built-in object.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Skipping built-in object.\n"); ret = EOK; goto done; } else if (ret != EOK) { @@ -245,7 +245,7 @@ int sdap_save_user(TALLOC_CTX *memctx, */ ret = sdap_replace_id(attrs, SYSDB_UIDNUM, uid); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot set the id-mapped UID\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot set the id-mapped UID\n"); goto done; } } else { @@ -254,16 +254,16 @@ int sdap_save_user(TALLOC_CTX *memctx, &uid); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("no uid provided for [%s] in domain [%s].\n", - user_name, dom->name)); + "no uid provided for [%s] in domain [%s].\n", + user_name, dom->name); ret = EINVAL; goto done; } } /* check that the uid is valid for this domain */ if (OUT_OF_ID_RANGE(uid, dom->id_min, dom->id_max)) { - DEBUG(2, ("User [%s] filtered out! (uid out of range)\n", - user_name)); + DEBUG(2, "User [%s] filtered out! (uid out of range)\n", + user_name); ret = EINVAL; goto done; } @@ -273,8 +273,8 @@ int sdap_save_user(TALLOC_CTX *memctx, &gid); if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot get the GID for [%s] in domain [%s].\n", - user_name, dom->name)); + "Cannot get the GID for [%s] in domain [%s].\n", + user_name, dom->name); goto done; }
@@ -289,7 +289,7 @@ int sdap_save_user(TALLOC_CTX *memctx, ret = sysdb_attrs_add_uint32(user_attrs, SYSDB_PRIMARY_GROUP_GIDNUM, (uint32_t) gid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_uint32 failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_uint32 failed.\n"); goto done; }
@@ -307,8 +307,8 @@ int sdap_save_user(TALLOC_CTX *memctx, &gid); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("no gid provided for [%s] in domain [%s].\n", - user_name, dom->name)); + "no gid provided for [%s] in domain [%s].\n", + user_name, dom->name); ret = EINVAL; goto done; } @@ -318,8 +318,8 @@ int sdap_save_user(TALLOC_CTX *memctx, if (IS_SUBDOMAIN(dom) == false && OUT_OF_ID_RANGE(gid, dom->id_min, dom->id_max)) { DEBUG(SSSDBG_CRIT_FAILURE, - ("User [%s] filtered out! (primary gid out of range)\n", - user_name)); + "User [%s] filtered out! (primary gid out of range)\n", + user_name); ret = EINVAL; goto done; } @@ -330,11 +330,11 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (!el || el->num_values == 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("originalDN is not available for [%s].\n", user_name)); + "originalDN is not available for [%s].\n", user_name); } else { orig_dn = (const char *) el->values[0].data; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding originalDN [%s] to attributes " - "of [%s].\n", orig_dn, user_name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Adding originalDN [%s] to attributes " + "of [%s].\n", orig_dn, user_name);
ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_DN, orig_dn); if (ret) { @@ -348,10 +348,10 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("Original memberOf is not available for [%s].\n", user_name)); + "Original memberOf is not available for [%s].\n", user_name); } else { DEBUG(SSSDBG_TRACE_FUNC, - ("Adding original memberOf attributes to [%s].\n", user_name)); + "Adding original memberOf attributes to [%s].\n", user_name); for (i = 0; i < el->num_values; i++) { ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_MEMBEROF, (const char *) el->values[i].data); @@ -376,7 +376,7 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("Original USN value is not available for [%s].\n", user_name)); + "Original USN value is not available for [%s].\n", user_name); } else { ret = sysdb_attrs_add_string(user_attrs, opts->user_map[SDAP_AT_USER_USN].sys_name, @@ -398,7 +398,7 @@ int sdap_save_user(TALLOC_CTX *memctx, } if (el->num_values == 0) { DEBUG(SSSDBG_TRACE_FUNC, - ("User principal is not available for [%s].\n", user_name)); + "User principal is not available for [%s].\n", user_name); } else { upn = talloc_strdup(user_attrs, (const char*) el->values[0].data); if (!upn) { @@ -409,8 +409,8 @@ int sdap_save_user(TALLOC_CTX *memctx, make_realm_upper_case(upn); } DEBUG(SSSDBG_TRACE_FUNC, - ("Adding user principal [%s] to attributes of [%s].\n", - upn, user_name)); + "Adding user principal [%s] to attributes of [%s].\n", + upn, user_name); ret = sysdb_attrs_add_string(user_attrs, SYSDB_UPN, upn); if (ret) { goto done; @@ -438,7 +438,7 @@ int sdap_save_user(TALLOC_CTX *memctx,
ret = sdap_save_all_names(user_name, attrs, dom, user_attrs); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to save user names\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to save user names\n"); goto done; }
@@ -451,7 +451,7 @@ int sdap_save_user(TALLOC_CTX *memctx, goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Storing info for user %s\n", user_name)); + DEBUG(SSSDBG_TRACE_FUNC, "Storing info for user %s\n", user_name);
ret = sysdb_store_user(ctx, dom, user_name, pwd, uid, gid, gecos, homedir, shell, orig_dn, @@ -468,8 +468,8 @@ int sdap_save_user(TALLOC_CTX *memctx, done: if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to save user [%s]\n", - user_name ? user_name : "Unknown")); + "Failed to save user [%s]\n", + user_name ? user_name : "Unknown"); } talloc_free(tmpctx); return ret; @@ -507,7 +507,7 @@ int sdap_save_users(TALLOC_CTX *memctx,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -523,9 +523,9 @@ int sdap_save_users(TALLOC_CTX *memctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ if (ret) { - DEBUG(2, ("Failed to store user %d. Ignoring.\n", i)); + DEBUG(2, "Failed to store user %d. Ignoring.\n", i); } else { - DEBUG(9, ("User %d processed!\n", i)); + DEBUG(9, "User %d processed!\n", i); }
if (usn_value) { @@ -545,7 +545,7 @@ int sdap_save_users(TALLOC_CTX *memctx,
ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction!\n"); goto done; } in_transaction = false; @@ -558,7 +558,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } talloc_zfree(tmpctx); @@ -627,7 +627,7 @@ struct tevent_req *sdap_get_users_send(TALLOC_CTX *memctx,
if (!state->search_bases) { DEBUG(SSSDBG_CRIT_FAILURE, - ("User lookup request without a search base\n")); + "User lookup request without a search base\n"); ret = EINVAL; goto done; } @@ -659,8 +659,8 @@ static errno_t sdap_get_users_next_base(struct tevent_req *req) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Searching for users with base [%s]\n", - state->search_bases[state->base_iter]->basedn)); + "Searching for users with base [%s]\n", + state->search_bases[state->base_iter]->basedn);
subreq = sdap_get_generic_send( state, state->ev, state->opts, state->sh, @@ -698,7 +698,7 @@ static void sdap_get_users_process(struct tevent_req *subreq) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Search for users, returned %zu results.\n", count)); + "Search for users, returned %zu results.\n", count);
if (state->enumeration || count == 0) { /* No users found in this search or enumerating */ @@ -754,12 +754,12 @@ static void sdap_get_users_process(struct tevent_req *subreq) state->users, state->count, &state->higher_usn); if (ret) { - DEBUG(2, ("Failed to store users.\n")); + DEBUG(2, "Failed to store users.\n"); tevent_req_error(req, ret); return; }
- DEBUG(SSSDBG_TRACE_ALL, ("Saving %zu Users - Done\n", state->count)); + DEBUG(SSSDBG_TRACE_ALL, "Saving %zu Users - Done\n", state->count);
tevent_req_done(req); } diff --git a/src/providers/ldap/sdap_autofs.c b/src/providers/ldap/sdap_autofs.c index e7947c9..aa4b35f 100644 --- a/src/providers/ldap/sdap_autofs.c +++ b/src/providers/ldap/sdap_autofs.c @@ -54,7 +54,7 @@ int sdap_autofs_init(struct be_ctx *be_ctx, { int ret;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing autofs LDAP back end\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing autofs LDAP back end\n");
*ops = &sdap_autofs_ops; *pvt_data = id_ctx; @@ -84,7 +84,7 @@ void sdap_autofs_handler(struct be_req *be_req) struct tevent_req *req; int ret = EOK;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("sdap autofs handler called\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "sdap autofs handler called\n");
id_ctx = talloc_get_type(be_ctx->bet_info[BET_AUTOFS].pvt_bet_data, struct sdap_id_ctx); @@ -95,15 +95,15 @@ void sdap_autofs_handler(struct be_req *be_req)
autofs_req = talloc_get_type(be_req_get_data(be_req), struct be_autofs_req);
- DEBUG(SSSDBG_FUNC_DATA, ("Requested refresh for: %s\n", - autofs_req->mapname ? autofs_req->mapname : "<ALL>\n")); + DEBUG(SSSDBG_FUNC_DATA, "Requested refresh for: %s\n", + autofs_req->mapname ? autofs_req->mapname : "<ALL>\n");
if (autofs_req->invalidate) { ret = sysdb_invalidate_autofs_maps(id_ctx->be->domain->sysdb, id_ctx->be->domain); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not invalidate autofs maps, " - "backend might return stale entries\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not invalidate autofs maps, " + "backend might return stale entries\n"); } }
@@ -156,7 +156,7 @@ sdap_autofs_get_map_send(TALLOC_CTX *mem_ctx,
state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache); if (!state->op) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; } @@ -219,7 +219,7 @@ sdap_autofs_get_map_connect_done(struct tevent_req *subreq) state->map_name); if (!subreq) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sdap_autofs_setautomntent_send failed\n")); + "sdap_autofs_setautomntent_send failed\n"); tevent_req_error(req, ENOMEM); return; } @@ -262,8 +262,8 @@ sdap_autofs_get_map_done(struct tevent_req *subreq) state->ctx->be->domain, state->map_name); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot delete autofs map %s [%d]: %s\n", - state->map_name, ret, strerror(ret))); + "Cannot delete autofs map %s [%d]: %s\n", + state->map_name, ret, strerror(ret)); tevent_req_error(req, ret); return; } diff --git a/src/providers/ldap/sdap_child_helpers.c b/src/providers/ldap/sdap_child_helpers.c index 9aaff78..2a0730e 100644 --- a/src/providers/ldap/sdap_child_helpers.c +++ b/src/providers/ldap/sdap_child_helpers.c @@ -56,15 +56,15 @@ static void sdap_close_fd(int *fd) int ret;
if (*fd == -1) { - DEBUG(6, ("fd already closed\n")); + DEBUG(6, "fd already closed\n"); return; }
ret = close(*fd); if (ret) { ret = errno; - DEBUG(2, ("Closing fd %d, return error %d (%s)\n", - *fd, ret, strerror(ret))); + DEBUG(2, "Closing fd %d, return error %d (%s)\n", + *fd, ret, strerror(ret)); }
*fd = -1; @@ -91,13 +91,13 @@ static errno_t sdap_fork_child(struct tevent_context *ev, ret = pipe(pipefd_from_child); if (ret == -1) { err = errno; - DEBUG(1, ("pipe failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "pipe failed [%d][%s].\n", err, strerror(err)); return err; } ret = pipe(pipefd_to_child); if (ret == -1) { err = errno; - DEBUG(1, ("pipe failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "pipe failed [%d][%s].\n", err, strerror(err)); return err; }
@@ -107,8 +107,8 @@ static errno_t sdap_fork_child(struct tevent_context *ev, err = exec_child(child, pipefd_to_child, pipefd_from_child, LDAP_CHILD, ldap_child_debug_fd); - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not exec LDAP child: [%d][%s].\n", - err, strerror(err))); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not exec LDAP child: [%d][%s].\n", + err, strerror(err)); return err; } else if (pid > 0) { /* parent */ child->pid = pid; @@ -126,7 +126,7 @@ static errno_t sdap_fork_child(struct tevent_context *ev,
} else { /* error */ err = errno; - DEBUG(1, ("fork failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "fork failed [%d][%s].\n", err, strerror(err)); return err; }
@@ -145,7 +145,7 @@ static errno_t create_tgt_req_send_buffer(TALLOC_CTX *mem_ctx,
buf = talloc(mem_ctx, struct io_buffer); if (buf == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; }
@@ -160,11 +160,11 @@ static errno_t create_tgt_req_send_buffer(TALLOC_CTX *mem_ctx, buf->size += strlen(keytab_name); }
- DEBUG(SSSDBG_TRACE_FUNC, ("buffer size: %zu\n", buf->size)); + DEBUG(SSSDBG_TRACE_FUNC, "buffer size: %zu\n", buf->size);
buf->data = talloc_size(buf, buf->size); if (buf->data == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); talloc_free(buf); return ENOMEM; } @@ -227,7 +227,7 @@ static int parse_child_response(TALLOC_CTX *mem_ctx,
ccn = talloc_size(mem_ctx, sizeof(char) * (len + 1)); if (ccn == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return ENOMEM; } safealign_memcpy(ccn, buf+p, sizeof(char) * len, &p); @@ -296,19 +296,19 @@ struct tevent_req *sdap_get_tgt_send(TALLOC_CTX *mem_ctx, realm_str, princ_str, keytab_name, lifetime, &buf); if (ret != EOK) { - DEBUG(1, ("create_tgt_req_send_buffer failed.\n")); + DEBUG(1, "create_tgt_req_send_buffer failed.\n"); goto fail; }
ret = sdap_fork_child(state->ev, state->child); if (ret != EOK) { - DEBUG(1, ("sdap_fork_child failed.\n")); + DEBUG(1, "sdap_fork_child failed.\n"); goto fail; }
ret = set_tgt_child_timeout(req, ev, timeout); if (ret != EOK) { - DEBUG(1, ("activate_child_timeout_handler failed.\n")); + DEBUG(1, "activate_child_timeout_handler failed.\n"); goto fail; }
@@ -394,11 +394,11 @@ int sdap_get_tgt_recv(struct tevent_req *req, ret = parse_child_response(mem_ctx, state->buf, state->len, &res, &krberr, &ccn, &expire_time); if (ret != EOK) { - DEBUG(1, ("Cannot parse child response: [%d][%s]\n", ret, strerror(ret))); + DEBUG(1, "Cannot parse child response: [%d][%s]\n", ret, strerror(ret)); return ret; }
- DEBUG(6, ("Child responded: %d [%s], expired on [%ld]\n", res, ccn, (long)expire_time)); + DEBUG(6, "Child responded: %d [%s], expired on [%ld]\n", res, ccn, (long)expire_time); *result = res; *kerr = krberr; *ccname = ccn; @@ -417,11 +417,11 @@ static void get_tgt_timeout_handler(struct tevent_context *ev, struct sdap_get_tgt_state); int ret;
- DEBUG(9, ("timeout for tgt child [%d] reached.\n", state->child->pid)); + DEBUG(9, "timeout for tgt child [%d] reached.\n", state->child->pid);
ret = kill(state->child->pid, SIGKILL); if (ret == -1) { - DEBUG(1, ("kill failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "kill failed [%d][%s].\n", errno, strerror(errno)); }
tevent_req_error(req, ETIMEDOUT); @@ -434,13 +434,13 @@ static errno_t set_tgt_child_timeout(struct tevent_req *req, struct tevent_timer *te; struct timeval tv;
- DEBUG(6, ("Setting %d seconds timeout for tgt child\n", timeout)); + DEBUG(6, "Setting %d seconds timeout for tgt child\n", timeout);
tv = tevent_timeval_current_ofs(timeout, 0);
te = tevent_add_timer(ev, req, tv, get_tgt_timeout_handler, req); if (te == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); return ENOMEM; }
@@ -458,14 +458,14 @@ int sdap_setup_child(void) if (debug_to_file != 0 && ldap_child_debug_fd == -1) { ret = open_debug_file_ex(LDAP_CHILD_LOG_FILE, &debug_filep, false); if (ret != EOK) { - DEBUG(0, ("Error setting up logging (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(0, "Error setting up logging (%d) [%s]\n", + ret, strerror(ret)); return ret; }
ldap_child_debug_fd = fileno(debug_filep); if (ldap_child_debug_fd == -1) { - DEBUG(0, ("fileno failed [%d][%s]\n", errno, strerror(errno))); + DEBUG(0, "fileno failed [%d][%s]\n", errno, strerror(errno)); ret = errno; return ret; } diff --git a/src/providers/ldap/sdap_dyndns.c b/src/providers/ldap/sdap_dyndns.c index bf5fb09..0246e7c 100644 --- a/src/providers/ldap/sdap_dyndns.c +++ b/src/providers/ldap/sdap_dyndns.c @@ -137,8 +137,8 @@ sdap_dyndns_update_send(TALLOC_CTX *mem_ctx, subreq = sdap_dyndns_get_addrs_send(state, state->ev, sdap_ctx, ifname); if (!subreq) { ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); goto done; } tevent_req_set_callback(subreq, sdap_dyndns_update_addrs_done, req); @@ -164,7 +164,7 @@ sdap_dyndns_update_addrs_done(struct tevent_req *subreq)
ret = sdap_dyndns_get_addrs_recv(subreq, state, &state->addresses); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses for DNS update\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses for DNS update\n"); tevent_req_error(req, ret); return; } @@ -176,7 +176,7 @@ sdap_dyndns_update_addrs_done(struct tevent_req *subreq) subreq = nsupdate_get_addrs_send(state, state->ev, state->be_res, state->hostname); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't initiate address check\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't initiate address check\n"); tevent_req_error(req, ret); return; } @@ -208,8 +208,8 @@ sdap_dyndns_dns_addrs_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not receive list of current addresses [%d]: %s\n", - ret, sss_strerror(ret))); + "Could not receive list of current addresses [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); return; } @@ -217,28 +217,28 @@ sdap_dyndns_dns_addrs_done(struct tevent_req *subreq) if (state->check_diff) { ret = sdap_dyndns_addrs_diff(state, &do_update); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not check the diff between DNS " - "and current addresses [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not check the diff between DNS " + "and current addresses [%d]: %s\n", ret, strerror(ret)); tevent_req_error(req, ret); return; }
if (do_update == false) { DEBUG(SSSDBG_TRACE_FUNC, - ("No DNS update needed, addresses did not change\n")); + "No DNS update needed, addresses did not change\n"); tevent_req_done(req); return; } DEBUG(SSSDBG_TRACE_FUNC, - ("Detected IP addresses change, will perform an update\n")); + "Detected IP addresses change, will perform an update\n"); }
/* Either we needed the addresses for updating PTR records only or * the addresses have changed (or both) */ ret = sdap_dyndns_update_step(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not start the update [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not start the update [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ret); } return; @@ -257,8 +257,8 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) state->dns_addrlist, &str_dnslist); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Converting DNS IP addresses to strings failed: [%d]: %s\n", - ret, sss_strerror(ret))); + "Converting DNS IP addresses to strings failed: [%d]: %s\n", + ret, sss_strerror(ret)); return ret; }
@@ -266,8 +266,8 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) state->addresses, &str_local_list); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Converting local IP addresses to strings failed: [%d]: %s\n", - ret, sss_strerror(ret))); + "Converting local IP addresses to strings failed: [%d]: %s\n", + ret, sss_strerror(ret)); return ret; }
@@ -276,14 +276,14 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) &dns_only, &local_only, NULL); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("diff_string_lists failed: [%d]: %s\n", ret, sss_strerror(ret))); + "diff_string_lists failed: [%d]: %s\n", ret, sss_strerror(ret)); return ret; }
if (dns_only) { for (i=0; dns_only[i]; i++) { DEBUG(SSSDBG_TRACE_LIBS, - ("Address in DNS only: %s\n", dns_only[i])); + "Address in DNS only: %s\n", dns_only[i]); do_update = true; } } @@ -291,7 +291,7 @@ sdap_dyndns_addrs_diff(struct sdap_dyndns_update_state *state, bool *_do_update) if (local_only) { for (i=0; local_only[i]; i++) { DEBUG(SSSDBG_TRACE_LIBS, - ("Address on localhost only: %s\n", local_only[i])); + "Address on localhost only: %s\n", local_only[i]); do_update = true; } } @@ -322,7 +322,7 @@ sdap_dyndns_update_step(struct tevent_req *req) state->addresses, state->dns_addrlist, &state->update_msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses for DNS update\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses for DNS update\n"); return ret; }
@@ -358,7 +358,7 @@ sdap_dyndns_update_done(struct tevent_req *subreq) WIFEXITED(child_status) && WEXITSTATUS(child_status) != 0) { state->use_server_with_nsupdate = true; DEBUG(SSSDBG_MINOR_FAILURE, - ("nsupdate failed, retrying with server name\n")); + "nsupdate failed, retrying with server name\n"); ret = sdap_dyndns_update_step(req); if (ret == EOK) { return; @@ -370,7 +370,7 @@ sdap_dyndns_update_done(struct tevent_req *subreq) }
if (state->update_ptr == false) { - DEBUG(SSSDBG_TRACE_FUNC, ("No PTR update requested, done\n")); + DEBUG(SSSDBG_TRACE_FUNC, "No PTR update requested, done\n"); tevent_req_done(req); return; } @@ -406,7 +406,7 @@ sdap_dyndns_update_ptr_step(struct tevent_req *req) state->addresses, state->dns_addrlist, &state->update_msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses for DNS update\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses for DNS update\n"); return ret; }
@@ -442,7 +442,7 @@ sdap_dyndns_update_ptr_done(struct tevent_req *subreq) WIFEXITED(child_status) && WEXITSTATUS(child_status) != 0) { state->use_server_with_nsupdate = true; DEBUG(SSSDBG_MINOR_FAILURE, - ("nsupdate failed, retrying with server name\n")); + "nsupdate failed, retrying with server name\n"); ret = sdap_dyndns_update_ptr_step(req); if (ret == EOK) { return; @@ -494,7 +494,7 @@ sdap_dyndns_get_addrs_send(TALLOC_CTX *mem_ctx, ret = sss_iface_addr_list_get(state, iface, &state->addresses); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot get list of addresses from interface %s\n", iface)); + "Cannot get list of addresses from interface %s\n", iface); } /* We're done. Just fake an async request completion */ goto done; @@ -504,15 +504,15 @@ sdap_dyndns_get_addrs_send(TALLOC_CTX *mem_ctx, state->sdap_op = sdap_id_op_create(state, sdap_ctx->conn->conn_cache); if (!state->sdap_op) { ret = ENOMEM; - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); goto done; }
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (!subreq) { ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); goto done; } tevent_req_set_callback(subreq, sdap_dyndns_get_addrs_done, req); @@ -546,13 +546,13 @@ sdap_dyndns_get_addrs_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No LDAP server is available, " - "dynamic DNS update is skipped in offline mode.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No LDAP server is available, " + "dynamic DNS update is skipped in offline mode.\n"); ret = ERR_DYNDNS_OFFLINE; } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to LDAP server: [%d](%s)\n", - ret, sss_strerror(ret))); + "Failed to connect to LDAP server: [%d](%s)\n", + ret, sss_strerror(ret)); } tevent_req_error(req, ret); return; @@ -560,7 +560,7 @@ sdap_dyndns_get_addrs_done(struct tevent_req *subreq)
ret = sdap_dyndns_add_ldap_conn(state, sdap_id_op_handle(state->sdap_op)); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Can't get addresses from LDAP connection\n")); + DEBUG(SSSDBG_OP_FAILURE, "Can't get addresses from LDAP connection\n"); tevent_req_error(req, ret); return; } @@ -593,7 +593,7 @@ sdap_dyndns_add_ldap_conn(struct sdap_dyndns_get_addrs_state *state, ret = getsockname(fd, (struct sockaddr *) &ss, &ss_len); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to get socket name\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to get socket name\n"); return ret; }
@@ -607,7 +607,7 @@ sdap_dyndns_add_ldap_conn(struct sdap_dyndns_get_addrs_state *state, break; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("Connection to LDAP is neither IPv4 nor IPv6\n")); + "Connection to LDAP is neither IPv4 nor IPv6\n"); return EIO; }
@@ -667,15 +667,15 @@ sdap_dyndns_timer_conn_send(TALLOC_CTX *mem_ctx, /* Make sure to have a valid LDAP connection */ state->sdap_op = sdap_id_op_create(state, state->sdap_ctx->conn->conn_cache); if (state->sdap_op == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_create failed\n"); ret = ENOMEM; goto fail; }
subreq = sdap_id_op_connect_send(state->sdap_op, state, &ret); if (subreq == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_connect_send failed: [%d](%s)\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sdap_id_op_connect_send failed: [%d](%s)\n", + ret, sss_strerror(ret)); ret = ENOMEM; goto fail; } @@ -707,14 +707,14 @@ sdap_dyndns_timer_conn_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { if (dp_error == DP_ERR_OFFLINE) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No server is available, " - "dynamic DNS update is skipped in offline mode.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No server is available, " + "dynamic DNS update is skipped in offline mode.\n"); /* Another timer will be scheduled when provider goes online */ tevent_req_error(req, ERR_DYNDNS_OFFLINE); } else { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to connect to LDAP server: [%d](%s)\n", - ret, sss_strerror(ret))); + "Failed to connect to LDAP server: [%d](%s)\n", + ret, sss_strerror(ret));
/* Just schedule another dyndns retry */ be_nsupdate_timer_schedule(state->ev, state->dyndns_ctx); diff --git a/src/providers/ldap/sdap_fd_events.c b/src/providers/ldap/sdap_fd_events.c index 5e4ea79..fc01d78 100644 --- a/src/providers/ldap/sdap_fd_events.c +++ b/src/providers/ldap/sdap_fd_events.c @@ -39,7 +39,7 @@ int get_fd_from_ldap(LDAP *ldap, int *fd)
ret = ldap_get_option(ldap, LDAP_OPT_DESC, fd); if (ret != LDAP_OPT_SUCCESS || *fd < 0) { - DEBUG(1, ("Failed to get fd from ldap!!\n")); + DEBUG(1, "Failed to get fd from ldap!!\n"); *fd = -1; return EIO; } @@ -74,9 +74,9 @@ static int remove_connection_callback(TALLOC_CTX *mem_ctx)
lret = ldap_get_option(cb_data->sh->ldap, LDAP_OPT_CONNECT_CB, conncb); if (lret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to remove connection callback.\n")); + DEBUG(1, "Failed to remove connection callback.\n"); } else { - DEBUG(9, ("Successfully removed connection callback.\n")); + DEBUG(9, "Successfully removed connection callback.\n"); } return EOK; } @@ -93,27 +93,27 @@ static int sdap_ldap_connect_callback_add(LDAP *ld, Sockbuf *sb, struct ldap_cb_data);
if (cb_data == NULL) { - DEBUG(1, ("sdap_ldap_connect_callback_add called without " - "callback data.\n")); + DEBUG(1, "sdap_ldap_connect_callback_add called without " + "callback data.\n"); return EINVAL; }
ret = ber_sockbuf_ctrl(sb, LBER_SB_OPT_GET_FD, &ber_fd); if (ret == -1) { - DEBUG(1, ("ber_sockbuf_ctrl failed.\n")); + DEBUG(1, "ber_sockbuf_ctrl failed.\n"); return EINVAL; }
if (DEBUG_IS_SET(SSSDBG_TRACE_LIBS)) { char *uri = ldap_url_desc2str(srv); - DEBUG(7, ("New LDAP connection to [%s] with fd [%d].\n", - uri, ber_fd)); + DEBUG(7, "New LDAP connection to [%s] with fd [%d].\n", + uri, ber_fd); free(uri); }
fd_event_item = talloc_zero(cb_data, struct fd_event_item); if (fd_event_item == NULL) { - DEBUG(1, ("talloc failed.\n")); + DEBUG(1, "talloc failed.\n"); return ENOMEM; }
@@ -121,7 +121,7 @@ static int sdap_ldap_connect_callback_add(LDAP *ld, Sockbuf *sb, TEVENT_FD_READ, sdap_ldap_result, cb_data->sh); if (fd_event_item->fde == NULL) { - DEBUG(1, ("tevent_add_fd failed.\n")); + DEBUG(1, "tevent_add_fd failed.\n"); talloc_free(fd_event_item); return ENOMEM; } @@ -147,10 +147,10 @@ static void sdap_ldap_connect_callback_del(LDAP *ld, Sockbuf *sb,
ret = ber_sockbuf_ctrl(sb, LBER_SB_OPT_GET_FD, &ber_fd); if (ret == -1) { - DEBUG(1, ("ber_sockbuf_ctrl failed.\n")); + DEBUG(1, "ber_sockbuf_ctrl failed.\n"); return; } - DEBUG(9, ("Closing LDAP connection with fd [%d].\n", ber_fd)); + DEBUG(9, "Closing LDAP connection with fd [%d].\n", ber_fd);
DLIST_FOR_EACH(fd_event_item, cb_data->fd_list) { if (fd_event_item->fd == ber_fd) { @@ -158,7 +158,7 @@ static void sdap_ldap_connect_callback_del(LDAP *ld, Sockbuf *sb, } } if (fd_event_item == NULL) { - DEBUG(1, ("No event for fd [%d] found.\n", ber_fd)); + DEBUG(1, "No event for fd [%d] found.\n", ber_fd); return; }
@@ -177,14 +177,14 @@ static int sdap_install_ldap_callbacks(struct sdap_handle *sh, int ret;
if (sh->sdap_fd_events) { - DEBUG(1, ("sdap_install_ldap_callbacks is called with already " - "initialized sdap_fd_events.\n")); + DEBUG(1, "sdap_install_ldap_callbacks is called with already " + "initialized sdap_fd_events.\n"); return EINVAL; }
sh->sdap_fd_events = talloc_zero(sh, struct sdap_fd_events); if (!sh->sdap_fd_events) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return ENOMEM; }
@@ -199,9 +199,9 @@ static int sdap_install_ldap_callbacks(struct sdap_handle *sh, return ENOMEM; }
- DEBUG(8, ("Trace: sh[%p], connected[%d], ops[%p], fde[%p], ldap[%p]\n", + DEBUG(8, "Trace: sh[%p], connected[%d], ops[%p], fde[%p], ldap[%p]\n", sh, (int)sh->connected, sh->ops, sh->sdap_fd_events->fde, - sh->ldap)); + sh->ldap);
return EOK; } @@ -218,7 +218,7 @@ errno_t setup_ldap_connection_callbacks(struct sdap_handle *sh,
sh->sdap_fd_events = talloc_zero(sh, struct sdap_fd_events); if (sh->sdap_fd_events == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; } @@ -226,14 +226,14 @@ errno_t setup_ldap_connection_callbacks(struct sdap_handle *sh, sh->sdap_fd_events->conncb = talloc_zero(sh->sdap_fd_events, struct ldap_conncb); if (sh->sdap_fd_events->conncb == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; }
cb_data = talloc_zero(sh->sdap_fd_events->conncb, struct ldap_cb_data); if (cb_data == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); ret = ENOMEM; goto fail; } @@ -247,7 +247,7 @@ errno_t setup_ldap_connection_callbacks(struct sdap_handle *sh, ret = ldap_set_option(sh->ldap, LDAP_OPT_CONNECT_CB, sh->sdap_fd_events->conncb); if (ret != LDAP_OPT_SUCCESS) { - DEBUG(1, ("Failed to set connection callback\n")); + DEBUG(1, "Failed to set connection callback\n"); ret = EFAULT; goto fail; } @@ -261,7 +261,7 @@ fail: talloc_zfree(sh->sdap_fd_events); return ret; #else - DEBUG(9, ("LDAP connection callbacks are not supported.\n")); + DEBUG(9, "LDAP connection callbacks are not supported.\n"); return EOK; #endif } @@ -288,13 +288,13 @@ errno_t sdap_call_conn_cb(const char *uri,int fd, struct sdap_handle *sh)
sb = ber_sockbuf_alloc(); if (sb == NULL) { - DEBUG(1, ("ber_sockbuf_alloc failed.\n")); + DEBUG(1, "ber_sockbuf_alloc failed.\n"); return ENOMEM; }
ret = ber_sockbuf_ctrl(sb, LBER_SB_OPT_SET_FD, &fd); if (ret != 1) { - DEBUG(1, ("ber_sockbuf_ctrl failed.\n")); + DEBUG(1, "ber_sockbuf_ctrl failed.\n"); return EFAULT; }
@@ -302,8 +302,8 @@ errno_t sdap_call_conn_cb(const char *uri,int fd, struct sdap_handle *sh) if (ret != 0) { ber_sockbuf_free(sb); DEBUG(SSSDBG_CRIT_FAILURE, - ("ldap_url_parse failed to validate [%s] on fd [%d].\n", - uri, fd)); + "ldap_url_parse failed to validate [%s] on fd [%d].\n", + uri, fd); return EFAULT; }
@@ -314,7 +314,7 @@ errno_t sdap_call_conn_cb(const char *uri,int fd, struct sdap_handle *sh) ber_sockbuf_free(sb); return ret; #else - DEBUG(9, ("LDAP connection callbacks are not supported.\n")); + DEBUG(9, "LDAP connection callbacks are not supported.\n"); return EOK; #endif } diff --git a/src/providers/ldap/sdap_id_op.c b/src/providers/ldap/sdap_id_op.c index be25b5d..925d8c6 100644 --- a/src/providers/ldap/sdap_id_op.c +++ b/src/providers/ldap/sdap_id_op.c @@ -109,7 +109,7 @@ int sdap_id_conn_cache_create(TALLOC_CTX *memctx, int ret; struct sdap_id_conn_cache *conn_cache = talloc_zero(memctx, struct sdap_id_conn_cache); if (!conn_cache) { - DEBUG(1, ("talloc_zero(struct sdap_id_conn_cache) failed.\n")); + DEBUG(1, "talloc_zero(struct sdap_id_conn_cache) failed.\n"); ret = ENOMEM; goto fail; } @@ -120,7 +120,7 @@ int sdap_id_conn_cache_create(TALLOC_CTX *memctx, sdap_id_conn_cache_be_offline_cb, conn_cache, NULL); if (ret != EOK) { - DEBUG(1, ("be_add_offline_cb failed.\n")); + DEBUG(1, "be_add_offline_cb failed.\n"); goto fail; }
@@ -128,7 +128,7 @@ int sdap_id_conn_cache_create(TALLOC_CTX *memctx, sdap_id_conn_cache_fo_reconnect_cb, conn_cache, NULL); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("be_add_reconnect_cb failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "be_add_reconnect_cb failed.\n"); goto fail; }
@@ -179,7 +179,7 @@ static void sdap_id_release_conn_data(struct sdap_id_conn_data *conn_data) return; }
- DEBUG(9, ("releasing unused connection\n")); + DEBUG(9, "releasing unused connection\n");
DLIST_REMOVE(conn_cache->connections, conn_data); talloc_zfree(conn_data); @@ -277,7 +277,7 @@ static void sdap_id_conn_data_expire_handler(struct tevent_context *ev, struct sdap_id_conn_data); struct sdap_id_conn_cache *conn_cache = conn_data->conn_cache;
- DEBUG(3, ("connection is about to expire, releasing it\n")); + DEBUG(3, "connection is about to expire, releasing it\n");
if (conn_cache->cached_connection == conn_data) { conn_cache->cached_connection = NULL; @@ -304,7 +304,7 @@ struct sdap_id_op *sdap_id_op_create(TALLOC_CTX *memctx, struct sdap_id_conn_cac static void sdap_id_op_hook_conn_data(struct sdap_id_op *op, struct sdap_id_conn_data *conn_data) { if (!op) { - DEBUG(0, ("NULL op passed!!!\n")); + DEBUG(0, "NULL op passed!!!\n"); return; }
@@ -334,7 +334,7 @@ static int sdap_id_op_destroy(void *pvt) struct sdap_id_op *op = talloc_get_type(pvt, struct sdap_id_op);
if (op->conn_data) { - DEBUG(9, ("releasing operation connection\n")); + DEBUG(9, "releasing operation connection\n"); sdap_id_op_hook_conn_data(op, NULL); }
@@ -392,14 +392,14 @@ struct tevent_req *sdap_id_op_connect_send(struct sdap_id_op *op, int ret = EOK;
if (!memctx) { - DEBUG(1, ("Bug: no memory context passed.\n")); + DEBUG(1, "Bug: no memory context passed.\n"); ret = EINVAL; goto done; }
if (op->connect_req) { /* Connection already in progress, invalid operation */ - DEBUG(1, ("Bug: connection request is already running or completed and leaked.\n")); + DEBUG(1, "Bug: connection request is already running or completed and leaked.\n"); ret = EINVAL; goto done; } @@ -420,7 +420,7 @@ struct tevent_req *sdap_id_op_connect_send(struct sdap_id_op *op, if (op->conn_data) { /* If the operation is already connected, * reuse existing connection regardless of its status */ - DEBUG(9, ("reusing operation connection\n")); + DEBUG(9, "reusing operation connection\n"); ret = EOK; goto done; } @@ -462,23 +462,23 @@ static int sdap_id_op_connect_step(struct tevent_req *req) conn_data = conn_cache->cached_connection; if (conn_data) { if (conn_data->connect_req) { - DEBUG(9, ("waiting for connection to complete\n")); + DEBUG(9, "waiting for connection to complete\n"); sdap_id_op_hook_conn_data(op, conn_data); goto done; }
if (sdap_can_reuse_connection(conn_data)) { - DEBUG(9, ("reusing cached connection\n")); + DEBUG(9, "reusing cached connection\n"); sdap_id_op_hook_conn_data(op, conn_data); goto done; }
- DEBUG(9, ("releasing expired cached connection\n")); + DEBUG(9, "releasing expired cached connection\n"); conn_cache->cached_connection = NULL; sdap_id_release_conn_data(conn_data); }
- DEBUG(9, ("beginning to connect\n")); + DEBUG(9, "beginning to connect\n");
conn_data = talloc_zero(conn_cache, struct sdap_id_conn_data); if (!conn_data) { @@ -544,18 +544,18 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) conn_data->notify_lock++;
if (ret == ENOTSUP) { - DEBUG(0, ("Authentication mechanism not Supported by server\n")); + DEBUG(0, "Authentication mechanism not Supported by server\n"); }
if (ret == EOK && (!conn_data->sh || !conn_data->sh->connected)) { - DEBUG(0, ("sdap_cli_connect_recv returned bogus connection\n")); + DEBUG(0, "sdap_cli_connect_recv returned bogus connection\n"); ret = EFAULT; }
if (ret != EOK && !can_retry) { /* be is going offline as there is no more servers to try */ - DEBUG(1, ("Failed to connect, going offline (%d [%s])\n", - ret, strerror(ret))); + DEBUG(1, "Failed to connect, going offline (%d [%s])\n", + ret, strerror(ret)); be_mark_offline(conn_cache->id_conn->id_ctx->be); is_offline = true; } @@ -563,12 +563,12 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) if (ret == EOK) { current_srv_opts = conn_cache->id_conn->id_ctx->srv_opts; if (current_srv_opts) { - DEBUG(8, ("Old USN: %lu, New USN: %lu\n", current_srv_opts->last_usn, srv_opts->last_usn)); + DEBUG(8, "Old USN: %lu, New USN: %lu\n", current_srv_opts->last_usn, srv_opts->last_usn);
if (strcmp(srv_opts->server_id, current_srv_opts->server_id) == 0 && srv_opts->supports_usn && current_srv_opts->last_usn > srv_opts->last_usn) { - DEBUG(5, ("Server was probably re-initialized\n")); + DEBUG(5, "Server was probably re-initialized\n");
current_srv_opts->max_user_value = 0; current_srv_opts->max_group_value = 0; @@ -609,7 +609,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) struct sdap_id_op *op;
if (ret == EOK && !conn_data->sh->connected) { - DEBUG(9, ("connection was broken after %d notifies\n", notify_count)); + DEBUG(9, "connection was broken after %d notifies\n", notify_count); }
DLIST_FOR_EACH(op, conn_data->ops) { @@ -639,7 +639,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) if (be_is_offline(conn_cache->id_conn->id_ctx->be)) { /* be is offline, no retry possible */ if (ret == EOK) { - DEBUG(9, ("skipping automatic retry on op #%d as be is offline\n", notify_count)); + DEBUG(9, "skipping automatic retry on op #%d as be is offline\n", notify_count); ret = EIO; }
@@ -647,10 +647,10 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) is_offline = true; } else { if (ret == EOK) { - DEBUG(9, ("attempting automatic retry on op #%d\n", notify_count)); + DEBUG(9, "attempting automatic retry on op #%d\n", notify_count); retry = true; } else if (sdap_id_op_can_reconnect(op)) { - DEBUG(9, ("attempting failover retry on op #%d\n", notify_count)); + DEBUG(9, "attempting failover retry on op #%d\n", notify_count); op->reconnect_retry_count++; retry = true; } @@ -669,13 +669,13 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) }
if (ret == EOK) { - DEBUG(9, ("notify connected to op #%d\n", notify_count)); + DEBUG(9, "notify connected to op #%d\n", notify_count); sdap_id_op_connect_req_complete(op, DP_ERR_OK, ret); } else if (is_offline) { - DEBUG(9, ("notify offline to op #%d\n", notify_count)); + DEBUG(9, "notify offline to op #%d\n", notify_count); sdap_id_op_connect_req_complete(op, DP_ERR_OFFLINE, EAGAIN); } else { - DEBUG(9, ("notify error to op #%d: %d [%s]\n", notify_count, ret, strerror(ret))); + DEBUG(9, "notify error to op #%d: %d [%s]\n", notify_count, ret, strerror(ret)); sdap_id_op_connect_req_complete(op, DP_ERR_FATAL, ret); } } @@ -688,7 +688,7 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) if ((ret == EOK) && conn_data->sh->connected && !be_is_offline(conn_cache->id_conn->id_ctx->be)) { - DEBUG(9, ("caching successful connection after %d notifies\n", notify_count)); + DEBUG(9, "caching successful connection after %d notifies\n", notify_count); conn_cache->cached_connection = conn_data;
/* Run any post-connection routines */ @@ -703,14 +703,14 @@ static void sdap_id_op_connect_done(struct tevent_req *subreq) }
if (reinit) { - DEBUG(SSSDBG_TRACE_FUNC, ("Server reinitialization detected. " - "Cleaning cache.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Server reinitialization detected. " + "Cleaning cache.\n"); reinit_req = sdap_reinit_cleanup_send(conn_cache->id_conn->id_ctx->be, conn_cache->id_conn->id_ctx->be, conn_cache->id_conn->id_ctx); if (reinit_req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up.\n"); return; }
@@ -726,13 +726,13 @@ static void sdap_id_op_connect_reinit_done(struct tevent_req *req) ret = sdap_reinit_cleanup_recv(req); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to perform reinitialization " - "clean up [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to perform reinitialization " + "clean up [%d]: %s\n", ret, strerror(ret)); /* not fatal */ return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Reinitialization clean up completed\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reinitialization clean up completed\n"); }
/* Mark operation connection request as complete */ @@ -804,7 +804,7 @@ int sdap_id_op_done(struct sdap_id_op *op, int retval, int *dp_err_out) /* do not reuse failed connection */ op->conn_cache->cached_connection = NULL;
- DEBUG(5, ("communication error on cached connection, moving to next server\n")); + DEBUG(5, "communication error on cached connection, moving to next server\n"); be_fo_try_next_server(op->conn_cache->id_conn->id_ctx->be, op->conn_cache->id_conn->service->name); } @@ -816,13 +816,13 @@ int sdap_id_op_done(struct sdap_id_op *op, int retval, int *dp_err_out) /* if backend is already offline, just report offline, do not duplicate errors */ dp_err = DP_ERR_OFFLINE; retval = EAGAIN; - DEBUG(9, ("falling back to offline data...\n")); + DEBUG(9, "falling back to offline data...\n"); } else if (communication_error) { /* communication error, can try to reconnect */
if (!sdap_id_op_can_reconnect(op)) { dp_err = DP_ERR_FATAL; - DEBUG(9, ("too many communication failures, giving up...\n")); + DEBUG(9, "too many communication failures, giving up...\n"); } else { dp_err = DP_ERR_OK; retval = EAGAIN; @@ -834,14 +834,14 @@ int sdap_id_op_done(struct sdap_id_op *op, int retval, int *dp_err_out) if (dp_err == DP_ERR_OK && retval != EOK) { /* reconnect retry */ op->reconnect_retry_count++; - DEBUG(9, ("advising for connection retry #%i\n", op->reconnect_retry_count)); + DEBUG(9, "advising for connection retry #%i\n", op->reconnect_retry_count); } else { /* end of request */ op->reconnect_retry_count = 0; }
if (current_conn) { - DEBUG(9, ("releasing operation connection\n")); + DEBUG(9, "releasing operation connection\n"); sdap_id_op_hook_conn_data(op, NULL); }
diff --git a/src/providers/ldap/sdap_idmap.c b/src/providers/ldap/sdap_idmap.c index 667e377..d54f48f 100644 --- a/src/providers/ldap/sdap_idmap.c +++ b/src/providers/ldap/sdap_idmap.c @@ -42,23 +42,23 @@ sdap_idmap_add_configured_external_range(struct sdap_idmap_ctx *idmap_ctx)
int_id = dp_opt_get_int(id_ctx->opts->basic, SDAP_MIN_ID); if (int_id < 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("ldap_min_id must be greater than 0.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "ldap_min_id must be greater than 0.\n"); return EINVAL; } range.min = int_id;
int_id = dp_opt_get_int(id_ctx->opts->basic, SDAP_MAX_ID); if (int_id < 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("ldap_min_id must be greater than 0.\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "ldap_min_id must be greater than 0.\n"); return EINVAL; } range.max = int_id;
if ((range.min == 0 && range.max != 0) || (range.min != 0 && range.max == 0)) { - DEBUG(SSSDBG_CONF_SETTINGS, ("Both ldap_min_id and ldap_max_id " \ + DEBUG(SSSDBG_CONF_SETTINGS, "Both ldap_min_id and ldap_max_id " \ "either must be 0 (not set) " \ - "or positive integers.\n")); + "or positive integers.\n"); return EINVAL; }
@@ -76,8 +76,8 @@ sdap_idmap_add_configured_external_range(struct sdap_idmap_ctx *idmap_ctx) NULL, 0, true); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s] to the map: [%d]\n", - id_ctx->be->domain->name, err)); + "Could not add domain [%s] to the map: [%d]\n", + id_ctx->be->domain->name, err); return EIO; }
@@ -95,7 +95,7 @@ errno_t sdap_idmap_find_new_domain(struct sdap_idmap_ctx *idmap_ctx, -1); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not add new domain [%s]\n", dom_name)); + "Could not add new domain [%s]\n", dom_name); return ret; }
@@ -148,17 +148,17 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, || (idmap_upper-idmap_lower) < rangesize) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid settings for range selection: " + "Invalid settings for range selection: " "[%"SPRIid"][%"SPRIid"][%"SPRIid"]\n", - idmap_lower, idmap_upper, rangesize)); + idmap_lower, idmap_upper, rangesize); ret = EINVAL; goto done; }
if (((idmap_upper - idmap_lower) % rangesize) != 0) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Range size does not divide evenly. Uppermost range will " - "not be used\n")); + "Range size does not divide evenly. Uppermost range will " + "not be used\n"); }
/* Initialize the map */ @@ -167,8 +167,8 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, &idmap_ctx->map); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not initialize the ID map: [%s]\n", - idmap_error_string(err))); + "Could not initialize the ID map: [%s]\n", + idmap_error_string(err)); if (err == IDMAP_OUT_OF_MEMORY) { ret = ENOMEM; } else { @@ -183,7 +183,7 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, err |= sss_idmap_ctx_set_rangesize(idmap_ctx->map, rangesize); if (err != IDMAP_SUCCESS) { /* This should never happen */ - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_idmap_ctx corrupted\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_idmap_ctx corrupted\n"); return EIO; }
@@ -194,7 +194,7 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, ret = sdap_idmap_add_configured_external_range(idmap_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_idmap_add_configured_external_range failed.\n")); + "sdap_idmap_add_configured_external_range failed.\n"); goto done; } } @@ -203,14 +203,14 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, ret = sysdb_idmap_get_mappings(tmp_ctx, sysdb, id_ctx->be->domain, &res); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not read ID mappings from the cache: [%s]\n", - strerror(ret))); + "Could not read ID mappings from the cache: [%s]\n", + strerror(ret)); goto done; }
if (ret == EOK && res->count > 0) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Initializing [%d] domains for ID-mapping\n", res->count)); + "Initializing [%d] domains for ID-mapping\n", res->count);
for (i = 0; i < res->count; i++) { dom_name = ldb_msg_find_attr_as_string(res->msgs[i], @@ -244,9 +244,9 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, sid_str, slice_num); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s][%s][%"SPRIid"] " + "Could not add domain [%s][%s][%"SPRIid"] " "to ID map: [%s]\n", - dom_name, sid_str, slice_num, strerror(ret))); + dom_name, sid_str, slice_num, strerror(ret)); goto done; } } @@ -271,18 +271,18 @@ sdap_idmap_init(TALLOC_CTX *mem_ctx, sid_str, 0); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s][%s][%u] to ID map: [%s]\n", - dom_name, sid_str, 0, strerror(ret))); + "Could not add domain [%s][%s][%u] to ID map: [%s]\n", + dom_name, sid_str, 0, strerror(ret)); goto done; } } else { if (dp_opt_get_bool(idmap_ctx->id_ctx->opts->basic, SDAP_IDMAP_AUTORID_COMPAT)) { /* In autorid compatibility mode, we MUST have a slice 0 */ DEBUG(SSSDBG_CRIT_FAILURE, - ("WARNING: Autorid compatibility mode selected, " + "WARNING: Autorid compatibility mode selected, " "but %s is not set. UID/GID values may differ " "between clients.\n", - idmap_ctx->id_ctx->opts->basic[SDAP_IDMAP_DEFAULT_DOMAIN_SID].opt_name)); + idmap_ctx->id_ctx->opts->basic[SDAP_IDMAP_DEFAULT_DOMAIN_SID].opt_name); } /* Otherwise, we'll just fall back to hash values as they are seen */ } @@ -310,7 +310,7 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, ret = sss_idmap_ctx_get_upper(idmap_ctx->map, &idmap_upper); if (ret != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to get upper bound of available ID range.\n")); + "Failed to get upper bound of available ID range.\n"); ret = EIO; goto done; } @@ -318,19 +318,19 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, ret = sss_idmap_calculate_range(idmap_ctx->map, dom_sid, &slice, &range); if (ret != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to calculate range for domain [%s]: [%d]\n", dom_name, - ret)); + "Failed to calculate range for domain [%s]: [%d]\n", dom_name, + ret); ret = EIO; goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Adding domain [%s] as slice [%"SPRIid"]\n", dom_sid, slice)); + "Adding domain [%s] as slice [%"SPRIid"]\n", dom_sid, slice);
if (range.max > idmap_upper) { /* This should never happen */ DEBUG(SSSDBG_CRIT_FAILURE, - ("BUG: Range maximum exceeds the global maximum: " - "%d > %"SPRIid"\n", range.max, idmap_upper)); + "BUG: Range maximum exceeds the global maximum: " + "%d > %"SPRIid"\n", range.max, idmap_upper); ret = EINVAL; goto done; } @@ -339,8 +339,8 @@ sdap_idmap_add_domain(struct sdap_idmap_ctx *idmap_ctx, err = sss_idmap_add_domain(idmap_ctx->map, dom_name, dom_sid, &range); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not add domain [%s] to the map: [%d]\n", - dom_name, err)); + "Could not add domain [%s] to the map: [%d]\n", + dom_name, err); ret = EIO; goto done; } @@ -424,14 +424,14 @@ sdap_idmap_sid_to_unix(struct sdap_idmap_ctx *idmap_ctx, &dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", sid_str)); + "Could not parse domain SID from [%s]\n", sid_str); goto done; }
ret = idmap_ctx->find_new_domain(idmap_ctx, dom_sid_str, dom_sid_str); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not add new domain for sid [%s]\n", sid_str)); + "Could not add new domain for sid [%s]\n", sid_str); goto done; }
@@ -441,23 +441,23 @@ sdap_idmap_sid_to_unix(struct sdap_idmap_ctx *idmap_ctx, (uint32_t *)id); if (err != IDMAP_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert objectSID [%s] to a UNIX ID\n", - sid_str)); + "Could not convert objectSID [%s] to a UNIX ID\n", + sid_str); ret = EIO; goto done; } break; case IDMAP_BUILTIN_SID: DEBUG(SSSDBG_TRACE_FUNC, - ("Object SID [%s] is a built-in one.\n", sid_str)); + "Object SID [%s] is a built-in one.\n", sid_str); /* ENOTSUP indicates built-in SID */ ret = ENOTSUP; goto done; break; default: DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not convert objectSID [%s] to a UNIX ID\n", - sid_str)); + "Could not convert objectSID [%s] to a UNIX ID\n", + sid_str); ret = EIO; goto done; } @@ -497,7 +497,7 @@ bool sdap_idmap_domain_has_algorithmic_mapping(struct sdap_idmap_ctx *ctx, } else { tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return false; }
@@ -505,7 +505,7 @@ bool sdap_idmap_domain_has_algorithmic_mapping(struct sdap_idmap_ctx *ctx, &new_dom_sid); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not parse domain SID from [%s]\n", dom_sid)); + "Could not parse domain SID from [%s]\n", dom_sid); talloc_free(tmp_ctx); return false; } @@ -515,7 +515,7 @@ bool sdap_idmap_domain_has_algorithmic_mapping(struct sdap_idmap_ctx *ctx, talloc_free(tmp_ctx); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not add new domain for sid [%s]\n", dom_sid)); + "Could not add new domain for sid [%s]\n", dom_sid); return false; }
diff --git a/src/providers/ldap/sdap_range.c b/src/providers/ldap/sdap_range.c index c4bf435..d88def6 100644 --- a/src/providers/ldap/sdap_range.c +++ b/src/providers/ldap/sdap_range.c @@ -55,7 +55,7 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, ret = EOK; } DEBUG(SSSDBG_TRACE_INTERNAL, - ("No sub-attributes for [%s]\n", attr_desc)); + "No sub-attributes for [%s]\n", attr_desc); goto done; }
@@ -67,8 +67,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Base attribute of [%s] is [%s]\n", - attr_desc, base)); + "Base attribute of [%s] is [%s]\n", + attr_desc, base);
/* Next, determine if this is a ranged attribute */ if (strncmp(endptr+1, SDAP_RANGE_STRING, rangestringlen) != 0) { @@ -82,8 +82,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, ret = EOK; } DEBUG(SSSDBG_TRACE_LIBS, - ("[%s] contains sub-attribute other than a range, returning whole\n", - attr_desc)); + "[%s] contains sub-attribute other than a range, returning whole\n", + attr_desc); goto done; } else if (disable_range_retrieval) { /* This is range sub-attribute, but we want to ignore it. @@ -102,8 +102,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, if (!end_range) { ret = EINVAL; DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot find hyphen in [%s]\n", - endptr + rangestringlen +1)); + "Cannot find hyphen in [%s]\n", + endptr + rangestringlen +1); goto done; } end_range++; /* advance past the hyphen */ @@ -113,8 +113,8 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, *base_attr = talloc_steal(mem_ctx, base); *range_offset = 0; DEBUG(SSSDBG_TRACE_LIBS, - ("[%s] contained the last set of values for this attribute\n", - attr_desc)); + "[%s] contained the last set of values for this attribute\n", + attr_desc); ret = EOK; goto done; } @@ -124,16 +124,16 @@ errno_t sdap_parse_range(TALLOC_CTX *mem_ctx, *range_offset = 0; ret = errno; DEBUG(SSSDBG_MINOR_FAILURE, - ("[%s] did not parse as an unsigned integer: [%s]\n", - end_range, strerror(ret))); + "[%s] did not parse as an unsigned integer: [%s]\n", + end_range, strerror(ret)); goto done; } (*range_offset)++;
*base_attr = talloc_steal(mem_ctx, base); DEBUG(SSSDBG_TRACE_LIBS, - ("Parsed range values: [%s][%d]\n", - base, *range_offset)); + "Parsed range values: [%s][%d]\n", + base, *range_offset);
ret = EAGAIN; done: diff --git a/src/providers/ldap/sdap_refresh.c b/src/providers/ldap/sdap_refresh.c index 819ee4f..fb2dbc7 100644 --- a/src/providers/ldap/sdap_refresh.c +++ b/src/providers/ldap/sdap_refresh.c @@ -47,7 +47,7 @@ struct tevent_req *sdap_refresh_netgroups_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sdap_refresh_netgroups_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -63,11 +63,11 @@ struct tevent_req *sdap_refresh_netgroups_send(TALLOC_CTX *mem_ctx,
ret = sdap_refresh_netgroups_step(req); if (ret == EOK) { - DEBUG(SSSDBG_TRACE_FUNC, ("Nothing to refresh\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Nothing to refresh\n"); goto immediately; } else if (ret != EAGAIN) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sdap_refresh_netgroups_step() failed " - "[%d]: %s\n", ret, sss_strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "sdap_refresh_netgroups_step() failed " + "[%d]: %s\n", ret, sss_strerror(ret)); goto immediately; }
@@ -104,7 +104,7 @@ static errno_t sdap_refresh_netgroups_step(struct tevent_req *req) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Issuing refresh of netgroup %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing refresh of netgroup %s\n", name);
subreq = ldap_netgroup_get_send(state, state->ev, state->id_ctx, state->id_ctx->opts->sdom, @@ -136,9 +136,9 @@ static void sdap_refresh_netgroups_done(struct tevent_req *subreq) ret = ldap_netgroup_get_recv(subreq, &dp_error, &sdap_ret); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to refresh netgroup [dp_error: %d, " + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to refresh netgroup [dp_error: %d, " "sdap_ret: %d, errno: %d]: %s\n", - dp_error, sdap_ret, ret, sss_strerror(ret))); + dp_error, sdap_ret, ret, sss_strerror(ret)); goto done; }
diff --git a/src/providers/ldap/sdap_reinit.c b/src/providers/ldap/sdap_reinit.c index 6a7f02c..41044aa 100644 --- a/src/providers/ldap/sdap_reinit.c +++ b/src/providers/ldap/sdap_reinit.c @@ -75,15 +75,15 @@ struct tevent_req* sdap_reinit_cleanup_send(TALLOC_CTX *mem_ctx,
ret = sdap_reinit_clear_usn(state->sysdb, state->domain); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to clear USN attributes [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to clear USN attributes [%d]: %s\n", + ret, strerror(ret)); goto immediately; }
subreq = sdap_dom_enum_send(id_ctx, be_ctx->ev, id_ctx, id_ctx->opts->sdom, id_ctx->conn); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to issue enumeration request\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to issue enumeration request\n"); ret = ENOMEM; goto immediately; } @@ -115,8 +115,8 @@ static void sdap_delete_msgs_usn(struct sysdb_ctx *sysdb, for (i = 0; i < msgs_num; i++) { ret = sysdb_set_entry_attr(sysdb, msgs[i]->dn, &usn_el, SYSDB_MOD_DEL); if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Failed to clean USN on entry: [%s]\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Failed to clean USN on entry: [%s]\n", + ldb_dn_get_linearized(msgs[i]->dn)); } } } @@ -134,7 +134,7 @@ static errno_t sdap_reinit_clear_usn(struct sysdb_ctx *sysdb,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -169,7 +169,7 @@ static errno_t sdap_reinit_clear_usn(struct sysdb_ctx *sysdb, "", attrs, &msgs_num, &msgs); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot search services [%d]: %s\n", ret, strerror(ret))); + "Cannot search services [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -181,14 +181,14 @@ static errno_t sdap_reinit_clear_usn(struct sysdb_ctx *sysdb, if (ret == EOK) { in_transaction = false; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not commit transaction\n"); }
done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } }
@@ -209,8 +209,8 @@ static void sdap_reinit_cleanup_done(struct tevent_req *subreq) ret = sdap_dom_enum_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Domain enumeration failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Domain enumeration failed [%d]: %s\n", + ret, strerror(ret)); goto fail; }
@@ -221,8 +221,8 @@ static void sdap_reinit_cleanup_done(struct tevent_req *subreq) */ ret = sysdb_set_enumerated(state->sysdb, state->domain, true); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not mark domain as having " - "enumerated.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not mark domain as having " + "enumerated.\n"); /* This error is non-fatal, so continue */ }
@@ -248,8 +248,8 @@ static void sdap_delete_msgs_dn(struct sysdb_ctx *sysdb, for (i = 0; i < msgs_num; i++) { ret = sysdb_delete_entry(sysdb, msgs[i]->dn, true); if (ret) { - DEBUG(SSSDBG_TRACE_FUNC, ("Failed to delete entry: [%s]\n", - ldb_dn_get_linearized(msgs[i]->dn))); + DEBUG(SSSDBG_TRACE_FUNC, "Failed to delete entry: [%s]\n", + ldb_dn_get_linearized(msgs[i]->dn)); } } } @@ -267,7 +267,7 @@ static errno_t sdap_reinit_delete_records(struct sysdb_ctx *sysdb,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -308,14 +308,14 @@ static errno_t sdap_reinit_delete_records(struct sysdb_ctx *sysdb, if (ret == EOK) { in_transaction = false; } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not commit transaction\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not commit transaction\n"); }
done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not cancel transaction\n"); } }
diff --git a/src/providers/ldap/sdap_sudo.c b/src/providers/ldap/sdap_sudo.c index b8bc409..adbc37b 100644 --- a/src/providers/ldap/sdap_sudo.c +++ b/src/providers/ldap/sdap_sudo.c @@ -128,11 +128,11 @@ int sdap_sudo_init(struct be_ctx *be_ctx, struct tevent_req *req = NULL; int ret;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Initializing sudo LDAP back end\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing sudo LDAP back end\n");
sudo_ctx = talloc_zero(be_ctx, struct sdap_sudo_ctx); if (sudo_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc() failed\n"); return ENOMEM; }
@@ -150,23 +150,23 @@ int sdap_sudo_init(struct be_ctx *be_ctx, &sudo_ctx->include_regexp, &sudo_ctx->include_netgroups); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get SUDO options [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get SUDO options [%d]: %s\n", + ret, strerror(ret)); return ret; }
req = sdap_sudo_get_hostinfo_send(sudo_ctx, id_ctx->opts, be_ctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve host information - " - "(host filter will be disabled)\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve host information - " + "(host filter will be disabled)\n");
sudo_ctx->use_host_filter = false;
ret = sdap_sudo_setup_periodical_refresh(sudo_ctx); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to setup periodical refresh" - "of sudo rules [%d]: %s\n", ret, strerror(ret))); + "Unable to setup periodical refresh" + "of sudo rules [%d]: %s\n", ret, strerror(ret)); /* periodical updates will not work, but specific-rule update * is no affected by this, therefore we don't have to fail here */ } @@ -189,8 +189,8 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *req) ret = sdap_sudo_get_hostinfo_recv(sudo_ctx, req, &hostnames, &ip_addr); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve host information - " - "(host filter will be disabled) [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve host information - " + "(host filter will be disabled) [%d]: %s\n", ret, strerror(ret)); sudo_ctx->use_host_filter = false; }
@@ -202,8 +202,8 @@ static void sdap_sudo_get_hostinfo_done(struct tevent_req *req)
ret = sdap_sudo_setup_periodical_refresh(sudo_ctx); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to setup periodical refresh" - "of sudo rules [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Unable to setup periodical refresh" + "of sudo rules [%d]: %s\n", ret, strerror(ret)); } }
@@ -226,9 +226,9 @@ static int sdap_sudo_setup_periodical_refresh(struct sdap_sudo_ctx *sudo_ctx) if (smart_interval == 0 && full_interval == 0) { smart_default = id_ctx->opts->basic[SDAP_SUDO_SMART_REFRESH_INTERVAL].def_val.number;
- DEBUG(SSSDBG_MINOR_FAILURE, ("At least one periodical update has to be " + DEBUG(SSSDBG_MINOR_FAILURE, "At least one periodical update has to be " "enabled. Setting smart refresh interval to default value (%ld).\n", - smart_default)); + smart_default);
ret = dp_opt_set_int(id_ctx->opts->basic, SDAP_SUDO_SMART_REFRESH_INTERVAL, @@ -239,9 +239,9 @@ static int sdap_sudo_setup_periodical_refresh(struct sdap_sudo_ctx *sudo_ctx) }
if (full_interval <= smart_interval) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Full refresh interval has to be greater" + DEBUG(SSSDBG_MINOR_FAILURE, "Full refresh interval has to be greater" "than smart refresh interval. Periodical full refresh will be " - "disabled.\n")); + "disabled.\n"); ret = dp_opt_set_int(id_ctx->opts->basic, SDAP_SUDO_FULL_REFRESH_INTERVAL, 0); @@ -281,8 +281,8 @@ static int sdap_sudo_setup_periodical_refresh(struct sdap_sudo_ctx *sudo_ctx) sdap_sudo_periodical_first_refresh_done, delay, full_interval, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules! Periodical updates will not work!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules! Periodical updates will not work!\n"); return ret; }
@@ -304,10 +304,10 @@ static void sdap_sudo_set_usn(struct sdap_server_opts *srv_opts, char *usn) srv_opts->last_usn = usn_number; }
- DEBUG(SSSDBG_FUNC_DATA, ("SUDO higher USN value: [%s]\n", - srv_opts->max_sudo_value)); + DEBUG(SSSDBG_FUNC_DATA, "SUDO higher USN value: [%s]\n", + srv_opts->max_sudo_value); } else { - DEBUG(SSSDBG_TRACE_FUNC, ("srv_opts is NULL\n")); + DEBUG(SSSDBG_TRACE_FUNC, "srv_opts is NULL\n"); } }
@@ -324,7 +324,7 @@ static char *sdap_sudo_build_host_filter(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return NULL; }
@@ -426,7 +426,7 @@ static char *sdap_sudo_get_filter(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return NULL; }
@@ -470,8 +470,8 @@ static void sdap_sudo_reply(struct tevent_req *req) ret = sdap_sudo_rules_refresh_recv(req, &dp_error, &error); break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid request type: %d\n", - sudo_req->type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid request type: %d\n", + sudo_req->type); ret = EINVAL; }
@@ -501,25 +501,25 @@ void sdap_sudo_handler(struct be_req *be_req)
switch (sudo_req->type) { case BE_REQ_SUDO_FULL: - DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a full refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a full refresh of sudo rules\n"); req = sdap_sudo_full_refresh_send(be_req, sudo_ctx); break; case BE_REQ_SUDO_RULES: - DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a refresh of specific sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a refresh of specific sudo rules\n"); req = sdap_sudo_rules_refresh_send(be_req, sudo_ctx, id_ctx->be, id_ctx->opts, id_ctx->conn->conn_cache, sudo_req->rules); break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid request type: %d\n", - sudo_req->type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid request type: %d\n", + sudo_req->type); ret = EINVAL; goto fail; }
if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to send request: %d\n", - sudo_req->type)); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to send request: %d\n", + sudo_req->type); ret = ENOMEM; goto fail; } @@ -547,7 +547,7 @@ static struct tevent_req *sdap_sudo_full_refresh_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_full_refresh_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -581,7 +581,7 @@ static struct tevent_req *sdap_sudo_full_refresh_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a full refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a full refresh of sudo rules\n");
subreq = sdap_sudo_refresh_send(state, id_ctx->be, id_ctx->opts, id_ctx->conn->conn_cache, @@ -634,14 +634,14 @@ static void sdap_sudo_full_refresh_done(struct tevent_req *subreq) ret = sysdb_sudo_set_last_full_refresh(state->sysdb, state->domain, time(NULL)); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to save time of " - "a successful full refresh\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to save time of " + "a successful full refresh\n"); /* this is only a minor error that does not affect the functionality, * therefore there is no need to report it with tevent_req_error() * which would cause problems in the consumers */ }
- DEBUG(SSSDBG_TRACE_FUNC, ("Successful full refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Successful full refresh of sudo rules\n");
/* set highest usn */ if (highest_usn != NULL) { @@ -699,13 +699,13 @@ static struct tevent_req *sdap_sudo_rules_refresh_send(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return NULL; }
req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_rules_refresh_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -853,15 +853,15 @@ static struct tevent_req *sdap_sudo_smart_refresh_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct sdap_sudo_smart_refresh_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
if (!sudo_ctx->full_refresh_done && (srv_opts == NULL || srv_opts->max_sudo_value == 0)) { /* Perform full refresh first */ - DEBUG(SSSDBG_TRACE_FUNC, ("USN value is unknown, " - "waiting for full refresh!\n")); + DEBUG(SSSDBG_TRACE_FUNC, "USN value is unknown, " + "waiting for full refresh!\n"); ret = EINVAL; goto immediately; } @@ -896,8 +896,8 @@ static struct tevent_req *sdap_sudo_smart_refresh_send(TALLOC_CTX *mem_ctx, /* Do not remove any rules that are already in the sysdb * sysdb_filter = NULL; */
- DEBUG(SSSDBG_TRACE_FUNC, ("Issuing a smart refresh of sudo rules " - "(USN > %s)\n", (usn == NULL ? "0" : usn))); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing a smart refresh of sudo rules " + "(USN > %s)\n", (usn == NULL ? "0" : usn));
subreq = sdap_sudo_refresh_send(state, id_ctx->be, id_ctx->opts, id_ctx->conn->conn_cache, @@ -945,7 +945,7 @@ static void sdap_sudo_smart_refresh_done(struct tevent_req *subreq) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Successful smart refresh of sudo rules\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Successful smart refresh of sudo rules\n");
/* set highest usn */ if (highest_usn != NULL) { @@ -999,8 +999,8 @@ static void sdap_sudo_full_refresh_online_cb(void *pvt) SDAP_SUDO_FULL_REFRESH_INTERVAL); if (timeout == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical full refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical full refresh of sudo rules " + "is disabled\n"); return; }
@@ -1009,8 +1009,8 @@ static void sdap_sudo_full_refresh_online_cb(void *pvt) sdap_sudo_periodical_first_refresh_done, 0, timeout, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules! Periodical updates will not work!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules! Periodical updates will not work!\n"); } }
@@ -1027,21 +1027,21 @@ static void sdap_sudo_periodical_first_refresh_done(struct tevent_req *req) ret = sdap_sudo_timer_recv(req, req, &subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Sudo timer failed [%d]: %s\n", ret, strerror(ret))); + "Sudo timer failed [%d]: %s\n", ret, strerror(ret)); goto schedule; }
ret = sdap_sudo_full_refresh_recv(subreq, &dp_error, &error); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " - "failed [%d]: %s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " + "failed [%d]: %s)\n", ret, strerror(ret)); goto schedule; }
if (dp_error != DP_ERR_OK || error != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " "failed [dp_error: %d] ([%d]: %s)\n", - dp_error, error, strerror(error))); + dp_error, error, strerror(error)); goto schedule; }
@@ -1057,8 +1057,8 @@ schedule: SDAP_SUDO_FULL_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical full refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical full refresh of sudo rules " + "is disabled\n"); return; }
@@ -1071,8 +1071,8 @@ schedule: delay = SUDO_MAX_FIRST_REFRESH_DELAY; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Data provider is offline. " - "Scheduling another full refresh in %ld minutes.\n", delay)); + DEBUG(SSSDBG_TRACE_FUNC, "Data provider is offline. " + "Scheduling another full refresh in %ld minutes.\n", delay);
ret = sdap_sudo_schedule_refresh(sudo_ctx, sudo_ctx, SDAP_SUDO_REFRESH_FULL, @@ -1080,8 +1080,8 @@ schedule: delay * 60, timeout, &sudo_ctx->first_refresh_timer); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules! Periodical updates will not work!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules! Periodical updates will not work!\n"); }
/* also setup online callback to make sure the refresh is fired as soon @@ -1090,7 +1090,7 @@ schedule: sdap_sudo_full_refresh_online_cb, sudo_ctx, &sudo_ctx->first_refresh_online_cb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set up online callback\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set up online callback\n"); }
return; @@ -1098,7 +1098,7 @@ schedule:
ret = sdap_sudo_schedule_full_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Full periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Full periodical refresh will not work.\n"); }
/* smart refresh */ @@ -1106,14 +1106,14 @@ schedule: SDAP_SUDO_SMART_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical smart refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical smart refresh of sudo rules " + "is disabled\n"); return; }
ret = sdap_sudo_schedule_smart_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Smart periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Smart periodical refresh will not work.\n"); } }
@@ -1129,21 +1129,21 @@ static void sdap_sudo_periodical_full_refresh_done(struct tevent_req *req) ret = sdap_sudo_timer_recv(req, req, &subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Sudo timer failed [%d]: %s\n", ret, strerror(ret))); + "Sudo timer failed [%d]: %s\n", ret, strerror(ret)); goto schedule; }
ret = sdap_sudo_full_refresh_recv(subreq, &dp_error, &error); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " - "failed [%d]: %s)\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " + "failed [%d]: %s)\n", ret, strerror(ret)); goto schedule; }
if (dp_error != DP_ERR_OK || error != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical full refresh of sudo rules " + DEBUG(SSSDBG_OP_FAILURE, "Periodical full refresh of sudo rules " "failed [dp_error: %d] ([%d]: %s)\n", - dp_error, error, strerror(error))); + dp_error, error, strerror(error)); goto schedule; }
@@ -1155,14 +1155,14 @@ schedule: SDAP_SUDO_FULL_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical full refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical full refresh of sudo rules " + "is disabled\n"); return; }
ret = sdap_sudo_schedule_full_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Full periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Full periodical refresh will not work.\n"); } }
@@ -1178,20 +1178,20 @@ static void sdap_sudo_periodical_smart_refresh_done(struct tevent_req *req) ret = sdap_sudo_timer_recv(req, req, &subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Sudo timer failed [%d]: %s\n", ret, strerror(ret))); + "Sudo timer failed [%d]: %s\n", ret, strerror(ret)); goto schedule; }
ret = sdap_sudo_smart_refresh_recv(subreq, &dp_error, &error); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical smart refresh of sudo rules " - "failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Periodical smart refresh of sudo rules " + "failed [%d]: %s\n", ret, strerror(ret)); }
if (dp_error != DP_ERR_OK || error != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Periodical smart refresh of sudo rules " + DEBUG(SSSDBG_OP_FAILURE, "Periodical smart refresh of sudo rules " "failed [dp_error: %d] ([%d]: %s)\n", - dp_error, error, strerror(error))); + dp_error, error, strerror(error)); goto schedule; }
@@ -1203,14 +1203,14 @@ schedule: SDAP_SUDO_SMART_REFRESH_INTERVAL); if (delay == 0) { /* runtime configuration change? */ - DEBUG(SSSDBG_TRACE_FUNC, ("Periodical smart refresh of sudo rules " - "is disabled\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Periodical smart refresh of sudo rules " + "is disabled\n"); return; }
ret = sdap_sudo_schedule_smart_refresh(sudo_ctx, delay); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Smart periodical refresh will not work.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Smart periodical refresh will not work.\n"); } }
@@ -1239,10 +1239,10 @@ static int sdap_sudo_schedule_refresh(TALLOC_CTX *mem_ctx, name = "Smart refresh"; break; case SDAP_SUDO_REFRESH_RULES: - DEBUG(SSSDBG_OP_FAILURE, ("Rules refresh can't be scheduled!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Rules refresh can't be scheduled!\n"); return EINVAL; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown refresh type [%d].\n", refresh)); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown refresh type [%d].\n", refresh); return EINVAL; }
@@ -1256,8 +1256,8 @@ static int sdap_sudo_schedule_refresh(TALLOC_CTX *mem_ctx,
tevent_req_set_callback(req, callback, sudo_ctx);
- DEBUG(SSSDBG_TRACE_FUNC, ("%s scheduled at: %lld\n", - name, (long long)when.tv_sec)); + DEBUG(SSSDBG_TRACE_FUNC, "%s scheduled at: %lld\n", + name, (long long)when.tv_sec);
if (_req != NULL) { *_req = req; @@ -1276,8 +1276,8 @@ static int sdap_sudo_schedule_full_refresh(struct sdap_sudo_ctx *sudo_ctx, sdap_sudo_periodical_full_refresh_done, delay, delay, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule full refresh of sudo " - "rules!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule full refresh of sudo " + "rules!\n"); return ret; }
@@ -1294,8 +1294,8 @@ static int sdap_sudo_schedule_smart_refresh(struct sdap_sudo_ctx *sudo_ctx, sdap_sudo_periodical_smart_refresh_done, delay, delay, NULL); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Unable to schedule smart refresh of sudo " - "rules!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unable to schedule smart refresh of sudo " + "rules!\n"); return ret; }
diff --git a/src/providers/ldap/sdap_sudo_cache.c b/src/providers/ldap/sdap_sudo_cache.c index de4f65c..7390d85 100644 --- a/src/providers/ldap/sdap_sudo_cache.c +++ b/src/providers/ldap/sdap_sudo_cache.c @@ -41,7 +41,7 @@ static errno_t sdap_sudo_get_usn(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(attrs, map[SDAP_AT_SUDO_USN].sys_name, &usn); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to retrieve USN value: [%s]\n", strerror(ret))); + "Failed to retrieve USN value: [%s]\n", strerror(ret));
return ret; } @@ -70,33 +70,33 @@ sdap_save_native_sudorule(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_get_string(attrs, map[SDAP_AT_SUDO_NAME].sys_name, &rule_name); if (ret == ERANGE) { - DEBUG(SSSDBG_OP_FAILURE, ("Warning: found rule that contains none " - "or multiple CN values. It will be skipped.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Warning: found rule that contains none " + "or multiple CN values. It will be skipped.\n"); return ret; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get rule name [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not get rule name [%d]: %s\n", + ret, strerror(ret)); return ret; }
ret = sysdb_attrs_add_time_t(attrs, SYSDB_CACHE_EXPIRE, (cache_timeout ? (now + cache_timeout) : 0)); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not set sysdb cache expire [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not set sysdb cache expire [%d]: %s\n", + ret, strerror(ret)); return ret; }
ret = sdap_sudo_get_usn(mem_ctx, attrs, map, rule_name, _usn); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not read USN from %s\n", rule_name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not read USN from %s\n", rule_name); *_usn = NULL; /* but we will store the rule anyway */ }
ret = sysdb_save_sudorule(sysdb_ctx, domain, rule_name, attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not save sudorule %s\n", rule_name)); + DEBUG(SSSDBG_OP_FAILURE, "Could not save sudorule %s\n", rule_name); return ret; }
@@ -123,13 +123,13 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
ret = sysdb_transaction_start(sysdb_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not start transaction\n"); goto fail; } in_transaction = true; @@ -140,8 +140,8 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx, domain, map, replies[i], cache_timeout, now, &usn_value); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to save sudo rule, " - "will continue with next...\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to save sudo rule, " + "will continue with next...\n"); continue; }
@@ -163,7 +163,7 @@ sdap_save_native_sudorule_list(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_commit(sysdb_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -177,7 +177,7 @@ fail: if (in_transaction) { tret = sysdb_transaction_cancel(sysdb_ctx); if (tret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } }
diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c index 61fec63..2e9d452 100644 --- a/src/providers/proxy/proxy_auth.c +++ b/src/providers/proxy/proxy_auth.c @@ -64,7 +64,7 @@ void proxy_pam_handler(struct be_req *req) be_req_terminate(req, DP_ERR_OK, EOK, NULL); return; default: - DEBUG(1, ("Unsupported PAM task.\n")); + DEBUG(1, "Unsupported PAM task.\n"); pd->pam_status = PAM_MODULE_UNKNOWN; be_req_terminate(req, DP_ERR_OK, EINVAL, "Unsupported PAM task"); return; @@ -102,13 +102,13 @@ static int proxy_child_destructor(TALLOC_CTX *ctx) hash_key_t key; int hret;
- DEBUG(8, ("Removing proxy child id [%d]\n", child_ctx->id)); + DEBUG(8, "Removing proxy child id [%d]\n", child_ctx->id); key.type = HASH_KEY_ULONG; key.ul = child_ctx->id; hret = hash_delete(child_ctx->auth_ctx->request_table, &key); if (!(hret == HASH_SUCCESS || hret == HASH_ERROR_KEY_NOT_FOUND)) { - DEBUG(1, ("Hash error [%d][%s]\n", hret, hash_error_string(hret))); + DEBUG(1, "Hash error [%d][%s]\n", hret, hash_error_string(hret)); /* Nothing we can do about this, so just continue */ } return 0; @@ -132,7 +132,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct proxy_child_ctx); if (req == NULL) { - DEBUG(1, ("Could not send PAM request to child\n")); + DEBUG(1, "Could not send PAM request to child\n"); return NULL; }
@@ -156,7 +156,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx,
if (auth_ctx->next_id == first) { /* We've looped through all possible integers! */ - DEBUG(0, ("Serious error: queue is too long!\n")); + DEBUG(0, "Serious error: queue is too long!\n"); talloc_zfree(req); return NULL; } @@ -167,11 +167,11 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx,
value.type = HASH_VALUE_PTR; value.ptr = req; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Queueing request [%lu]\n", key.ul)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Queueing request [%lu]\n", key.ul); hret = hash_enter(auth_ctx->request_table, &key, &value); if (hret != HASH_SUCCESS) { - DEBUG(1, ("Could not add request to the queue\n")); + DEBUG(1, "Could not add request to the queue\n"); talloc_zfree(req); return NULL; } @@ -187,7 +187,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, auth_ctx->running++; subreq = proxy_child_init_send(auth_ctx, state, auth_ctx); if (!subreq) { - DEBUG(1, ("Could not fork child process\n")); + DEBUG(1, "Could not fork child process\n"); auth_ctx->running--; talloc_zfree(req); return NULL; @@ -200,7 +200,7 @@ static struct tevent_req *proxy_child_send(TALLOC_CTX *mem_ctx, /* If there was no available slot, it will be queued * until a slot is available */ - DEBUG(8, ("All available child slots are full, queuing request\n")); + DEBUG(8, "All available child slots are full, queuing request\n"); } return req; } @@ -234,7 +234,7 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct pc_init_ctx); if (req == NULL) { - DEBUG(1, ("Could not create tevent_req\n")); + DEBUG(1, "Could not create tevent_req\n"); return NULL; }
@@ -248,16 +248,16 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx, auth_ctx->be->domain->name, child_ctx->id); if (state->command == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return NULL; }
- DEBUG(7, ("Starting proxy child with args [%s]\n", state->command)); + DEBUG(7, "Starting proxy child with args [%s]\n", state->command);
pid = fork(); if (pid < 0) { ret = errno; - DEBUG(1, ("fork failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "fork failed [%d][%s].\n", ret, strerror(ret)); talloc_zfree(req); return NULL; } @@ -267,8 +267,8 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx, execvp(proxy_child_args[0], proxy_child_args);
ret = errno; - DEBUG(0, ("Could not start proxy child [%s]: [%d][%s].\n", - state->command, ret, strerror(ret))); + DEBUG(0, "Could not start proxy child [%s]: [%d][%s].\n", + state->command, ret, strerror(ret));
_exit(1); } @@ -282,7 +282,7 @@ static struct tevent_req *proxy_child_init_send(TALLOC_CTX *mem_ctx, SIGCHLD, SA_SIGINFO, pc_init_sig_handler, req); if (state->sige == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); talloc_zfree(req); return NULL; } @@ -322,42 +322,42 @@ static void pc_init_sig_handler(struct tevent_context *ev, struct pc_init_ctx *init_ctx;
if (count <= 0) { - DEBUG(0, ("SIGCHLD handler called with invalid child count\n")); + DEBUG(0, "SIGCHLD handler called with invalid child count\n"); return; }
req = talloc_get_type(pvt, struct tevent_req); init_ctx = tevent_req_data(req, struct pc_init_ctx);
- DEBUG(7, ("Waiting for child [%d].\n", init_ctx->pid)); + DEBUG(7, "Waiting for child [%d].\n", init_ctx->pid);
errno = 0; ret = waitpid(init_ctx->pid, &child_status, WNOHANG);
if (ret == -1) { ret = errno; - DEBUG(1, ("waitpid failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "waitpid failed [%d][%s].\n", ret, strerror(ret)); } else if (ret == 0) { - DEBUG(1, ("waitpid did not find a child with changed status.\n")); + DEBUG(1, "waitpid did not find a child with changed status.\n"); } else { if (WIFEXITED(child_status)) { - DEBUG(4, ("child [%d] exited with status [%d].\n", ret, - WEXITSTATUS(child_status))); + DEBUG(4, "child [%d] exited with status [%d].\n", ret, + WEXITSTATUS(child_status)); tevent_req_error(req, EIO); } else if (WIFSIGNALED(child_status)) { - DEBUG(4, ("child [%d] was terminate by signal [%d].\n", ret, - WTERMSIG(child_status))); + DEBUG(4, "child [%d] was terminate by signal [%d].\n", ret, + WTERMSIG(child_status)); tevent_req_error(req, EIO); } else { if (WIFSTOPPED(child_status)) { - DEBUG(1, ("child [%d] was stopped by signal [%d].\n", ret, - WSTOPSIG(child_status))); + DEBUG(1, "child [%d] was stopped by signal [%d].\n", ret, + WSTOPSIG(child_status)); } if (WIFCONTINUED(child_status)) { - DEBUG(1, ("child [%d] was resumed by delivery of SIGCONT.\n", - ret)); + DEBUG(1, "child [%d] was resumed by delivery of SIGCONT.\n", + ret); } - DEBUG(1, ("Child is still running, no new child is started.\n")); + DEBUG(1, "Child is still running, no new child is started.\n"); return; } } @@ -369,7 +369,7 @@ static void pc_init_timeout(struct tevent_context *ev, { struct tevent_req *req;
- DEBUG(2, ("Client timed out before Identification!\n")); + DEBUG(2, "Client timed out before Identification!\n"); req = talloc_get_type(ptr, struct tevent_req); tevent_req_error(req, ETIMEDOUT); } @@ -421,7 +421,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { ret = proxy_child_init_recv(subreq, &child_ctx->pid, &child_ctx->conn); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(6, ("Proxy child init failed [%d]\n", ret)); + DEBUG(6, "Proxy child init failed [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -431,7 +431,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { child_ctx->conn, child_ctx->pd, child_ctx->pid); if (!subreq) { - DEBUG(1,("Could not start PAM conversation\n")); + DEBUG(1,"Could not start PAM conversation\n"); tevent_req_error(req, EIO); return; } @@ -443,7 +443,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { */ sig_ctx = talloc_zero(child_ctx->auth_ctx, struct proxy_child_sig_ctx); if(sig_ctx == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -456,7 +456,7 @@ static void proxy_child_init_done(struct tevent_req *subreq) { proxy_child_sig_handler, sig_ctx); if (sige == NULL) { - DEBUG(1, ("tevent_add_signal failed.\n")); + DEBUG(1, "tevent_add_signal failed.\n"); tevent_req_error(req, ENOMEM); return; } @@ -485,44 +485,44 @@ static void proxy_child_sig_handler(struct tevent_context *ev, struct tevent_immediate *imm2;
if (count <= 0) { - DEBUG(0, ("SIGCHLD handler called with invalid child count\n")); + DEBUG(0, "SIGCHLD handler called with invalid child count\n"); return; }
sig_ctx = talloc_get_type(pvt, struct proxy_child_sig_ctx); - DEBUG(7, ("Waiting for child [%d].\n", sig_ctx->pid)); + DEBUG(7, "Waiting for child [%d].\n", sig_ctx->pid);
errno = 0; ret = waitpid(sig_ctx->pid, &child_status, WNOHANG);
if (ret == -1) { ret = errno; - DEBUG(1, ("waitpid failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "waitpid failed [%d][%s].\n", ret, strerror(ret)); } else if (ret == 0) { - DEBUG(1, ("waitpid did not found a child with changed status.\n")); + DEBUG(1, "waitpid did not found a child with changed status.\n"); } else { if (WIFEXITED(child_status)) { - DEBUG(4, ("child [%d] exited with status [%d].\n", ret, - WEXITSTATUS(child_status))); + DEBUG(4, "child [%d] exited with status [%d].\n", ret, + WEXITSTATUS(child_status)); } else if (WIFSIGNALED(child_status)) { - DEBUG(4, ("child [%d] was terminated by signal [%d].\n", ret, - WTERMSIG(child_status))); + DEBUG(4, "child [%d] was terminated by signal [%d].\n", ret, + WTERMSIG(child_status)); } else { if (WIFSTOPPED(child_status)) { - DEBUG(1, ("child [%d] was stopped by signal [%d].\n", ret, - WSTOPSIG(child_status))); + DEBUG(1, "child [%d] was stopped by signal [%d].\n", ret, + WSTOPSIG(child_status)); } if (WIFCONTINUED(child_status)) { - DEBUG(1, ("child [%d] was resumed by delivery of SIGCONT.\n", - ret)); + DEBUG(1, "child [%d] was resumed by delivery of SIGCONT.\n", + ret); } - DEBUG(1, ("Child is still running, no new child is started.\n")); + DEBUG(1, "Child is still running, no new child is started.\n"); return; }
imm = tevent_create_immediate(ev); if (imm == NULL) { - DEBUG(1, ("tevent_create_immediate failed.\n")); + DEBUG(1, "tevent_create_immediate failed.\n"); return; }
@@ -532,7 +532,7 @@ static void proxy_child_sig_handler(struct tevent_context *ev, /* schedule another immediate timer to delete the sigchld handler */ imm2 = tevent_create_immediate(ev); if (imm2 == NULL) { - DEBUG(1, ("tevent_create_immediate failed.\n")); + DEBUG(1, "tevent_create_immediate failed.\n"); return; }
@@ -583,17 +583,17 @@ static struct tevent_req *proxy_pam_conv_send(TALLOC_CTX *mem_ctx, DP_INTERFACE, DP_METHOD_PAMHANDLER); if (msg == NULL) { - DEBUG(1, ("dbus_message_new_method_call failed.\n")); + DEBUG(1, "dbus_message_new_method_call failed.\n"); talloc_zfree(req); return NULL; }
- DEBUG(4, ("Sending request with the following data:\n")); + DEBUG(4, "Sending request with the following data:\n"); DEBUG_PAM_DATA(4, pd);
dp_ret = dp_pack_pam_request(msg, pd); if (!dp_ret) { - DEBUG(1, ("Failed to build message\n")); + DEBUG(1, "Failed to build message\n"); dbus_message_unref(msg); talloc_zfree(req); return NULL; @@ -620,7 +620,7 @@ static void proxy_pam_conv_reply(DBusPendingCall *pending, void *ptr) int type; int ret;
- DEBUG(8, ("Handling pam conversation reply\n")); + DEBUG(8, "Handling pam conversation reply\n");
req = talloc_get_type(ptr, struct tevent_req); state = tevent_req_data(req, struct proxy_conv_ctx); @@ -630,8 +630,8 @@ static void proxy_pam_conv_reply(DBusPendingCall *pending, void *ptr) reply = dbus_pending_call_steal_reply(pending); dbus_pending_call_unref(pending); if (reply == NULL) { - DEBUG(0, ("Severe error. A reply callback was called but no reply was" - "received and no timeout occurred\n")); + DEBUG(0, "Severe error. A reply callback was called but no reply was" + "received and no timeout occurred\n"); state->pd->pam_status = PAM_SYSTEM_ERR; tevent_req_error(req, EIO); } @@ -641,23 +641,23 @@ static void proxy_pam_conv_reply(DBusPendingCall *pending, void *ptr) case DBUS_MESSAGE_TYPE_METHOD_RETURN: ret = dp_unpack_pam_response(reply, state->pd, &dbus_error); if (!ret) { - DEBUG(0, ("Failed to parse reply.\n")); + DEBUG(0, "Failed to parse reply.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; dbus_message_unref(reply); tevent_req_error(req, EIO); return; } - DEBUG(4, ("received: [%d][%s]\n", + DEBUG(4, "received: [%d][%s]\n", state->pd->pam_status, - state->pd->domain)); + state->pd->domain); break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0, ("Reply error [%s].\n", - dbus_message_get_error_name(reply))); + DEBUG(0, "Reply error [%s].\n", + dbus_message_get_error_name(reply)); state->pd->pam_status = PAM_SYSTEM_ERR; break; default: - DEBUG(0, ("Default... what now?.\n")); + DEBUG(0, "Default... what now?.\n"); state->pd->pam_status = PAM_SYSTEM_ERR; } dbus_message_unref(reply); @@ -686,7 +686,7 @@ static void proxy_pam_conv_done(struct tevent_req *subreq) ret = proxy_pam_conv_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(6, ("Proxy PAM conversation failed [%d]\n", ret)); + DEBUG(6, "Proxy PAM conversation failed [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -725,7 +725,7 @@ static void proxy_child_done(struct tevent_req *req) client_ctx->auth_ctx->running--; imm = tevent_create_immediate(be_ctx->ev); if (imm == NULL) { - DEBUG(1, ("tevent_create_immediate failed.\n")); + DEBUG(1, "tevent_create_immediate failed.\n"); /* We'll still finish the current request, but we're * likely to have problems if there are queued events * if we've gotten into this state. @@ -753,7 +753,7 @@ static void proxy_child_done(struct tevent_req *req) ret = sss_authtok_get_password(pd->authtok, &password, NULL); if (ret) { /* password caching failures are not fatal errors */ - DEBUG(2, ("Failed to cache password\n")); + DEBUG(2, "Failed to cache password\n"); goto done; }
@@ -763,8 +763,8 @@ static void proxy_child_done(struct tevent_req *req) /* password caching failures are not fatal errors */ /* so we just log it any return */ if (ret != EOK) { - DEBUG(2, ("Failed to cache password (%d)[%s]!?\n", - ret, strerror(ret))); + DEBUG(2, "Failed to cache password (%d)[%s]!?\n", + ret, strerror(ret)); } }
@@ -808,7 +808,7 @@ static void run_proxy_child_queue(struct tevent_context *ev, auth_ctx->running++; subreq = proxy_child_init_send(auth_ctx, state, auth_ctx); if (!subreq) { - DEBUG(1, ("Could not fork child process\n")); + DEBUG(1, "Could not fork child process\n"); auth_ctx->running--; talloc_zfree(req); return; diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c index 66afcfb..09a3b4b 100644 --- a/src/providers/proxy/proxy_child.c +++ b/src/providers/proxy/proxy_child.c @@ -95,7 +95,7 @@ static int proxy_internal_conv(int num_msg, const struct pam_message **msgm, for (i=0; i < num_msg; i++) { switch( msgm[i]->msg_style ) { case PAM_PROMPT_ECHO_OFF: - DEBUG(4, ("Conversation message: [%s]\n", msgm[i]->msg)); + DEBUG(4, "Conversation message: [%s]\n", msgm[i]->msg); reply[i].resp_retcode = 0;
ret = sss_authtok_get_password(auth_data->authtok, @@ -107,8 +107,8 @@ static int proxy_internal_conv(int num_msg, const struct pam_message **msgm,
break; default: - DEBUG(1, ("Conversation style %d not supported.\n", - msgm[i]->msg_style)); + DEBUG(1, "Conversation style %d not supported.\n", + msgm[i]->msg_style); goto failed; } } @@ -144,7 +144,7 @@ static int proxy_chauthtok_conv(int num_msg, const struct pam_message **msgm, for (i=0; i < num_msg; i++) { switch( msgm[i]->msg_style ) { case PAM_PROMPT_ECHO_OFF: - DEBUG(4, ("Conversation message: [%s]\n", msgm[i]->msg)); + DEBUG(4, "Conversation message: [%s]\n", msgm[i]->msg);
reply[i].resp_retcode = 0; if (!auth_data->sent_old) { @@ -170,8 +170,8 @@ static int proxy_chauthtok_conv(int num_msg, const struct pam_message **msgm,
break; default: - DEBUG(1, ("Conversation style %d not supported.\n", - msgm[i]->msg_style)); + DEBUG(1, "Conversation style %d not supported.\n", + msgm[i]->msg_style); goto failed; } } @@ -202,18 +202,18 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd) } auth_data = talloc_zero(pd, struct authtok_conv); if (auth_data == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; } auth_data->authtok = sss_authtok_new(auth_data); if (auth_data->authtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_authtok_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_authtok_new failed.\n"); ret = ENOMEM; goto fail; } auth_data->newauthtok = sss_authtok_new(auth_data); if (auth_data->newauthtok == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_authtok_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_authtok_new failed.\n"); ret = ENOMEM; goto fail; } @@ -222,22 +222,22 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd)
ret = pam_start(pam_target, pd->user, &conv, &pamh); if (ret == PAM_SUCCESS) { - DEBUG(7, ("Pam transaction started with service name [%s].\n", - pam_target)); + DEBUG(7, "Pam transaction started with service name [%s].\n", + pam_target); ret = pam_set_item(pamh, PAM_TTY, pd->tty); if (ret != PAM_SUCCESS) { - DEBUG(1, ("Setting PAM_TTY failed: %s.\n", - pam_strerror(pamh, ret))); + DEBUG(1, "Setting PAM_TTY failed: %s.\n", + pam_strerror(pamh, ret)); } ret = pam_set_item(pamh, PAM_RUSER, pd->ruser); if (ret != PAM_SUCCESS) { - DEBUG(1, ("Setting PAM_RUSER failed: %s.\n", - pam_strerror(pamh, ret))); + DEBUG(1, "Setting PAM_RUSER failed: %s.\n", + pam_strerror(pamh, ret)); } ret = pam_set_item(pamh, PAM_RHOST, pd->rhost); if (ret != PAM_SUCCESS) { - DEBUG(1, ("Setting PAM_RHOST failed: %s.\n", - pam_strerror(pamh, ret))); + DEBUG(1, "Setting PAM_RHOST failed: %s.\n", + pam_strerror(pamh, ret)); } switch (pd->cmd) { case SSS_PAM_AUTHENTICATE: @@ -275,21 +275,21 @@ static errno_t call_pam_stack(const char *pam_target, struct pam_data *pd) } break; default: - DEBUG(1, ("unknown PAM call\n")); + DEBUG(1, "unknown PAM call\n"); pam_status=PAM_ABORT; }
- DEBUG(4, ("Pam result: [%d][%s]\n", pam_status, - pam_strerror(pamh, pam_status))); + DEBUG(4, "Pam result: [%d][%s]\n", pam_status, + pam_strerror(pamh, pam_status));
ret = pam_end(pamh, pam_status); if (ret != PAM_SUCCESS) { pamh=NULL; - DEBUG(1, ("Cannot terminate pam transaction.\n")); + DEBUG(1, "Cannot terminate pam transaction.\n"); }
} else { - DEBUG(1, ("Failed to initialize pam transaction.\n")); + DEBUG(1, "Failed to initialize pam transaction.\n"); pam_status = PAM_SYSTEM_ERR; }
@@ -323,8 +323,8 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn)
reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(1, ("dbus_message_new_method_return failed, " - "cannot send reply.\n")); + DEBUG(1, "dbus_message_new_method_return failed, " + "cannot send reply.\n"); ret = ENOMEM; goto done; } @@ -333,7 +333,7 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn)
ret = dp_unpack_pam_request(message, pc_ctx, &pd, &dbus_error); if (!ret) { - DEBUG(1,("Failed, to parse message!\n")); + DEBUG(1,"Failed, to parse message!\n"); ret = EIO; goto done; } @@ -346,20 +346,20 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn) goto done; }
- DEBUG(4, ("Got request with the following data\n")); + DEBUG(4, "Got request with the following data\n"); DEBUG_PAM_DATA(4, pd);
ret = call_pam_stack(pc_ctx->pam_target, pd); if (ret != EOK) { - DEBUG(1, ("call_pam_stack failed.\n")); + DEBUG(1, "call_pam_stack failed.\n"); }
- DEBUG(4, ("Sending result [%d][%s]\n", - pd->pam_status, pd->domain)); + DEBUG(4, "Sending result [%d][%s]\n", + pd->pam_status, pd->domain);
ret = dp_pack_pam_response(reply, pd); if (!ret) { - DEBUG(1, ("Failed to generate dbus reply\n")); + DEBUG(1, "Failed to generate dbus reply\n"); talloc_free(pd); dbus_message_unref(reply); ret = EIO; @@ -391,7 +391,7 @@ static int proxy_cli_init(struct pc_ctx *ctx) PIPE_PATH, PROXY_CHILD_PIPE, ctx->domain->name); if (sbus_address == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return ENOMEM; }
@@ -399,13 +399,13 @@ static int proxy_cli_init(struct pc_ctx *ctx) &pc_interface, &ctx->conn, NULL, ctx); if (ret != EOK) { - DEBUG(1, ("sbus_client_init failed.\n")); + DEBUG(1, "sbus_client_init failed.\n"); return ret; }
ret = proxy_child_send_id(ctx->conn, DATA_PROVIDER_VERSION, ctx->id); if (ret != EOK) { - DEBUG(0, ("dp_common_send_id failed.\n")); + DEBUG(0, "dp_common_send_id failed.\n"); return ret; }
@@ -426,19 +426,19 @@ int proxy_child_send_id(struct sbus_connection *conn, DP_INTERFACE, DP_METHOD_REGISTER); if (msg == NULL) { - DEBUG(0, ("Out of memory?!\n")); + DEBUG(0, "Out of memory?!\n"); return ENOMEM; }
- DEBUG(SSSDBG_FUNC_DATA, ("Sending ID to Proxy Backend: (%d,%"PRIu32")\n", - version, id)); + DEBUG(SSSDBG_FUNC_DATA, "Sending ID to Proxy Backend: (%d,%"PRIu32")\n", + version, id);
ret = dbus_message_append_args(msg, DBUS_TYPE_UINT16, &version, DBUS_TYPE_UINT32, &id, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1, ("Failed to build message\n")); + DEBUG(1, "Failed to build message\n"); return EIO; }
@@ -457,7 +457,7 @@ int proxy_child_process_init(TALLOC_CTX *mem_ctx, const char *domain,
ctx = talloc_zero(mem_ctx, struct pc_ctx); if (!ctx) { - DEBUG(0, ("fatal error initializing pc_ctx\n")); + DEBUG(0, "fatal error initializing pc_ctx\n"); return ENOMEM; } ctx->ev = ev; @@ -466,19 +466,19 @@ int proxy_child_process_init(TALLOC_CTX *mem_ctx, const char *domain, ctx->id = id; ctx->conf_path = talloc_asprintf(ctx, CONFDB_DOMAIN_PATH_TMPL, domain); if (!ctx->conf_path) { - DEBUG(0, ("Out of memory!?\n")); + DEBUG(0, "Out of memory!?\n"); return ENOMEM; }
ret = confdb_get_domain(cdb, domain, &ctx->domain); if (ret != EOK) { - DEBUG(0, ("fatal error retrieving domain configuration\n")); + DEBUG(0, "fatal error retrieving domain configuration\n"); return ret; }
ret = proxy_cli_init(ctx); if (ret != EOK) { - DEBUG(0, ("fatal error setting up server bus\n")); + DEBUG(0, "fatal error setting up server bus\n"); return ret; }
@@ -551,43 +551,43 @@ int main(int argc, const char *argv[])
ret = server_setup(srv_name, 0, conf_entry, &main_ctx); if (ret != EOK) { - DEBUG(0, ("Could not set up mainloop [%d]\n", ret)); + DEBUG(0, "Could not set up mainloop [%d]\n", ret); return 2; }
ret = unsetenv("_SSS_LOOPS"); if (ret != EOK) { - DEBUG(1, ("Failed to unset _SSS_LOOPS, " - "pam modules might not work as expected.\n")); + DEBUG(1, "Failed to unset _SSS_LOOPS, " + "pam modules might not work as expected.\n"); }
ret = confdb_get_string(main_ctx->confdb_ctx, main_ctx, conf_entry, CONFDB_PROXY_PAM_TARGET, NULL, &pam_target); if (ret != EOK) { - DEBUG(0, ("Error reading from confdb (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(0, "Error reading from confdb (%d) [%s]\n", + ret, strerror(ret)); return 4; } if (pam_target == NULL) { - DEBUG(1, ("Missing option proxy_pam_target.\n")); + DEBUG(1, "Missing option proxy_pam_target.\n"); return 4; }
ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(2, ("Could not set up to exit when parent process does\n")); + DEBUG(2, "Could not set up to exit when parent process does\n"); }
ret = proxy_child_process_init(main_ctx, domain, main_ctx->event_ctx, main_ctx->confdb_ctx, pam_target, (uint32_t)id); if (ret != EOK) { - DEBUG(0, ("Could not initialize proxy child [%d].\n", ret)); + DEBUG(0, "Could not initialize proxy child [%d].\n", ret); return 3; }
- DEBUG(1, ("Proxy child for domain [%s] started!\n", domain)); + DEBUG(1, "Proxy child for domain [%s] started!\n", domain);
/* loop on main */ server_loop(main_ctx); diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c index 963aad2..974fda6 100644 --- a/src/providers/proxy/proxy_id.c +++ b/src/providers/proxy/proxy_id.c @@ -60,7 +60,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, struct ldb_result *cached_pwd = NULL; const char *real_name = NULL;
- DEBUG(SSSDBG_TRACE_FUNC, ("Searching user by name (%s)\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Searching user by name (%s)\n", name);
tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -86,7 +86,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwnam failed [%d]: %s\n", ret, strerror(ret))); + "getpwnam failed [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -103,15 +103,15 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, ret = sysdb_getpwuid(tmpctx, sysdb, dom, uid, &cached_pwd); if (ret != EOK) { /* Non-fatal, attempt to canonicalize online */ - DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n", + ret, strerror(ret)); }
if (ret == EOK && cached_pwd->count == 1) { real_name = ldb_msg_find_attr_as_string(cached_pwd->msgs[0], SYSDB_NAME, NULL); if (!real_name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cached user has no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cached user has no name?\n"); } } } @@ -123,7 +123,7 @@ static int get_pw_name(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwuid failed [%d]: %s\n", ret, strerror(ret))); + "getpwuid failed [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -143,8 +143,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("proxy -> getpwnam_r failed for '%s' <%d>: %s\n", - name, ret, strerror(ret))); + "proxy -> getpwnam_r failed for '%s' <%d>: %s\n", + name, ret, strerror(ret)); } return ret; } @@ -163,14 +163,14 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd, switch (status) { case NSS_STATUS_NOTFOUND:
- DEBUG(SSSDBG_MINOR_FAILURE, ("User not found.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "User not found.\n"); *del_user = true; break;
case NSS_STATUS_SUCCESS:
- DEBUG(SSSDBG_TRACE_FUNC, ("User found: (%s, %"SPRIuid", %"SPRIgid")\n", - pwd->pw_name, pwd->pw_uid, pwd->pw_gid)); + DEBUG(SSSDBG_TRACE_FUNC, "User found: (%s, %"SPRIuid", %"SPRIgid")\n", + pwd->pw_name, pwd->pw_uid, pwd->pw_gid);
/* uid=0 or gid=0 are invalid values */ /* also check that the id is in the valid range for this domain */ @@ -178,7 +178,7 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd, OUT_OF_ID_RANGE(pwd->pw_gid, dom->id_min, dom->id_max)) {
DEBUG(SSSDBG_MINOR_FAILURE, - ("User filtered out! (id out of range)\n")); + "User filtered out! (id out of range)\n"); *del_user = true; break; } @@ -186,12 +186,12 @@ handle_getpw_result(enum nss_status status, struct passwd *pwd,
case NSS_STATUS_UNAVAIL: DEBUG(SSSDBG_MINOR_FAILURE, - ("Remote back end is not available. Entering offline mode\n")); + "Remote back end is not available. Entering offline mode\n"); ret = ENXIO; break;
default: - DEBUG(SSSDBG_OP_FAILURE, ("Unknown return code %d\n", status)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown return code %d\n", status); ret = EIO; break; } @@ -207,8 +207,8 @@ delete_user(struct sysdb_ctx *sysdb, int ret = EOK;
DEBUG(SSSDBG_TRACE_FUNC, - ("User %s does not exist (or is invalid) on remote server," - " deleting!\n", name)); + "User %s does not exist (or is invalid) on remote server," + " deleting!\n", name); ret = sysdb_delete_user(sysdb, domain, name, uid); if (ret == ENOENT) { ret = EOK; @@ -243,7 +243,7 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, if (lowercase || alias) { attrs = sysdb_new_attrs(NULL); if (!attrs) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error ?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error ?!\n"); return ENOMEM; } } @@ -251,14 +251,14 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, if (lowercase) { lower = sss_tc_utf8_str_tolower(attrs, pwd->pw_name); if (!lower) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot convert name to lowercase\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot convert name to lowercase\n"); talloc_zfree(attrs); return ENOMEM; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, lower); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); talloc_zfree(attrs); return ret; } @@ -273,7 +273,7 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, cased_alias); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); talloc_zfree(attrs); return ret; } @@ -294,7 +294,7 @@ static int save_user(struct sysdb_ctx *sysdb, struct sss_domain_info *domain, 0); talloc_zfree(attrs); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add user to cache\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add user to cache\n"); return ret; }
@@ -317,7 +317,7 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx, bool del_user = false; int ret;
- DEBUG(SSSDBG_TRACE_FUNC, ("Searching user by uid (%"SPRIuid")\n", uid)); + DEBUG(SSSDBG_TRACE_FUNC, "Searching user by uid (%"SPRIuid")\n", uid);
tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -341,7 +341,7 @@ static int get_pw_uid(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwuid failed [%d]: %s\n", ret, strerror(ret))); + "getpwuid failed [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -357,8 +357,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_CRIT_FAILURE, - ("proxy -> getpwuid_r failed for '%"SPRIuid"' <%d>: %s\n", - uid, ret, strerror(ret))); + "proxy -> getpwuid_r failed for '%"SPRIuid"' <%d>: %s\n", + uid, ret, strerror(ret)); } return ret; } @@ -381,7 +381,7 @@ static int enum_users(TALLOC_CTX *mem_ctx, errno_t sret; bool again;
- DEBUG(SSSDBG_TRACE_LIBS, ("Enumerating users\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumerating users\n");
tmpctx = talloc_new(mem_ctx); if (!tmpctx) { @@ -403,7 +403,7 @@ static int enum_users(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -444,11 +444,11 @@ static int enum_users(TALLOC_CTX *mem_ctx, case NSS_STATUS_NOTFOUND:
/* we are done here */ - DEBUG(SSSDBG_TRACE_LIBS, ("Enumeration completed.\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumeration completed.\n");
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -457,8 +457,8 @@ static int enum_users(TALLOC_CTX *mem_ctx, case NSS_STATUS_SUCCESS:
DEBUG(SSSDBG_TRACE_LIBS, - ("User found (%s, %"SPRIuid", %"SPRIgid")\n", - pwd->pw_name, pwd->pw_uid, pwd->pw_gid)); + "User found (%s, %"SPRIuid", %"SPRIgid")\n", + pwd->pw_name, pwd->pw_uid, pwd->pw_gid);
/* uid=0 or gid=0 are invalid values */ /* also check that the id is in the valid range for this domain @@ -466,8 +466,8 @@ static int enum_users(TALLOC_CTX *mem_ctx, if (OUT_OF_ID_RANGE(pwd->pw_uid, dom->id_min, dom->id_max) || OUT_OF_ID_RANGE(pwd->pw_gid, dom->id_min, dom->id_max)) {
- DEBUG(SSSDBG_OP_FAILURE, ("User [%s] filtered out! (id out" - " of range)\n", pwd->pw_name)); + DEBUG(SSSDBG_OP_FAILURE, "User [%s] filtered out! (id out" + " of range)\n", pwd->pw_name);
again = true; break; @@ -478,8 +478,8 @@ static int enum_users(TALLOC_CTX *mem_ctx, if (ret) { /* Do not fail completely on errors. * Just report the failure to save and go on */ - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store user %s." - " Ignoring.\n", pwd->pw_name)); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store user %s." + " Ignoring.\n", pwd->pw_name); } again = true; break; @@ -491,8 +491,8 @@ static int enum_users(TALLOC_CTX *mem_ctx,
default: ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("proxy -> getpwent_r failed (%d)[%s]" - "\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "proxy -> getpwent_r failed (%d)[%s]" + "\n", ret, strerror(ret)); break; } } while (again); @@ -502,7 +502,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } ctx->ops.endpwent(); @@ -514,16 +514,16 @@ done: do { \ if (DEBUG_IS_SET(debug_get_level(level))) { \ if (!grp->gr_mem || !grp->gr_mem[0]) { \ - DEBUG(level, ("Group %s has no members!\n", \ - grp->gr_name)); \ + DEBUG(level, "Group %s has no members!\n", \ + grp->gr_name); \ } else { \ int i = 0; \ while (grp->gr_mem[i]) { \ /* count */ \ i++; \ } \ - DEBUG(level, ("Group %s has %d members!\n", \ - grp->gr_name, i)); \ + DEBUG(level, "Group %s has %d members!\n", \ + grp->gr_name, i); \ } \ } \ } while(0) @@ -555,7 +555,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom,
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -563,7 +563,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, if (grp->gr_mem && grp->gr_mem[0]) { attrs = sysdb_new_attrs(tmp_ctx); if (!attrs) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error ?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error ?!\n"); ret = ENOMEM; goto done; } @@ -572,14 +572,14 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, attrs, SYSDB_MEMBER, dom->name, (const char *const *)grp->gr_mem); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group members\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group members\n"); goto done; }
/* Create ghost users */ ret = proxy_process_missing_users(sysdb, dom, attrs, grp, now); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add missing members\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add missing members\n"); goto done; } } @@ -588,7 +588,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, if (!attrs) { attrs = sysdb_new_attrs(tmp_ctx); if (!attrs) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Allocation error ?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Allocation error ?!\n"); ret = ENOMEM; goto done; } @@ -597,14 +597,14 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, if (dom->case_sensitive == false) { lower = sss_tc_utf8_str_tolower(attrs, grp->gr_name); if (!lower) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot convert name to lowercase\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot convert name to lowercase\n"); ret = ENOMEM; goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, lower); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); ret = ENOMEM; goto done; } @@ -619,7 +619,7 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom,
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, cased_alias); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); ret = ENOMEM; goto done; } @@ -633,15 +633,15 @@ static int save_group(struct sysdb_ctx *sysdb, struct sss_domain_info *dom, cache_timeout, now); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add group to cache\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add group to cache\n"); goto done; }
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not commit transaction: [%s]\n", - strerror(ret))); + "Could not commit transaction: [%s]\n", + strerror(ret)); goto done; } in_transaction = false; @@ -650,7 +650,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not cancel transaction\n"); } } talloc_free(tmp_ctx); @@ -679,28 +679,28 @@ static errno_t proxy_process_missing_users(struct sysdb_ctx *sysdb, if (ret == EOK) { /* Member already exists in the cache */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("Member [%s] already cached\n", grp->gr_mem[i])); + "Member [%s] already cached\n", grp->gr_mem[i]); /* clean up */ talloc_zfree(msg); continue; } else if (ret == ENOENT) { /* No entry for this user. Create a ghost user */ DEBUG(SSSDBG_TRACE_LIBS, - ("Member [%s] not cached, creating ghost user entry\n", - grp->gr_mem[i])); + "Member [%s] not cached, creating ghost user entry\n", + grp->gr_mem[i]);
ret = sysdb_attrs_add_string(group_attrs, SYSDB_GHOST, grp->gr_mem[i]); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot store ghost user entry: [%d]: %s\n", - ret, strerror(ret))); + "Cannot store ghost user entry: [%d]: %s\n", + ret, strerror(ret)); goto done; } } else { /* Unexpected error */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Error searching cache for user [%s]: [%s]\n", - grp->gr_mem[i], strerror(ret))); + "Error searching cache for user [%s]: [%s]\n", + grp->gr_mem[i], strerror(ret)); goto done; } } @@ -744,23 +744,23 @@ handle_getgr_result(enum nss_status status, struct group *grp, { switch (status) { case NSS_STATUS_TRYAGAIN: - DEBUG(SSSDBG_MINOR_FAILURE, ("Buffer too small\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Buffer too small\n"); return EAGAIN;
case NSS_STATUS_NOTFOUND: - DEBUG(SSSDBG_MINOR_FAILURE, ("Group not found.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Group not found.\n"); *delete_group = true; break;
case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_FUNC_DATA, ("Group found: (%s, %"SPRIgid")\n", - grp->gr_name, grp->gr_gid)); + DEBUG(SSSDBG_FUNC_DATA, "Group found: (%s, %"SPRIgid")\n", + grp->gr_name, grp->gr_gid);
/* gid=0 is an invalid value */ /* also check that the id is in the valid range for this domain */ if (OUT_OF_ID_RANGE(grp->gr_gid, dom->id_min, dom->id_max)) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Group filtered out! (id out of range)\n")); + "Group filtered out! (id out of range)\n"); *delete_group = true; break; } @@ -768,11 +768,11 @@ handle_getgr_result(enum nss_status status, struct group *grp,
case NSS_STATUS_UNAVAIL: DEBUG(SSSDBG_MINOR_FAILURE, - ("Remote back end is not available. Entering offline mode\n")); + "Remote back end is not available. Entering offline mode\n"); return ENXIO;
default: - DEBUG(SSSDBG_OP_FAILURE, ("Unknown return code %d\n", status)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown return code %d\n", status); return EIO; }
@@ -796,7 +796,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, struct ldb_result *cached_grp = NULL; const char *real_name = NULL;
- DEBUG(SSSDBG_FUNC_DATA, ("Searching group by name (%s)\n", name)); + DEBUG(SSSDBG_FUNC_DATA, "Searching group by name (%s)\n", name);
tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -807,8 +807,8 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, if (!grp) { ret = ENOMEM; DEBUG(SSSDBG_CRIT_FAILURE, - ("proxy -> getgrnam_r failed for '%s': [%d] %s\n", - name, ret, strerror(ret))); + "proxy -> getgrnam_r failed for '%s': [%d] %s\n", + name, ret, strerror(ret)); goto done; }
@@ -828,7 +828,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx,
if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("getgrnam failed [%d]: %s\n", ret, strerror(ret))); + "getgrnam failed [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -839,15 +839,15 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, ret = sysdb_getgrgid(tmpctx, sysdb, dom, gid, &cached_grp); if (ret != EOK) { /* Non-fatal, attempt to canonicalize online */ - DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n", + ret, strerror(ret)); }
if (ret == EOK && cached_grp->count == 1) { real_name = ldb_msg_find_attr_as_string(cached_grp->msgs[0], SYSDB_NAME, NULL); if (!real_name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cached group has no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cached group has no name?\n"); } } } @@ -871,7 +871,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx,
if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("getgrgid failed [%d]: %s\n", ret, strerror(ret))); + "getgrgid failed [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -880,8 +880,8 @@ static int get_gr_name(TALLOC_CTX *mem_ctx,
if (delete_group) { DEBUG(SSSDBG_TRACE_FUNC, - ("Group %s does not exist (or is invalid) on remote server," - " deleting!\n", name)); + "Group %s does not exist (or is invalid) on remote server," + " deleting!\n", name);
ret = sysdb_delete_group(sysdb, dom, NULL, gid); if (ret == ENOENT) { @@ -893,7 +893,7 @@ static int get_gr_name(TALLOC_CTX *mem_ctx, ret = save_group(sysdb, dom, grp, real_name, name, dom->group_timeout); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save group [%d]: %s\n", ret, strerror(ret))); + "Cannot save group [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -901,8 +901,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("proxy -> getgrnam_r failed for '%s' <%d>: %s\n", - name, ret, strerror(ret))); + "proxy -> getgrnam_r failed for '%s' <%d>: %s\n", + name, ret, strerror(ret)); } return ret; } @@ -923,7 +923,7 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx, bool delete_group = false; int ret;
- DEBUG(SSSDBG_TRACE_FUNC, ("Searching group by gid (%"SPRIgid")\n", gid)); + DEBUG(SSSDBG_TRACE_FUNC, "Searching group by gid (%"SPRIgid")\n", gid);
tmpctx = talloc_new(mem_ctx); if (!tmpctx) { @@ -952,14 +952,14 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx,
if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("getgrgid failed [%d]: %s\n", ret, strerror(ret))); + "getgrgid failed [%d]: %s\n", ret, strerror(ret)); goto done; }
if (delete_group) { DEBUG(SSSDBG_TRACE_FUNC, - ("Group %"SPRIgid" does not exist (or is invalid) on remote " - "server, deleting!\n", gid)); + "Group %"SPRIgid" does not exist (or is invalid) on remote " + "server, deleting!\n", gid);
ret = sysdb_delete_group(sysdb, dom, NULL, gid); if (ret == ENOENT) { @@ -971,7 +971,7 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx, ret = save_group(sysdb, dom, grp, grp->gr_name, NULL, dom->group_timeout); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot save user [%d]: %s\n", ret, strerror(ret))); + "Cannot save user [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -979,8 +979,8 @@ done: talloc_zfree(tmpctx); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("proxy -> getgrgid_r failed for '%"SPRIgid"' <%d>: %s\n", - gid, ret, strerror(ret))); + "proxy -> getgrgid_r failed for '%"SPRIgid"' <%d>: %s\n", + gid, ret, strerror(ret)); } return ret; } @@ -1003,7 +1003,7 @@ static int enum_groups(TALLOC_CTX *mem_ctx, errno_t sret; bool again;
- DEBUG(SSSDBG_TRACE_LIBS, ("Enumerating groups\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumerating groups\n");
tmpctx = talloc_new(mem_ctx); if (!tmpctx) { @@ -1025,7 +1025,7 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -1066,11 +1066,11 @@ static int enum_groups(TALLOC_CTX *mem_ctx, case NSS_STATUS_NOTFOUND:
/* we are done here */ - DEBUG(SSSDBG_TRACE_LIBS, ("Enumeration completed.\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Enumeration completed.\n");
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -1078,16 +1078,16 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
case NSS_STATUS_SUCCESS:
- DEBUG(SSSDBG_OP_FAILURE, ("Group found (%s, %"SPRIgid")\n", - grp->gr_name, grp->gr_gid)); + DEBUG(SSSDBG_OP_FAILURE, "Group found (%s, %"SPRIgid")\n", + grp->gr_name, grp->gr_gid);
/* gid=0 is an invalid value */ /* also check that the id is in the valid range for this domain */ if (OUT_OF_ID_RANGE(grp->gr_gid, dom->id_min, dom->id_max)) {
- DEBUG(SSSDBG_OP_FAILURE, ("Group [%s] filtered out! (id" - "out of range)\n", grp->gr_name)); + DEBUG(SSSDBG_OP_FAILURE, "Group [%s] filtered out! (id" + "out of range)\n", grp->gr_name);
again = true; break; @@ -1098,8 +1098,8 @@ static int enum_groups(TALLOC_CTX *mem_ctx, if (ret) { /* Do not fail completely on errors. * Just report the failure to save and go on */ - DEBUG(SSSDBG_OP_FAILURE, ("Failed to store group." - "Ignoring\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to store group." + "Ignoring\n"); } again = true; break; @@ -1111,8 +1111,8 @@ static int enum_groups(TALLOC_CTX *mem_ctx,
default: ret = EIO; - DEBUG(SSSDBG_OP_FAILURE, ("proxy -> getgrent_r failed (%d)[%s]" - "\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "proxy -> getgrent_r failed (%d)[%s]" + "\n", ret, strerror(ret)); break; } } while (again); @@ -1122,7 +1122,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } ctx->ops.endgrent(); @@ -1177,7 +1177,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto fail; } in_transaction = true; @@ -1188,14 +1188,14 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwnam failed [%d]: %s\n", ret, strerror(ret))); + "getpwnam failed [%d]: %s\n", ret, strerror(ret)); goto fail; }
if (del_user) { ret = delete_user(sysdb, dom, name, 0); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not delete user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not delete user\n"); goto fail; } goto done; @@ -1209,15 +1209,15 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = sysdb_getpwuid(tmpctx, sysdb, dom, uid, &cached_pwd); if (ret != EOK) { /* Non-fatal, attempt to canonicalize online */ - DEBUG(SSSDBG_TRACE_FUNC, ("Request to cache failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Request to cache failed [%d]: %s\n", + ret, strerror(ret)); }
if (ret == EOK && cached_pwd->count == 1) { real_name = ldb_msg_find_attr_as_string(cached_pwd->msgs[0], SYSDB_NAME, NULL); if (!real_name) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cached user has no name?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Cached user has no name?\n"); } } } @@ -1229,7 +1229,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = handle_getpw_result(status, pwd, dom, &del_user); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getpwuid failed [%d]: %s\n", ret, strerror(ret))); + "getpwuid failed [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -1239,7 +1239,7 @@ static int get_initgr(TALLOC_CTX *mem_ctx, if (del_user) { ret = delete_user(sysdb, dom, name, uid); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not delete user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not delete user\n"); goto fail; } goto done; @@ -1248,20 +1248,20 @@ static int get_initgr(TALLOC_CTX *mem_ctx, ret = save_user(sysdb, dom, !dom->case_sensitive, pwd, real_name, name, dom->user_timeout); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not save user\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not save user\n"); goto fail; }
ret = get_initgr_groups_process(tmpctx, ctx, sysdb, dom, pwd); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not process initgroups\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not process initgroups\n"); goto fail; }
done: ret = sysdb_transaction_commit(sysdb); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to commit transaction\n"); goto fail; } in_transaction = false; @@ -1271,7 +1271,7 @@ fail: if (in_transaction) { sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } return ret; @@ -1333,13 +1333,13 @@ static int get_initgr_groups_process(TALLOC_CTX *memctx,
switch (status) { case NSS_STATUS_NOTFOUND: - DEBUG(SSSDBG_FUNC_DATA, ("The initgroups call returned 'NOTFOUND'. " + DEBUG(SSSDBG_FUNC_DATA, "The initgroups call returned 'NOTFOUND'. " "Assume the user is only member of its " - "primary group (%"SPRIgid")\n", pwd->pw_gid)); + "primary group (%"SPRIgid")\n", pwd->pw_gid); /* fall through */ case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_CONF_SETTINGS, ("User [%s] appears to be member of %lu" - "groups\n", pwd->pw_name, num_gids)); + DEBUG(SSSDBG_CONF_SETTINGS, "User [%s] appears to be member of %lu" + "groups\n", pwd->pw_name, num_gids);
now = time(NULL); for (i = 0; i < num_gids; i++) { @@ -1353,8 +1353,8 @@ static int get_initgr_groups_process(TALLOC_CTX *memctx, break;
default: - DEBUG(2, ("proxy -> initgroups_dyn failed (%d)[%s]\n", - ret, strerror(ret))); + DEBUG(2, "proxy -> initgroups_dyn failed (%d)[%s]\n", + ret, strerror(ret)); ret = EIO; break; } @@ -1512,7 +1512,7 @@ void proxy_get_account_info(struct be_req *breq)
if (ret) { if (ret == ENXIO) { - DEBUG(2, ("proxy returned UNAVAIL error, going offline!\n")); + DEBUG(2, "proxy returned UNAVAIL error, going offline!\n"); be_mark_offline(be_ctx); } be_req_terminate(breq, DP_ERR_FATAL, ret, NULL); diff --git a/src/providers/proxy/proxy_init.c b/src/providers/proxy/proxy_init.c index 491482d..f2ad144 100644 --- a/src/providers/proxy/proxy_init.c +++ b/src/providers/proxy/proxy_init.c @@ -125,8 +125,8 @@ int sssm_proxy_id_init(struct be_ctx *bectx,
ctx->handle = dlopen(libpath, RTLD_NOW); if (!ctx->handle) { - DEBUG(0, ("Unable to load %s module with path, error: %s\n", - libpath, dlerror())); + DEBUG(0, "Unable to load %s module with path, error: %s\n", + libpath, dlerror()); ret = ELIBACC; goto done; } @@ -134,7 +134,7 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getpwnam_r = proxy_dlsym(ctx->handle, "_nss_%s_getpwnam_r", libname); if (!ctx->ops.getpwnam_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -142,14 +142,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getpwuid_r = proxy_dlsym(ctx->handle, "_nss_%s_getpwuid_r", libname); if (!ctx->ops.getpwuid_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; }
ctx->ops.setpwent = proxy_dlsym(ctx->handle, "_nss_%s_setpwent", libname); if (!ctx->ops.setpwent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -157,14 +157,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getpwent_r = proxy_dlsym(ctx->handle, "_nss_%s_getpwent_r", libname); if (!ctx->ops.getpwent_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; }
ctx->ops.endpwent = proxy_dlsym(ctx->handle, "_nss_%s_endpwent", libname); if (!ctx->ops.endpwent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -172,7 +172,7 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getgrnam_r = proxy_dlsym(ctx->handle, "_nss_%s_getgrnam_r", libname); if (!ctx->ops.getgrnam_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -180,14 +180,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getgrgid_r = proxy_dlsym(ctx->handle, "_nss_%s_getgrgid_r", libname); if (!ctx->ops.getgrgid_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; }
ctx->ops.setgrent = proxy_dlsym(ctx->handle, "_nss_%s_setgrent", libname); if (!ctx->ops.setgrent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -195,14 +195,14 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.getgrent_r = proxy_dlsym(ctx->handle, "_nss_%s_getgrent_r", libname); if (!ctx->ops.getgrent_r) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; }
ctx->ops.endgrent = proxy_dlsym(ctx->handle, "_nss_%s_endgrent", libname); if (!ctx->ops.endgrent) { - DEBUG(0, ("Failed to load NSS fns, error: %s\n", dlerror())); + DEBUG(0, "Failed to load NSS fns, error: %s\n", dlerror()); ret = ELIBBAD; goto done; } @@ -210,34 +210,34 @@ int sssm_proxy_id_init(struct be_ctx *bectx, ctx->ops.initgroups_dyn = proxy_dlsym(ctx->handle, "_nss_%s_initgroups_dyn", libname); if (!ctx->ops.initgroups_dyn) { - DEBUG(1, ("The '%s' library does not provides the " + DEBUG(1, "The '%s' library does not provides the " "_nss_XXX_initgroups_dyn function!\n" "initgroups will be slow as it will require " - "full groups enumeration!\n", libname)); + "full groups enumeration!\n", libname); }
ctx->ops.setnetgrent = proxy_dlsym(ctx->handle, "_nss_%s_setnetgrent", libname); if (!ctx->ops.setnetgrent) { - DEBUG(0, ("Failed to load _nss_%s_setnetgrent, error: %s. " + DEBUG(0, "Failed to load _nss_%s_setnetgrent, error: %s. " "The library does not support netgroups.\n", libname, - dlerror())); + dlerror()); }
ctx->ops.getnetgrent_r = proxy_dlsym(ctx->handle, "_nss_%s_getnetgrent_r", libname); if (!ctx->ops.getgrent_r) { - DEBUG(0, ("Failed to load _nss_%s_getnetgrent_r, error: %s. " + DEBUG(0, "Failed to load _nss_%s_getnetgrent_r, error: %s. " "The library does not support netgroups.\n", libname, - dlerror())); + dlerror()); }
ctx->ops.endnetgrent = proxy_dlsym(ctx->handle, "_nss_%s_endnetgrent", libname); if (!ctx->ops.endnetgrent) { - DEBUG(0, ("Failed to load _nss_%s_endnetgrent, error: %s. " + DEBUG(0, "Failed to load _nss_%s_endnetgrent, error: %s. " "The library does not support netgroups.\n", libname, - dlerror())); + dlerror()); }
ctx->ops.getservbyname_r = proxy_dlsym(ctx->handle, @@ -245,10 +245,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.getservbyname_r) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_getservbyname_r, error: %s. " + "Failed to load _nss_%s_getservbyname_r, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); }
ctx->ops.getservbyport_r = proxy_dlsym(ctx->handle, @@ -256,10 +256,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.getservbyport_r) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_getservbyport_r, error: %s. " + "Failed to load _nss_%s_getservbyport_r, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); }
ctx->ops.setservent = proxy_dlsym(ctx->handle, @@ -267,10 +267,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.setservent) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_setservent, error: %s. " + "Failed to load _nss_%s_setservent, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); }
ctx->ops.getservent_r = proxy_dlsym(ctx->handle, @@ -278,10 +278,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.getservent_r) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_getservent_r, error: %s. " + "Failed to load _nss_%s_getservent_r, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); }
ctx->ops.endservent = proxy_dlsym(ctx->handle, @@ -289,10 +289,10 @@ int sssm_proxy_id_init(struct be_ctx *bectx, libname); if (!ctx->ops.endservent) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to load _nss_%s_endservent, error: %s. " + "Failed to load _nss_%s_endservent, error: %s. " "The library does not support services.\n", libname, - dlerror())); + dlerror()); }
*ops = &proxy_id_ops; @@ -329,7 +329,7 @@ static int proxy_client_init(struct sbus_connection *conn, void *data)
proxy_cli = talloc_zero(conn, struct proxy_client); if (!proxy_cli) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } @@ -343,11 +343,11 @@ static int proxy_client_init(struct sbus_connection *conn, void *data) proxy_cli->timeout = tevent_add_timer(proxy_auth_ctx->be->ev, proxy_cli, tv, init_timeout, proxy_cli); if (!proxy_cli->timeout) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); talloc_zfree(conn); return ENOMEM; } - DEBUG(4, ("Set-up proxy client ID timeout [%p]\n", proxy_cli->timeout)); + DEBUG(4, "Set-up proxy client ID timeout [%p]\n", proxy_cli->timeout);
/* Attach the client context to the connection context, so that it is * always available when we need to manage the connection. */ @@ -362,7 +362,7 @@ static void init_timeout(struct tevent_context *ev, { struct proxy_client *proxy_cli;
- DEBUG(2, ("Client timed out before Identification [%p]!\n", te)); + DEBUG(2, "Client timed out before Identification [%p]!\n", te);
proxy_cli = talloc_get_type(ptr, struct proxy_client);
@@ -396,12 +396,12 @@ static int client_registration(DBusMessage *message, data = sbus_conn_get_private_data(conn); proxy_cli = talloc_get_type(data, struct proxy_client); if (!proxy_cli) { - DEBUG(0, ("Connection holds no valid init data\n")); + DEBUG(0, "Connection holds no valid init data\n"); return EINVAL; }
/* First thing, cancel the timeout */ - DEBUG(4, ("Cancel proxy client ID timeout [%p]\n", proxy_cli->timeout)); + DEBUG(4, "Cancel proxy client ID timeout [%p]\n", proxy_cli->timeout); talloc_zfree(proxy_cli->timeout);
dbus_error_init(&dbus_error); @@ -411,20 +411,20 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT32, &cli_id, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(1, ("Failed to parse message, killing connection\n")); + DEBUG(1, "Failed to parse message, killing connection\n"); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); sbus_disconnect(conn); /* FIXME: should we just talloc_zfree(conn) ? */ return EIO; }
- DEBUG(SSSDBG_FUNC_DATA, ("Proxy client [%"PRIu32"] connected\n", cli_id)); + DEBUG(SSSDBG_FUNC_DATA, "Proxy client [%"PRIu32"] connected\n", cli_id);
/* Check the hash table */ key.type = HASH_KEY_ULONG; key.ul = cli_id; if (!hash_has_key(proxy_cli->proxy_auth_ctx->request_table, &key)) { - DEBUG(1, ("Unknown child ID. Killing the connection\n")); + DEBUG(1, "Unknown child ID. Killing the connection\n"); sbus_disconnect(proxy_cli->conn); return EIO; } @@ -432,7 +432,7 @@ static int client_registration(DBusMessage *message, /* reply that all is ok */ reply = dbus_message_new_method_return(message); if (!reply) { - DEBUG(0, ("Dbus Out of memory!\n")); + DEBUG(0, "Dbus Out of memory!\n"); return ENOMEM; }
@@ -440,7 +440,7 @@ static int client_registration(DBusMessage *message, DBUS_TYPE_UINT16, &version, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(0, ("Failed to build dbus reply\n")); + DEBUG(0, "Failed to build dbus reply\n"); dbus_message_unref(reply); sbus_disconnect(conn); return EIO; @@ -452,7 +452,7 @@ static int client_registration(DBusMessage *message,
hret = hash_lookup(proxy_cli->proxy_auth_ctx->request_table, &key, &value); if (hret != HASH_SUCCESS) { - DEBUG(1, ("Hash error [%d][%s]\n", hret, hash_error_string(hret))); + DEBUG(1, "Hash error [%d][%s]\n", hret, hash_error_string(hret)); sbus_disconnect(conn); }
@@ -466,8 +466,8 @@ static int client_registration(DBusMessage *message, * the init_req will be NULL below and things will * break. */ - DEBUG(1, ("Client connection from a request " - "that's not marked as running\n")); + DEBUG(1, "Client connection from a request " + "that's not marked as running\n"); return EIO; }
@@ -490,7 +490,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, /* If we're already set up, just return that */ if(bectx->bet_info[BET_AUTH].mod_name && strcmp("proxy", bectx->bet_info[BET_AUTH].mod_name) == 0) { - DEBUG(8, ("Re-using proxy_auth_ctx for this provider\n")); + DEBUG(8, "Re-using proxy_auth_ctx for this provider\n"); *ops = bectx->bet_info[BET_AUTH].bet_ops; *pvt_data = bectx->bet_info[BET_AUTH].pvt_bet_data; return EOK; @@ -509,7 +509,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, &ctx->pam_target); if (ret != EOK) goto done; if (!ctx->pam_target) { - DEBUG(1, ("Missing option proxy_pam_target.\n")); + DEBUG(1, "Missing option proxy_pam_target.\n"); ret = EINVAL; goto done; } @@ -517,7 +517,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, sbus_address = talloc_asprintf(ctx, "unix:path=%s/%s_%s", PIPE_PATH, PROXY_CHILD_PIPE, bectx->domain->name); if (sbus_address == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -525,7 +525,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, ret = sbus_new_server(ctx, bectx->ev, sbus_address, &proxy_interface, false, &ctx->sbus_srv, proxy_client_init, ctx); if (ret != EOK) { - DEBUG(0, ("Could not set up sbus server.\n")); + DEBUG(0, "Could not set up sbus server.\n"); goto done; }
@@ -536,7 +536,7 @@ int sssm_proxy_auth_init(struct be_ctx *bectx, hret = hash_create(ctx->max_children * 2, &ctx->request_table, NULL, NULL); if (hret != HASH_SUCCESS) { - DEBUG(0, ("Could not initialize request table\n")); + DEBUG(0, "Could not initialize request table\n"); ret = EIO; goto done; } diff --git a/src/providers/proxy/proxy_netgroup.c b/src/providers/proxy/proxy_netgroup.c index 04a0b18..a5f8196 100644 --- a/src/providers/proxy/proxy_netgroup.c +++ b/src/providers/proxy/proxy_netgroup.c @@ -40,7 +40,7 @@ static errno_t make_netgroup_attr(struct __netgrent netgrent, ret =sysdb_attrs_add_string(attrs, SYSDB_NETGROUP_MEMBER, netgrent.val.group); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); return ret; } } else if (netgrent.type == triple_val) { @@ -49,17 +49,17 @@ static errno_t make_netgroup_attr(struct __netgrent netgrent, get_triple_el(netgrent.val.triple.user), get_triple_el(netgrent.val.triple.domain)); if (dummy == NULL) { - DEBUG(1, ("talloc_asprintf failed.\n")); + DEBUG(1, "talloc_asprintf failed.\n"); return ENOMEM; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NETGROUP_TRIPLE, dummy); if (ret != EOK) { - DEBUG(1, ("sysdb_attrs_add_string failed.\n")); + DEBUG(1, "sysdb_attrs_add_string failed.\n"); return ret; } } else { - DEBUG(1, ("Unknown netgrent entry type [%d].\n", netgrent.type)); + DEBUG(1, "Unknown netgrent entry type [%d].\n", netgrent.type); return EINVAL; }
@@ -79,14 +79,14 @@ static errno_t save_netgroup(struct sysdb_ctx *sysdb, if (lowercase) { lower = sss_tc_utf8_str_tolower(NULL, name); if (!lower) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot convert name to lowercase\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot convert name to lowercase\n"); return ENOMEM; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, lower); talloc_free(lower); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not add name alias\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not add name alias\n"); return ret; } } @@ -94,7 +94,7 @@ static errno_t save_netgroup(struct sysdb_ctx *sysdb, ret = sysdb_add_netgroup(sysdb, domain, name, NULL, attrs, NULL, cache_timeout, 0); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_add_netgroup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_add_netgroup failed.\n"); return ret; }
@@ -108,27 +108,27 @@ static errno_t handle_error(enum nss_status status, struct sysdb_ctx *sysdb,
switch (status) { case NSS_STATUS_SUCCESS: - DEBUG(SSSDBG_TRACE_INTERNAL, ("Netgroup lookup succeeded\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Netgroup lookup succeeded\n"); ret = EOK; break;
case NSS_STATUS_NOTFOUND: - DEBUG(SSSDBG_MINOR_FAILURE, ("The netgroup was not found\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "The netgroup was not found\n"); ret = sysdb_delete_netgroup(sysdb, domain, name); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot delete netgroup: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot delete netgroup: %d\n", ret); ret = EIO; } break;
case NSS_STATUS_UNAVAIL: DEBUG(SSSDBG_TRACE_LIBS, - ("The proxy target did not respond, going offline\n")); + "The proxy target did not respond, going offline\n"); ret = ENXIO; break;
default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unexpected error looking up netgroup\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unexpected error looking up netgroup\n"); ret = EIO; break; } @@ -152,21 +152,21 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx, status = ctx->ops.setnetgrent(name, &result); if (status != NSS_STATUS_SUCCESS) { DEBUG(SSSDBG_OP_FAILURE, - ("setnetgrent failed for netgroup [%s].\n", name)); + "setnetgrent failed for netgroup [%s].\n", name); ret = handle_error(status, sysdb, dom, name); goto done; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n"); ret = ENOMEM; goto done; }
attrs = sysdb_new_attrs(tmp_ctx); if (attrs == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; } @@ -178,15 +178,15 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx, status != NSS_STATUS_NOTFOUND) { ret = handle_error(status, sysdb, dom, name); DEBUG(SSSDBG_OP_FAILURE, - ("getnetgrent_r failed for netgroup [%s]: [%d][%s].\n", - name, ret, strerror(ret))); + "getnetgrent_r failed for netgroup [%s]: [%d][%s].\n", + name, ret, strerror(ret)); goto done; }
if (status == NSS_STATUS_SUCCESS) { ret = make_netgroup_attr(result, attrs); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("make_netgroup_attr failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "make_netgroup_attr failed.\n"); goto done; } } @@ -194,7 +194,7 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx,
status = ctx->ops.endnetgrent(&result); if (status != NSS_STATUS_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("endnetgrent failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "endnetgrent failed.\n"); ret = handle_error(status, sysdb, dom, name); goto done; } @@ -203,7 +203,7 @@ errno_t get_netgroup(struct proxy_id_ctx *ctx, !dom->case_sensitive, dom->netgroup_timeout); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_add_netgroup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_add_netgroup failed.\n"); goto done; }
diff --git a/src/providers/proxy/proxy_services.c b/src/providers/proxy/proxy_services.c index e9f3b3f..01accd2 100644 --- a/src/providers/proxy/proxy_services.c +++ b/src/providers/proxy/proxy_services.c @@ -111,7 +111,7 @@ get_serv_byname(struct proxy_id_ctx *ctx, buffer, BUFLEN, &ret); if (status != NSS_STATUS_SUCCESS && status != NSS_STATUS_NOTFOUND) { DEBUG(SSSDBG_MINOR_FAILURE, - ("getservbyname_r failed for service [%s].\n", name)); + "getservbyname_r failed for service [%s].\n", name); return ret; }
@@ -165,7 +165,7 @@ get_serv_byport(struct proxy_id_ctx *ctx, buffer, BUFLEN, &ret); if (status != NSS_STATUS_SUCCESS && status != NSS_STATUS_NOTFOUND) { DEBUG(SSSDBG_MINOR_FAILURE, - ("getservbyport_r failed for service [%s].\n", be_filter)); + "getservbyport_r failed for service [%s].\n", be_filter); return ret; }
@@ -202,7 +202,7 @@ enum_services(struct proxy_id_ctx *ctx, const char **cased_aliases; bool again;
- DEBUG(SSSDBG_TRACE_FUNC, ("Enumerating services\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Enumerating services\n");
tmpctx = talloc_new(NULL); if (!tmpctx) { @@ -224,7 +224,7 @@ enum_services(struct proxy_id_ctx *ctx,
ret = sysdb_transaction_start(sysdb); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -265,11 +265,11 @@ enum_services(struct proxy_id_ctx *ctx, case NSS_STATUS_NOTFOUND:
/* we are done here */ - DEBUG(SSSDBG_TRACE_FUNC, ("Enumeration completed.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Enumeration completed.\n");
ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; }
@@ -279,8 +279,8 @@ enum_services(struct proxy_id_ctx *ctx, case NSS_STATUS_SUCCESS:
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Service found (%s, %d/%s)\n", - svc->s_name, svc->s_port, svc->s_proto)); + "Service found (%s, %d/%s)\n", + svc->s_name, svc->s_port, svc->s_proto);
protocols[0] = sss_get_cased_name(protocols, svc->s_proto, dom->case_sensitive); @@ -297,8 +297,8 @@ enum_services(struct proxy_id_ctx *ctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ DEBUG(SSSDBG_OP_FAILURE, - ("Failed to store service [%s]. Ignoring.\n", - strerror(ret))); + "Failed to store service [%s]. Ignoring.\n", + strerror(ret)); again = true; break; } @@ -315,8 +315,8 @@ enum_services(struct proxy_id_ctx *ctx, /* Do not fail completely on errors. * Just report the failure to save and go on */ DEBUG(SSSDBG_OP_FAILURE, - ("Failed to store service [%s]. Ignoring.\n", - strerror(ret))); + "Failed to store service [%s]. Ignoring.\n", + strerror(ret)); } again = true; break; @@ -329,8 +329,8 @@ enum_services(struct proxy_id_ctx *ctx, default: ret = EIO; DEBUG(SSSDBG_CRIT_FAILURE, - ("proxy -> getservent_r failed (%d)[%s]\n", - ret, strerror(ret))); + "proxy -> getservent_r failed (%d)[%s]\n", + ret, strerror(ret)); break; } } while (again); @@ -341,8 +341,8 @@ done: sret = sysdb_transaction_cancel(sysdb); if (sret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not cancel transaction! [%s]\n", - strerror(sret))); + "Could not cancel transaction! [%s]\n", + strerror(sret)); } } ctx->ops.endservent(); diff --git a/src/providers/simple/simple_access.c b/src/providers/simple/simple_access.c index 46b045e..8315111 100644 --- a/src/providers/simple/simple_access.c +++ b/src/providers/simple/simple_access.c @@ -46,7 +46,7 @@ void simple_access_handler(struct be_req *be_req) pd->pam_status = PAM_SYSTEM_ERR;
if (pd->cmd != SSS_PAM_ACCT_MGMT) { - DEBUG(4, ("simple access does not handles pam task %d.\n", pd->cmd)); + DEBUG(4, "simple access does not handles pam task %d.\n", pd->cmd); pd->pam_status = PAM_MODULE_UNKNOWN; goto done; } @@ -113,7 +113,7 @@ static errno_t simple_access_parse_names(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); ret = ENOMEM; goto done; } @@ -124,7 +124,7 @@ static errno_t simple_access_parse_names(TALLOC_CTX *mem_ctx,
out = talloc_zero_array(tmp_ctx, char*, size + 1); if (out == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero_array() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero_array() failed\n"); ret = ENOMEM; goto done; } @@ -135,8 +135,8 @@ static errno_t simple_access_parse_names(TALLOC_CTX *mem_ctx, ret = sss_parse_name(tmp_ctx, be_ctx->domain->names, list[i], &domain, &name); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to parse name '%s' [%d]: %s\n", - list[i], ret, sss_strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse name '%s' [%d]: %s\n", + list[i], ret, sss_strerror(ret)); goto done; }
@@ -188,7 +188,7 @@ int sssm_simple_access_init(struct be_ctx *bectx, struct bet_ops **ops,
ctx = talloc_zero(bectx, struct simple_ctx); if (ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); return ENOMEM; }
@@ -204,19 +204,19 @@ int sssm_simple_access_init(struct be_ctx *bectx, struct bet_ops **ops, ret = confdb_get_string_as_list(bectx->cdb, ctx, bectx->conf_path, lists[i].option, &lists[i].orig_list); if (ret == ENOENT) { - DEBUG(SSSDBG_FUNC_DATA, ("%s list is empty.\n", lists[i].name)); + DEBUG(SSSDBG_FUNC_DATA, "%s list is empty.\n", lists[i].name); *lists[i].ctx_list = NULL; continue; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("confdb_get_string_as_list failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "confdb_get_string_as_list failed.\n"); goto failed; }
ret = simple_access_parse_names(ctx, bectx, lists[i].orig_list, lists[i].ctx_list); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to parse %s list [%d]: %s\n", - lists[i].name, ret, sss_strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse %s list [%d]: %s\n", + lists[i].name, ret, sss_strerror(ret)); goto failed; } } @@ -225,8 +225,8 @@ int sssm_simple_access_init(struct be_ctx *bectx, struct bet_ops **ops, !ctx->allow_groups && !ctx->deny_users && !ctx->deny_groups) { - DEBUG(SSSDBG_OP_FAILURE, ("No rules supplied for simple access provider. " - "Access will be granted for all users.\n")); + DEBUG(SSSDBG_OP_FAILURE, "No rules supplied for simple access provider. " + "Access will be granted for all users.\n"); }
*ops = &simple_access_ops; diff --git a/src/providers/simple/simple_access_check.c b/src/providers/simple/simple_access_check.c index a368431..007ec10 100644 --- a/src/providers/simple/simple_access_check.c +++ b/src/providers/simple/simple_access_check.c @@ -53,16 +53,16 @@ simple_check_users(struct simple_ctx *ctx, const char *username, domain = find_subdomain_by_object_name(ctx->domain, ctx->allow_users[i]); if (domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid user %s!\n", - ctx->allow_users[i])); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid user %s!\n", + ctx->allow_users[i]); return EINVAL; }
if (sss_string_equal(domain->case_sensitive, username, ctx->allow_users[i])) { DEBUG(SSSDBG_TRACE_LIBS, - ("User [%s] found in allow list, access granted.\n", - username)); + "User [%s] found in allow list, access granted.\n", + username);
/* Do not return immediately on explicit allow * We need to make sure none of the user's groups @@ -76,7 +76,7 @@ simple_check_users(struct simple_ctx *ctx, const char *username, * unless a deny rule disables us below. */ DEBUG(SSSDBG_TRACE_LIBS, - ("No allow rule, assumuing allow unless explicitly denied\n")); + "No allow rule, assumuing allow unless explicitly denied\n"); *access_granted = true; }
@@ -86,16 +86,16 @@ simple_check_users(struct simple_ctx *ctx, const char *username, domain = find_subdomain_by_object_name(ctx->domain, ctx->deny_users[i]); if (domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid user %s!\n", - ctx->deny_users[i])); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid user %s!\n", + ctx->deny_users[i]); return EINVAL; }
if (sss_string_equal(domain->case_sensitive, username, ctx->deny_users[i])) { DEBUG(SSSDBG_TRACE_LIBS, - ("User [%s] found in deny list, access denied.\n", - ctx->deny_users[i])); + "User [%s] found in deny list, access denied.\n", + ctx->deny_users[i]);
/* Return immediately on explicit denial */ *access_granted = false; @@ -125,8 +125,8 @@ simple_check_groups(struct simple_ctx *ctx, const char **group_names, domain = find_subdomain_by_object_name(ctx->domain, ctx->allow_groups[i]); if (domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid group %s!\n", - ctx->allow_groups[i])); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid group %s!\n", + ctx->allow_groups[i]); return EINVAL; }
@@ -143,8 +143,8 @@ simple_check_groups(struct simple_ctx *ctx, const char **group_names, */ if (matched) { DEBUG(SSSDBG_TRACE_LIBS, - ("Group [%s] found in allow list, access granted.\n", - group_names[j])); + "Group [%s] found in allow list, access granted.\n", + group_names[j]); *access_granted = true; break; } @@ -158,8 +158,8 @@ simple_check_groups(struct simple_ctx *ctx, const char **group_names, domain = find_subdomain_by_object_name(ctx->domain, ctx->deny_groups[i]); if (domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid group %s!\n", - ctx->deny_groups[i])); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid group %s!\n", + ctx->deny_groups[i]); return EINVAL; }
@@ -176,8 +176,8 @@ simple_check_groups(struct simple_ctx *ctx, const char **group_names, */ if (matched) { DEBUG(SSSDBG_TRACE_LIBS, - ("Group [%s] found in deny list, access denied.\n", - group_names[j])); + "Group [%s] found in deny list, access denied.\n", + group_names[j]); *access_granted = false; break; } @@ -224,13 +224,13 @@ simple_resolve_group_send(TALLOC_CTX *mem_ctx, * parent was updated first), then just shortcut */ ret = simple_resolve_group_check(state); if (ret == EOK) { - DEBUG(SSSDBG_TRACE_LIBS, ("Group already updated\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Group already updated\n"); ret = EOK; goto done; } else if (ret != EAGAIN) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot check if group was already updated [%d]: %s\n", - ret, sss_strerror(ret))); + "Cannot check if group was already updated [%d]: %s\n", + ret, sss_strerror(ret)); goto done; } /* EAGAIN - still needs update */ @@ -287,24 +287,24 @@ simple_resolve_group_check(struct simple_resolve_group_state *state) return EAGAIN; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not look up group by gid [%"SPRIgid"]: [%d][%s]\n", - state->gid, ret, sss_strerror(ret))); + "Could not look up group by gid [%"SPRIgid"]: [%d][%s]\n", + state->gid, ret, sss_strerror(ret)); return ret; }
state->name = ldb_msg_find_attr_as_string(group, SYSDB_NAME, NULL); if (!state->name) { - DEBUG(SSSDBG_OP_FAILURE, ("No group name\n")); + DEBUG(SSSDBG_OP_FAILURE, "No group name\n"); return ERR_ACCOUNT_UNKNOWN; }
if (is_posix(group) == false) { DEBUG(SSSDBG_TRACE_LIBS, - ("The group is still non-POSIX\n")); + "The group is still non-POSIX\n"); return EAGAIN; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Got POSIX group\n")); + DEBUG(SSSDBG_TRACE_LIBS, "Got POSIX group\n"); return EOK; }
@@ -324,15 +324,15 @@ static void simple_resolve_group_done(struct tevent_req *subreq) &err_maj, &err_min, &err_msg); talloc_zfree(subreq); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("be_get_account_info_recv failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "be_get_account_info_recv failed\n"); tevent_req_error(req, ret); return; }
if (err_maj) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot refresh data from DP: %u,%u: %s\n", - err_maj, err_min, err_msg)); + "Cannot refresh data from DP: %u,%u: %s\n", + err_maj, err_min, err_msg); tevent_req_error(req, EIO); return; } @@ -340,7 +340,7 @@ static void simple_resolve_group_done(struct tevent_req *subreq) /* Check the cache by GID again and fetch the name */ ret = simple_resolve_group_check(state); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Refresh failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "Refresh failed\n"); tevent_req_error(req, ret); return; } @@ -415,12 +415,12 @@ simple_check_get_groups_send(TALLOC_CTX *mem_ctx, state->ev = ev; state->ctx = ctx;
- DEBUG(SSSDBG_TRACE_LIBS, ("Looking up groups for user %s\n", username)); + DEBUG(SSSDBG_TRACE_LIBS, "Looking up groups for user %s\n", username);
/* get domain from username */ state->domain = find_subdomain_by_object_name(ctx->domain, username); if (state->domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid user %s!\n", username)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid user %s!\n", username); ret = EINVAL; goto done; } @@ -428,13 +428,13 @@ simple_check_get_groups_send(TALLOC_CTX *mem_ctx, ret = sysdb_search_user_by_name(state, state->domain->sysdb, state->domain, username, attrs, &user); if (ret == ENOENT) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No such user %s\n", username)); + DEBUG(SSSDBG_MINOR_FAILURE, "No such user %s\n", username); ret = ERR_ACCOUNT_UNKNOWN; goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not look up username [%s]: [%d][%s]\n", - username, ret, sss_strerror(ret))); + "Could not look up username [%s]: [%d][%s]\n", + username, ret, sss_strerror(ret)); goto done; }
@@ -446,8 +446,8 @@ simple_check_get_groups_send(TALLOC_CTX *mem_ctx, }
DEBUG(SSSDBG_TRACE_FUNC, - ("User %s is a member of %zu supplemental groups\n", - username, group_count)); + "User %s is a member of %zu supplemental groups\n", + username, group_count);
/* One extra space for terminator, one extra space for private group */ state->group_names = talloc_zero_array(state, const char *, group_count + 2); @@ -474,7 +474,7 @@ simple_check_get_groups_send(TALLOC_CTX *mem_ctx,
gid = ldb_msg_find_attr_as_uint64(user, SYSDB_GIDNUM, 0); if (!gid) { - DEBUG(SSSDBG_MINOR_FAILURE, ("User %s has no gid?\n", username)); + DEBUG(SSSDBG_MINOR_FAILURE, "User %s has no gid?\n", username); ret = EINVAL; goto done; } @@ -488,13 +488,13 @@ simple_check_get_groups_send(TALLOC_CTX *mem_ctx, /* If all groups could have been resolved by name, we are * done */ - DEBUG(SSSDBG_TRACE_FUNC, ("All groups had name attribute\n")); + DEBUG(SSSDBG_TRACE_FUNC, "All groups had name attribute\n"); ret = EOK; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Need to resolve %zu groups\n", - state->num_groups)); + DEBUG(SSSDBG_TRACE_FUNC, "Need to resolve %zu groups\n", + state->num_groups); state->giter = 0; subreq = simple_resolve_group_send(req, state->ev, state->ctx, state->lookup_groups[state->giter].domain, @@ -530,8 +530,8 @@ static void simple_check_get_groups_next(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not resolve name of group with GID %"SPRIgid"\n", - state->lookup_groups[state->giter].gid)); + "Could not resolve name of group with GID %"SPRIgid"\n", + state->lookup_groups[state->giter].gid); tevent_req_error(req, ret); return; } @@ -551,7 +551,7 @@ static void simple_check_get_groups_next(struct tevent_req *subreq) return; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("All groups resolved. Done.\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "All groups resolved. Done.\n"); tevent_req_done(req); }
@@ -576,7 +576,7 @@ simple_check_process_group(struct simple_check_groups_state *state,
if (gid == 0) { if (posix == true) { - DEBUG(SSSDBG_CRIT_FAILURE, ("POSIX group without GID\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "POSIX group without GID\n"); return EINVAL; }
@@ -588,7 +588,7 @@ simple_check_process_group(struct simple_check_groups_state *state, if (!state->group_names[state->num_names]) { return ENOMEM; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding group %s\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Adding group %s\n", name); state->num_names++; return EOK; } @@ -601,7 +601,7 @@ simple_check_process_group(struct simple_check_groups_state *state, if (!state->group_names[state->num_names]) { return ENOMEM; } - DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding group %s\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Adding group %s\n", name); state->num_names++; return EOK; } @@ -614,8 +614,8 @@ simple_check_process_group(struct simple_check_groups_state *state, } else { domain = find_subdomain_by_sid(state->ctx->domain, group_sid); if (domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("There is no domain information for " - "SID %s\n", group_sid)); + DEBUG(SSSDBG_CRIT_FAILURE, "There is no domain information for " + "SID %s\n", group_sid); return ENOENT; } } @@ -623,7 +623,7 @@ simple_check_process_group(struct simple_check_groups_state *state, /* It is a non-posix group with a GID. Needs resolving */ state->lookup_groups[state->num_groups].domain = domain; state->lookup_groups[state->num_groups].gid = gid; - DEBUG(SSSDBG_TRACE_INTERNAL, ("Adding GID %"SPRIgid"\n", gid)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Adding GID %"SPRIgid"\n", gid); state->num_groups++; return EOK; } @@ -641,8 +641,8 @@ simple_check_get_groups_primary(struct simple_check_groups_state *state, gid, group_attrs, &msg); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not look up primary group [%"SPRIgid"]: [%d][%s]\n", - gid, ret, sss_strerror(ret))); + "Could not look up primary group [%"SPRIgid"]: [%d][%s]\n", + gid, ret, sss_strerror(ret)); /* We have to treat this as non-fatal, because the primary * group may be local to the machine and not available in * our ID provider. @@ -650,7 +650,7 @@ simple_check_get_groups_primary(struct simple_check_groups_state *state, } else { ret = simple_check_process_group(state, msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot process primary group\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot process primary group\n"); return ret; } } @@ -705,7 +705,7 @@ struct tevent_req *simple_access_check_send(TALLOC_CTX *mem_ctx, goto immediate; }
- DEBUG(SSSDBG_FUNC_DATA, ("Simple access check for %s\n", username)); + DEBUG(SSSDBG_FUNC_DATA, "Simple access check for %s\n", username);
ret = simple_check_users(ctx, username, &state->access_granted); if (ret == EOK) { @@ -721,7 +721,7 @@ struct tevent_req *simple_access_check_send(TALLOC_CTX *mem_ctx, /* There are no group restrictions, so just return * here with whatever we've decided. */ - DEBUG(SSSDBG_TRACE_LIBS, ("No group restrictions, end request\n")); + DEBUG(SSSDBG_TRACE_LIBS, "No group restrictions, end request\n"); ret = EOK; goto immediate; } @@ -767,7 +767,7 @@ static void simple_access_check_done(struct tevent_req *subreq) return; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not collect groups of user %s\n", state->username)); + "Could not collect groups of user %s\n", state->username); tevent_req_error(req, ret); return; } @@ -775,14 +775,14 @@ static void simple_access_check_done(struct tevent_req *subreq) ret = simple_check_groups(state->ctx, state->group_names, &state->access_granted); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not check group access [%d]: %s\n", - ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not check group access [%d]: %s\n", + ret, sss_strerror(ret)); tevent_req_error(req, ERR_INTERNAL); return; }
/* Now just return whatever we decided */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("Group check done\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Group check done\n"); tevent_req_done(req); }
@@ -794,7 +794,7 @@ errno_t simple_access_check_recv(struct tevent_req *req, bool *access_granted) TEVENT_REQ_RETURN_ON_ERROR(req);
DEBUG(SSSDBG_TRACE_LIBS, - ("Access %sgranted\n", state->access_granted ? "" : "not ")); + "Access %sgranted\n", state->access_granted ? "" : "not "); if (access_granted) { *access_granted = state->access_granted; } diff --git a/src/resolv/async_resolv.c b/src/resolv/async_resolv.c index dda2885..7f03923 100644 --- a/src/resolv/async_resolv.c +++ b/src/resolv/async_resolv.c @@ -140,7 +140,7 @@ fd_input_available(struct tevent_context *ev, struct tevent_fd *fde, struct fd_watch *watch = talloc_get_type(data, struct fd_watch);
if (watch->ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); return; }
@@ -182,7 +182,7 @@ add_timeout_timer(struct tevent_context *ev, struct resolv_ctx *ctx) ctx->timeout_watcher = tevent_add_timer(ev, ctx, tv, check_fd_timeouts, ctx); if (ctx->timeout_watcher == NULL) { - DEBUG(1, ("Out of memory\n")); + DEBUG(1, "Out of memory\n"); } }
@@ -192,7 +192,7 @@ check_fd_timeouts(struct tevent_context *ev, struct tevent_timer *te, { struct resolv_ctx *ctx = talloc_get_type(private_data, struct resolv_ctx);
- DEBUG(9, ("Checking for DNS timeouts\n")); + DEBUG(9, "Checking for DNS timeouts\n");
/* NULLify the timeout_watcher so we don't * free it in the _done() function if it @@ -216,11 +216,11 @@ resolv_request_timeout(struct tevent_context *ev, { struct resolv_request *rreq;
- DEBUG(SSSDBG_MINOR_FAILURE, ("The resolve request timed out\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "The resolve request timed out\n");
rreq = talloc_get_type(pvt, struct resolv_request); if (rreq->rwatch == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("The request already completed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The request already completed\n"); return; }
@@ -231,7 +231,7 @@ resolv_request_timeout(struct tevent_context *ev, static int request_watch_destructor(struct request_watch *rwatch) { - DEBUG(SSSDBG_TRACE_FUNC, ("Deleting request watch\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Deleting request watch\n"); if (rwatch->rr) rwatch->rr->rwatch = NULL; return 0; } @@ -243,8 +243,8 @@ schedule_request_timeout(struct tevent_context *ev, struct resolv_ctx *ctx, struct resolv_request *rreq; struct timeval tv;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Scheduling a timeout of %d seconds\n", - ctx->timeout)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Scheduling a timeout of %d seconds\n", + ctx->timeout); tv = tevent_timeval_current_ofs(ctx->timeout, 0);
/* Intentionally allocating on ctx, because the request might go away @@ -288,7 +288,7 @@ schedule_timeout_watcher(struct tevent_context *ev, struct resolv_ctx *ctx,
ctx->pending_requests++;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Scheduling DNS timeout watcher\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Scheduling DNS timeout watcher\n"); add_timeout_timer(ev, ctx); return rreq; } @@ -303,13 +303,13 @@ unschedule_timeout_watcher(struct resolv_ctx *ctx, struct resolv_request *rreq) talloc_free(rreq); /* Cancels the tevent timeout as well */
if (ctx->pending_requests <= 0) { - DEBUG(1, ("Pending DNS requests mismatch\n")); + DEBUG(1, "Pending DNS requests mismatch\n"); return; }
ctx->pending_requests--; if (ctx->pending_requests == 0) { - DEBUG(9, ("Unscheduling DNS timeout watcher\n")); + DEBUG(9, "Unscheduling DNS timeout watcher\n"); talloc_zfree(ctx->timeout_watcher); } } @@ -360,7 +360,7 @@ fd_event_add(struct resolv_ctx *ctx, int s, int flags) /* The file descriptor is new, register it with tevent. */ watch = talloc(ctx, struct fd_watch); if (watch == NULL) { - DEBUG(1, ("Out of memory allocating fd_watch structure\n")); + DEBUG(1, "Out of memory allocating fd_watch structure\n"); return; } talloc_set_destructor(watch, fd_watch_destructor); @@ -371,7 +371,7 @@ fd_event_add(struct resolv_ctx *ctx, int s, int flags) watch->fde = tevent_add_fd(ctx->ev_ctx, watch, s, flags, fd_input_available, watch); if (watch->fde == NULL) { - DEBUG(1, ("tevent_add_fd() failed\n")); + DEBUG(1, "tevent_add_fd() failed\n"); talloc_free(watch); return; } @@ -400,7 +400,7 @@ resolv_ctx_destructor(struct resolv_ctx *ctx) ares_channel channel;
if (ctx->channel == NULL) { - DEBUG(1, ("Ares channel already destroyed?\n")); + DEBUG(1, "Ares channel already destroyed?\n"); return -1; }
@@ -421,7 +421,7 @@ recreate_ares_channel(struct resolv_ctx *ctx) ares_channel old_channel; struct ares_options options;
- DEBUG(4, ("Initializing new c-ares channel\n")); + DEBUG(4, "Initializing new c-ares channel\n"); /* FIXME: the options would contain * the nameservers to contact, the domains * to search... => get from confdb @@ -438,15 +438,15 @@ recreate_ares_channel(struct resolv_ctx *ctx) ARES_OPT_LOOKUPS | ARES_OPT_TRIES); if (ret != ARES_SUCCESS) { - DEBUG(1, ("Failed to initialize ares channel: %s\n", - resolv_strerror(ret))); + DEBUG(1, "Failed to initialize ares channel: %s\n", + resolv_strerror(ret)); return return_code(ret); }
old_channel = ctx->channel; ctx->channel = new_channel; if (old_channel != NULL) { - DEBUG(4, ("Destroying the old c-ares channel\n")); + DEBUG(4, "Destroying the old c-ares channel\n"); ares_destroy(old_channel); }
@@ -462,8 +462,8 @@ resolv_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx,
if (timeout < 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("The timeout is too short, DNS operations are going to fail. " - "This is a bug outside unit tests\n")); + "The timeout is too short, DNS operations are going to fail. " + "This is a bug outside unit tests\n"); }
ctx = talloc_zero(mem_ctx, struct resolv_ctx); @@ -646,12 +646,12 @@ resolv_copy_hostent_ares(TALLOC_CTX *mem_ctx, struct hostent *src, break; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("Unknown address family %d\n", family)); + "Unknown address family %d\n", family); goto fail; }
if (cret != EOK) { - DEBUG(1, ("Could not copy address\n")); + DEBUG(1, "Could not copy address\n"); goto fail; } } @@ -706,8 +706,8 @@ resolv_gethostbyname_files_send(TALLOC_CTX *mem_ctx, state->rhostent = NULL; state->family = family;
- DEBUG(4, ("Trying to resolve %s record of '%s' in files\n", - state->family == AF_INET ? "A" : "AAAA", state->name)); + DEBUG(4, "Trying to resolve %s record of '%s' in files\n", + state->family == AF_INET ? "A" : "AAAA", state->name);
state->status = ares_gethostbyname_file(state->resolv_ctx->channel, state->name, state->family, @@ -798,7 +798,7 @@ resolv_gethostbyname_dns_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct timeval tv = { 0, 0 };
if (ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); return NULL; }
@@ -821,7 +821,7 @@ resolv_gethostbyname_dns_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, * This would not let our caller to set a callback for req. */ subreq = tevent_wakeup_send(req, ev, tv); if (subreq == NULL) { - DEBUG(1, ("Failed to add critical timer to run next operation!\n")); + DEBUG(1, "Failed to add critical timer to run next operation!\n"); talloc_zfree(req); return NULL; } @@ -845,7 +845,7 @@ resolv_gethostbyname_dns_wakeup(struct tevent_req *subreq) talloc_zfree(subreq);
if (state->resolv_ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); tevent_req_error(req, EIO); return; } @@ -859,8 +859,8 @@ resolv_gethostbyname_dns_query(struct tevent_req *req, { struct resolv_request *rreq;
- DEBUG(4, ("Trying to resolve %s record of '%s' in DNS\n", - state->family == AF_INET ? "A" : "AAAA", state->name)); + DEBUG(4, "Trying to resolve %s record of '%s' in DNS\n", + state->family == AF_INET ? "A" : "AAAA", state->name);
rreq = schedule_timeout_watcher(state->ev, state->resolv_ctx, req); if (!rreq) { @@ -951,7 +951,7 @@ resolv_gethostbyname_dns_parse(struct gethostbyname_dns_state *state,
switch (state->family) { case AF_INET: - DEBUG(7, ("Parsing an A reply\n")); + DEBUG(7, "Parsing an A reply\n");
addr = talloc_array(state, struct ares_addrttl, naddrttls); if (!addr) { @@ -964,7 +964,7 @@ resolv_gethostbyname_dns_parse(struct gethostbyname_dns_state *state, &naddrttls); break; case AF_INET6: - DEBUG(7, ("Parsing an AAAA reply\n")); + DEBUG(7, "Parsing an AAAA reply\n");
addr = talloc_array(state, struct ares_addr6ttl, naddrttls); if (!addr) { @@ -977,7 +977,7 @@ resolv_gethostbyname_dns_parse(struct gethostbyname_dns_state *state, &naddrttls); break; default: - DEBUG(1, ("Unknown family %d\n", state->family)); + DEBUG(1, "Unknown family %d\n", state->family); ret = EAFNOSUPPORT; goto fail; } @@ -1083,7 +1083,7 @@ resolv_gethostbyname_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, errno_t ret;
if (ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); return NULL; }
@@ -1096,7 +1096,7 @@ resolv_gethostbyname_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, state->ev = ev; state->name = talloc_strdup(state, name); if (state->name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); goto fail; }
@@ -1114,7 +1114,7 @@ resolv_gethostbyname_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, ret = resolv_gethostbyname_address(state, state->name, &state->rhostent); if (ret != EOK) { - DEBUG(1, ("Canot create a fake hostent structure\n")); + DEBUG(1, "Canot create a fake hostent structure\n"); goto fail; }
@@ -1125,7 +1125,7 @@ resolv_gethostbyname_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
ret = resolv_gethostbyname_step(req); if (ret != EOK) { - DEBUG(1, ("Cannot start the resolving\n")); + DEBUG(1, "Cannot start the resolving\n"); goto fail; }
@@ -1151,10 +1151,10 @@ resolv_is_address(const char *name) freeaddrinfo(res); if (ret != 0) { if (ret == -2) { - DEBUG(9, ("[%s] does not look like an IP address\n", name)); + DEBUG(9, "[%s] does not look like an IP address\n", name); } else { - DEBUG(2, ("getaddrinfo failed [%d]: %s\n", - ret, gai_strerror(ret))); + DEBUG(2, "getaddrinfo failed [%d]: %s\n", + ret, gai_strerror(ret)); } }
@@ -1210,7 +1210,7 @@ resolv_gethostbyname_address(TALLOC_CTX *mem_ctx, const char *address, ret = inet_pton(family, address, rhostent->addr_list[0]->ipaddr); if (ret != 1) { - DEBUG(1, ("Could not parse address as neither v4 nor v6\n")); + DEBUG(1, "Could not parse address as neither v4 nor v6\n"); ret = EINVAL; goto done; } @@ -1240,7 +1240,7 @@ resolv_gethostbyname_family_init(enum restrict_family family_order) return AF_INET6; }
- DEBUG(1, ("Unknown address family order %d\n", family_order)); + DEBUG(1, "Unknown address family order %d\n", family_order); return -1; }
@@ -1258,7 +1258,7 @@ resolv_gethostbyname_next(struct gethostbyname_state *state) } else { /* No more address families for this DB, check if * there is another DB to try */ - DEBUG(5, ("No more address families to retry\n")); + DEBUG(5, "No more address families to retry\n"); state->dbi++; if (state->db[state->dbi] != DB_SENTINEL) { state->family = resolv_gethostbyname_family_init( @@ -1267,7 +1267,7 @@ resolv_gethostbyname_next(struct gethostbyname_state *state) } }
- DEBUG(4, ("No more hosts databases to retry\n")); + DEBUG(4, "No more hosts databases to retry\n"); return ENOENT; }
@@ -1283,21 +1283,21 @@ resolv_gethostbyname_step(struct tevent_req *req)
switch(state->db[state->dbi]) { case DB_FILES: - DEBUG(8, ("Querying files\n")); + DEBUG(8, "Querying files\n"); subreq = resolv_gethostbyname_files_send(state, state->ev, state->resolv_ctx, state->name, state->family); break; case DB_DNS: - DEBUG(8, ("Querying DNS\n")); + DEBUG(8, "Querying DNS\n"); subreq = resolv_gethostbyname_dns_send(state, state->ev, state->resolv_ctx, state->name, state->family); break; default: - DEBUG(1, ("Invalid hosts database\n")); + DEBUG(1, "Invalid hosts database\n"); return EINVAL; }
@@ -1332,7 +1332,7 @@ resolv_gethostbyname_done(struct tevent_req *subreq) &state->rhostent); break; default: - DEBUG(1, ("Invalid hosts database\n")); + DEBUG(1, "Invalid hosts database\n"); tevent_req_error(req, EINVAL); return; } @@ -1358,8 +1358,8 @@ resolv_gethostbyname_done(struct tevent_req *subreq) }
if (ret != EOK) { - DEBUG(2, ("querying hosts database failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(2, "querying hosts database failed [%d]: %s\n", + ret, strerror(ret)); tevent_req_error(req, ret); return; } @@ -1402,14 +1402,14 @@ resolv_get_string_address_index(TALLOC_CTX *mem_ctx,
address = talloc_zero_size(mem_ctx, 128); if (address == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return NULL; }
errno = 0; if (inet_ntop(hostent->family, hostent->addr_list[addrindex]->ipaddr, address, 128) == NULL) { - DEBUG(1, ("inet_ntop failed [%d][%s].\n", errno, strerror(errno))); + DEBUG(1, "inet_ntop failed [%d][%s].\n", errno, strerror(errno)); talloc_free(address); return NULL; } @@ -1446,7 +1446,7 @@ resolv_get_string_ptr_address(TALLOC_CTX *mem_ctx, (address[1]), (address[0])); } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown address family\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown address family\n"); return NULL; }
@@ -1464,7 +1464,7 @@ resolv_get_sockaddr_address_index(TALLOC_CTX *mem_ctx,
sockaddr = talloc_zero(mem_ctx, struct sockaddr_storage); if (sockaddr == NULL) { - DEBUG(1, ("talloc_zero failed.\n")); + DEBUG(1, "talloc_zero failed.\n"); return NULL; }
@@ -1486,7 +1486,7 @@ resolv_get_sockaddr_address_index(TALLOC_CTX *mem_ctx, break; default: DEBUG(SSSDBG_CRIT_FAILURE, - ("Unknown address family %d\n", hostent->family)); + "Unknown address family %d\n", hostent->family); return NULL; }
@@ -1583,10 +1583,10 @@ resolv_getsrv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct getsrv_state *state; struct timeval tv = { 0, 0 };
- DEBUG(4, ("Trying to resolve SRV record of '%s'\n", query)); + DEBUG(4, "Trying to resolve SRV record of '%s'\n", query);
if (ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); return NULL; }
@@ -1604,7 +1604,7 @@ resolv_getsrv_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
subreq = tevent_wakeup_send(req, ev, tv); if (subreq == NULL) { - DEBUG(1, ("Failed to add critical timer to run next operation!\n")); + DEBUG(1, "Failed to add critical timer to run next operation!\n"); talloc_zfree(req); return NULL; } @@ -1650,7 +1650,7 @@ resolv_getsrv_done(void *arg, int status, int timeouts, unsigned char *abuf, int
ret = ares_parse_srv_reply(abuf, alen, &reply_list); if (ret != ARES_SUCCESS) { - DEBUG(2, ("SRV record parsing failed: %d: %s\n", ret, ares_strerror(ret))); + DEBUG(2, "SRV record parsing failed: %d: %s\n", ret, ares_strerror(ret)); ret = return_code(ret); goto fail; } @@ -1700,7 +1700,7 @@ ares_getsrv_wakeup(struct tevent_req *subreq) talloc_zfree(subreq);
if (state->resolv_ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); tevent_req_error(req, EIO); return; } @@ -1819,10 +1819,10 @@ resolv_gettxt_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct gettxt_state *state; struct timeval tv = { 0, 0 };
- DEBUG(4, ("Trying to resolve TXT record of '%s'\n", query)); + DEBUG(4, "Trying to resolve TXT record of '%s'\n", query);
if (ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); return NULL; }
@@ -1840,7 +1840,7 @@ resolv_gettxt_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
subreq = tevent_wakeup_send(req, ev, tv); if (subreq == NULL) { - DEBUG(1, ("Failed to add critical timer to run next operation!\n")); + DEBUG(1, "Failed to add critical timer to run next operation!\n"); talloc_zfree(req); return NULL; } @@ -1887,7 +1887,7 @@ resolv_gettxt_done(void *arg, int status, int timeouts, unsigned char *abuf, int
ret = ares_parse_txt_reply(abuf, alen, &reply_list); if (status != ARES_SUCCESS) { - DEBUG(2, ("TXT record parsing failed: %d: %s\n", ret, ares_strerror(ret))); + DEBUG(2, "TXT record parsing failed: %d: %s\n", ret, ares_strerror(ret)); ret = return_code(ret); goto fail; } @@ -1937,7 +1937,7 @@ ares_gettxt_wakeup(struct tevent_req *subreq) talloc_zfree(subreq);
if (state->resolv_ctx->channel == NULL) { - DEBUG(1, ("Invalid ares channel - this is likely a bug\n")); + DEBUG(1, "Invalid ares channel - this is likely a bug\n"); tevent_req_error(req, EIO); return; } @@ -2121,7 +2121,7 @@ static int reply_weight_rearrange(int len, }
if (r == NULL || totals[i] == -1) { - DEBUG(1, ("Bug: did not select any server!\n")); + DEBUG(1, "Bug: did not select any server!\n"); ret = EIO; goto done; } @@ -2165,7 +2165,7 @@ resolv_sort_srv_reply(struct ares_srv_reply **reply) * (the root domain), abort. */ if (*reply && !(*reply)->next && strcmp((*reply)->host, ".") == 0) { - DEBUG(1, ("DNS returned only the root domain, aborting\n")); + DEBUG(1, "DNS returned only the root domain, aborting\n"); return EIO; }
@@ -2190,8 +2190,8 @@ resolv_sort_srv_reply(struct ares_srv_reply **reply) pri_end->next = NULL; ret = reply_weight_rearrange(len, &pri_start, &pri_end); if (ret) { - DEBUG(1, ("Error rearranging priority level [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "Error rearranging priority level [%d]: %s\n", + ret, strerror(ret)); return ret; }
diff --git a/src/resolv/async_resolv_utils.c b/src/resolv/async_resolv_utils.c index dbc33d5..b24ae60 100644 --- a/src/resolv/async_resolv_utils.c +++ b/src/resolv/async_resolv_utils.c @@ -50,7 +50,7 @@ resolv_get_domain_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct resolv_get_domain_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -59,8 +59,8 @@ resolv_get_domain_send(TALLOC_CTX *mem_ctx, ret = gethostname(system_hostname, HOST_NAME_MAX); if (ret) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("gethostname() failed: [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "gethostname() failed: [%d]: %s\n", + ret, strerror(ret)); goto immediately; } system_hostname[HOST_NAME_MAX-1] = '\0'; @@ -74,7 +74,7 @@ resolv_get_domain_send(TALLOC_CTX *mem_ctx, goto immediately; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Host name is: %s\n", state->hostname)); + DEBUG(SSSDBG_TRACE_LIBS, "Host name is: %s\n", state->hostname);
subreq = resolv_gethostbyname_send(state, ev, resolv_ctx, state->hostname, family_order, host_dbs); @@ -110,13 +110,13 @@ static void resolv_get_domain_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not get fully qualified name for host name %s " + "Could not get fully qualified name for host name %s " "error [%d]: %s, resolver returned: [%d]: %s\n", state->hostname, ret, strerror(ret), resolv_status, - resolv_strerror(resolv_status))); + resolv_strerror(resolv_status)); state->fqdn = state->hostname; } else { - DEBUG(SSSDBG_TRACE_LIBS, ("The FQDN is: %s\n", rhostent->name)); + DEBUG(SSSDBG_TRACE_LIBS, "The FQDN is: %s\n", rhostent->name); state->fqdn = talloc_steal(state, rhostent->name); talloc_zfree(rhostent); } @@ -181,7 +181,7 @@ struct tevent_req *resolv_discover_srv_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct resolv_discover_srv_state); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -239,8 +239,8 @@ static errno_t resolv_discover_srv_next_domain(struct tevent_req *req) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("SRV resolution of service '%s'. Will use DNS " - "discovery domain '%s'\n", state->service, domain)); + DEBUG(SSSDBG_TRACE_FUNC, "SRV resolution of service '%s'. Will use DNS " + "discovery domain '%s'\n", state->service, domain);
subreq = resolv_getsrv_send(state, state->ev, state->resolv_ctx, query); @@ -275,8 +275,8 @@ static void resolv_discover_srv_done(struct tevent_req *subreq) ret = resolv_getsrv_recv(state, subreq, &status, NULL, &state->reply_list); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("SRV query failed [%d]: %s\n", - status, resolv_strerror(status))); + DEBUG(SSSDBG_OP_FAILURE, "SRV query failed [%d]: %s\n", + status, resolv_strerror(status));
if (status == ARES_ENOTFOUND) { /* continue with next discovery domain */ diff --git a/src/responder/autofs/autofssrv.c b/src/responder/autofs/autofssrv.c index edd6f42..12f318e 100644 --- a/src/responder/autofs/autofssrv.c +++ b/src/responder/autofs/autofssrv.c @@ -70,8 +70,8 @@ autofs_get_config(struct autofs_ctx *actx, CONFDB_AUTOFS_MAP_NEG_TIMEOUT, 15, &actx->neg_timeout); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot read %s from configuration [%d]: %s\n", - CONFDB_AUTOFS_MAP_NEG_TIMEOUT, ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Cannot read %s from configuration [%d]: %s\n", + CONFDB_AUTOFS_MAP_NEG_TIMEOUT, ret, strerror(ret)); return ret; }
@@ -87,7 +87,7 @@ autofs_dp_reconnect_init(struct sbus_connection *conn,
/* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(SSSDBG_TRACE_FUNC, ("Reconnected to the Data Provider.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reconnected to the Data Provider.\n");
/* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -101,8 +101,8 @@ autofs_dp_reconnect_init(struct sbus_connection *conn, }
/* Failed to reconnect */ - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not reconnect to %s provider.\n", - be_conn->domain->name)); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not reconnect to %s provider.\n", + be_conn->domain->name); }
static int autofs_clean_hash_table(DBusMessage *message, @@ -116,7 +116,7 @@ static int autofs_clean_hash_table(DBusMessage *message,
ret = autofs_orphan_maps(actx); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not invalidate maps\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not invalidate maps\n"); return ret; }
@@ -148,20 +148,20 @@ autofs_process_init(TALLOC_CTX *mem_ctx, &autofs_dp_interface, &rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n"); return ret; }
autofs_ctx = talloc_zero(rctx, struct autofs_ctx); if (!autofs_ctx) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing autofs_ctx\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing autofs_ctx\n"); ret = ENOMEM; goto fail; }
ret = autofs_get_config(autofs_ctx, cdb); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Cannot read autofs configuration\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Cannot read autofs configuration\n"); goto fail; }
@@ -175,7 +175,7 @@ autofs_process_init(TALLOC_CTX *mem_ctx, 3, &max_retries); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set up automatic reconnection\n")); + "Failed to set up automatic reconnection\n"); goto fail; }
@@ -189,18 +189,18 @@ autofs_process_init(TALLOC_CTX *mem_ctx, autofs_map_hash_delete_cb, NULL); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to initialize automount maps hash table\n")); + "Unable to initialize automount maps hash table\n"); ret = EIO; goto fail; }
ret = schedule_get_domains_task(rctx, rctx->ev, rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("schedule_get_domains_tasks failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("autofs Initialization complete\n")); + DEBUG(SSSDBG_TRACE_FUNC, "autofs Initialization complete\n"); return EOK;
fail: @@ -250,8 +250,8 @@ int main(int argc, const char *argv[]) ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(SSSDBG_OP_FAILURE, ("Could not set up to exit " - "when parent process does\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set up to exit " + "when parent process does\n"); }
ret = autofs_process_init(main_ctx, diff --git a/src/responder/autofs/autofssrv_cmd.c b/src/responder/autofs/autofssrv_cmd.c index e9168ea..ecec0d6 100644 --- a/src/responder/autofs/autofssrv_cmd.c +++ b/src/responder/autofs/autofssrv_cmd.c @@ -110,7 +110,7 @@ autofs_orphan_maps(struct autofs_ctx *actx) for (i = 0; i < mcount; i++) { hret = hash_delete(actx->maps, &maps[i]); if (hret != HASH_SUCCESS) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not delete key from hash\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not delete key from hash\n"); continue; } } @@ -139,8 +139,8 @@ get_autofs_map(struct autofs_ctx *actx, }
DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected error reading from autofs map hash [%d][%s]\n", - hret, hash_error_string(hret))); + "Unexpected error reading from autofs map hash [%d][%s]\n", + hret, hash_error_string(hret)); return EIO; }
@@ -158,7 +158,7 @@ autofs_map_hash_delete_cb(hash_entry_t *item,
map = talloc_get_type(item->value.ptr, struct autofs_map_ctx); if (!map) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid autofs map\n")); + DEBUG(SSSDBG_OP_FAILURE, "Invalid autofs map\n"); return; }
@@ -176,7 +176,7 @@ set_autofs_map(struct autofs_ctx *actx, int hret;
if (map->mapname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Missing autofs map name.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing autofs map name.\n"); return EINVAL; }
@@ -188,9 +188,9 @@ set_autofs_map(struct autofs_ctx *actx, hret = hash_enter(actx->maps, &key, &value); if (hret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to add hash table entry for [%s]", key.str)); + "Unable to add hash table entry for [%s]", key.str); DEBUG(SSSDBG_MINOR_FAILURE, - ("Hash error [%d][%s]", hret, hash_error_string(hret))); + "Hash error [%d][%s]", hret, hash_error_string(hret)); return EIO; } talloc_steal(actx->maps, map); @@ -208,8 +208,8 @@ autofs_map_hash_remove(TALLOC_CTX *ctx) talloc_get_type(ctx, struct autofs_map_ctx);
if (map->map_table == NULL) { - DEBUG(SSSDBG_TRACE_LIBS, ("autofs map [%s] was already removed\n", - map->mapname)); + DEBUG(SSSDBG_TRACE_LIBS, "autofs map [%s] was already removed\n", + map->mapname); return 0; }
@@ -220,8 +220,8 @@ autofs_map_hash_remove(TALLOC_CTX *ctx) hret = hash_delete(map->map_table, &key); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not remove key from table! [%d][%s]\n", - hret, hash_error_string(hret))); + "Could not remove key from table! [%d][%s]\n", + hret, hash_error_string(hret)); return -1; } return 0; @@ -246,7 +246,7 @@ sss_autofs_cmd_setautomntent(struct cli_ctx *client) const char *rawname; struct tevent_req *req;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("sss_autofs_cmd_setautomntent\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "sss_autofs_cmd_setautomntent\n");
cmdctx = talloc_zero(client, struct autofs_cmd_ctx); if (!cmdctx) { @@ -270,12 +270,12 @@ sss_autofs_cmd_setautomntent(struct cli_ctx *client)
rawname = (const char *)body; DEBUG(SSSDBG_TRACE_FUNC, - ("Got request for automount map named %s\n", rawname)); + "Got request for automount map named %s\n", rawname);
req = setautomntent_send(cmdctx, rawname, cmdctx); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Fatal error calling setautomntent_send\n")); + "Fatal error calling setautomntent_send\n"); ret = EIO; goto done; } @@ -296,12 +296,12 @@ static void sss_autofs_cmd_setautomntent_done(struct tevent_req *req) uint8_t *body; size_t blen;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("setautomntent done\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "setautomntent done\n");
reqret = setautomntent_recv(req); talloc_zfree(req); if (reqret != EOK && reqret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_recv failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "setautomntent_recv failed\n"); autofs_cmd_done(cmdctx, reqret); return; } @@ -312,15 +312,15 @@ static void sss_autofs_cmd_setautomntent_done(struct tevent_req *req) &cmdctx->cctx->creq->out); if (ret == EOK) { if (reqret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("setautomntent did not find requested map\n")); + DEBUG(SSSDBG_TRACE_FUNC, "setautomntent did not find requested map\n"); /* Notify the caller that this entry wasn't found */ sss_cmd_empty_packet(cmdctx->cctx->creq->out); } else { - DEBUG(SSSDBG_TRACE_FUNC, ("setautomntent found data\n")); + DEBUG(SSSDBG_TRACE_FUNC, "setautomntent found data\n"); packet = cmdctx->cctx->creq->out; ret = sss_packet_grow(packet, 2*sizeof(uint32_t)); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Couldn't grow the packet\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Couldn't grow the packet\n"); talloc_free(cmdctx); return; } @@ -334,7 +334,7 @@ static void sss_autofs_cmd_setautomntent_done(struct tevent_req *req) return; }
- DEBUG(SSSDBG_CRIT_FAILURE, ("Error creating packet\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error creating packet\n"); return; }
@@ -392,8 +392,8 @@ set_autofs_map_lifetime(uint32_t lifetime, map); if (!te) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not set up life timer for autofs maps. " - "Entries may become stale.\n")); + "Could not set up life timer for autofs maps. " + "Entries may become stale.\n"); } }
@@ -420,14 +420,14 @@ setautomntent_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct setautomntent_state); if (!req) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not create tevent request for setautomntent\n")); + "Could not create tevent request for setautomntent\n"); return NULL; } state->cmdctx = cmdctx;
dctx = talloc_zero(state, struct autofs_dom_ctx); if (!dctx) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory\n"); ret = ENOMEM; goto fail; } @@ -439,13 +439,13 @@ setautomntent_send(TALLOC_CTX *mem_ctx, &domname, &state->mapname); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Invalid name received [%s]\n", rawname)); + "Invalid name received [%s]\n", rawname); goto fail; }
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting info for automount map [%s] from [%s]\n", - state->mapname, domname?domname:"<ALL>")); + "Requesting info for automount map [%s] from [%s]\n", + state->mapname, domname?domname:"<ALL>");
if (domname) { dctx->domain = responder_get_domain(client->rctx, domname); @@ -483,13 +483,13 @@ setautomntent_send(TALLOC_CTX *mem_ctx, if (state->map->ready) { if (state->map->found) { DEBUG(SSSDBG_TRACE_LIBS, - ("Map %s is ready to be processed\n", state->mapname)); + "Map %s is ready to be processed\n", state->mapname); tevent_req_done(req); tevent_req_post(req, actx->rctx->ev); return req; } else { DEBUG(SSSDBG_TRACE_LIBS, - ("Map %s was marked as nonexistent\n", state->mapname)); + "Map %s was marked as nonexistent\n", state->mapname); tevent_req_error(req, ENOENT); tevent_req_post(req, actx->rctx->ev); return req; @@ -500,8 +500,8 @@ setautomntent_send(TALLOC_CTX *mem_ctx, * Register for notification when it's ready */ DEBUG(SSSDBG_TRACE_LIBS, - ("Map %s is being looked up, registering for notification\n", - state->mapname)); + "Map %s is being looked up, registering for notification\n", + state->mapname); ret = autofs_setent_add_ref(state, state->map, req); if (ret != EOK) { goto fail; @@ -509,7 +509,7 @@ setautomntent_send(TALLOC_CTX *mem_ctx, /* Will return control below */ } else if (ret == ENOENT) { DEBUG(SSSDBG_TRACE_LIBS, - ("Map %s needs to be looked up\n", state->mapname)); + "Map %s needs to be looked up\n", state->mapname);
state->map = talloc_zero(actx, struct autofs_map_ctx); if (!state->map) { @@ -563,11 +563,11 @@ setautomntent_send(TALLOC_CTX *mem_ctx,
ret = lookup_automntmap_step(lookup_ctx); if (ret == EAGAIN) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("lookup_automntmap_step " - "is refreshing the cache, re-entering the mainloop\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "lookup_automntmap_step " + "is refreshing the cache, re-entering the mainloop\n"); return req; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get data from cache\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not get data from cache\n"); talloc_free(state->map); ret = ENOMEM; goto fail; @@ -578,8 +578,8 @@ setautomntent_send(TALLOC_CTX *mem_ctx, return req; } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unexpected error from get_autofs_map [%d]: %s\n", - ret, strerror(ret))); + "Unexpected error from get_autofs_map [%d]: %s\n", + ret, strerror(ret)); goto fail; }
@@ -602,7 +602,7 @@ setautomntent_get_autofs_map(struct autofs_ctx *actx, /* Iterate over the hash and remove all maps */ ret = autofs_orphan_maps(actx); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not remove existing maps from hash\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not remove existing maps from hash\n"); } return ENOENT; } @@ -643,12 +643,12 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom;
- DEBUG(SSSDBG_TRACE_FUNC, ("Requesting info for [%s@%s]\n", - lookup_ctx->mapname, dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Requesting info for [%s@%s]\n", + lookup_ctx->mapname, dom->name); sysdb = dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Fatal: Sysdb CTX not found for this domain!\n")); + "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; }
@@ -657,15 +657,15 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx) ret = sysdb_get_map_byname(dctx, sysdb, dom, lookup_ctx->mapname, &dctx->map); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not check cache\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not check cache\n"); return ret; } else if (ret == ENOENT) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No automount map [%s] in cache for domain [%s]\n", - lookup_ctx->mapname, dom->name)); + "No automount map [%s] in cache for domain [%s]\n", + lookup_ctx->mapname, dom->name); if (!dctx->check_provider) { if (dctx->cmd_ctx->check_next) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Moving on to next domain\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Moving on to next domain\n"); dom = get_next_domain(dom, false); continue; } @@ -676,13 +676,13 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx) ret = get_autofs_map(lookup_ctx->actx, lookup_ctx->mapname, &map); if (ret != EOK) { /* Something really bad happened! */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Autofs map entry was lost!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Autofs map entry was lost!\n"); return ret; }
if (dctx->map == NULL && !dctx->check_provider) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Autofs map not found, setting negative cache\n")); + "Autofs map not found, setting negative cache\n"); map->ready = true; map->found = false; set_autofs_map_lifetime(lookup_ctx->actx->neg_timeout, lookup_ctx, map); @@ -693,12 +693,12 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx) ret = lookup_automntmap_update_cache(lookup_ctx); if (ret == EAGAIN) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Looking up automount maps from the DP\n")); + "Looking up automount maps from the DP\n"); return EAGAIN; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error looking up automount maps [%d]: %s\n", - ret, strerror(ret))); + "Error looking up automount maps [%d]: %s\n", + ret, strerror(ret)); return ret; } } @@ -711,8 +711,8 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx) &map->entries); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("Error looking automount map entries [%d]: %s\n", - ret, strerror(ret))); + "Error looking automount map entries [%d]: %s\n", + ret, strerror(ret)); map->ready = true; map->found = false; set_autofs_map_lifetime(lookup_ctx->actx->neg_timeout, lookup_ctx, map); @@ -722,7 +722,7 @@ lookup_automntmap_step(struct setautomntent_lookup_ctx *lookup_ctx) map->map = talloc_steal(map, dctx->map);
DEBUG(SSSDBG_TRACE_FUNC, - ("setautomntent done for map %s\n", lookup_ctx->mapname)); + "setautomntent done for map %s\n", lookup_ctx->mapname); map->ready = true; map->found = true; set_autofs_map_lifetime(dom->autofsmap_timeout, lookup_ctx, map); @@ -778,10 +778,10 @@ lookup_automntmap_update_cache(struct setautomntent_lookup_ctx *lookup_ctx) /* if we have any reply let's check cache validity */ ret = sss_cmd_check_cache(dctx->map, 0, cache_expire); if (ret == EOK) { - DEBUG(SSSDBG_TRACE_FUNC, ("Cached entry is valid, returning..\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Cached entry is valid, returning..\n"); return EOK; } else if (ret != EAGAIN && ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error checking cache: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "Error checking cache: %d\n", ret); goto error; } } @@ -802,7 +802,7 @@ lookup_automntmap_update_cache(struct setautomntent_lookup_ctx *lookup_ctx) SSS_DP_AUTOFS, lookup_ctx->mapname); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending data provider request\n")); + "Out of memory sending data provider request\n"); ret = ENOMEM; goto error; } @@ -825,7 +825,7 @@ lookup_automntmap_update_cache(struct setautomntent_lookup_ctx *lookup_ctx) error: ret = autofs_cmd_send_error(lookup_ctx->dctx->cmd_ctx, ret); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Fatal error, killing connection!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Fatal error, killing connection!\n"); talloc_free(lookup_ctx->cctx); return ret; } @@ -850,7 +850,7 @@ static void autofs_dp_send_map_req_done(struct tevent_req *req) &err_msg); talloc_free(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Fatal error, killing connection!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Fatal error, killing connection!\n"); talloc_free(lookup_ctx->cctx); return; } @@ -868,10 +868,10 @@ static void lookup_automntmap_cache_updated(uint16_t err_maj, uint32_t err_min,
if (err_maj) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to get information from Data Provider\n" + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); /* Loop to the next domain if possible */ if (dctx->cmd_ctx->check_next && get_next_domain(dctx->domain, false)) { dctx->domain = get_next_domain(dctx->domain, false); @@ -921,7 +921,7 @@ sss_autofs_cmd_getautomntent(struct cli_ctx *client) size_t c = 0; struct tevent_req *req;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("sss_autofs_cmd_getautomntent\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "sss_autofs_cmd_getautomntent\n");
cmdctx = talloc_zero(client, struct autofs_cmd_ctx); if (!cmdctx) { @@ -931,7 +931,7 @@ sss_autofs_cmd_getautomntent(struct cli_ctx *client)
actx = talloc_get_type(client->rctx->pvt_ctx, struct autofs_ctx); if (!actx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Missing autofs context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing autofs context\n"); return EIO; }
@@ -963,15 +963,15 @@ sss_autofs_cmd_getautomntent(struct cli_ctx *client) SAFEALIGN_COPY_UINT32_CHECK(&cmdctx->max_entries, body+c+namelen+1, blen, &c);
DEBUG(SSSDBG_TRACE_FUNC, - ("Requested data of map %s cursor %d max entries %d\n", - cmdctx->mapname, cmdctx->cursor, cmdctx->max_entries)); + "Requested data of map %s cursor %d max entries %d\n", + cmdctx->mapname, cmdctx->cursor, cmdctx->max_entries);
ret = get_autofs_map(actx, cmdctx->mapname, &map); if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("Performing implicit setautomntent\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Performing implicit setautomntent\n"); req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_send failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "setautomntent_send failed\n"); ret = EIO; goto done; } @@ -981,16 +981,16 @@ sss_autofs_cmd_getautomntent(struct cli_ctx *client) goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("An unexpected error occurred: [%d][%s]\n", - ret, strerror(ret))); + "An unexpected error occurred: [%d][%s]\n", + ret, strerror(ret)); goto done; }
if (map->ready == false) { - DEBUG(SSSDBG_TRACE_FUNC, ("Performing implicit setautomntent\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Performing implicit setautomntent\n"); req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_send failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "setautomntent_send failed\n"); ret = EIO; goto done; } @@ -999,13 +999,13 @@ sss_autofs_cmd_getautomntent(struct cli_ctx *client) ret = EOK; goto done; } else if (map->found == false) { - DEBUG(SSSDBG_TRACE_FUNC, ("negative cache hit\n")); + DEBUG(SSSDBG_TRACE_FUNC, "negative cache hit\n"); ret = ENOENT; goto done; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("returning entries for [%s]\n", map->mapname)); + "returning entries for [%s]\n", map->mapname);
ret = getautomntent_process(cmdctx, map, cmdctx->cursor, cmdctx->max_entries);
@@ -1027,9 +1027,9 @@ getautomntent_implicit_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { if (ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_recv failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "setautomntent_recv failed\n"); } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("No such map\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No such map\n"); } goto done; } @@ -1037,13 +1037,13 @@ getautomntent_implicit_done(struct tevent_req *req) ret = get_autofs_map(actx, cmdctx->mapname, &map); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot get map after setautomntent succeeded?\n")); + "Cannot get map after setautomntent succeeded?\n"); goto done; }
if (map->ready == false) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Map not ready after setautomntent succeeded\n")); + "Map not ready after setautomntent succeeded\n"); goto done; }
@@ -1077,7 +1077,7 @@ getautomntent_process(struct autofs_cmd_ctx *cmdctx,
if (!map->map || !map->entries || !map->entries[0] || cursor >= map->entry_count) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No entries found\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No entries found\n"); ret = sss_cmd_empty_packet(client->creq->out); if (ret != EOK) { return autofs_cmd_done(cmdctx, ret); @@ -1088,7 +1088,7 @@ getautomntent_process(struct autofs_cmd_ctx *cmdctx, /* allocate memory for number of entries in the packet */ ret = sss_packet_grow(client->creq->out, sizeof(uint32_t)); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot grow packet\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot grow packet\n"); goto done; }
@@ -1105,7 +1105,7 @@ getautomntent_process(struct autofs_cmd_ctx *cmdctx, ret = fill_autofs_entry(entry, client->creq->out, &rp); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot fill entry %d/%d, skipping\n", i, stop)); + "Cannot fill entry %d/%d, skipping\n", i, stop); continue; } nentries++; @@ -1141,7 +1141,7 @@ fill_autofs_entry(struct ldb_message *entry, struct sss_packet *packet, size_t * key = ldb_msg_find_attr_as_string(entry, SYSDB_AUTOFS_ENTRY_KEY, NULL); value = ldb_msg_find_attr_as_string(entry, SYSDB_AUTOFS_ENTRY_VALUE, NULL); if (!key || !value) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Incomplete entry\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Incomplete entry\n"); return EINVAL; }
@@ -1151,7 +1151,7 @@ fill_autofs_entry(struct ldb_message *entry, struct sss_packet *packet, size_t *
ret = sss_packet_grow(packet, len); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot grow packet\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot grow packet\n"); return ret; }
@@ -1199,7 +1199,7 @@ sss_autofs_cmd_getautomntbyname(struct cli_ctx *client) size_t c = 0; struct tevent_req *req;
- DEBUG(SSSDBG_TRACE_INTERNAL, ("sss_autofs_cmd_getautomntbyname\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "sss_autofs_cmd_getautomntbyname\n");
cmdctx = talloc_zero(client, struct autofs_cmd_ctx); if (!cmdctx) { @@ -1209,7 +1209,7 @@ sss_autofs_cmd_getautomntbyname(struct cli_ctx *client)
actx = talloc_get_type(client->rctx->pvt_ctx, struct autofs_ctx); if (!actx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Missing autofs context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing autofs context\n"); return EIO; }
@@ -1263,14 +1263,14 @@ sss_autofs_cmd_getautomntbyname(struct cli_ctx *client) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Requested data of map %s key %s\n", cmdctx->mapname, cmdctx->key)); + "Requested data of map %s key %s\n", cmdctx->mapname, cmdctx->key);
ret = get_autofs_map(actx, cmdctx->mapname, &map); if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("Performing implicit setautomntent\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Performing implicit setautomntent\n"); req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_send failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "setautomntent_send failed\n"); ret = EIO; goto done; } @@ -1280,16 +1280,16 @@ sss_autofs_cmd_getautomntbyname(struct cli_ctx *client) goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("An unexpected error occurred: [%d][%s]\n", - ret, strerror(ret))); + "An unexpected error occurred: [%d][%s]\n", + ret, strerror(ret)); goto done; }
if (map->ready == false) { - DEBUG(SSSDBG_TRACE_FUNC, ("Performing implicit setautomntent\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Performing implicit setautomntent\n"); req = setautomntent_send(cmdctx, cmdctx->mapname, cmdctx); if (req == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_send failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "setautomntent_send failed\n"); ret = EIO; goto done; } @@ -1298,13 +1298,13 @@ sss_autofs_cmd_getautomntbyname(struct cli_ctx *client) ret = EOK; goto done; } else if (map->found == false) { - DEBUG(SSSDBG_TRACE_FUNC, ("negative cache hit\n")); + DEBUG(SSSDBG_TRACE_FUNC, "negative cache hit\n"); ret = ENOENT; goto done; }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Looking up value for [%s] in [%s]\n", cmdctx->key, map->mapname)); + "Looking up value for [%s] in [%s]\n", cmdctx->key, map->mapname);
ret = getautomntbyname_process(cmdctx, map, cmdctx->key);
@@ -1326,9 +1326,9 @@ getautomntbyname_implicit_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { if (ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("setautomntent_recv failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "setautomntent_recv failed\n"); } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("No such map\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No such map\n"); } goto done; } @@ -1336,13 +1336,13 @@ getautomntbyname_implicit_done(struct tevent_req *req) ret = get_autofs_map(actx, cmdctx->mapname, &map); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot get map after setautomntent succeeded?\n")); + "Cannot get map after setautomntent succeeded?\n"); goto done; }
if (map->ready == false) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Map not ready after setautomntent succeeded\n")); + "Map not ready after setautomntent succeeded\n"); goto done; }
@@ -1376,7 +1376,7 @@ getautomntbyname_process(struct autofs_cmd_ctx *cmdctx, }
if (!map->map || !map->entries || !map->entries[0]) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No entries found\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No entries found\n"); ret = sss_cmd_empty_packet(client->creq->out); if (ret != EOK) { return autofs_cmd_done(cmdctx, ret); @@ -1388,18 +1388,18 @@ getautomntbyname_process(struct autofs_cmd_ctx *cmdctx, k = ldb_msg_find_attr_as_string(map->entries[i], SYSDB_AUTOFS_ENTRY_KEY, NULL); if (!k) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Skipping incomplete entry\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Skipping incomplete entry\n"); continue; }
if (strcmp(k, key) == 0) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Found key [%s]\n", key)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Found key [%s]\n", key); break; } }
if (i >= map->entry_count) { - DEBUG(SSSDBG_MINOR_FAILURE, ("No key named [%s] found\n", key)); + DEBUG(SSSDBG_MINOR_FAILURE, "No key named [%s] found\n", key); ret = sss_cmd_empty_packet(client->creq->out); if (ret != EOK) { return autofs_cmd_done(cmdctx, ret); @@ -1444,7 +1444,7 @@ sss_autofs_cmd_endautomntent(struct cli_ctx *client) { errno_t ret;
- DEBUG(SSSDBG_TRACE_FUNC, ("endautomntent called\n")); + DEBUG(SSSDBG_TRACE_FUNC, "endautomntent called\n");
/* create response packet */ ret = sss_packet_new(client->creq, 0, diff --git a/src/responder/autofs/autofssrv_dp.c b/src/responder/autofs/autofssrv_dp.c index 7f51b61..975692a 100644 --- a/src/responder/autofs/autofssrv_dp.c +++ b/src/responder/autofs/autofssrv_dp.c @@ -82,8 +82,8 @@ sss_dp_get_autofs_send(TALLOC_CTX *mem_ctx, talloc_free(key); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not issue DP request [%d]: %s\n", - ret, strerror(ret))); + "Could not issue DP request [%d]: %s\n", + ret, strerror(ret)); goto error; }
@@ -112,7 +112,7 @@ sss_dp_get_autofs_msg(void *pvt)
filter = talloc_asprintf(info, "mapname=%s", info->name); if (!filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return NULL; }
@@ -121,14 +121,14 @@ sss_dp_get_autofs_msg(void *pvt) DP_INTERFACE, DP_METHOD_AUTOFSHANDLER); if (msg == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return NULL; }
/* create the message */ DEBUG(SSSDBG_TRACE_FUNC, - ("Creating autofs request for [%s][%u][%s]\n", - info->dom->name, be_type, filter)); + "Creating autofs request for [%s][%u][%s]\n", + info->dom->name, be_type, filter);
dbret = dbus_message_append_args(msg, DBUS_TYPE_UINT32, &be_type, @@ -136,7 +136,7 @@ sss_dp_get_autofs_msg(void *pvt) DBUS_TYPE_INVALID); talloc_free(filter); if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build message\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build message\n"); dbus_message_unref(msg); return NULL; } diff --git a/src/responder/common/negcache.c b/src/responder/common/negcache.c index 5d82e52..2fdc951 100644 --- a/src/responder/common/negcache.c +++ b/src/responder/common/negcache.c @@ -83,7 +83,7 @@ static int sss_ncache_check_str(struct sss_nc_ctx *ctx, char *str, int ttl) char *ep; int ret;
- DEBUG(8, ("Checking negative cache for [%s]\n", str)); + DEBUG(8, "Checking negative cache for [%s]\n", str);
data.dptr = NULL;
@@ -158,13 +158,13 @@ static int sss_ncache_set_str(struct sss_nc_ctx *ctx, ret = string_to_tdb_data(timest, &data); if (ret != EOK) goto done;
- DEBUG(6, ("Adding [%s] to negative cache%s\n", - str, permanent?" permanently":"")); + DEBUG(6, "Adding [%s] to negative cache%s\n", + str, permanent?" permanently":"");
ret = tdb_store(ctx->tdb, key, data, TDB_REPLACE); if (ret != 0) { - DEBUG(1, ("Negative cache failed to set entry: [%s]\n", - tdb_errorstr(ctx->tdb))); + DEBUG(1, "Negative cache failed to set entry: [%s]\n", + tdb_errorstr(ctx->tdb)); ret = EFAULT; }
@@ -632,23 +632,23 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, filter_list[i], &domainname, &name); if (ret != EOK) { - DEBUG(1, ("Invalid name in filterUsers list: [%s] (%d)\n", - filter_list[i], ret)); + DEBUG(1, "Invalid name in filterUsers list: [%s] (%d)\n", + filter_list[i], ret); continue; }
if (domainname && strcmp(domainname, dom->name)) { - DEBUG(1, ("Mismatch between domain name (%s) and name " + DEBUG(1, "Mismatch between domain name (%s) and name " "set in FQN (%s), skipping user %s\n", - dom->name, domainname, name)); + dom->name, domainname, name); continue; }
ret = sss_ncache_set_user(ncache, true, dom, name); if (ret != EOK) { - DEBUG(1, ("Failed to store permanent user filter for [%s]" + DEBUG(1, "Failed to store permanent user filter for [%s]" " (%d [%s])\n", filter_list[i], - ret, strerror(ret))); + ret, strerror(ret)); continue; } } @@ -678,33 +678,33 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, rctx->default_domain, filter_list[i], &domainname, &name); if (ret != EOK) { - DEBUG(1, ("Invalid name in filterUsers list: [%s] (%d)\n", - filter_list[i], ret)); + DEBUG(1, "Invalid name in filterUsers list: [%s] (%d)\n", + filter_list[i], ret); continue; } if (domainname) { dom = responder_get_domain(rctx, domainname); if (!dom) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid domain name [%s]\n", domainname)); + "Invalid domain name [%s]\n", domainname); continue; }
ret = sss_ncache_set_user(ncache, true, dom, name); if (ret != EOK) { - DEBUG(1, ("Failed to store permanent user filter for [%s]" + DEBUG(1, "Failed to store permanent user filter for [%s]" " (%d [%s])\n", filter_list[i], - ret, strerror(ret))); + ret, strerror(ret)); continue; } } else { for (dom = domain_list; dom; dom = get_next_domain(dom, false)) { ret = sss_ncache_set_user(ncache, true, dom, name); if (ret != EOK) { - DEBUG(1, ("Failed to store permanent user filter for" + DEBUG(1, "Failed to store permanent user filter for" " [%s:%s] (%d [%s])\n", dom->name, filter_list[i], - ret, strerror(ret))); + ret, strerror(ret)); continue; } } @@ -730,23 +730,23 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, ret = sss_parse_name(tmpctx, dom->names, filter_list[i], &domainname, &name); if (ret != EOK) { - DEBUG(1, ("Invalid name in filterGroups list: [%s] (%d)\n", - filter_list[i], ret)); + DEBUG(1, "Invalid name in filterGroups list: [%s] (%d)\n", + filter_list[i], ret); continue; }
if (domainname && strcmp(domainname, dom->name)) { - DEBUG(1, ("Mismatch betwen domain name (%s) and name " + DEBUG(1, "Mismatch betwen domain name (%s) and name " "set in FQN (%s), skipping group %s\n", - dom->name, domainname, name)); + dom->name, domainname, name); continue; }
ret = sss_ncache_set_group(ncache, true, dom, name); if (ret != EOK) { - DEBUG(1, ("Failed to store permanent group filter for [%s]" + DEBUG(1, "Failed to store permanent group filter for [%s]" " (%d [%s])\n", filter_list[i], - ret, strerror(ret))); + ret, strerror(ret)); continue; } } @@ -776,33 +776,33 @@ errno_t sss_ncache_prepopulate(struct sss_nc_ctx *ncache, rctx->default_domain, filter_list[i], &domainname, &name); if (ret != EOK) { - DEBUG(1, ("Invalid name in filterGroups list: [%s] (%d)\n", - filter_list[i], ret)); + DEBUG(1, "Invalid name in filterGroups list: [%s] (%d)\n", + filter_list[i], ret); continue; } if (domainname) { dom = responder_get_domain(rctx, domainname); if (!dom) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Invalid domain name [%s]\n", domainname)); + "Invalid domain name [%s]\n", domainname); continue; }
ret = sss_ncache_set_group(ncache, true, dom, name); if (ret != EOK) { - DEBUG(1, ("Failed to store permanent group filter for" + DEBUG(1, "Failed to store permanent group filter for" " [%s] (%d [%s])\n", filter_list[i], - ret, strerror(ret))); + ret, strerror(ret)); continue; } } else { for (dom = domain_list; dom; dom = get_next_domain(dom, false)) { ret = sss_ncache_set_group(ncache, true, dom, name); if (ret != EOK) { - DEBUG(1, ("Failed to store permanent group filter for" + DEBUG(1, "Failed to store permanent group filter for" " [%s:%s] (%d [%s])\n", dom->name, filter_list[i], - ret, strerror(ret))); + ret, strerror(ret)); continue; } } diff --git a/src/responder/common/responder_cmd.c b/src/responder/common/responder_cmd.c index 3a3fca9..bc395cf 100644 --- a/src/responder/common/responder_cmd.c +++ b/src/responder/common/responder_cmd.c @@ -33,7 +33,7 @@ int sss_cmd_send_error(struct cli_ctx *cctx, int err) sss_packet_get_cmd(cctx->creq->in), &cctx->creq->out); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot create new packet: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot create new packet: %d\n", ret); return ret; }
@@ -112,7 +112,7 @@ int sss_cmd_get_version(struct cli_ctx *cctx) sss_packet_get_body(cctx->creq->in, &req_body, &req_blen); if (req_blen == sizeof(uint32_t)) { memcpy(&client_version, req_body, sizeof(uint32_t)); - DEBUG(5, ("Received client version [%d].\n", client_version)); + DEBUG(5, "Received client version [%d].\n", client_version);
i=0; while(cli_protocol_version[i].version>0) { @@ -135,7 +135,7 @@ int sss_cmd_get_version(struct cli_ctx *cctx) sss_packet_get_body(cctx->creq->out, &body, &blen); ((uint32_t *)body)[0] = cctx->cli_protocol_version!=NULL ? cctx->cli_protocol_version->version : 0; - DEBUG(5, ("Offered version [%d].\n", ((uint32_t *)body)[0])); + DEBUG(5, "Offered version [%d].\n", ((uint32_t *)body)[0]);
sss_cmd_done(cctx, NULL); return EOK; @@ -221,8 +221,8 @@ void setent_notify(struct setent_req_list **list, errno_t err) * request. Log a bug and continue. */ DEBUG(SSSDBG_FATAL_FAILURE, - ("BUG: a callback did not free its request. " - "May leak memory\n")); + "BUG: a callback did not free its request. " + "May leak memory\n"); /* Skip to the next since a memory leak is non-fatal */ *list = (*list)->next; } diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c index 908031a..bb54c55 100644 --- a/src/responder/common/responder_common.c +++ b/src/responder/common/responder_common.c @@ -58,8 +58,8 @@ static errno_t set_nonblocking(int fd) ferr = fcntl(fd, F_SETFL, v | O_NONBLOCK); if (ferr < 0) { error = errno; - DEBUG(0, ("Unable to set fd non-blocking: [%d][%s]\n", - error, strerror(error))); + DEBUG(0, "Unable to set fd non-blocking: [%d][%s]\n", + error, strerror(error)); return error; } return EOK; @@ -79,8 +79,8 @@ static errno_t set_close_on_exec(int fd) ferr = fcntl(fd, F_SETFD, v | FD_CLOEXEC); if (ferr < 0) { error = errno; - DEBUG(0, ("Unable to set fd close-on-exec: [%d][%s]\n", - error, strerror(error))); + DEBUG(0, "Unable to set fd close-on-exec: [%d][%s]\n", + error, strerror(error)); return error; } return EOK; @@ -93,13 +93,13 @@ static int client_destructor(struct cli_ctx *ctx) if ((ctx->cfd > 0) && close(ctx->cfd) < 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to close fd [%d]: [%s]\n", - ctx->cfd, strerror(ret))); + "Failed to close fd [%d]: [%s]\n", + ctx->cfd, strerror(ret)); }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Terminated client [%p][%d]\n", - ctx, ctx->cfd)); + "Terminated client [%p][%d]\n", + ctx, ctx->cfd); return 0; }
@@ -118,11 +118,11 @@ static errno_t get_client_cred(struct cli_ctx *cctx) &client_cred_len); if (ret != EOK) { ret = errno; - DEBUG(1, ("getsock failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "getsock failed [%d][%s].\n", ret, strerror(ret)); return ret; } if (client_cred_len != sizeof(struct ucred)) { - DEBUG(1, ("getsockopt returned unexpected message size.\n")); + DEBUG(1, "getsockopt returned unexpected message size.\n"); return ENOMSG; }
@@ -130,8 +130,8 @@ static errno_t get_client_cred(struct cli_ctx *cctx) cctx->client_egid = client_cred.gid; cctx->client_pid = client_cred.pid;
- DEBUG(9, ("Client creds: euid[%d] egid[%d] pid[%d].\n", - cctx->client_euid, cctx->client_egid, cctx->client_pid)); + DEBUG(9, "Client creds: euid[%d] egid[%d] pid[%d].\n", + cctx->client_euid, cctx->client_egid, cctx->client_pid); #endif
return EOK; @@ -170,14 +170,14 @@ errno_t csv_string_to_uid_array(TALLOC_CTX *mem_ctx, const char *cvs_string, ret = split_on_separator(mem_ctx, cvs_string, ',', true, false, &list, &list_size); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("split_on_separator failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "split_on_separator failed [%d][%s].\n", + ret, strerror(ret)); goto done; }
uids = talloc_array(mem_ctx, uint32_t, list_size); if (uids == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n"); ret = ENOMEM; goto done; } @@ -185,15 +185,15 @@ errno_t csv_string_to_uid_array(TALLOC_CTX *mem_ctx, const char *cvs_string, if (allow_sss_loop) { ret = unsetenv("_SSS_LOOPS"); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to unset _SSS_LOOPS, getpwnam " - "might not find sssd users.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to unset _SSS_LOOPS, getpwnam " + "might not find sssd users.\n"); } }
for (c = 0; c < list_size; c++) { errno = 0; if (*list[c] == '\0') { - DEBUG(SSSDBG_OP_FAILURE, ("Empty list item.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Empty list item.\n"); ret = EINVAL; goto done; } @@ -202,17 +202,17 @@ errno_t csv_string_to_uid_array(TALLOC_CTX *mem_ctx, const char *cvs_string, if (errno != 0 || *endptr != '\0') { ret = errno; if (ret == ERANGE) { - DEBUG(SSSDBG_OP_FAILURE, ("List item [%s] is out of range.\n", - list[c])); + DEBUG(SSSDBG_OP_FAILURE, "List item [%s] is out of range.\n", + list[c]); goto done; }
errno = 0; pwd = getpwnam(list[c]); if (pwd == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("List item [%s] is neither a valid " + DEBUG(SSSDBG_OP_FAILURE, "List item [%s] is neither a valid " "UID nor a user name which cloud be " - "resolved by getpwnam().\n", list[c])); + "resolved by getpwnam().\n", list[c]); ret = EINVAL; goto done; } @@ -228,7 +228,7 @@ errno_t csv_string_to_uid_array(TALLOC_CTX *mem_ctx, const char *cvs_string,
done: if(setenv("_SSS_LOOPS", "NO", 0) != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to set _SSS_LOOPS.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to set _SSS_LOOPS.\n"); } talloc_free(list); if (ret != EOK) { @@ -249,7 +249,7 @@ static void client_send(struct cli_ctx *cctx) return; } if (ret != EOK) { - DEBUG(0, ("Failed to send data, aborting client!\n")); + DEBUG(0, "Failed to send data, aborting client!\n"); talloc_free(cctx); return; } @@ -277,7 +277,7 @@ static void client_recv(struct cli_ctx *cctx) if (!cctx->creq) { cctx->creq = talloc_zero(cctx, struct cli_request); if (!cctx->creq) { - DEBUG(0, ("Failed to alloc request, aborting client!\n")); + DEBUG(0, "Failed to alloc request, aborting client!\n"); talloc_free(cctx); return; } @@ -287,7 +287,7 @@ static void client_recv(struct cli_ctx *cctx) ret = sss_packet_new(cctx->creq, SSS_PACKET_MAX_RECV_SIZE, 0, &cctx->creq->in); if (ret != EOK) { - DEBUG(0, ("Failed to alloc request, aborting client!\n")); + DEBUG(0, "Failed to alloc request, aborting client!\n"); talloc_free(cctx); return; } @@ -301,7 +301,7 @@ static void client_recv(struct cli_ctx *cctx) /* execute command */ ret = client_cmd_execute(cctx, cctx->rctx->sss_cmds); if (ret != EOK) { - DEBUG(0, ("Failed to execute request, aborting client!\n")); + DEBUG(0, "Failed to execute request, aborting client!\n"); talloc_free(cctx); } /* past this point cctx can be freed at any time by callbacks @@ -313,17 +313,17 @@ static void client_recv(struct cli_ctx *cctx) break;
case EINVAL: - DEBUG(6, ("Invalid data from client, closing connection!\n")); + DEBUG(6, "Invalid data from client, closing connection!\n"); talloc_free(cctx); break;
case ENODATA: - DEBUG(5, ("Client disconnected!\n")); + DEBUG(5, "Client disconnected!\n"); talloc_free(cctx); break;
default: - DEBUG(6, ("Failed to read request, aborting client!\n")); + DEBUG(6, "Failed to read request, aborting client!\n"); talloc_free(cctx); }
@@ -343,8 +343,8 @@ static void client_fd_handler(struct tevent_context *ev, ret = reset_idle_timer(cctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not create idle timer for client. " - "This connection may not auto-terminate\n")); + "Could not create idle timer for client. " + "This connection may not auto-terminate\n"); /* Non-fatal, continue */ }
@@ -386,14 +386,14 @@ static void accept_fd_handler(struct tevent_context *ev, if (accept_ctx->is_private) { ret = stat(rctx->priv_sock_name, &stat_buf); if (ret == -1) { - DEBUG(1, ("stat on privileged pipe failed: [%d][%s].\n", errno, - strerror(errno))); + DEBUG(1, "stat on privileged pipe failed: [%d][%s].\n", errno, + strerror(errno)); return; }
if ( ! (stat_buf.st_uid == 0 && stat_buf.st_gid == 0 && (stat_buf.st_mode&(S_IFSOCK|S_IRUSR|S_IWUSR)) == stat_buf.st_mode)) { - DEBUG(1, ("privileged pipe has an illegal status.\n")); + DEBUG(1, "privileged pipe has an illegal status.\n"); /* TODO: what is the best response to this condition? Terminate? */ return; } @@ -402,8 +402,8 @@ static void accept_fd_handler(struct tevent_context *ev, cctx = talloc_zero(rctx, struct cli_ctx); if (!cctx) { struct sockaddr_un addr; - DEBUG(0, ("Out of memory trying to setup client context%s!\n", - accept_ctx->is_private ? " on privileged pipe": "")); + DEBUG(0, "Out of memory trying to setup client context%s!\n", + accept_ctx->is_private ? " on privileged pipe": ""); /* accept and close to signal the client we have a problem */ memset(&addr, 0, sizeof(addr)); len = sizeof(addr); @@ -418,7 +418,7 @@ static void accept_fd_handler(struct tevent_context *ev, len = sizeof(cctx->addr); cctx->cfd = accept(fd, (struct sockaddr *)&cctx->addr, &len); if (cctx->cfd == -1) { - DEBUG(1, ("Accept failed [%s]\n", strerror(errno))); + DEBUG(1, "Accept failed [%s]\n", strerror(errno)); talloc_free(cctx); return; } @@ -427,16 +427,16 @@ static void accept_fd_handler(struct tevent_context *ev,
ret = get_client_cred(cctx); if (ret != EOK) { - DEBUG(2, ("get_client_cred failed, " - "client cred may not be available.\n")); + DEBUG(2, "get_client_cred failed, " + "client cred may not be available.\n"); }
if (rctx->allowed_uids_count != 0) { if (cctx->client_euid == -1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("allowed_uids configured, " \ + DEBUG(SSSDBG_CRIT_FAILURE, "allowed_uids configured, " \ "but platform does not support " \ "reading peer credential from the " \ - "socket. Access denied.\n")); + "socket. Access denied.\n"); close(cctx->cfd); talloc_free(cctx); return; @@ -446,10 +446,10 @@ static void accept_fd_handler(struct tevent_context *ev, rctx->allowed_uids); if (ret != EOK) { if (ret == EACCES) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Access denied for uid [%d].\n", - cctx->client_euid)); + DEBUG(SSSDBG_CRIT_FAILURE, "Access denied for uid [%d].\n", + cctx->client_euid); } else { - DEBUG(SSSDBG_OP_FAILURE, ("check_allowed_uids failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "check_allowed_uids failed.\n"); } close(cctx->cfd); talloc_free(cctx); @@ -463,8 +463,8 @@ static void accept_fd_handler(struct tevent_context *ev, close(cctx->cfd); talloc_free(cctx); DEBUG(SSSDBG_OP_FAILURE, - ("Failed to queue client handler%s\n", - accept_ctx->is_private ? " on privileged pipe" : "")); + "Failed to queue client handler%s\n", + accept_ctx->is_private ? " on privileged pipe" : ""); return; }
@@ -477,14 +477,14 @@ static void accept_fd_handler(struct tevent_context *ev, ret = reset_idle_timer(cctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not create idle timer for client. " - "This connection may not auto-terminate\n")); + "Could not create idle timer for client. " + "This connection may not auto-terminate\n"); /* Non-fatal, continue */ }
DEBUG(SSSDBG_TRACE_FUNC, - ("Client connected%s!\n", - accept_ctx->is_private ? " to privileged pipe" : "")); + "Client connected%s!\n", + accept_ctx->is_private ? " to privileged pipe" : "");
return; } @@ -500,8 +500,8 @@ static errno_t reset_idle_timer(struct cli_ctx *cctx) if (!cctx->idle) return ENOMEM;
DEBUG(SSSDBG_TRACE_ALL, - ("Idle timer re-set for client [%p][%d]\n", - cctx, cctx->cfd)); + "Idle timer re-set for client [%p][%d]\n", + cctx, cctx->cfd);
return EOK; } @@ -516,8 +516,8 @@ static void idle_handler(struct tevent_context *ev, talloc_get_type(data, struct cli_ctx);
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Terminating idle client [%p][%d]\n", - cctx, cctx->cfd)); + "Terminating idle client [%p][%d]\n", + cctx, cctx->cfd);
/* The cli_ctx destructor will handle the rest */ talloc_free(cctx); @@ -542,7 +542,7 @@ static int sss_dp_init(struct resp_ctx *rctx, /* Set up SBUS connection to the monitor */ ret = dp_get_sbus_address(be_conn, &be_conn->sbus_address, domain->name); if (ret != EOK) { - DEBUG(0, ("Could not locate DP address.\n")); + DEBUG(0, "Could not locate DP address.\n"); return ret; } ret = sbus_client_init(rctx, rctx->ev, @@ -550,7 +550,7 @@ static int sss_dp_init(struct resp_ctx *rctx, intf, &be_conn->conn, NULL, rctx); if (ret != EOK) { - DEBUG(0, ("Failed to connect to monitor services.\n")); + DEBUG(0, "Failed to connect to monitor services.\n"); return ret; }
@@ -561,7 +561,7 @@ static int sss_dp_init(struct resp_ctx *rctx, DATA_PROVIDER_VERSION, cli_name); if (ret != EOK) { - DEBUG(0, ("Failed to identify to the DP!\n")); + DEBUG(0, "Failed to identify to the DP!\n"); return ret; }
@@ -640,11 +640,11 @@ static int set_unix_socket(struct resp_ctx *rctx) unlink(rctx->sock_name);
if (bind(rctx->lfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { - DEBUG(0,("Unable to bind on socket '%s'\n", rctx->sock_name)); + DEBUG(0,"Unable to bind on socket '%s'\n", rctx->sock_name); goto failed; } if (listen(rctx->lfd, 10) != 0) { - DEBUG(0,("Unable to listen on socket '%s'\n", rctx->sock_name)); + DEBUG(0,"Unable to listen on socket '%s'\n", rctx->sock_name); goto failed; }
@@ -657,7 +657,7 @@ static int set_unix_socket(struct resp_ctx *rctx) TEVENT_FD_READ, accept_fd_handler, accept_ctx); if (!rctx->lfde) { - DEBUG(0, ("Failed to queue handler on pipe\n")); + DEBUG(0, "Failed to queue handler on pipe\n"); goto failed; } } @@ -690,11 +690,11 @@ static int set_unix_socket(struct resp_ctx *rctx) unlink(rctx->priv_sock_name);
if (bind(rctx->priv_lfd, (struct sockaddr *)&addr, sizeof(addr)) == -1) { - DEBUG(0,("Unable to bind on socket '%s'\n", rctx->priv_sock_name)); + DEBUG(0,"Unable to bind on socket '%s'\n", rctx->priv_sock_name); goto failed; } if (listen(rctx->priv_lfd, 10) != 0) { - DEBUG(0,("Unable to listen on socket '%s'\n", rctx->priv_sock_name)); + DEBUG(0,"Unable to listen on socket '%s'\n", rctx->priv_sock_name); goto failed; }
@@ -707,7 +707,7 @@ static int set_unix_socket(struct resp_ctx *rctx) TEVENT_FD_READ, accept_fd_handler, accept_ctx); if (!rctx->priv_lfde) { - DEBUG(0, ("Failed to queue handler on privileged pipe\n")); + DEBUG(0, "Failed to queue handler on privileged pipe\n"); goto failed; } } @@ -732,7 +732,7 @@ static int sss_responder_ctx_destructor(void *ptr)
/* mark that we are shutting down the responder, so it is propagated * into underlying contexts that are freed right before rctx */ - DEBUG(SSSDBG_TRACE_FUNC, ("Responder is being shut down\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Responder is being shut down\n"); rctx->shutting_down = true;
return 0; @@ -758,7 +758,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
rctx = talloc_zero(mem_ctx, struct resp_ctx); if (!rctx) { - DEBUG(0, ("fatal error initializing resp_ctx\n")); + DEBUG(0, "fatal error initializing resp_ctx\n"); return ENOMEM; } rctx->ev = ev; @@ -777,8 +777,8 @@ int sss_process_init(TALLOC_CTX *mem_ctx, &rctx->client_idle_timeout); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannot get the client idle timeout [%d]: %s\n", - ret, strerror(ret))); + "Cannot get the client idle timeout [%d]: %s\n", + ret, strerror(ret)); goto fail; }
@@ -792,19 +792,19 @@ int sss_process_init(TALLOC_CTX *mem_ctx, GET_DOMAINS_DEFAULT_TIMEOUT, &rctx->domains_timeout); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannnot get the default domain timeout [%d]: %s\n", - ret, strerror(ret))); + "Cannnot get the default domain timeout [%d]: %s\n", + ret, strerror(ret)); goto fail; }
if (rctx->domains_timeout < 0) { - DEBUG(SSSDBG_CONF_SETTINGS, ("timeout can't be set to negative value, setting default\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "timeout can't be set to negative value, setting default\n"); rctx->domains_timeout = GET_DOMAINS_DEFAULT_TIMEOUT; }
ret = confdb_get_domains(rctx->cdb, &rctx->domains); if (ret != EOK) { - DEBUG(0, ("fatal error setting up domain map\n")); + DEBUG(0, "fatal error setting up domain map\n"); goto fail; }
@@ -813,8 +813,8 @@ int sss_process_init(TALLOC_CTX *mem_ctx, &rctx->default_domain); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Cannnot get the default domain [%d]: %s\n", - ret, strerror(ret))); + "Cannnot get the default domain [%d]: %s\n", + ret, strerror(ret)); goto fail; }
@@ -822,7 +822,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx, svc_name, svc_version, rctx, &rctx->mon_conn); if (ret != EOK) { - DEBUG(0, ("fatal error setting up message bus\n")); + DEBUG(0, "fatal error setting up message bus\n"); goto fail; }
@@ -830,8 +830,8 @@ int sss_process_init(TALLOC_CTX *mem_ctx, ret = sss_names_init(rctx->cdb, rctx->cdb, dom->name, &dom->names); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing regex data for domain: %s\n", - dom->name)); + "fatal error initializing regex data for domain: %s\n", + dom->name); goto fail; }
@@ -842,7 +842,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
ret = sss_dp_init(rctx, dp_intf, cli_name, dom); if (ret != EOK) { - DEBUG(0, ("fatal error setting up backend connector\n")); + DEBUG(0, "fatal error setting up backend connector\n"); goto fail; } } @@ -850,14 +850,14 @@ int sss_process_init(TALLOC_CTX *mem_ctx, ret = sysdb_init(rctx, rctx->domains, false); if (ret != EOK) { SYSDB_VERSION_ERROR_DAEMON(ret); - DEBUG(0, ("fatal error initializing resp_ctx\n")); + DEBUG(0, "fatal error initializing resp_ctx\n"); goto fail; }
/* after all initializations we are ready to listen on our socket */ ret = set_unix_socket(rctx); if (ret != EOK) { - DEBUG(0, ("fatal error initializing socket\n")); + DEBUG(0, "fatal error initializing socket\n"); goto fail; }
@@ -865,11 +865,11 @@ int sss_process_init(TALLOC_CTX *mem_ctx, ret = sss_hash_create(rctx, 30, &rctx->dp_request_table); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not create hash table for the request queue\n")); + "Could not create hash table for the request queue\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Responder Initialization complete\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Responder Initialization complete\n");
*responder_ctx = rctx; return EOK; @@ -917,8 +917,8 @@ responder_get_domain(struct resp_ctx *rctx, const char *name) }
if (!ret_dom) { - DEBUG(SSSDBG_OP_FAILURE, ("Unknown domain [%s], checking for " - "possible subdomains!\n", name)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown domain [%s], checking for " + "possible subdomains!\n", name); }
return ret_dom; @@ -950,8 +950,8 @@ errno_t responder_get_domain_by_id(struct resp_ctx *rctx, const char *id, if (IS_SUBDOMAIN(dom) && ((time(NULL) - dom->parent->subdomains_last_checked.tv_sec) > rctx->domains_timeout)) { - DEBUG(SSSDBG_TRACE_FUNC, ("Domain entry with id [%s] " \ - "is expired.\n", id)); + DEBUG(SSSDBG_TRACE_FUNC, "Domain entry with id [%s] " \ + "is expired.\n", id); ret = EAGAIN; goto done; } @@ -961,8 +961,8 @@ errno_t responder_get_domain_by_id(struct resp_ctx *rctx, const char *id, }
if (ret_dom == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Unknown domain id [%s], checking for " - "possible subdomains!\n", id)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown domain id [%s], checking for " + "possible subdomains!\n", id); ret = ENOENT; } else { *_ret_dom = ret_dom; @@ -999,8 +999,8 @@ void responder_set_fd_limit(rlim_t fd_limit) limret = setrlimit(RLIMIT_NOFILE, &new_limit); if (limret == 0) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Maximum file descriptors set to [%"SPRIrlim"]\n", - new_limit.rlim_cur)); + "Maximum file descriptors set to [%"SPRIrlim"]\n", + new_limit.rlim_cur); return; }
@@ -1012,8 +1012,8 @@ void responder_set_fd_limit(rlim_t fd_limit) limret = getrlimit(RLIMIT_NOFILE, ¤t_limit); if (limret == 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Current fd limit: [%"SPRIrlim"]\n", - current_limit.rlim_cur)); + "Current fd limit: [%"SPRIrlim"]\n", + current_limit.rlim_cur); /* Choose the lesser of the requested and the hard limit */ if (current_limit.rlim_max < fd_limit) { new_limit.rlim_cur = current_limit.rlim_max; @@ -1025,16 +1025,16 @@ void responder_set_fd_limit(rlim_t fd_limit) limret = setrlimit(RLIMIT_NOFILE, &new_limit); if (limret == 0) { DEBUG(SSSDBG_CONF_SETTINGS, - ("Maximum file descriptors set to [%"SPRIrlim"]\n", - new_limit.rlim_cur)); + "Maximum file descriptors set to [%"SPRIrlim"]\n", + new_limit.rlim_cur); } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not set new fd limits. Proceeding with " - "[%"SPRIrlim"]\n", current_limit.rlim_cur)); + "Could not set new fd limits. Proceeding with " + "[%"SPRIrlim"]\n", current_limit.rlim_cur); } } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not determine fd limits. " - "Proceeding with system values\n")); + "Could not determine fd limits. " + "Proceeding with system values\n"); } } diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c index e73e1e6..396c809 100644 --- a/src/responder/common/responder_dp.c +++ b/src/responder/common/responder_dp.c @@ -103,22 +103,22 @@ static int sss_dp_req_destructor(void *ptr) */ if (cb == sdp_req->cb_list) { DEBUG(SSSDBG_FATAL_FAILURE, - ("BUG: a callback did not free its request. " - "May leak memory\n")); + "BUG: a callback did not free its request. " + "May leak memory\n"); /* Skip to the next since a memory leak is non-fatal */ sdp_req->cb_list = sdp_req->cb_list->next; } }
/* Destroy the hash entry */ - DEBUG(SSSDBG_TRACE_FUNC, ("Deleting request: [%s]\n", sdp_req->key->str)); + DEBUG(SSSDBG_TRACE_FUNC, "Deleting request: [%s]\n", sdp_req->key->str); hret = hash_delete(sdp_req->rctx->dp_request_table, sdp_req->key); if (hret != HASH_SUCCESS) { /* This should never happen */ DEBUG(SSSDBG_TRACE_INTERNAL, - ("BUG: Could not clear [%d:%lu:%s] from request queue: [%s]\n", + "BUG: Could not clear [%d:%lu:%s] from request queue: [%s]\n", sdp_req->key->type, sdp_req->key->ul, sdp_req->key->str, - hash_error_string(hret))); + hash_error_string(hret)); return -1; }
@@ -142,18 +142,18 @@ void handle_requests_after_reconnect(struct resp_ctx *rctx) struct sss_dp_req *sdp_req;
if (!rctx->dp_request_table) { - DEBUG(7, ("No requests to handle after reconnect\n")); + DEBUG(7, "No requests to handle after reconnect\n"); return; }
ret = hash_values(rctx->dp_request_table, &count, &values); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_values failed, " - "not all request might be handled after reconnect.\n")); + DEBUG(1, "hash_values failed, " + "not all request might be handled after reconnect.\n"); return; }
- DEBUG(7, ("Will handle %lu requests after reconnect\n", count)); + DEBUG(7, "Will handle %lu requests after reconnect\n", count); for (i=0; i<count; i++) { sdp_req = talloc_get_type(values[i].ptr, struct sss_dp_req); talloc_free(sdp_req); @@ -180,8 +180,8 @@ static int sss_dp_get_reply(DBusPendingCall *pending, * here, something is seriously wrong and we should bail out. */ DEBUG(SSSDBG_CRIT_FAILURE, - ("Severe error. A reply callback was called but no reply " - "was received and no timeout occurred\n")); + "Severe error. A reply callback was called but no reply " + "was received and no timeout occurred\n");
/* FIXME: Destroy this connection ? */ err = EIO; @@ -197,17 +197,17 @@ static int sss_dp_get_reply(DBusPendingCall *pending, DBUS_TYPE_STRING, err_msg, DBUS_TYPE_INVALID); if (!ret) { - DEBUG(1,("Failed to parse message\n")); + DEBUG(1,"Failed to parse message\n"); /* FIXME: Destroy this connection ? */ if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); err = EIO; goto done; } DEBUG(SSSDBG_TRACE_LIBS, - ("Got reply from Data Provider - " + "Got reply from Data Provider - " "DP error code: %u errno: %u error message: %s\n", (unsigned int)*dp_err, (unsigned int)*dp_ret, - *err_msg ? *err_msg : "none")); + *err_msg ? *err_msg : "none"); break;
case DBUS_MESSAGE_TYPE_ERROR: @@ -216,8 +216,8 @@ static int sss_dp_get_reply(DBusPendingCall *pending, err = ETIME; goto done; } - DEBUG(0,("The Data Provider returned an error [%s]\n", - dbus_message_get_error_name(reply))); + DEBUG(0,"The Data Provider returned an error [%s]\n", + dbus_message_get_error_name(reply)); /* Falling through to default intentionally*/ default: /* @@ -284,7 +284,7 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx, goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Issuing request for [%s]\n", key->str)); + DEBUG(SSSDBG_TRACE_FUNC, "Issuing request for [%s]\n", key->str);
/* Check the hash for existing references to this request */ hret = hash_lookup(rctx->dp_request_table, key, &value); @@ -292,7 +292,7 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx, case HASH_SUCCESS: /* Request already in progress */ DEBUG(SSSDBG_TRACE_FUNC, - ("Identical request in progress: [%s]\n", key->str)); + "Identical request in progress: [%s]\n", key->str); break;
case HASH_ERROR_KEY_NOT_FOUND: @@ -301,7 +301,7 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx, */ msg = msg_create(pvt); if (!msg) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot create D-Bus message\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot create D-Bus message\n"); ret = EIO; goto fail; } @@ -310,7 +310,7 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx, sidereq = sss_dp_internal_get_send(rctx, key, dom, msg); dbus_message_unref(msg); if (!sidereq) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot send D-Bus message\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot send D-Bus message\n"); ret = EIO; goto fail; } @@ -325,7 +325,7 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx, sss_dp_req_timeout, sidereq); if (!te) { /* Nothing much we can do */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); ret = ENOMEM; goto fail; } @@ -334,7 +334,7 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx, hret = hash_lookup(rctx->dp_request_table, key, &value); if (hret != HASH_SUCCESS) { /* Something must have gone wrong with creating the request */ - DEBUG(SSSDBG_CRIT_FAILURE, ("The request has disappeared?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "The request has disappeared?\n"); ret = EIO; goto fail; } @@ -342,8 +342,8 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx,
default: DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not query request list (%s)\n", - hash_error_string(hret))); + "Could not query request list (%s)\n", + hash_error_string(hret)); ret = EIO; goto fail; } @@ -351,7 +351,7 @@ sss_dp_issue_request(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx, /* Register this request for results */ sdp_req = talloc_get_type(value.ptr, struct sss_dp_req); if (!sdp_req) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not retrieve DP request context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not retrieve DP request context\n"); ret = EIO; goto fail; } @@ -500,8 +500,8 @@ sss_dp_get_account_send(TALLOC_CTX *mem_ctx, talloc_free(key); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not issue DP request [%d]: %s\n", - ret, strerror(ret))); + "Could not issue DP request [%d]: %s\n", + ret, strerror(ret)); goto error; }
@@ -581,7 +581,7 @@ sss_dp_get_account_msg(void *pvt) filter = talloc_strdup(info, ENUM_INDICATOR); } if (!filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return NULL; }
@@ -591,14 +591,14 @@ sss_dp_get_account_msg(void *pvt) DP_METHOD_GETACCTINFO); if (msg == NULL) { talloc_free(filter); - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return NULL; }
/* create the message */ DEBUG(SSSDBG_TRACE_FUNC, - ("Creating request for [%s][%u][%d][%s]\n", - info->dom->name, be_type, attrs, filter)); + "Creating request for [%s][%u][%d][%s]\n", + info->dom->name, be_type, attrs, filter);
dbret = dbus_message_append_args(msg, DBUS_TYPE_UINT32, &be_type, @@ -608,7 +608,7 @@ sss_dp_get_account_msg(void *pvt) DBUS_TYPE_INVALID); talloc_free(filter); if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build message\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build message\n"); dbus_message_unref(msg); return NULL; } @@ -683,8 +683,8 @@ sss_dp_internal_get_send(struct resp_ctx *rctx, ret = sss_dp_get_domain_conn(rctx, dom->conn_name, &be_conn); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("BUG: The Data Provider connection for %s is not available!", - dom->name)); + "BUG: The Data Provider connection for %s is not available!", + dom->name); ret = EIO; goto error; } @@ -700,7 +700,7 @@ sss_dp_internal_get_send(struct resp_ctx *rctx, * We can't communicate on this connection */ DEBUG(SSSDBG_CRIT_FAILURE, - ("D-BUS send failed.\n")); + "D-BUS send failed.\n"); ret = EIO; goto error; } @@ -709,12 +709,12 @@ sss_dp_internal_get_send(struct resp_ctx *rctx, value.type = HASH_VALUE_PTR; value.ptr = state->sdp_req;
- DEBUG(SSSDBG_TRACE_FUNC, ("Entering request [%s]\n", key->str)); + DEBUG(SSSDBG_TRACE_FUNC, "Entering request [%s]\n", key->str); hret = hash_enter(rctx->dp_request_table, key, &value); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not store request query (%s)\n", - hash_error_string(hret))); + "Could not store request query (%s)\n", + hash_error_string(hret)); ret = EIO; goto error; } @@ -790,8 +790,8 @@ static void sss_dp_internal_get_done(DBusPendingCall *pending, void *ptr) */ if (cb == sdp_req->cb_list) { DEBUG(SSSDBG_FATAL_FAILURE, - ("BUG: a callback did not free its request. " - "May leak memory\n")); + "BUG: a callback did not free its request. " + "May leak memory\n"); /* Skip to the next since a memory leak is non-fatal */ sdp_req->cb_list = sdp_req->cb_list->next; } diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c index a976d27..ba9a090 100644 --- a/src/responder/common/responder_get_domains.c +++ b/src/responder/common/responder_get_domains.c @@ -97,13 +97,13 @@ sss_dp_get_domains_msg(void *pvt) DP_INTERFACE, DP_METHOD_GETDOMAINS); if (msg == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return NULL; }
DEBUG(SSSDBG_TRACE_FUNC, - ("Sending get domains request for [%s][%sforced][%s]\n", - info->dom->name, info->force ? "" : "not ", info->hint)); + "Sending get domains request for [%s][%sforced][%s]\n", + info->dom->name, info->force ? "" : "not ", info->hint);
/* Send the hint argument to provider as well. This will * be useful for some cases of transitional trust where @@ -114,7 +114,7 @@ sss_dp_get_domains_msg(void *pvt) DBUS_TYPE_STRING, &info->hint, DBUS_TYPE_INVALID); if (!dbret) { - DEBUG(SSSDBG_OP_FAILURE ,("Failed to build message\n")); + DEBUG(SSSDBG_OP_FAILURE ,"Failed to build message\n"); dbus_message_unref(msg); return NULL; } @@ -163,7 +163,7 @@ struct tevent_req *sss_dp_get_domains_send(TALLOC_CTX *mem_ctx, }
if (rctx->domains == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No domains configured.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No domains configured.\n"); ret = EINVAL; goto immediately; } @@ -172,11 +172,11 @@ struct tevent_req *sss_dp_get_domains_send(TALLOC_CTX *mem_ctx, ret = check_last_request(rctx, hint); if (ret == EOK) { DEBUG(SSSDBG_TRACE_FUNC, - ("Last call was too recent, nothing to do!\n")); + "Last call was too recent, nothing to do!\n"); goto immediately; } else if (ret != EAGAIN) { - DEBUG(SSSDBG_TRACE_FUNC, ("check_domain_request failed with [%d][%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "check_domain_request failed with [%d][%s]\n", + ret, strerror(ret)); goto immediately; } } @@ -246,8 +246,8 @@ sss_dp_get_domains_process(struct tevent_req *subreq)
ret = process_subdomains(state->dom); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("process_subdomains failed, " - "trying next domain.\n")); + DEBUG(SSSDBG_OP_FAILURE, "process_subdomains failed, " + "trying next domain.\n"); goto fail; }
@@ -289,8 +289,8 @@ process_subdomains(struct sss_domain_info *domain) domain->domain_id == NULL) { ret = sysdb_master_domain_update(domain); if (ret != EOK) { - DEBUG(SSSDBG_FUNC_DATA, ("sysdb_master_domain_get_info " \ - "failed.\n")); + DEBUG(SSSDBG_FUNC_DATA, "sysdb_master_domain_get_info " \ + "failed.\n"); goto done; } } @@ -300,7 +300,7 @@ process_subdomains(struct sss_domain_info *domain) */ ret = sysdb_update_subdomains(domain); if (ret != EOK) { - DEBUG(SSSDBG_FUNC_DATA, ("sysdb_update_subdomains failed.\n")); + DEBUG(SSSDBG_FUNC_DATA, "sysdb_update_subdomains failed.\n"); goto done; }
@@ -315,8 +315,8 @@ process_subdomains(struct sss_domain_info *domain)
done: if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to update sub-domains " - "of domain [%s].\n", domain->name)); + DEBUG(SSSDBG_OP_FAILURE, "Failed to update sub-domains " + "of domain [%s].\n", domain->name); }
return ret; @@ -337,8 +337,8 @@ static void set_time_of_last_request(struct resp_ctx *rctx) ret = gettimeofday(&rctx->get_domains_last_call, NULL); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_TRACE_FUNC, ("gettimeofday failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "gettimeofday failed [%d][%s].\n", + ret, strerror(ret)); } }
@@ -380,7 +380,7 @@ static void get_domains_at_startup_done(struct tevent_req *req) ret = sss_dp_get_domains_recv(req); talloc_free(req); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_dp_get_domains request failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_dp_get_domains request failed.\n"); }
return; @@ -397,7 +397,7 @@ static void get_domains_at_startup(struct tevent_context *ev,
req = sss_dp_get_domains_send(rctx, rctx, true, NULL); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_dp_get_domains_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_dp_get_domains_send failed.\n"); return; }
@@ -413,7 +413,7 @@ errno_t schedule_get_domains_task(TALLOC_CTX *mem_ctx,
imm = tevent_create_immediate(mem_ctx); if (imm == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("tevent_create_immediate failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "tevent_create_immediate failed.\n"); return ENOMEM; }
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c index a6e6d77..9fe2dec 100644 --- a/src/responder/nss/nsssrv.c +++ b/src/responder/nss/nsssrv.c @@ -91,11 +91,11 @@ static int nss_clear_memcache(DBusMessage *message, ret = errno; if (ret == ENOENT) { DEBUG(SSSDBG_TRACE_FUNC, - ("CLEAR_MC_FLAG not found. Nothing to do.\n")); + "CLEAR_MC_FLAG not found. Nothing to do.\n"); goto done; } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to unlink file: %s.\n", - strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to unlink file: %s.\n", + strerror(ret)); return ret; } } @@ -108,18 +108,18 @@ static int nss_clear_memcache(DBusMessage *message, 300, &memcache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Unable to get memory cache entry timeout.\n")); + "Unable to get memory cache entry timeout.\n"); return ret; }
/* TODO: read cache sizes from configuration */ - DEBUG(SSSDBG_TRACE_FUNC, ("Clearing memory caches.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Clearing memory caches.\n"); ret = sss_mmap_cache_reinit(nctx, SSS_MC_CACHE_ELEMENTS, (time_t) memcache_timeout, &nctx->pwd_mc_ctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("passwd mmap cache invalidation failed\n")); + "passwd mmap cache invalidation failed\n"); return ret; }
@@ -128,7 +128,7 @@ static int nss_clear_memcache(DBusMessage *message, &nctx->grp_mc_ctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("group mmap cache invalidation failed\n")); + "group mmap cache invalidation failed\n"); return ret; }
@@ -147,7 +147,7 @@ static int nss_clear_netgroup_hash_table(DBusMessage *message, ret = nss_orphan_netgroups(nctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not invalidate netgroups\n")); + "Could not invalidate netgroups\n"); return ret; }
@@ -181,16 +181,16 @@ static errno_t nss_get_etc_shells(TALLOC_CTX *mem_ctx, char ***_shells) ret = ENOMEM; goto done; } - DEBUG(6, ("Found shell %s in /etc/shells\n", shells[i])); + DEBUG(6, "Found shell %s in /etc/shells\n", shells[i]); i++;
if (i == size) { size += SHELL_REALLOC_INCREMENT; if (size > SHELL_REALLOC_MAX) { - DEBUG(0, ("Reached maximum number of shells [%d]. " + DEBUG(0, "Reached maximum number of shells [%d]. " "Users may be denied access. " "Please check /etc/shells for sanity\n", - SHELL_REALLOC_MAX)); + SHELL_REALLOC_MAX); break; } shells = talloc_realloc(NULL, shells, char *, @@ -245,8 +245,8 @@ static int nss_get_config(struct nss_ctx *nctx, if (ret != EOK) goto done; if (nctx->cache_refresh_percent < 0 || nctx->cache_refresh_percent > 99) { - DEBUG(0,("Configuration error: entry_cache_nowait_percentage is " - "invalid. Disabling feature.\n")); + DEBUG(0,"Configuration error: entry_cache_nowait_percentage is " + "invalid. Disabling feature.\n"); nctx->cache_refresh_percent = 0; }
@@ -342,7 +342,7 @@ static int nss_memcache_initgr_check(DBusMessage *message, DBUS_TYPE_INVALID);
if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed, to parse message!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed, to parse message!\n"); if (dbus_error_is_set(&dbus_error)) { dbus_error_free(&dbus_error); } @@ -350,7 +350,7 @@ static int nss_memcache_initgr_check(DBusMessage *message, }
DEBUG(SSSDBG_TRACE_LIBS, - ("Got request for [%s@%s]\n", user, domain)); + "Got request for [%s@%s]\n", user, domain);
nss_update_initgr_memcache(nctx, user, domain, gnum, groups);
@@ -393,7 +393,7 @@ static void nss_dp_reconnect_init(struct sbus_connection *conn,
/* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(1, ("Reconnected to the Data Provider.\n")); + DEBUG(1, "Reconnected to the Data Provider.\n");
/* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -407,8 +407,8 @@ static void nss_dp_reconnect_init(struct sbus_connection *conn, }
/* Failed to reconnect */ - DEBUG(0, ("Could not reconnect to %s provider.\n", - be_conn->domain->name)); + DEBUG(0, "Could not reconnect to %s provider.\n", + be_conn->domain->name);
/* FIXME: kill the frontend and let the monitor restart it ? */ /* nss_shutdown(rctx); */ @@ -440,20 +440,20 @@ int nss_process_init(TALLOC_CTX *mem_ctx, "NSS", &nss_dp_interface, &rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n"); return ret; }
nctx = talloc_zero(rctx, struct nss_ctx); if (!nctx) { - DEBUG(0, ("fatal error initializing nss_ctx\n")); + DEBUG(0, "fatal error initializing nss_ctx\n"); ret = ENOMEM; goto fail; }
ret = sss_ncache_init(rctx, &nctx->ncache); if (ret != EOK) { - DEBUG(0, ("fatal error initializing negative cache\n")); + DEBUG(0, "fatal error initializing negative cache\n"); goto fail; }
@@ -462,7 +462,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
ret = nss_get_config(nctx, cdb); if (ret != EOK) { - DEBUG(0, ("fatal error getting nss config\n")); + DEBUG(0, "fatal error getting nss config\n"); goto fail; }
@@ -472,7 +472,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx, CONFDB_SERVICE_RECON_RETRIES, 3, &max_retries); if (ret != EOK) { - DEBUG(0, ("Failed to set up automatic reconnection\n")); + DEBUG(0, "Failed to set up automatic reconnection\n"); goto fail; }
@@ -484,7 +484,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx, err = sss_idmap_init(sss_idmap_talloc, nctx, sss_idmap_talloc_free, &nctx->idmap_ctx); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_idmap_init failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_idmap_init failed.\n"); ret = EFAULT; goto fail; } @@ -493,7 +493,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx, hret = sss_hash_create_ex(nctx, 10, &nctx->netgroups, 0, 0, 0, 0, netgroup_hash_delete_cb, NULL); if (hret != HASH_SUCCESS) { - DEBUG(0,("Unable to initialize netgroup hash table\n")); + DEBUG(0,"Unable to initialize netgroup hash table\n"); ret = EIO; goto fail; } @@ -504,9 +504,9 @@ int nss_process_init(TALLOC_CTX *mem_ctx, if (ret != 0 && errno != ENOENT) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to unlink file [%s]. This can cause memory cache to " + "Failed to unlink file [%s]. This can cause memory cache to " "be purged when next log rotation is requested. %d: %s\n", - SSS_NSS_MCACHE_DIR"/"CLEAR_MC_FLAG, ret, strerror(ret))); + SSS_NSS_MCACHE_DIR"/"CLEAR_MC_FLAG, ret, strerror(ret)); }
ret = confdb_get_int(nctx->rctx->cdb, @@ -515,7 +515,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx, 300, &memcache_timeout); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to get 'memcache_timeout' option from confdb.\n")); + "Failed to get 'memcache_timeout' option from confdb.\n"); goto fail; }
@@ -524,14 +524,14 @@ int nss_process_init(TALLOC_CTX *mem_ctx, SSS_MC_CACHE_ELEMENTS, (time_t)memcache_timeout, &nctx->pwd_mc_ctx); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("passwd mmap cache is DISABLED\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "passwd mmap cache is DISABLED\n"); }
ret = sss_mmap_cache_init(nctx, "group", SSS_MC_GROUP, SSS_MC_CACHE_ELEMENTS, (time_t)memcache_timeout, &nctx->grp_mc_ctx); if (ret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("group mmap cache is DISABLED\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "group mmap cache is DISABLED\n"); }
/* Set up file descriptor limits */ @@ -542,18 +542,18 @@ int nss_process_init(TALLOC_CTX *mem_ctx, &fd_limit); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set up file descriptor limit\n")); + "Failed to set up file descriptor limit\n"); goto fail; } responder_set_fd_limit(fd_limit);
ret = schedule_get_domains_task(rctx, rctx->ev, rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("schedule_get_domains_tasks failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("NSS Initialization complete\n")); + DEBUG(SSSDBG_TRACE_FUNC, "NSS Initialization complete\n");
return EOK;
@@ -602,7 +602,7 @@ int main(int argc, const char *argv[]) ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(2, ("Could not set up to exit when parent process does\n")); + DEBUG(2, "Could not set up to exit when parent process does\n"); }
ret = nss_process_init(main_ctx, diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c index 7220e3a..16557e1 100644 --- a/src/responder/nss/nsssrv_cmd.c +++ b/src/responder/nss/nsssrv_cmd.c @@ -125,7 +125,7 @@ void nss_update_pw_memcache(struct nss_ctx *nctx) ret = sysdb_enumpwent(nctx, dom->sysdb, dom, &res); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to enumerate users for domain [%s]\n", dom->name)); + "Failed to enumerate users for domain [%s]\n", dom->name); continue; }
@@ -142,8 +142,8 @@ void nss_update_pw_memcache(struct nss_ctx *nctx) id = ldb_msg_find_attr_as_string(res->msgs[i], SYSDB_UIDNUM, NULL); if (!id) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to find uidNumber in %s.\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to find uidNumber in %s.\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); continue; } to_sized_string(&key, id); @@ -151,8 +151,8 @@ void nss_update_pw_memcache(struct nss_ctx *nctx) ret = sss_mmap_cache_pw_invalidate(nctx->pwd_mc_ctx, &key); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Internal failure in memory cache code: %d [%s]\n", - ret, strerror(ret))); + "Internal failure in memory cache code: %d [%s]\n", + ret, strerror(ret)); } }
@@ -241,8 +241,8 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx, if (nctx->vetoed_shells) { for (i=0; nctx->vetoed_shells[i]; i++) { if (strcmp(nctx->vetoed_shells[i], user_shell) == 0) { - DEBUG(5, ("The shell '%s' is vetoed. " - "Using fallback\n", user_shell)); + DEBUG(5, "The shell '%s' is vetoed. " + "Using fallback\n", user_shell); return talloc_strdup(mem_ctx, nctx->shell_fallback); } } @@ -251,14 +251,14 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx, if (nctx->etc_shells) { for (i=0; nctx->etc_shells[i]; i++) { if (strcmp(user_shell, nctx->etc_shells[i]) == 0) { - DEBUG(9, ("Shell %s found in /etc/shells\n", - nctx->etc_shells[i])); + DEBUG(9, "Shell %s found in /etc/shells\n", + nctx->etc_shells[i]); break; } }
if (nctx->etc_shells[i]) { - DEBUG(9, ("Using original shell '%s'\n", user_shell)); + DEBUG(9, "Using original shell '%s'\n", user_shell); return talloc_strdup(mem_ctx, user_shell); } } @@ -266,15 +266,15 @@ static const char *get_shell_override(TALLOC_CTX *mem_ctx, if (nctx->allowed_shells) { for (i=0; nctx->allowed_shells[i]; i++) { if (strcmp(nctx->allowed_shells[i], user_shell) == 0) { - DEBUG(5, ("The shell '%s' is allowed but does not exist. " - "Using fallback\n", user_shell)); + DEBUG(5, "The shell '%s' is allowed but does not exist. " + "Using fallback\n", user_shell); return talloc_strdup(mem_ctx, nctx->shell_fallback); } } }
- DEBUG(5, ("The shell '%s' is not allowed and does not exist.\n", - user_shell)); + DEBUG(5, "The shell '%s' is not allowed and does not exist.\n", + user_shell); return talloc_strdup(mem_ctx, NOLOGIN_SHELL); }
@@ -328,8 +328,8 @@ static int fill_pwent(struct sss_packet *packet, gid = get_gid_override(msg, dom);
if (!orig_name || !uid || !gid) { - DEBUG(SSSDBG_OP_FAILURE, ("Incomplete user object for %s[%llu]! Skipping\n", - orig_name?orig_name:"<NULL>", (unsigned long long int)uid)); + DEBUG(SSSDBG_OP_FAILURE, "Incomplete user object for %s[%llu]! Skipping\n", + orig_name?orig_name:"<NULL>", (unsigned long long int)uid); continue; }
@@ -339,8 +339,8 @@ static int fill_pwent(struct sss_packet *packet, dom, orig_name); if (ncret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("User [%s@%s] filtered out! (negative cache)\n", - orig_name, domain)); + "User [%s@%s] filtered out! (negative cache)\n", + orig_name, domain); continue; } } @@ -355,7 +355,7 @@ static int fill_pwent(struct sss_packet *packet, tmpstr = sss_get_cased_name(tmp_ctx, orig_name, dom->case_sensitive); if (tmpstr == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_get_cased_name failed, skipping\n")); + "sss_get_cased_name failed, skipping\n"); continue; } to_sized_string(&name, tmpstr); @@ -413,8 +413,8 @@ static int fill_pwent(struct sss_packet *packet, }
if (ret != name.len + delim + dom_len - 1) { - DEBUG(1, ("Failed to generate a fully qualified name for user " - "[%s] in [%s]! Skipping user.\n", name.str, domain)); + DEBUG(1, "Failed to generate a fully qualified name for user " + "[%s] in [%s]! Skipping user.\n", name.str, domain); continue; } } else { @@ -441,8 +441,8 @@ static int fill_pwent(struct sss_packet *packet, &gecos, &homedir, &shell); if (ret != EOK && ret != ENOMEM) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to store user %s(%s) in mmap cache!\n", - name.str, domain)); + "Failed to store user %s(%s) in mmap cache!\n", + name.str, domain); } } } @@ -516,8 +516,8 @@ errno_t check_cache(struct nss_dom_ctx *dctx, */ if ((req_type == SSS_DP_USER || req_type == SSS_DP_NETGR) && (res->count > 1)) { - DEBUG(1, ("getpwXXX call returned more than one result!" - " DB Corrupted?\n")); + DEBUG(1, "getpwXXX call returned more than one result!" + " DB Corrupted?\n"); return ENOENT; }
@@ -536,10 +536,10 @@ errno_t check_cache(struct nss_dom_ctx *dctx, ret = sss_cmd_check_cache(res->msgs[0], nctx->cache_refresh_percent, cacheExpire); if (ret == EOK) { - DEBUG(SSSDBG_TRACE_FUNC, ("Cached entry is valid, returning..\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Cached entry is valid, returning..\n"); return EOK; } else if (ret != EAGAIN && ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error checking cache: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "Error checking cache: %d\n", ret); goto error; } } else { @@ -555,17 +555,17 @@ errno_t check_cache(struct nss_dom_ctx *dctx, * immediately. */ DEBUG(SSSDBG_TRACE_FUNC, - ("Performing midpoint cache update on [%s]\n", opt_name)); + "Performing midpoint cache update on [%s]\n", opt_name);
req = sss_dp_get_account_send(cctx, cctx->rctx, dctx->domain, true, req_type, opt_name, opt_id, NULL); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending out-of-band data provider " - "request\n")); + "Out of memory sending out-of-band data provider " + "request\n"); /* This is non-fatal, so we'll continue here */ } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Updating cache out-of-band\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Updating cache out-of-band\n"); }
/* We don't need to listen for a reply, so we will free the @@ -590,7 +590,7 @@ errno_t check_cache(struct nss_dom_ctx *dctx, req_type, opt_name, opt_id, NULL); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending data provider request\n")); + "Out of memory sending data provider request\n"); ret = ENOMEM; goto error; } @@ -653,14 +653,14 @@ static int delete_entry_from_memcache(struct sss_domain_info *dom, char *name,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory.\n"); return ENOMEM; }
if (dom->fqnames) { fqdn = sss_tc_fqname(tmp_ctx, dom->names, dom, name); if (fqdn == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory.\n"); ret = ENOMEM; goto done; } @@ -672,8 +672,8 @@ static int delete_entry_from_memcache(struct sss_domain_info *dom, char *name, ret = sss_mmap_cache_pw_invalidate(mc_ctx, &delete_name); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Internal failure in memory cache code: %d [%s]\n", - ret, strerror(ret))); + "Internal failure in memory cache code: %d [%s]\n", + ret, strerror(ret)); goto done; }
@@ -737,8 +737,8 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) /* if neg cached, return we didn't find it */ if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("User [%s] does not exist in [%s]! (negative cache)\n", - name, dom->name)); + "User [%s] does not exist in [%s]! (negative cache)\n", + name, dom->name); /* if a multidomain search, try with next */ if (cmdctx->check_next) { dom = get_next_domain(dom, false); @@ -750,22 +750,22 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) return ENOENT; }
- DEBUG(4, ("Requesting info for [%s@%s]\n", name, dom->name)); + DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; }
ret = sysdb_getpwnam(cmdctx, sysdb, dom, name, &dctx->res); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!\n")); + DEBUG(1, "Failed to make request to our cache!\n"); return EIO; }
if (dctx->res->count > 1) { - DEBUG(0, ("getpwnam call returned more than one result !?!\n")); + DEBUG(0, "getpwnam call returned more than one result !?!\n"); return ENOENT; }
@@ -773,8 +773,8 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) /* set negative cache only if not result of cache check */ ret = sss_ncache_set_user(nctx->ncache, false, dom, name); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot set negcache for %s@%s\n", - name, dom->name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Cannot set negcache for %s@%s\n", + name, dom->name); }
/* if a multidomain search, try with next */ @@ -783,14 +783,14 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) if (dom) continue; }
- DEBUG(2, ("No results for getpwnam call\n")); + DEBUG(2, "No results for getpwnam call\n");
/* User not found in ldb -> delete user from memory cache. */ ret = delete_entry_from_memcache(dctx->domain, name, nctx->pwd_mc_ctx); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Deleting user from memcache failed.\n")); + "Deleting user from memcache failed.\n"); }
return ENOENT; @@ -812,13 +812,13 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx) }
/* One result found */ - DEBUG(6, ("Returning info for user [%s@%s]\n", name, dom->name)); + DEBUG(6, "Returning info for user [%s@%s]\n", name, dom->name);
return EOK; }
DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", cmdctx->name)); + "No matching domain found for [%s], fail!\n", cmdctx->name); return ENOENT; }
@@ -842,10 +842,10 @@ static void nss_cmd_getby_dp_callback(uint16_t err_maj, uint32_t err_min, bool check_subdomains;
if (err_maj) { - DEBUG(2, ("Unable to get information from Data Provider\n" + DEBUG(2, "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg);
if ((dctx->res && dctx->res->count == 1) || (dctx->cmdctx->cmd == SSS_NSS_INITGR && @@ -873,8 +873,8 @@ static void nss_cmd_getby_dp_callback(uint16_t err_maj, uint32_t err_min, ret = nss_cmd_getbysid_send_reply(dctx); break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", - dctx->cmdctx->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command [%d].\n", + dctx->cmdctx->cmd); ret = EINVAL; } goto done; @@ -963,8 +963,8 @@ static void nss_cmd_getby_dp_callback(uint16_t err_maj, uint32_t err_min, } break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", - dctx->cmdctx->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command [%d].\n", + dctx->cmdctx->cmd); ret = EINVAL; }
@@ -1001,7 +1001,7 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx) case SSS_NSS_GETSIDBYNAME: break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command type [%d].\n", cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command type [%d].\n", cmd); return EINVAL; }
@@ -1036,8 +1036,8 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx)
rawname = (const char *)body;
- DEBUG(SSSDBG_TRACE_FUNC, ("Running command [%d] with input [%s].\n", - dctx->cmdctx->cmd, rawname)); + DEBUG(SSSDBG_TRACE_FUNC, "Running command [%d] with input [%s].\n", + dctx->cmdctx->cmd, rawname);
domname = NULL; ret = sss_parse_name_for_domains(cmdctx, cctx->rctx->domains, @@ -1054,13 +1054,13 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx) } goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid name received [%s]\n", rawname)); + DEBUG(SSSDBG_OP_FAILURE, "Invalid name received [%s]\n", rawname); ret = ENOENT; goto done; }
- DEBUG(4, ("Requesting info for [%s] from [%s]\n", - cmdctx->name, domname?domname:"<ALL>")); + DEBUG(4, "Requesting info for [%s] from [%s]\n", + cmdctx->name, domname?domname:"<ALL>");
if (domname) { dctx->domain = responder_get_domain(cctx->rctx, domname); @@ -1117,8 +1117,8 @@ static int nss_cmd_getbynam(enum sss_cli_command cmd, struct cli_ctx *cctx) } break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", - dctx->cmdctx->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command [%d].\n", + dctx->cmdctx->cmd); ret = EINVAL; }
@@ -1145,13 +1145,13 @@ static void nss_cmd_getbynam_done(struct tevent_req *req) cctx->rctx->default_domain, rawname, &domname, &cmdctx->name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid name received [%s]\n", rawname)); + DEBUG(SSSDBG_OP_FAILURE, "Invalid name received [%s]\n", rawname); ret = ENOENT; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Requesting info for [%s] from [%s]\n", - cmdctx->name, domname?domname:"<ALL>")); + DEBUG(SSSDBG_TRACE_FUNC, "Requesting info for [%s] from [%s]\n", + cmdctx->name, domname?domname:"<ALL>");
if (domname) { dctx->domain = responder_get_domain(cctx->rctx, domname); @@ -1197,8 +1197,8 @@ static void nss_cmd_getbynam_done(struct tevent_req *req) } break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", - dctx->cmdctx->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command [%d].\n", + dctx->cmdctx->cmd); ret = EINVAL; }
@@ -1231,9 +1231,9 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) /* check that the uid is valid for this domain */ if ((dom->id_min && (cmdctx->id < dom->id_min)) || (dom->id_max && (cmdctx->id > dom->id_max))) { - DEBUG(4, ("Uid [%lu] does not exist in domain [%s]! " + DEBUG(4, "Uid [%lu] does not exist in domain [%s]! " "(id out of range)\n", - (unsigned long)cmdctx->id, dom->name)); + (unsigned long)cmdctx->id, dom->name); if (cmdctx->check_next) { dom = get_next_domain(dom, true); continue; @@ -1251,24 +1251,24 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom;
- DEBUG(4, ("Requesting info for [%d@%s]\n", cmdctx->id, dom->name)); + DEBUG(4, "Requesting info for [%d@%s]\n", cmdctx->id, dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); ret = EIO; goto done; }
ret = sysdb_getpwuid(cmdctx, sysdb, dom, cmdctx->id, &dctx->res); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!\n")); + DEBUG(1, "Failed to make request to our cache!\n"); ret = EIO; goto done; }
if (dctx->res->count > 1) { - DEBUG(0, ("getpwuid call returned more than one result !?!\n")); + DEBUG(0, "getpwuid call returned more than one result !?!\n"); ret = ENOENT; goto done; } @@ -1281,7 +1281,7 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) }
/* set negative cache only if not result of cache check */ - DEBUG(SSSDBG_MINOR_FAILURE, ("No results for getpwuid call\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No results for getpwuid call\n"); ret = ENOENT; goto done; } @@ -1302,7 +1302,7 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx) }
/* One result found */ - DEBUG(6, ("Returning info for uid [%d@%s]\n", cmdctx->id, dom->name)); + DEBUG(6, "Returning info for uid [%d@%s]\n", cmdctx->id, dom->name);
ret = EOK; goto done; @@ -1316,11 +1316,11 @@ done: err = sss_ncache_set_uid(nctx->ncache, false, cmdctx->id); if (err != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set negative cache for UID %d\n", cmdctx->id)); + "Cannot set negative cache for UID %d\n", cmdctx->id); } }
- DEBUG(SSSDBG_MINOR_FAILURE, ("No matching domain found for [%d]\n", cmdctx->id)); + DEBUG(SSSDBG_MINOR_FAILURE, "No matching domain found for [%d]\n", cmdctx->id); return ret; }
@@ -1348,7 +1348,7 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx) case SSS_NSS_GETSIDBYID: break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command type [%d].\n", cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command type [%d].\n", cmd); return EINVAL; }
@@ -1377,16 +1377,16 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx) } cmdctx->id = *((uint32_t *)body);
- DEBUG(SSSDBG_TRACE_FUNC, ("Running command [%d] with id [%d].\n", - dctx->cmdctx->cmd, cmdctx->id)); + DEBUG(SSSDBG_TRACE_FUNC, "Running command [%d] with id [%d].\n", + dctx->cmdctx->cmd, cmdctx->id);
switch(dctx->cmdctx->cmd) { case SSS_NSS_GETPWUID: ret = sss_ncache_check_uid(nctx->ncache, nctx->neg_timeout, cmdctx->id); if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Uid [%lu] does not exist! (negative cache)\n", - (unsigned long)cmdctx->id)); + "Uid [%lu] does not exist! (negative cache)\n", + (unsigned long)cmdctx->id); ret = ENOENT; goto done; } @@ -1395,8 +1395,8 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx) ret = sss_ncache_check_gid(nctx->ncache, nctx->neg_timeout, cmdctx->id); if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Gid [%lu] does not exist! (negative cache)\n", - (unsigned long)cmdctx->id)); + "Gid [%lu] does not exist! (negative cache)\n", + (unsigned long)cmdctx->id); ret = ENOENT; goto done; } @@ -1409,15 +1409,15 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx) } if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Id [%lu] does not exist! (negative cache)\n", - (unsigned long)cmdctx->id)); + "Id [%lu] does not exist! (negative cache)\n", + (unsigned long)cmdctx->id); ret = ENOENT; goto done; } break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", - dctx->cmdctx->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command [%d].\n", + dctx->cmdctx->cmd); ret = EINVAL; goto done; } @@ -1462,8 +1462,8 @@ static int nss_cmd_getbyid(enum sss_cli_command cmd, struct cli_ctx *cctx) } break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", - dctx->cmdctx->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command [%d].\n", + dctx->cmdctx->cmd); ret = EINVAL; }
@@ -1504,8 +1504,8 @@ static void nss_cmd_getbyid_done(struct tevent_req *req) ret = responder_get_domain_by_id(cmdctx->cctx->rctx, cmdctx->secid, &dctx->domain); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot find domain for SID [%s].\n", - cmdctx->secid)); + DEBUG(SSSDBG_OP_FAILURE, "Cannot find domain for SID [%s].\n", + cmdctx->secid); ret = ENOENT; goto done; } @@ -1524,8 +1524,8 @@ static void nss_cmd_getbyid_done(struct tevent_req *req) } break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command [%d].\n", - dctx->cmdctx->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command [%d].\n", + dctx->cmdctx->cmd); ret = EINVAL; }
@@ -1568,7 +1568,7 @@ static int nss_cmd_setpwent(struct cli_ctx *cctx)
req = nss_cmd_setpwent_send(cmdctx, cctx); if (!req) { - DEBUG(0, ("Fatal error calling nss_cmd_setpwent_send\n")); + DEBUG(0, "Fatal error calling nss_cmd_setpwent_send\n"); ret = EIO; goto done; } @@ -1589,7 +1589,7 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom; struct setent_step_ctx *step_ctx;
- DEBUG(4, ("Received setpwent request\n")); + DEBUG(4, "Received setpwent request\n"); nctx = talloc_get_type(client->rctx->pvt_ctx, struct nss_ctx);
/* Reset the read pointers */ @@ -1598,7 +1598,7 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct setent_ctx); if (!req) { - DEBUG(0, ("Could not create tevent request for setpwent\n")); + DEBUG(0, "Could not create tevent request for setpwent\n"); return NULL; }
@@ -1618,7 +1618,7 @@ struct tevent_req *nss_cmd_setpwent_send(TALLOC_CTX *mem_ctx, state->dctx->domain = dom;
if (state->dctx->domain == NULL) { - DEBUG(2, ("Enumeration disabled on all domains!\n")); + DEBUG(2, "Enumeration disabled on all domains!\n"); ret = ENOENT; goto error; } @@ -1739,11 +1739,11 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom;
- DEBUG(6, ("Requesting info for domain [%s]\n", dom->name)); + DEBUG(6, "Requesting info for domain [%s]\n", dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; }
@@ -1758,9 +1758,9 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx) SSS_DP_USER, NULL, 0, NULL); if (!dpreq) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Enum Cache refresh for domain [%s] failed." + "Enum Cache refresh for domain [%s] failed." " Trying to return what we have in cache!\n", - dom->name)); + dom->name); } else { cb_ctx = talloc_zero(step_ctx, struct dp_callback_ctx); if(!cb_ctx) { @@ -1781,14 +1781,14 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx)
ret = sysdb_enumpwent(dctx, sysdb, dom, &res); if (ret != EOK) { - DEBUG(1, ("Enum from cache failed, skipping domain [%s]\n", - dom->name)); + DEBUG(1, "Enum from cache failed, skipping domain [%s]\n", + dom->name); dom = get_next_domain(dom, true); continue; }
if (res->count == 0) { - DEBUG(4, ("Domain [%s] has no users, skipping.\n", dom->name)); + DEBUG(4, "Domain [%s] has no users, skipping.\n", dom->name); dom = get_next_domain(dom, true); continue; } @@ -1823,8 +1823,8 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx) te = tevent_add_timer(rctx->ev, nctx->pctx, tv, setpwent_result_timeout, nctx); if (!te) { - DEBUG(0, ("Could not set up life timer for setpwent result object. " - "Entries may become stale.\n")); + DEBUG(0, "Could not set up life timer for setpwent result object. " + "Entries may become stale.\n"); }
/* Notify the waiting clients */ @@ -1844,7 +1844,7 @@ static void setpwent_result_timeout(struct tevent_context *ev, { struct nss_ctx *nctx = talloc_get_type(pvt, struct nss_ctx);
- DEBUG(1, ("setpwent result object has expired. Cleaning up.\n")); + DEBUG(1, "setpwent result object has expired. Cleaning up.\n");
/* Free the passwd enumeration context. * If additional getpwent requests come in, they will invoke @@ -1861,10 +1861,10 @@ static void nss_cmd_setpwent_dp_callback(uint16_t err_maj, uint32_t err_min, int ret;
if (err_maj) { - DEBUG(2, ("Unable to get information from Data Provider\n" + DEBUG(2, "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); }
ret = nss_cmd_setpwent_step(step_ctx); @@ -1910,7 +1910,7 @@ static int nss_cmd_getpwent(struct cli_ctx *cctx) struct nss_cmd_ctx *cmdctx; struct tevent_req *req;
- DEBUG(4, ("Requesting info for all accounts\n")); + DEBUG(4, "Requesting info for all accounts\n");
cmdctx = talloc_zero(cctx, struct nss_cmd_ctx); if (!cmdctx) { @@ -2004,10 +2004,10 @@ static int nss_cmd_retpwent(struct cli_ctx *cctx, int num) if (!n) break;
if (n < 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("BUG: Negative difference" - "[%d - %d = %d]\n", pdom->res->count, cctx->pwent_cur, n)); - DEBUG(SSSDBG_CRIT_FAILURE, ("Domain: %d (total %d)\n", - cctx->pwent_dom_idx, pctx->num)); + DEBUG(SSSDBG_CRIT_FAILURE, "BUG: Negative difference" + "[%d - %d = %d]\n", pdom->res->count, cctx->pwent_cur, n); + DEBUG(SSSDBG_CRIT_FAILURE, "Domain: %d (total %d)\n", + cctx->pwent_dom_idx, pctx->num); break; }
@@ -2042,8 +2042,8 @@ static void nss_cmd_implicit_setpwent_done(struct tevent_req *req) * later. */ if (ret != EOK && ret != ENOENT) { - DEBUG(0, ("Implicit setpwent failed with unexpected error [%d][%s]\n", - ret, strerror(ret))); + DEBUG(0, "Implicit setpwent failed with unexpected error [%d][%s]\n", + ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); }
@@ -2053,8 +2053,8 @@ static void nss_cmd_implicit_setpwent_done(struct tevent_req *req)
ret = nss_cmd_getpwent_immediate(cmdctx); if (ret != EOK) { - DEBUG(0, ("Immediate retrieval failed with unexpected error " - "[%d][%s]\n", ret, strerror(ret))); + DEBUG(0, "Immediate retrieval failed with unexpected error " + "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } } @@ -2064,7 +2064,7 @@ static int nss_cmd_endpwent(struct cli_ctx *cctx) struct nss_ctx *nctx; int ret;
- DEBUG(4, ("Terminating request info for all accounts\n")); + DEBUG(4, "Terminating request info for all accounts\n");
nctx = talloc_get_type(cctx->rctx->pvt_ctx, struct nss_ctx);
@@ -2108,7 +2108,7 @@ void nss_update_gr_memcache(struct nss_ctx *nctx) ret = sysdb_enumgrent(nctx, dom->sysdb, dom, &res); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to enumerate users for domain [%s]\n", dom->name)); + "Failed to enumerate users for domain [%s]\n", dom->name); continue; }
@@ -2125,8 +2125,8 @@ void nss_update_gr_memcache(struct nss_ctx *nctx) id = ldb_msg_find_attr_as_string(res->msgs[i], SYSDB_GIDNUM, NULL); if (!id) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to find gidNumber in %s.\n", - ldb_dn_get_linearized(res->msgs[i]->dn))); + "Failed to find gidNumber in %s.\n", + ldb_dn_get_linearized(res->msgs[i]->dn)); continue; } to_sized_string(&key, id); @@ -2134,8 +2134,8 @@ void nss_update_gr_memcache(struct nss_ctx *nctx) ret = sss_mmap_cache_gr_invalidate(nctx->grp_mc_ctx, &key); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Internal failure in memory cache code: %d [%s]\n", - ret, strerror(ret))); + "Internal failure in memory cache code: %d [%s]\n", + ret, strerror(ret)); } } talloc_zfree(res); @@ -2187,7 +2187,7 @@ static int fill_members(struct sss_packet *packet, dom->case_sensitive); if (tmpstr == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_get_cased_name failed, skipping\n")); + "sss_get_cased_name failed, skipping\n"); continue; }
@@ -2197,9 +2197,9 @@ static int fill_members(struct sss_packet *packet, dom, tmpstr); if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Group [%s] member [%s@%s] filtered out!" + "Group [%s] member [%s@%s] filtered out!" " (negative cache)\n", - (char *)&body[rzero+STRS_ROFFSET], tmpstr, domain)); + (char *)&body[rzero+STRS_ROFFSET], tmpstr, domain); continue; } } @@ -2234,10 +2234,10 @@ static int fill_members(struct sss_packet *packet, }
if (ret != name.len + delim + dom_len - 1) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to generate a fully qualified name" + DEBUG(SSSDBG_OP_FAILURE, "Failed to generate a fully qualified name" " for member [%s@%s] of group [%s]!" " Skipping\n", name.str, domain, - (char *)&body[rzero+STRS_ROFFSET])); + (char *)&body[rzero+STRS_ROFFSET]); /* reclaim space */ ret = sss_packet_shrink(packet, name.len + delim + dom_len); if (ret != EOK) { @@ -2316,8 +2316,8 @@ static int fill_grent(struct sss_packet *packet, /* new group */ if (!ldb_msg_check_string_attribute(msg, "objectClass", SYSDB_GROUP_CLASS)) { - DEBUG(1, ("Wrong object (%s) found on stack!\n", - ldb_dn_get_linearized(msg->dn))); + DEBUG(1, "Wrong object (%s) found on stack!\n", + ldb_dn_get_linearized(msg->dn)); continue; }
@@ -2329,8 +2329,8 @@ static int fill_grent(struct sss_packet *packet, orig_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); gid = ldb_msg_find_attr_as_uint64(msg, SYSDB_GIDNUM, 0); if (!orig_name || !gid) { - DEBUG(2, ("Incomplete group object for %s[%llu]! Skipping\n", - orig_name?orig_name:"<NULL>", (unsigned long long int)gid)); + DEBUG(2, "Incomplete group object for %s[%llu]! Skipping\n", + orig_name?orig_name:"<NULL>", (unsigned long long int)gid); continue; }
@@ -2339,8 +2339,8 @@ static int fill_grent(struct sss_packet *packet, nctx->neg_timeout, dom, orig_name); if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Group [%s@%s] filtered out! (negative cache)\n", - orig_name, domain)); + "Group [%s@%s] filtered out! (negative cache)\n", + orig_name, domain); continue; } } @@ -2348,7 +2348,7 @@ static int fill_grent(struct sss_packet *packet, tmpstr = sss_get_cased_name(tmp_ctx, orig_name, dom->case_sensitive); if (tmpstr == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_get_cased_name failed, skipping\n")); + "sss_get_cased_name failed, skipping\n"); continue; } to_sized_string(&name, tmpstr); @@ -2394,8 +2394,8 @@ static int fill_grent(struct sss_packet *packet, }
if (ret != name.len + delim + dom_len - 1) { - DEBUG(1, ("Failed to generate a fully qualified name for" - " group [%s] in [%s]! Skipping\n", name.str, domain)); + DEBUG(1, "Failed to generate a fully qualified name for" + " group [%s] in [%s]! Skipping\n", name.str, domain); /* reclaim space */ ret = sss_packet_shrink(packet, rsize); if (ret != EOK) { @@ -2456,8 +2456,8 @@ static int fill_grent(struct sss_packet *packet, fullname.len - pwfield.len); if (ret != EOK && ret != ENOMEM) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to store group %s(%s) in mmap cache!", - name.str, domain)); + "Failed to store group %s(%s) in mmap cache!", + name.str, domain); } }
@@ -2561,8 +2561,8 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) /* if neg cached, return we didn't find it */ if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Group [%s] does not exist in [%s]! (negative cache)\n", - name, dom->name)); + "Group [%s] does not exist in [%s]! (negative cache)\n", + name, dom->name); /* if a multidomain search, try with next */ if (cmdctx->check_next) { dom = get_next_domain(dom, false); @@ -2574,22 +2574,22 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) return ENOENT; }
- DEBUG(4, ("Requesting info for [%s@%s]\n", name, dom->name)); + DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; }
ret = sysdb_getgrnam(cmdctx, sysdb, dom, name, &dctx->res); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!\n")); + DEBUG(1, "Failed to make request to our cache!\n"); return EIO; }
if (dctx->res->count > 1) { - DEBUG(0, ("getgrnam call returned more than one result !?!\n")); + DEBUG(0, "getgrnam call returned more than one result !?!\n"); return ENOENT; }
@@ -2597,8 +2597,8 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) /* set negative cache only if not result of cache check */ ret = sss_ncache_set_group(nctx->ncache, false, dom, name); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot set negcache for %s@%s\n", - name, dom->name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Cannot set negcache for %s@%s\n", + name, dom->name); }
/* if a multidomain search, try with next */ @@ -2607,14 +2607,14 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) if (dom) continue; }
- DEBUG(2, ("No results for getgrnam call\n")); + DEBUG(2, "No results for getgrnam call\n");
/* Group not found in ldb -> delete group from memory cache. */ ret = delete_entry_from_memcache(dctx->domain, name, nctx->grp_mc_ctx); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Deleting group from memcache failed.\n")); + "Deleting group from memcache failed.\n"); }
@@ -2637,13 +2637,13 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx) }
/* One result found */ - DEBUG(6, ("Returning info for group [%s@%s]\n", name, dom->name)); + DEBUG(6, "Returning info for group [%s@%s]\n", name, dom->name);
return EOK; }
DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", cmdctx->name)); + "No matching domain found for [%s], fail!\n", cmdctx->name); return ENOENT; }
@@ -2677,9 +2677,9 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) /* check that the gid is valid for this domain */ if ((dom->id_min && (cmdctx->id < dom->id_min)) || (dom->id_max && (cmdctx->id > dom->id_max))) { - DEBUG(4, ("Gid [%lu] does not exist in domain [%s]! " + DEBUG(4, "Gid [%lu] does not exist in domain [%s]! " "(id out of range)\n", - (unsigned long)cmdctx->id, dom->name)); + (unsigned long)cmdctx->id, dom->name); if (cmdctx->check_next) { dom = get_next_domain(dom, true); continue; @@ -2697,24 +2697,24 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom;
- DEBUG(4, ("Requesting info for [%d@%s]\n", cmdctx->id, dom->name)); + DEBUG(4, "Requesting info for [%d@%s]\n", cmdctx->id, dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); ret = EIO; goto done; }
ret = sysdb_getgrgid(cmdctx, sysdb, dom, cmdctx->id, &dctx->res); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!\n")); + DEBUG(1, "Failed to make request to our cache!\n"); ret = EIO; goto done; }
if (dctx->res->count > 1) { - DEBUG(0, ("getgrgid call returned more than one result !?!\n")); + DEBUG(0, "getgrgid call returned more than one result !?!\n"); ret = ENOENT; goto done; } @@ -2727,7 +2727,7 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) }
/* set negative cache only if not result of cache check */ - DEBUG(SSSDBG_MINOR_FAILURE, ("No results for getgrgid call\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No results for getgrgid call\n"); ret = ENOENT; goto done; } @@ -2748,7 +2748,7 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx) }
/* One result found */ - DEBUG(6, ("Returning info for gid [%d@%s]\n", cmdctx->id, dom->name)); + DEBUG(6, "Returning info for gid [%d@%s]\n", cmdctx->id, dom->name);
/* Success. Break from the loop and return EOK */ ret = EOK; @@ -2763,11 +2763,11 @@ done: err = sss_ncache_set_gid(nctx->ncache, false, cmdctx->id); if (err != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set negative cache for GID %d\n", cmdctx->id)); + "Cannot set negative cache for GID %d\n", cmdctx->id); } }
- DEBUG(SSSDBG_MINOR_FAILURE, ("No matching domain found for [%d]\n", cmdctx->id)); + DEBUG(SSSDBG_MINOR_FAILURE, "No matching domain found for [%d]\n", cmdctx->id); return ret; }
@@ -2804,7 +2804,7 @@ static int nss_cmd_setgrent(struct cli_ctx *cctx)
req = nss_cmd_setgrent_send(cmdctx, cctx); if (!req) { - DEBUG(0, ("Fatal error calling nss_cmd_setgrent_send\n")); + DEBUG(0, "Fatal error calling nss_cmd_setgrent_send\n"); ret = EIO; goto done; } @@ -2825,7 +2825,7 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom; struct setent_step_ctx *step_ctx;
- DEBUG(4, ("Received setgrent request\n")); + DEBUG(4, "Received setgrent request\n"); nctx = talloc_get_type(client->rctx->pvt_ctx, struct nss_ctx);
/* Reset the read pointers */ @@ -2834,7 +2834,7 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct setent_ctx); if (!req) { - DEBUG(0, ("Could not create tevent request for setgrent\n")); + DEBUG(0, "Could not create tevent request for setgrent\n"); return NULL; }
@@ -2854,7 +2854,7 @@ struct tevent_req *nss_cmd_setgrent_send(TALLOC_CTX *mem_ctx, state->dctx->domain = dom;
if (state->dctx->domain == NULL) { - DEBUG(2, ("Enumeration disabled on all domains!\n")); + DEBUG(2, "Enumeration disabled on all domains!\n"); ret = ENOENT; goto error; } @@ -2975,11 +2975,11 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx) /* make sure to update the dctx if we changed domain */ dctx->domain = dom;
- DEBUG(6, ("Requesting info for domain [%s]\n", dom->name)); + DEBUG(6, "Requesting info for domain [%s]\n", dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; }
@@ -2994,9 +2994,9 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx) SSS_DP_GROUP, NULL, 0, NULL); if (!dpreq) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Enum Cache refresh for domain [%s] failed." + "Enum Cache refresh for domain [%s] failed." " Trying to return what we have in cache!\n", - dom->name)); + dom->name); } else { cb_ctx = talloc_zero(step_ctx, struct dp_callback_ctx); if(!cb_ctx) { @@ -3017,14 +3017,14 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx)
ret = sysdb_enumgrent(dctx, sysdb, dom, &res); if (ret != EOK) { - DEBUG(1, ("Enum from cache failed, skipping domain [%s]\n", - dom->name)); + DEBUG(1, "Enum from cache failed, skipping domain [%s]\n", + dom->name); dom = get_next_domain(dom, true); continue; }
if (res->count == 0) { - DEBUG(4, ("Domain [%s] has no groups, skipping.\n", dom->name)); + DEBUG(4, "Domain [%s] has no groups, skipping.\n", dom->name); dom = get_next_domain(dom, true); continue; } @@ -3059,8 +3059,8 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx) te = tevent_add_timer(rctx->ev, nctx->gctx, tv, setgrent_result_timeout, nctx); if (!te) { - DEBUG(0, ("Could not set up life timer for setgrent result object. " - "Entries may become stale.\n")); + DEBUG(0, "Could not set up life timer for setgrent result object. " + "Entries may become stale.\n"); }
/* Notify the waiting clients */ @@ -3081,7 +3081,7 @@ static void setgrent_result_timeout(struct tevent_context *ev, { struct nss_ctx *nctx = talloc_get_type(pvt, struct nss_ctx);
- DEBUG(1, ("setgrent result object has expired. Cleaning up.\n")); + DEBUG(1, "setgrent result object has expired. Cleaning up.\n");
/* Free the group enumeration context. * If additional getgrent requests come in, they will invoke @@ -3098,10 +3098,10 @@ static void nss_cmd_setgrent_dp_callback(uint16_t err_maj, uint32_t err_min, int ret;
if (err_maj) { - DEBUG(2, ("Unable to get information from Data Provider\n" + DEBUG(2, "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); }
ret = nss_cmd_setgrent_step(step_ctx); @@ -3225,7 +3225,7 @@ static int nss_cmd_getgrent(struct cli_ctx *cctx) struct nss_cmd_ctx *cmdctx; struct tevent_req *req;
- DEBUG(4, ("Requesting info for all groups\n")); + DEBUG(4, "Requesting info for all groups\n");
cmdctx = talloc_zero(cctx, struct nss_cmd_ctx); if (!cmdctx) { @@ -3271,8 +3271,8 @@ static void nss_cmd_implicit_setgrent_done(struct tevent_req *req) * later. */ if (ret != EOK && ret != ENOENT) { - DEBUG(0, ("Implicit setgrent failed with unexpected error [%d][%s]\n", - ret, strerror(ret))); + DEBUG(0, "Implicit setgrent failed with unexpected error [%d][%s]\n", + ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); }
@@ -3282,8 +3282,8 @@ static void nss_cmd_implicit_setgrent_done(struct tevent_req *req)
ret = nss_cmd_getgrent_immediate(cmdctx); if (ret != EOK) { - DEBUG(0, ("Immediate retrieval failed with unexpected error " - "[%d][%s]\n", ret, strerror(ret))); + DEBUG(0, "Immediate retrieval failed with unexpected error " + "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } } @@ -3293,7 +3293,7 @@ static int nss_cmd_endgrent(struct cli_ctx *cctx) struct nss_ctx *nctx; int ret;
- DEBUG(4, ("Terminating request info for all groups\n")); + DEBUG(4, "Terminating request info for all groups\n");
nctx = talloc_get_type(cctx->rctx->pvt_ctx, struct nss_ctx);
@@ -3338,7 +3338,7 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx,
if (dom == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("Unknown domain (%s) requested by provider\n", domain)); + "Unknown domain (%s) requested by provider\n", domain); return; }
@@ -3347,8 +3347,8 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx, ret = sysdb_initgroups(tmp_ctx, dom->sysdb, dom, name, &res); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to make request to our cache! [%d][%s]\n", - ret, strerror(ret))); + "Failed to make request to our cache! [%d][%s]\n", + ret, strerror(ret)); goto done; }
@@ -3362,8 +3362,8 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx, ret = sss_mmap_cache_pw_invalidate(nctx->pwd_mc_ctx, &delete_name); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Internal failure in memory cache code: %d [%s]\n", - ret, strerror(ret))); + "Internal failure in memory cache code: %d [%s]\n", + ret, strerror(ret)); }
/* Also invalidate his groups */ @@ -3409,8 +3409,8 @@ void nss_update_initgr_memcache(struct nss_ctx *nctx, ret = sss_mmap_cache_gr_invalidate_gid(nctx->grp_mc_ctx, id); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Internal failure in memory cache code: %d [%s]\n", - ret, strerror(ret))); + "Internal failure in memory cache code: %d [%s]\n", + ret, strerror(ret)); } } } @@ -3468,7 +3468,7 @@ static int fill_initgr(struct sss_packet *packet, struct ldb_result *res) skipped++; continue; } else { - DEBUG(1, ("Incomplete group object for initgroups! Aborting\n")); + DEBUG(1, "Incomplete group object for initgroups! Aborting\n"); return EFAULT; } } @@ -3558,8 +3558,8 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) /* if neg cached, return we didn't find it */ if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("User [%s] does not exist in [%s]! (negative cache)\n", - name, dom->name)); + "User [%s] does not exist in [%s]! (negative cache)\n", + name, dom->name); /* if a multidomain search, try with next */ if (cmdctx->check_next) { dom = get_next_domain(dom, false); @@ -3571,18 +3571,18 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) return ENOENT; }
- DEBUG(4, ("Requesting info for [%s@%s]\n", name, dom->name)); + DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; }
ret = sysdb_initgroups(cmdctx, sysdb, dom, name, &dctx->res); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache! [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Failed to make request to our cache! [%d][%s]\n", + ret, strerror(ret)); return EIO; }
@@ -3590,8 +3590,8 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) /* set negative cache only if not result of cache check */ ret = sss_ncache_set_user(nctx->ncache, false, dom, name); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Cannot set negcache for %s@%s\n", - name, dom->name)); + DEBUG(SSSDBG_MINOR_FAILURE, "Cannot set negcache for %s@%s\n", + name, dom->name); }
/* if a multidomain search, try with next */ @@ -3600,7 +3600,7 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) if (dom) continue; }
- DEBUG(2, ("No results for initgroups call\n")); + DEBUG(2, "No results for initgroups call\n");
return ENOENT; } @@ -3620,12 +3620,12 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx) } }
- DEBUG(6, ("Initgroups for [%s@%s] completed\n", name, dom->name)); + DEBUG(6, "Initgroups for [%s@%s] completed\n", name, dom->name); return EOK; }
DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", cmdctx->name)); + "No matching domain found for [%s], fail!\n", cmdctx->name); return ENOENT; }
@@ -3663,9 +3663,9 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) if ((dom->id_min && (cmdctx->id < dom->id_min)) || (dom->id_max && (cmdctx->id > dom->id_max))) { DEBUG(SSSDBG_TRACE_FUNC, - ("Uid [%lu] does not exist in domain [%s]! " + "Uid [%lu] does not exist in domain [%s]! " "(id out of range)\n", - (unsigned long)cmdctx->id, dom->name)); + (unsigned long)cmdctx->id, dom->name); if (cmdctx->check_next) { dom = get_next_domain(dom, true); continue; @@ -3693,15 +3693,15 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) dctx->domain = dom;
if (cmdctx->cmd == SSS_NSS_GETSIDBYID) { - DEBUG(SSSDBG_TRACE_FUNC, ("Requesting info for [%d@%s]\n", - cmdctx->id, dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Requesting info for [%d@%s]\n", + cmdctx->id, dom->name); } else { talloc_free(name); talloc_zfree(sysdb_name);
name = sss_get_cased_name(cmdctx, cmdctx->name, dom->case_sensitive); if (name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_get_cased_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_get_cased_name failed.\n"); ret = ENOMEM; goto done; } @@ -3711,7 +3711,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) if (IS_SUBDOMAIN(dom)) { sysdb_name = sss_tc_fqname(cmdctx, dom->names, dom, name); if (sysdb_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -3726,8 +3726,8 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) /* if neg cached, return we didn't find it */ if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("User [%s] does not exist in [%s]! (negative cache)\n", - name, dom->name)); + "User [%s] does not exist in [%s]! (negative cache)\n", + name, dom->name); /* if a multidomain search, try with next */ if (cmdctx->check_next) { dom = get_next_domain(dom, false); @@ -3740,15 +3740,15 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Requesting info for [%s@%s]\n", - name, dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Requesting info for [%s@%s]\n", + name, dom->name); }
sysdb = dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Fatal: Sysdb CTX not found for this domain!\n")); + "Fatal: Sysdb CTX not found for this domain!\n"); ret = EIO; goto done; } @@ -3758,7 +3758,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) attrs, &msg); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to make request to our cache!\n")); + "Failed to make request to our cache!\n"); ret = EIO; goto done; } @@ -3771,7 +3771,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) attrs, &msg); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to make request to our cache!\n")); + "Failed to make request to our cache!\n"); ret = EIO; goto done; } @@ -3786,7 +3786,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) attrs, &msg); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to make request to our cache!\n")); + "Failed to make request to our cache!\n"); ret = EIO; goto done; } @@ -3800,7 +3800,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) attrs, &msg); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to make request to our cache!\n")); + "Failed to make request to our cache!\n"); ret = EIO; goto done; } @@ -3813,7 +3813,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx)
dctx->res = talloc_zero(cmdctx, struct ldb_result); if (dctx->res == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); ret = ENOMEM; goto done; } @@ -3822,7 +3822,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) dctx->res->count = 1; dctx->res->msgs = talloc_array(dctx->res, struct ldb_message *, 1); if (dctx->res->msgs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n"); ret = ENOMEM; goto done; } @@ -3834,13 +3834,13 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) ret = sss_ncache_set_user(nctx->ncache, false, dom, name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set negcache for %s@%s\n", name, dom->name)); + "Cannot set negcache for %s@%s\n", name, dom->name); }
ret = sss_ncache_set_group(nctx->ncache, false, dom, name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set negcache for %s@%s\n", name, dom->name)); + "Cannot set negcache for %s@%s\n", name, dom->name); } } /* if a multidomain search, try with next */ @@ -3849,7 +3849,7 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx) continue; }
- DEBUG(SSSDBG_OP_FAILURE, ("No matching user or group found.\n")); + DEBUG(SSSDBG_OP_FAILURE, "No matching user or group found.\n"); ret = ENOENT; goto done; } @@ -3886,11 +3886,11 @@ static errno_t nss_cmd_getsidby_search(struct nss_dom_ctx *dctx)
/* One result found */ if (cmdctx->cmd == SSS_NSS_GETSIDBYID) { - DEBUG(SSSDBG_TRACE_FUNC, ("Returning info for id [%d@%s]\n", - cmdctx->id, dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Returning info for id [%d@%s]\n", + cmdctx->id, dom->name); } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Returning info for user/group [%s@%s]\n", - name, dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Returning info for user/group [%s@%s]\n", + name, dom->name); }
/* Success. Break from the loop and return EOK */ @@ -3905,21 +3905,21 @@ done: /* The entry was not found, need to set result in negative cache */ if (cmdctx->cmd == SSS_NSS_GETSIDBYID) { DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%d], fail!\n", cmdctx->id)); + "No matching domain found for [%d], fail!\n", cmdctx->id); err = sss_ncache_set_uid(nctx->ncache, false, cmdctx->id); if (err != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set negative cache for UID %d\n", cmdctx->id)); + "Cannot set negative cache for UID %d\n", cmdctx->id); }
err = sss_ncache_set_gid(nctx->ncache, false, cmdctx->id); if (err != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set negative cache for GID %d\n", cmdctx->id)); + "Cannot set negative cache for GID %d\n", cmdctx->id); } } else { DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", cmdctx->name)); + "No matching domain found for [%s], fail!\n", cmdctx->name); } } return ret; @@ -3936,37 +3936,37 @@ static errno_t nss_cmd_getbysid_search(struct nss_dom_ctx *dctx)
nctx = talloc_get_type(cctx->rctx->pvt_ctx, struct nss_ctx);
- DEBUG(SSSDBG_TRACE_FUNC, ("Requesting info for [%s@%s]\n", cmdctx->secid, - dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Requesting info for [%s@%s]\n", cmdctx->secid, + dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Fatal: Sysdb CTX not found for this " \ - "domain!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Fatal: Sysdb CTX not found for this " \ + "domain!\n"); return EIO; }
ret = sysdb_search_object_by_sid(cmdctx, sysdb, dom, cmdctx->secid, NULL, &dctx->res); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to make request to our cache!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to make request to our cache!\n"); return EIO; }
if (dctx->res->count > 1) { - DEBUG(SSSDBG_FATAL_FAILURE, ("getbysid call returned more than one " \ - "result !?!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "getbysid call returned more than one " \ + "result !?!\n"); return ENOENT; }
if (dctx->res->count == 0 && !dctx->check_provider) { - DEBUG(2, ("No results for getbysid call.\n")); + DEBUG(2, "No results for getbysid call.\n");
/* set negative cache only if not result of cache check */ ret = sss_ncache_set_sid(nctx->ncache, false, cmdctx->secid); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set negative cache for %s\n", cmdctx->secid)); + "Cannot set negative cache for %s\n", cmdctx->secid); }
return ENOENT; @@ -3988,8 +3988,8 @@ static errno_t nss_cmd_getbysid_search(struct nss_dom_ctx *dctx) }
/* One result found */ - DEBUG(SSSDBG_TRACE_FUNC, ("Returning info for sid [%s@%s]\n", cmdctx->secid, - dom->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Returning info for sid [%s@%s]\n", cmdctx->secid, + dom->name);
return EOK; } @@ -4004,7 +4004,7 @@ static errno_t find_sss_id_type(struct ldb_message *msg,
el = ldb_msg_find_element(msg, SYSDB_OBJECTCLASS); if (el == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Objectclass attribute not found.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Objectclass attribute not found.\n"); return EINVAL; }
@@ -4041,7 +4041,7 @@ static errno_t fill_sid(struct sss_packet *packet,
sid_str = ldb_msg_find_attr_as_string(msg, SYSDB_SID_STR, NULL); if (sid_str == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Missing SID.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing SID.\n"); return EINVAL; }
@@ -4049,7 +4049,7 @@ static errno_t fill_sid(struct sss_packet *packet,
ret = sss_packet_grow(packet, sid.len + 3* sizeof(uint32_t)); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_packet_grow failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_packet_grow failed.\n"); return ret; }
@@ -4079,19 +4079,19 @@ static errno_t fill_name(struct sss_packet *packet,
orig_name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); if (orig_name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Missing name.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing name.\n"); return EINVAL; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
cased_name= sss_get_cased_name(tmp_ctx, orig_name, dom->case_sensitive); if (cased_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_get_cased_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_get_cased_name failed.\n"); ret = ENOMEM; goto done; } @@ -4099,7 +4099,7 @@ static errno_t fill_name(struct sss_packet *packet, if (add_domain) { fq_name = sss_tc_fqname(tmp_ctx, dom->names, dom, cased_name); if (fq_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -4110,7 +4110,7 @@ static errno_t fill_name(struct sss_packet *packet,
ret = sss_packet_grow(packet, name.len + 3 * sizeof(uint32_t)); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_packet_grow failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_packet_grow failed.\n"); goto done; }
@@ -4144,13 +4144,13 @@ static errno_t fill_id(struct sss_packet *packet, }
if (id == 0 || id >= UINT32_MAX) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid POSIX ID.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid POSIX ID.\n"); return EINVAL; }
ret = sss_packet_grow(packet, 4 * sizeof(uint32_t)); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_packet_grow failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_packet_grow failed.\n"); return ret; }
@@ -4185,7 +4185,7 @@ static errno_t nss_cmd_getbysid_send_reply(struct nss_dom_ctx *dctx)
ret = find_sss_id_type(dctx->res->msgs[0], dctx->domain->mpg, &id_type); if (ret != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("find_sss_id_type failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "find_sss_id_type failed.\n"); return ret; }
@@ -4204,7 +4204,7 @@ static errno_t nss_cmd_getbysid_send_reply(struct nss_dom_ctx *dctx) ret = fill_sid(cctx->creq->out, id_type, dctx->res->msgs[0]); break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("Unsupported request type.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unsupported request type.\n"); return EINVAL; } if (ret != EOK) { @@ -4232,7 +4232,7 @@ static int nss_cmd_getbysid(enum sss_cli_command cmd, struct cli_ctx *cctx) size_t bin_sid_length;
if (cmd != SSS_NSS_GETNAMEBYSID && cmd != SSS_NSS_GETIDBYSID) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid command type [%d].\n", cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid command type [%d].\n", cmd); return EINVAL; }
@@ -4268,18 +4268,18 @@ static int nss_cmd_getbysid(enum sss_cli_command cmd, struct cli_ctx *cctx) &bin_sid, &bin_sid_length); talloc_free(bin_sid); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_idmap_sid_to_bin_sid failed for [%s].\n", - body)); + DEBUG(SSSDBG_OP_FAILURE, "sss_idmap_sid_to_bin_sid failed for [%s].\n", + body); ret = EINVAL; goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Running command [%d] with SID [%s].\n", - dctx->cmdctx->cmd, sid_str)); + DEBUG(SSSDBG_TRACE_FUNC, "Running command [%d] with SID [%s].\n", + dctx->cmdctx->cmd, sid_str);
cmdctx->secid = talloc_strdup(cmdctx, sid_str); if (cmdctx->secid == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -4296,12 +4296,12 @@ static int nss_cmd_getbysid(enum sss_cli_command cmd, struct cli_ctx *cctx) } goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("responder_get_domain_by_id failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "responder_get_domain_by_id failed.\n"); goto done; }
- DEBUG(4, ("Requesting info for [%s] from [%s]\n", - cmdctx->secid, dctx->domain->name)); + DEBUG(4, "Requesting info for [%s] from [%s]\n", + cmdctx->secid, dctx->domain->name);
dctx->check_provider = NEED_CHECK_PROVIDER(dctx->domain->provider);
diff --git a/src/responder/nss/nsssrv_mmap_cache.c b/src/responder/nss/nsssrv_mmap_cache.c index 8655a1a..cfc2fb1 100644 --- a/src/responder/nss/nsssrv_mmap_cache.c +++ b/src/responder/nss/nsssrv_mmap_cache.c @@ -133,20 +133,20 @@ static void sss_mc_save_corrupted(struct sss_mc_ctx *mc_ctx)
if (mc_ctx == NULL) { DEBUG(SSSDBG_TRACE_FUNC, - ("Cannot store uninitialized cache. Nothing to do.\n")); + "Cannot store uninitialized cache. Nothing to do.\n"); return; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory.\n"); return; }
file = talloc_asprintf(tmp_ctx, "%s_%s", mc_ctx->file, "corrupted"); if (file == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory.\n"); goto done; }
@@ -155,8 +155,8 @@ static void sss_mc_save_corrupted(struct sss_mc_ctx *mc_ctx) if (fd == -1) { err = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to open file '%s' [%d]: %s\n", - file, err, strerror(err))); + "Failed to open file '%s' [%d]: %s\n", + file, err, strerror(err)); goto done; }
@@ -165,11 +165,11 @@ static void sss_mc_save_corrupted(struct sss_mc_ctx *mc_ctx) if (written == -1) { err = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("write() failed [%d]: %s\n", err, strerror(err))); + "write() failed [%d]: %s\n", err, strerror(err)); } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("write() returned %zd (expected (%zd))\n", - written, mc_ctx->mmap_size)); + "write() returned %zd (expected (%zd))\n", + written, mc_ctx->mmap_size); } goto done; } @@ -184,8 +184,8 @@ done: if (err != 0) { err = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to remove file '%s': %s.\n", file, - strerror(err))); + "Failed to remove file '%s': %s.\n", file, + strerror(err)); } } } @@ -474,7 +474,7 @@ static errno_t sss_mc_get_strs_offset(struct sss_mc_ctx *mcc, *_offset = offsetof(struct sss_mc_grp_data, strs); return EOK; default: - DEBUG(SSSDBG_FATAL_FAILURE, ("Unknown memory cache type.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Unknown memory cache type.\n"); return EINVAL; } } @@ -491,7 +491,7 @@ static errno_t sss_mc_get_strs_len(struct sss_mc_ctx *mcc, *_len = ((struct sss_mc_grp_data *)&rec->data)->strs_len; return EOK; default: - DEBUG(SSSDBG_FATAL_FAILURE, ("Unknown memory cache type.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Unknown memory cache type.\n"); return EINVAL; } } @@ -527,7 +527,7 @@ static struct sss_mc_rec *sss_mc_find_record(struct sss_mc_ctx *mcc, while (slot != MC_INVALID_VAL) { if (!MC_SLOT_WITHIN_BOUNDS(slot, mcc->dt_size)) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Corrupted fastcache. Slot number too big.\n")); + "Corrupted fastcache. Slot number too big.\n"); sss_mc_save_corrupted(mcc); sss_mmap_cache_reset(mcc); return NULL; @@ -544,7 +544,7 @@ static struct sss_mc_rec *sss_mc_find_record(struct sss_mc_ctx *mcc, || (name_ptr + key->len) > (strs_offset + strs_len) || (uint8_t *)rec->data + strs_offset + strs_len > max_addr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Corrupted fastcache. name_ptr value is %u.\n", name_ptr)); + "Corrupted fastcache. name_ptr value is %u.\n", name_ptr); sss_mc_save_corrupted(mcc); sss_mmap_cache_reset(mcc); return NULL; @@ -600,7 +600,7 @@ static errno_t sss_mc_get_record(struct sss_mc_ctx **_mcc, if (ret != EOK) { if (ret == EFAULT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Fatal internal mmap cache error, invalidating cache!\n")); + "Fatal internal mmap cache error, invalidating cache!\n"); (void)sss_mmap_cache_reinit(talloc_parent(mcc), -1, -1, _mcc); } return ret; @@ -785,7 +785,7 @@ errno_t sss_mmap_cache_pw_invalidate_uid(struct sss_mc_ctx *mcc, uid_t uid)
while (slot != MC_INVALID_VAL) { if (!MC_SLOT_WITHIN_BOUNDS(slot, mcc->dt_size)) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Corrupted fastcache.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Corrupted fastcache.\n"); sss_mc_save_corrupted(mcc); sss_mmap_cache_reset(mcc); ret = ENOENT; @@ -924,7 +924,7 @@ errno_t sss_mmap_cache_gr_invalidate_gid(struct sss_mc_ctx *mcc, gid_t gid)
while (slot != MC_INVALID_VAL) { if (!MC_SLOT_WITHIN_BOUNDS(slot, mcc->dt_size)) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Corrupted fastcache.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Corrupted fastcache.\n"); sss_mc_save_corrupted(mcc); sss_mmap_cache_reset(mcc); ret = ENOENT; @@ -1011,29 +1011,29 @@ static errno_t sss_mc_create_file(struct sss_mc_ctx *mc_ctx) ret = sss_br_lock_file(ofd, 0, 1, retries, t); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to lock file %s.\n", mc_ctx->file)); + "Failed to lock file %s.\n", mc_ctx->file); } ret = sss_mc_set_recycled(ofd); if (ret) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to mark mmap file %s as" + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to mark mmap file %s as" " recycled: %d(%s)\n", - mc_ctx->file, ret, strerror(ret))); + mc_ctx->file, ret, strerror(ret)); }
close(ofd); } else if (errno != ENOENT) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to open old memory cache file %s: %d(%s).\n", - mc_ctx->file, ret, strerror(ret))); + "Failed to open old memory cache file %s: %d(%s).\n", + mc_ctx->file, ret, strerror(ret)); }
errno = 0; ret = unlink(mc_ctx->file); if (ret == -1 && errno != ENOENT) { ret = errno; - DEBUG(SSSDBG_TRACE_FUNC, ("Failed to rm mmap file %s: %d(%s)\n", - mc_ctx->file, ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Failed to rm mmap file %s: %d(%s)\n", + mc_ctx->file, ret, strerror(ret)); }
/* temporarily relax umask as we need the file to be readable @@ -1045,15 +1045,15 @@ static errno_t sss_mc_create_file(struct sss_mc_ctx *mc_ctx) umask(old_mask); if (mc_ctx->fd == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to open mmap file %s: %d(%s)\n", - mc_ctx->file, ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to open mmap file %s: %d(%s)\n", + mc_ctx->file, ret, strerror(ret)); return ret; }
ret = sss_br_lock_file(mc_ctx->fd, 0, 1, retries, t); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to lock file %s.\n", mc_ctx->file)); + "Failed to lock file %s.\n", mc_ctx->file); close(mc_ctx->fd); mc_ctx->fd = -1;
@@ -1064,8 +1064,8 @@ static errno_t sss_mc_create_file(struct sss_mc_ctx *mc_ctx) uret = unlink(mc_ctx->file); if (uret == -1) { uret = errno; - DEBUG(SSSDBG_TRACE_FUNC, ("Failed to rm mmap file %s: %d(%s)\n", - mc_ctx->file, uret, strerror(uret))); + DEBUG(SSSDBG_TRACE_FUNC, "Failed to rm mmap file %s: %d(%s)\n", + mc_ctx->file, uret, strerror(uret)); }
return ret; @@ -1111,8 +1111,8 @@ static int mc_ctx_destructor(struct sss_mc_ctx *mc_ctx) if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to unmap old memory cache file." - "[%d]: %s\n", ret, strerror(ret))); + "Failed to unmap old memory cache file." + "[%d]: %s\n", ret, strerror(ret)); } }
@@ -1121,8 +1121,8 @@ static int mc_ctx_destructor(struct sss_mc_ctx *mc_ctx) if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to close old memory cache file." - "[%d]: %s\n", ret, strerror(ret))); + "Failed to close old memory cache file." + "[%d]: %s\n", ret, strerror(ret)); } }
@@ -1199,8 +1199,8 @@ errno_t sss_mmap_cache_init(TALLOC_CTX *mem_ctx, const char *name, ret = ftruncate(mc_ctx->fd, mc_ctx->mmap_size); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to resize file %s: %d(%s)\n", - mc_ctx->file, ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to resize file %s: %d(%s)\n", + mc_ctx->file, ret, strerror(ret)); goto done; }
@@ -1209,9 +1209,9 @@ errno_t sss_mmap_cache_init(TALLOC_CTX *mem_ctx, const char *name, MAP_SHARED, mc_ctx->fd, 0); if (mc_ctx->mmap_base == MAP_FAILED) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to mmap file %s(%zu): %d(%s)\n", + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to mmap file %s(%zu): %d(%s)\n", mc_ctx->file, mc_ctx->mmap_size, - ret, strerror(ret))); + ret, strerror(ret)); goto done; }
@@ -1242,8 +1242,8 @@ done: dret = unlink(mc_ctx->file); if (dret == -1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to rm mmap file %s: %d(%s)\n", mc_ctx->file, - dret, strerror(dret))); + "Failed to rm mmap file %s: %d(%s)\n", mc_ctx->file, + dret, strerror(dret)); } }
@@ -1264,19 +1264,19 @@ errno_t sss_mmap_cache_reinit(TALLOC_CTX *mem_ctx, size_t n_elem,
if (mc_ctx == NULL || (*mc_ctx) == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to re-init unitialized memory cache.\n")); + "Unable to re-init unitialized memory cache.\n"); return EINVAL; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory.\n"); return ENOMEM; }
name = talloc_strdup(tmp_ctx, (*mc_ctx)->name); if (name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory.\n"); ret = ENOMEM; goto done; } @@ -1298,7 +1298,7 @@ errno_t sss_mmap_cache_reinit(TALLOC_CTX *mem_ctx, size_t n_elem,
ret = sss_mmap_cache_init(mem_ctx, name, type, n_elem, timeout, mc_ctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to re-initialize mmap cache.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to re-initialize mmap cache.\n"); goto done; }
@@ -1313,7 +1313,7 @@ void sss_mmap_cache_reset(struct sss_mc_ctx *mc_ctx) { if (mc_ctx == NULL) { DEBUG(SSSDBG_TRACE_FUNC, - ("Fastcache not initialized. Nothing to do.\n")); + "Fastcache not initialized. Nothing to do.\n"); return; }
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c index a1c4196..283d37e 100644 --- a/src/responder/nss/nsssrv_netgroup.c +++ b/src/responder/nss/nsssrv_netgroup.c @@ -50,8 +50,8 @@ static errno_t get_netgroup_entry(struct nss_ctx *nctx, return ENOENT; }
- DEBUG(1, ("Unexpected error reading from netgroup hash [%d][%s]\n", - hret, hash_error_string(hret))); + DEBUG(1, "Unexpected error reading from netgroup hash [%d][%s]\n", + hret, hash_error_string(hret)); return EIO; }
@@ -64,7 +64,7 @@ static errno_t set_netgroup_entry(struct nss_ctx *nctx, int hret;
if (netgr->name == NULL) { - DEBUG(1, ("Missing netgroup name.\n")); + DEBUG(1, "Missing netgroup name.\n"); return EINVAL; } /* Add this entry to the hash table */ @@ -74,8 +74,8 @@ static errno_t set_netgroup_entry(struct nss_ctx *nctx, value.ptr = netgr; hret = hash_enter(nctx->netgroups, &key, &value); if (hret != EOK) { - DEBUG(0, ("Unable to add hash table entry for [%s]", key.str)); - DEBUG(4, ("Hash error [%d][%s]", hret, hash_error_string(hret))); + DEBUG(0, "Unable to add hash table entry for [%s]", key.str); + DEBUG(4, "Hash error [%d][%s]", hret, hash_error_string(hret)); return EIO; } talloc_steal(nctx->netgroups, netgr); @@ -125,7 +125,7 @@ int nss_cmd_setnetgrent(struct cli_ctx *client)
req = setnetgrent_send(cmdctx, rawname, cmdctx); if (!req) { - DEBUG(0, ("Fatal error calling setnetgrent_send\n")); + DEBUG(0, "Fatal error calling setnetgrent_send\n"); ret = EIO; goto done; } @@ -143,8 +143,8 @@ static int netgr_hash_remove (TALLOC_CTX *ctx) talloc_get_type(ctx, struct getent_ctx);
if (netgr->lookup_table == NULL) { - DEBUG(SSSDBG_TRACE_LIBS, ("netgroup [%s] was already removed\n", - netgr->name)); + DEBUG(SSSDBG_TRACE_LIBS, "netgroup [%s] was already removed\n", + netgr->name); return EOK; }
@@ -154,8 +154,8 @@ static int netgr_hash_remove (TALLOC_CTX *ctx) /* Remove the netgroup result object from the lookup table */ hret = hash_delete(netgr->lookup_table, &key); if (hret != HASH_SUCCESS) { - DEBUG(0, ("Could not remove key [%s] from table! [%d][%s]\n", - netgr->name, hret, hash_error_string(hret))); + DEBUG(0, "Could not remove key [%s] from table! [%d][%s]\n", + netgr->name, hret, hash_error_string(hret)); return -1; } return 0; @@ -187,7 +187,7 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct setnetgrent_ctx); if (!req) { - DEBUG(0, ("Could not create tevent request for setnetgrent\n")); + DEBUG(0, "Could not create tevent request for setnetgrent\n"); return NULL; }
@@ -207,12 +207,12 @@ static struct tevent_req *setnetgrent_send(TALLOC_CTX *mem_ctx, client->rctx->default_domain, rawname, &domname, &state->netgr_shortname); if (ret != EOK) { - DEBUG(2, ("Invalid name received [%s]\n", rawname)); + DEBUG(2, "Invalid name received [%s]\n", rawname); goto error; }
- DEBUG(4, ("Requesting info for netgroup [%s] from [%s]\n", - state->netgr_shortname, domname?domname:"<ALL>")); + DEBUG(4, "Requesting info for netgroup [%s] from [%s]\n", + state->netgr_shortname, domname?domname:"<ALL>");
if (domname) { dctx->domain = responder_get_domain(client->rctx, domname); @@ -341,7 +341,7 @@ static errno_t setnetgrent_retry(struct tevent_req *req)
ret = set_netgroup_entry(nctx, state->netgr); if (ret != EOK) { - DEBUG(1, ("set_netgroup_entry failed.\n")); + DEBUG(1, "set_netgroup_entry failed.\n"); talloc_free(state->netgr); goto done; } @@ -418,8 +418,8 @@ static void set_netgr_lifetime(uint32_t lifetime, setnetgrent_result_timeout, netgr); if (!te) { - DEBUG(0, ("Could not set up life timer for setnetgrent result object. " - "Entries may become stale.\n")); + DEBUG(0, "Could not set up life timer for setnetgrent result object. " + "Entries may become stale.\n"); } }
@@ -455,15 +455,15 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) name = sss_get_cased_name(step_ctx, step_ctx->name, dom->case_sensitive); if (!name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_get_cased_name failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_get_cased_name failed\n"); return ENOMEM; }
- DEBUG(4, ("Requesting info for [%s@%s]\n", - name, dom->name)); + DEBUG(4, "Requesting info for [%s@%s]\n", + name, dom->name); sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); return EIO; }
@@ -472,7 +472,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) &step_ctx->dctx->res); if (step_ctx->dctx->res->count > 1) { DEBUG(SSSDBG_FATAL_FAILURE, - ("getnetgr call returned more than one result !?!\n")); + "getnetgr call returned more than one result !?!\n"); return EMSGSIZE; } if (ret == ENOENT) { @@ -488,7 +488,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) }
if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!\n")); + DEBUG(1, "Failed to make request to our cache!\n"); return EIO; }
@@ -496,7 +496,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) &netgr); if (ret != EOK) { /* Something really bad happened! */ - DEBUG(0, ("Netgroup entry was lost!\n")); + DEBUG(0, "Netgroup entry was lost!\n"); return ret; }
@@ -505,8 +505,8 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) &netgr->entries); if (ret == ENOENT) { /* This netgroup was not found in this domain */ - DEBUG(2, ("No results for netgroup %s (domain %s)\n", - name, dom->name)); + DEBUG(2, "No results for netgroup %s (domain %s)\n", + name, dom->name);
if (!step_ctx->dctx->check_provider) { if (step_ctx->check_next) { @@ -519,7 +519,7 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) }
if (ret != EOK) { - DEBUG(1, ("Failed to convert results into entries\n")); + DEBUG(1, "Failed to convert results into entries\n"); netgr->ready = true; netgr->found = false; set_netgr_lifetime(step_ctx->nctx->neg_timeout, step_ctx, netgr); @@ -545,8 +545,8 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) }
/* Results found */ - DEBUG(6, ("Returning info for netgroup [%s@%s]\n", - name, dom->name)); + DEBUG(6, "Returning info for netgroup [%s@%s]\n", + name, dom->name); netgr->ready = true; netgr->found = true; if (step_ctx->nctx->cache_refresh_percent) { @@ -562,11 +562,11 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
/* If we've gotten here, then no domain contained this netgroup */ DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", step_ctx->name)); + "No matching domain found for [%s], fail!\n", step_ctx->name);
netgr = talloc_zero(step_ctx->nctx, struct getent_ctx); if (netgr == NULL) { - DEBUG(1, ("talloc_zero failed, ignored.\n")); + DEBUG(1, "talloc_zero failed, ignored.\n"); } else { netgr->ready = true; netgr->found = false; @@ -574,14 +574,14 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx) netgr->lookup_table = step_ctx->nctx->netgroups; netgr->name = talloc_strdup(netgr, step_ctx->name); if (netgr->name == NULL) { - DEBUG(1, ("talloc_strdup failed.\n")); + DEBUG(1, "talloc_strdup failed.\n"); talloc_free(netgr); return ENOMEM; }
ret = set_netgroup_entry(step_ctx->nctx, netgr); if (ret != EOK) { - DEBUG(1, ("set_netgroup_entry failed, ignored.\n")); + DEBUG(1, "set_netgroup_entry failed, ignored.\n"); } set_netgr_lifetime(step_ctx->nctx->neg_timeout, step_ctx, netgr); } @@ -599,10 +599,10 @@ static void lookup_netgr_dp_callback(uint16_t err_maj, uint32_t err_min, int ret;
if (err_maj) { - DEBUG(2, ("Unable to get information from Data Provider\n" + DEBUG(2, "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); /* Loop to the next domain if possible */ if (cmdctx->check_next && get_next_domain(dctx->domain, false)) { dctx->domain = get_next_domain(dctx->domain, false); @@ -661,7 +661,7 @@ static void nss_cmd_setnetgrent_done(struct tevent_req *req) reqret = setnetgrent_recv(req); talloc_zfree(req); if (reqret != EOK && reqret != ENOENT) { - DEBUG(1, ("setnetgrent failed\n")); + DEBUG(1, "setnetgrent failed\n"); nss_cmd_done(cmdctx, reqret); return; } @@ -678,7 +678,7 @@ static void nss_cmd_setnetgrent_done(struct tevent_req *req) packet = cmdctx->cctx->creq->out; ret = sss_packet_grow(packet, 2*sizeof(uint32_t)); if (ret != EOK) { - DEBUG(1, ("Couldn't grow the packet\n")); + DEBUG(1, "Couldn't grow the packet\n"); NSS_CMD_FATAL_ERROR(cmdctx); }
@@ -691,7 +691,7 @@ static void nss_cmd_setnetgrent_done(struct tevent_req *req) return; }
- DEBUG(1, ("Error creating packet\n")); + DEBUG(1, "Error creating packet\n"); }
static void setnetgrent_implicit_done(struct tevent_req *req); @@ -705,7 +705,7 @@ int nss_cmd_getnetgrent(struct cli_ctx *client) struct getent_ctx *netgr; struct tevent_req *req;
- DEBUG(4, ("Requesting netgroup data\n")); + DEBUG(4, "Requesting netgroup data\n");
cmdctx = talloc_zero(client, struct nss_cmd_ctx); if (!cmdctx) { @@ -738,8 +738,8 @@ int nss_cmd_getnetgrent(struct cli_ctx *client)
return EOK; } else if (ret != EOK) { - DEBUG(1, ("An unexpected error occurred: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "An unexpected error occurred: [%d][%s]\n", + ret, strerror(ret));
return nss_cmd_done(cmdctx, ret); } @@ -757,16 +757,16 @@ int nss_cmd_getnetgrent(struct cli_ctx *client)
return EOK; } else if (!netgr->found) { - DEBUG(6, ("Results for [%s] not found.\n", client->netgr_name)); + DEBUG(6, "Results for [%s] not found.\n", client->netgr_name); return ENOENT; }
- DEBUG(6, ("Returning results for [%s]\n", client->netgr_name)); + DEBUG(6, "Returning results for [%s]\n", client->netgr_name);
/* Read the result strings */ ret = nss_cmd_getnetgrent_process(cmdctx, netgr); if (ret != EOK) { - DEBUG(1, ("Failed: [%d][%s]\n", ret, strerror(ret))); + DEBUG(1, "Failed: [%d][%s]\n", ret, strerror(ret)); } return ret; } @@ -788,8 +788,8 @@ static void setnetgrent_implicit_done(struct tevent_req *req) * nss_cmd_retnetgrent later */ if (ret != EOK && ret != ENOENT) { - DEBUG(0, ("Implicit setnetgrent failed with unexpected error " - "[%d][%s]\n", ret, strerror(ret))); + DEBUG(0, "Implicit setnetgrent failed with unexpected error " + "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); }
@@ -803,27 +803,27 @@ static void setnetgrent_implicit_done(struct tevent_req *req) ret = get_netgroup_entry(nctx, cmdctx->cctx->netgr_name, &netgr); if (ret == ENOENT) { /* Critical error. This should never happen */ - DEBUG(0, ("Implicit setnetgrent returned success without creating " - "result object.\n")); + DEBUG(0, "Implicit setnetgrent returned success without creating " + "result object.\n"); NSS_CMD_FATAL_ERROR(cmdctx); } else if (ret != EOK) { - DEBUG(1, ("An unexpected error occurred: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "An unexpected error occurred: [%d][%s]\n", + ret, strerror(ret));
NSS_CMD_FATAL_ERROR(cmdctx); }
if (!netgr->ready) { /* Critical error. This should never happen */ - DEBUG(0, ("Implicit setnetgrent returned success without creating " - "result object.\n")); + DEBUG(0, "Implicit setnetgrent returned success without creating " + "result object.\n"); NSS_CMD_FATAL_ERROR(cmdctx); }
ret = nss_cmd_getnetgrent_process(cmdctx, netgr); if (ret != EOK) { - DEBUG(0, ("Immediate retrieval failed with unexpected error " - "[%d][%s]\n", ret, strerror(ret))); + DEBUG(0, "Immediate retrieval failed with unexpected error " + "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } } @@ -857,7 +857,7 @@ static errno_t nss_cmd_getnetgrent_process(struct nss_cmd_ctx *cmdctx,
if (!netgr->entries || netgr->entries[0] == NULL) { /* No entries */ - DEBUG(5, ("No entries found\n")); + DEBUG(5, "No entries found\n"); ret = sss_cmd_empty_packet(client->creq->out); if (ret != EOK) { return nss_cmd_done(cmdctx, ret); @@ -952,7 +952,7 @@ static errno_t nss_cmd_retnetgrent(struct cli_ctx *client, } else if (entries[client->netgrent_cur]->type == SYSDB_NETGROUP_GROUP_VAL) { if (entries[client->netgrent_cur]->value.groupname == NULL || entries[client->netgrent_cur]->value.groupname[0] == '\0') { - DEBUG(1, ("Empty netgroup member. Please check your cache.\n")); + DEBUG(1, "Empty netgroup member. Please check your cache.\n"); continue; }
@@ -974,8 +974,8 @@ static errno_t nss_cmd_retnetgrent(struct cli_ctx *client, grouplen); rp += grouplen; } else { - DEBUG(1, ("Unexpected value type for netgroup entry. " - "Please check your cache.\n")); + DEBUG(1, "Unexpected value type for netgroup entry. " + "Please check your cache.\n"); continue; }
@@ -1023,7 +1023,7 @@ netgroup_hash_delete_cb(hash_entry_t *item,
netgr = talloc_get_type(item->value.ptr, struct getent_ctx); if (!netgr) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid netgroup\n")); + DEBUG(SSSDBG_OP_FAILURE, "Invalid netgroup\n"); return; }
@@ -1048,13 +1048,13 @@ errno_t nss_orphan_netgroups(struct nss_ctx *nctx) return EIO; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Removing netgroups from memory cache.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Removing netgroups from memory cache.\n");
for (i = 0; i < mcount; i++) { /* netgroup entry will be deleted by setnetgrent_result_timeout */ hret = hash_delete(nctx->netgroups, &netgroups[i]); if (hret != HASH_SUCCESS) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Could not delete key from hash\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Could not delete key from hash\n"); continue; } } diff --git a/src/responder/nss/nsssrv_private.h b/src/responder/nss/nsssrv_private.h index 04f1330..221db6c 100644 --- a/src/responder/nss/nsssrv_private.h +++ b/src/responder/nss/nsssrv_private.h @@ -95,13 +95,13 @@ struct setent_step_ctx { };
#define NSS_CMD_FATAL_ERROR(cctx) do { \ - DEBUG(1,("Fatal error, killing connection!\n")); \ + DEBUG(1,"Fatal error, killing connection!\n"); \ talloc_free(cctx); \ return; \ } while(0)
#define NSS_CMD_FATAL_ERROR_CODE(cctx, ret) do { \ - DEBUG(1,("Fatal error, killing connection!\n")); \ + DEBUG(1,"Fatal error, killing connection!\n"); \ talloc_free(cctx); \ return ret; \ } while(0) diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c index 79caa7d..837825a 100644 --- a/src/responder/nss/nsssrv_services.c +++ b/src/responder/nss/nsssrv_services.c @@ -168,7 +168,7 @@ getserv_send(TALLOC_CTX *mem_ctx, sysdb = dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Critical: Sysdb CTX not found for [%s]!\n", dom->name)); + "Critical: Sysdb CTX not found for [%s]!\n", dom->name); ret = EINVAL; goto immediate; } @@ -184,11 +184,11 @@ getserv_send(TALLOC_CTX *mem_ctx, /* If negatively cached, return we didn't find it */ if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Service [%s:%s] does not exist in [%s]! " + "Service [%s:%s] does not exist in [%s]! " "(negative cache)\n", SVC_NAME_CASED, SVC_PROTO_CASED ? SVC_PROTO_CASED : "<ANY>", - dom->name)); + dom->name);
/* If this is a multi-domain search, try the next one */ if (cmdctx->check_next) { @@ -207,10 +207,10 @@ getserv_send(TALLOC_CTX *mem_ctx,
/* Check the cache */ DEBUG(SSSDBG_TRACE_FUNC, - ("Checking cache for [%s:%s@%s]\n", + "Checking cache for [%s:%s@%s]\n", SVC_NAME_CASED, SVC_PROTO_CASED ? SVC_PROTO_CASED : "<ANY>", - dom->name)); + dom->name);
ret = sysdb_getservbyname(state, sysdb, dom, SVC_NAME_CASED, @@ -225,11 +225,11 @@ getserv_send(TALLOC_CTX *mem_ctx, /* If negatively cached, return we didn't find it */ if (ret == EEXIST) { DEBUG(SSSDBG_TRACE_FUNC, - ("Service [%"PRIu16":%s] does not exist in [%s]! " + "Service [%"PRIu16":%s] does not exist in [%s]! " "(negative cache)\n", port, SVC_PROTO_CASED ? SVC_PROTO_CASED : "<ANY>", - dom->name)); + dom->name);
/* If this is a multi-domain search, try the next one */ if (cmdctx->check_next) { @@ -248,10 +248,10 @@ getserv_send(TALLOC_CTX *mem_ctx,
/* Check the cache */ DEBUG(SSSDBG_TRACE_FUNC, - ("Checking cache for [%"PRIu16":%s@%s]\n", + "Checking cache for [%"PRIu16":%s@%s]\n", port, SVC_PROTO_CASED ? SVC_PROTO_CASED : "<ANY>", - dom->name)); + dom->name);
ret = sysdb_getservbyport(state, sysdb, dom, port, SVC_PROTO_CASED, @@ -278,8 +278,8 @@ getserv_send(TALLOC_CTX *mem_ctx, * We'll log an error and continue. */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not set negative cache for [%s][%s]\n", - SVC_NAME_CASED, SVC_PROTO_CASED)); + "Could not set negative cache for [%s][%s]\n", + SVC_NAME_CASED, SVC_PROTO_CASED); } } else { ret = sss_ncache_set_service_port(nctx->ncache, false, @@ -291,9 +291,9 @@ getserv_send(TALLOC_CTX *mem_ctx, * We'll log an error and continue. */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not set negative cache for " + "Could not set negative cache for " "[%"PRIu16"][%s]\n", - state->port, SVC_PROTO_CASED)); + state->port, SVC_PROTO_CASED); } } } @@ -313,7 +313,7 @@ getserv_send(TALLOC_CTX *mem_ctx, /* Found a result. Check its validity */ if (state->res->count > 1) { DEBUG(SSSDBG_OP_FAILURE, - ("getservby* returned more than one result!\n")); + "getservby* returned more than one result!\n"); ret = ENOENT; goto immediate; } @@ -348,7 +348,7 @@ getserv_send(TALLOC_CTX *mem_ctx, * queue the cache entry for update out-of-band. */ DEBUG(SSSDBG_TRACE_FUNC, - ("Performing midpoint cache update\n")); + "Performing midpoint cache update\n");
/* Update the cache */ subreq = sss_dp_get_account_send(cctx, cctx->rctx, @@ -358,8 +358,8 @@ getserv_send(TALLOC_CTX *mem_ctx, port, NULL); if (!subreq) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending out-of-band data provider " - "request\n")); + "Out of memory sending out-of-band data provider " + "request\n"); /* This is non-fatal, so we'll continue here */ } /* We don't need to listen for a reply, so we will free the @@ -467,11 +467,11 @@ static void lookup_service_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to get information from Data Provider\n" + "Unable to get information from Data Provider\n" "dp_error: [%u], errno: [%u], error_msg: [%s]\n" "Will try to return what we have in cache\n", (unsigned int)err_maj, (unsigned int)err_min, - err_msg ? err_msg : "none")); + err_msg ? err_msg : "none"); }
/* Recheck the cache after the lookup. @@ -484,18 +484,18 @@ static void lookup_service_done(struct tevent_req *subreq) sysdb = dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Critical: Sysdb CTX not found for [%s]!\n", - dom->name)); + "Critical: Sysdb CTX not found for [%s]!\n", + dom->name); ret = EINVAL; goto done; }
if (state->name) { DEBUG(SSSDBG_TRACE_FUNC, - ("Re-checking cache for [%s:%s@%s]\n", + "Re-checking cache for [%s:%s@%s]\n", SVC_NAME_CASED, SVC_PROTO_CASED ? SVC_PROTO_CASED : "<ANY>", - dom->name)); + dom->name);
ret = sysdb_getservbyname(state, sysdb, dom, SVC_NAME_CASED, @@ -503,10 +503,10 @@ static void lookup_service_done(struct tevent_req *subreq) &state->res); } else { DEBUG(SSSDBG_TRACE_FUNC, - ("Re-checking cache for [%"PRIu16":%s@%s]\n", + "Re-checking cache for [%"PRIu16":%s@%s]\n", state->port, SVC_PROTO_CASED ? SVC_PROTO_CASED : "<ANY>", - dom->name)); + dom->name);
ret = sysdb_getservbyport(state, sysdb, dom, state->port, @@ -528,8 +528,8 @@ static void lookup_service_done(struct tevent_req *subreq) * We'll log an error and continue. */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not set negative cache for [%s][%s]\n", - SVC_NAME_CASED, SVC_PROTO_CASED)); + "Could not set negative cache for [%s][%s]\n", + SVC_NAME_CASED, SVC_PROTO_CASED); } } else { ret = sss_ncache_set_service_port(nctx->ncache, false, @@ -541,8 +541,8 @@ static void lookup_service_done(struct tevent_req *subreq) * We'll log an error and continue. */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not set negative cache for [%"PRIu16"][%s]\n", - state->port, SVC_PROTO_CASED)); + "Could not set negative cache for [%"PRIu16"][%s]\n", + state->port, SVC_PROTO_CASED); } }
@@ -635,8 +635,8 @@ fill_service(struct sss_packet *packet, /* new service */ if (!ldb_msg_check_string_attribute(msg, "objectClass", SYSDB_SVC_CLASS)) { - DEBUG(1, ("Wrong object (%s) found on stack!\n", - ldb_dn_get_linearized(msg->dn))); + DEBUG(1, "Wrong object (%s) found on stack!\n", + ldb_dn_get_linearized(msg->dn)); continue; }
@@ -649,7 +649,7 @@ fill_service(struct sss_packet *packet, tmpstr = sss_get_cased_name(tmp_ctx, orig_name, dom->case_sensitive); if (tmpstr == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not identify service name, skipping\n")); + "Could not identify service name, skipping\n"); continue; } to_sized_string(&cased_name, tmpstr); @@ -658,7 +658,7 @@ fill_service(struct sss_packet *packet, port = (uint16_t) ldb_msg_find_attr_as_uint(msg, SYSDB_SVC_PORT, 0); if (!port) { DEBUG(SSSDBG_CRIT_FAILURE, - ("No port for service [%s]. Skipping\n", tmpstr)); + "No port for service [%s]. Skipping\n", tmpstr);
}
@@ -684,7 +684,7 @@ fill_service(struct sss_packet *packet, tmpstr = sss_get_cased_name(tmp_ctx, orig_proto, dom->case_sensitive); if (tmpstr == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_get_cased_name failed, skipping\n")); + "sss_get_cased_name failed, skipping\n"); continue; } to_sized_string(&cased_proto, tmpstr); @@ -829,17 +829,17 @@ int nss_cmd_getservbyname(struct cli_ctx *cctx) &service_protocol); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not parse request\n")); + "Could not parse request\n"); goto done; }
dctx->protocol = service_protocol;
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting info for service [%s:%s] from [%s]\n", + "Requesting info for service [%s:%s] from [%s]\n", service_name, service_protocol ? service_protocol : "<ANY>", - domname ? domname : "<ALL>")); + domname ? domname : "<ALL>");
if (domname) { dctx->domain = responder_get_domain(cctx->rctx, domname); @@ -957,7 +957,7 @@ errno_t parse_getservbyname(TALLOC_CTX *mem_ctx,
if (j != blen - namelen - 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Body longer than the name and protocol\n")); + "Body longer than the name and protocol\n"); ret = EINVAL; goto done; } @@ -967,8 +967,8 @@ errno_t parse_getservbyname(TALLOC_CTX *mem_ctx, &domname, &svc_name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not split name and domain of [%s]\n", - rawname)); + "Could not split name and domain of [%s]\n", + rawname); goto done; }
@@ -997,7 +997,7 @@ nss_cmd_getserv_done(struct tevent_req *req) talloc_zfree(req); if (reqret != EOK && reqret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("getservbyname failed\n")); + "getservbyname failed\n"); nss_cmd_done(cmdctx, reqret); return; } @@ -1020,15 +1020,15 @@ nss_cmd_getserv_done(struct tevent_req *req) } if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not create response packet: [%s]\n", - strerror(ret))); + "Could not create response packet: [%s]\n", + strerror(ret)); }
sss_cmd_done(cmdctx->cctx, cmdctx); return; }
- DEBUG(SSSDBG_OP_FAILURE, ("Error creating packet\n")); + DEBUG(SSSDBG_OP_FAILURE, "Error creating packet\n"); }
errno_t parse_getservbyport(TALLOC_CTX *mem_ctx, @@ -1085,7 +1085,7 @@ errno_t parse_getservbyport(TALLOC_CTX *mem_ctx,
if (j != blen - port_and_padding_len - 1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Body longer than the name and protocol\n")); + "Body longer than the name and protocol\n"); ret = EINVAL; goto done; } @@ -1140,15 +1140,15 @@ int nss_cmd_getservbyport(struct cli_ctx *cctx) &service_protocol); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not parse request\n")); + "Could not parse request\n"); goto done; }
dctx->protocol = service_protocol;
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting info for service on port [%"PRIu16"/%s]\n", - port, service_protocol ? service_protocol : "<ANY>")); + "Requesting info for service on port [%"PRIu16"/%s]\n", + port, service_protocol ? service_protocol : "<ANY>");
/* All port lookups are multidomain searches */ dctx->domain = cctx->rctx->domains; @@ -1199,7 +1199,7 @@ setservent_send(TALLOC_CTX *mem_ctx, struct cli_ctx *cctx) struct nss_ctx *nctx = talloc_get_type(cctx->rctx->pvt_ctx, struct nss_ctx);
- DEBUG(SSSDBG_TRACE_FUNC, ("Received setservent request\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Received setservent request\n");
/* Reset the read pointers */ cctx->svc_dom_idx = 0; @@ -1299,8 +1299,8 @@ setservent_send(TALLOC_CTX *mem_ctx, struct cli_ctx *cctx) }
DEBUG(SSSDBG_CRIT_FAILURE, - ("Error [%s] requesting info from domain [%s]. Skipping.\n", - strerror(ret), step_ctx->dctx->domain->name)); + "Error [%s] requesting info from domain [%s]. Skipping.\n", + strerror(ret), step_ctx->dctx->domain->name);
step_ctx->dctx->domain = get_next_domain(step_ctx->dctx->domain, false); } @@ -1375,7 +1375,7 @@ lookup_servent_send(TALLOC_CTX *mem_ctx, sysdb = dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Sysdb CTX not found for [%s]!\n", dom->name)); + "Sysdb CTX not found for [%s]!\n", dom->name); ret = EINVAL; goto immediate; } @@ -1426,18 +1426,18 @@ lookup_servent_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to get information from Data Provider\n" + "Unable to get information from Data Provider\n" "dp_error: [%u], errno: [%u], error_msg: [%s]\n" "Will try to return what we have in cache\n", (unsigned int)dp_err, (unsigned int)dp_ret, - err_msg ? err_msg : "none")); + err_msg ? err_msg : "none"); }
/* Check the cache now */ sysdb = state->dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Sysdb CTX not found for [%s]!\n", state->dom->name)); + "Sysdb CTX not found for [%s]!\n", state->dom->name); ret = EINVAL; goto done; } @@ -1482,11 +1482,11 @@ setservent_step_done(struct tevent_req *req) talloc_zfree(req); if (ret == ENOENT) { DEBUG(SSSDBG_TRACE_FUNC, - ("Domain [%s] returned no results\n", dctx->domain->name)); + "Domain [%s] returned no results\n", dctx->domain->name); } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error [%s] while retrieving info from domain [%s]. " - "Skipping.\n", strerror(ret), dctx->domain->name)); + "Error [%s] while retrieving info from domain [%s]. " + "Skipping.\n", strerror(ret), dctx->domain->name); /* Continue on */ } else { /* Got some results @@ -1508,8 +1508,8 @@ setservent_step_done(struct tevent_req *req) }
DEBUG(SSSDBG_CRIT_FAILURE, - ("Error [%s] requesting info from domain [%s]. Skipping.\n", - strerror(ret), step_ctx->dctx->domain->name)); + "Error [%s] requesting info from domain [%s]. Skipping.\n", + strerror(ret), step_ctx->dctx->domain->name);
step_ctx->dctx->domain = get_next_domain(step_ctx->dctx->domain, false); } @@ -1546,8 +1546,8 @@ setservent_finalize(struct setent_step_ctx *step_ctx) setservent_result_timeout, nctx); if (!te) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not set up life timer for setservent result object. " - "Entries may become stale.\n")); + "Could not set up life timer for setservent result object. " + "Entries may become stale.\n"); }
nss_setent_notify_done(nctx->svcctx); @@ -1562,7 +1562,7 @@ setservent_result_timeout(struct tevent_context *ev, struct nss_ctx *nctx = talloc_get_type(pvt, struct nss_ctx);
DEBUG(SSSDBG_TRACE_FUNC, - ("setservent result object has expired. Cleaning up.\n")); + "setservent result object has expired. Cleaning up.\n");
/* Free the service enumeration context. * If additional getservent requests come in, they will invoke @@ -1597,7 +1597,7 @@ nss_cmd_setservent(struct cli_ctx *cctx) req = setservent_send(cmdctx, cctx); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Fatal error calling nss_cmd_setservent_send\n")); + "Fatal error calling nss_cmd_setservent_send\n"); ret = EIO; goto done; } @@ -1652,7 +1652,7 @@ int nss_cmd_getservent(struct cli_ctx *cctx) struct tevent_req *req;
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting info for all services\n")); + "Requesting info for all services\n");
cmdctx = talloc_zero(cctx, struct nss_cmd_ctx); if (!cmdctx) { @@ -1702,8 +1702,8 @@ nss_cmd_implicit_setservent_done(struct tevent_req *req) */ if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Implicit setservent failed with unexpected error [%d][%s]\n", - ret, strerror(ret))); + "Implicit setservent failed with unexpected error [%d][%s]\n", + ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); }
@@ -1714,8 +1714,8 @@ nss_cmd_implicit_setservent_done(struct tevent_req *req) ret = nss_cmd_getservent_immediate(cmdctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Immediate retrieval failed with unexpected error " - "[%d][%s]\n", ret, strerror(ret))); + "Immediate retrieval failed with unexpected error " + "[%d][%s]\n", ret, strerror(ret)); NSS_CMD_FATAL_ERROR(cmdctx); } } @@ -1807,7 +1807,7 @@ int nss_cmd_endservent(struct cli_ctx *cctx) int ret;
DEBUG(SSSDBG_TRACE_FUNC, - ("Terminating request info for all accounts\n")); + "Terminating request info for all accounts\n");
nctx = talloc_get_type(cctx->rctx->pvt_ctx, struct nss_ctx);
diff --git a/src/responder/pac/pacsrv.c b/src/responder/pac/pacsrv.c index a06d768..ee64dc8 100644 --- a/src/responder/pac/pacsrv.c +++ b/src/responder/pac/pacsrv.c @@ -85,7 +85,7 @@ static void pac_dp_reconnect_init(struct sbus_connection *conn,
/* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("Reconnected to the Data Provider.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Reconnected to the Data Provider.\n");
/* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -99,8 +99,8 @@ static void pac_dp_reconnect_init(struct sbus_connection *conn, }
/* Failed to reconnect */ - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not reconnect to %s provider.\n", - be_conn->domain->name)); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not reconnect to %s provider.\n", + be_conn->domain->name);
/* FIXME: kill the frontend and let the monitor restart it ? */ /* nss_shutdown(rctx); */ @@ -131,13 +131,13 @@ int pac_process_init(TALLOC_CTX *mem_ctx, "PAC", &pac_dp_interface, &rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n"); return ret; }
pac_ctx = talloc_zero(rctx, struct pac_ctx); if (!pac_ctx) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing pac_ctx\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing pac_ctx\n"); ret = ENOMEM; goto fail; } @@ -150,7 +150,7 @@ int pac_process_init(TALLOC_CTX *mem_ctx, CONFDB_PAC_CONF_ENTRY, CONFDB_SERVICE_ALLOWED_UIDS, DEFAULT_ALLOWED_UIDS, &uid_str); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to get allowed UIDs.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to get allowed UIDs.\n"); goto fail; }
@@ -158,7 +158,7 @@ int pac_process_init(TALLOC_CTX *mem_ctx, &pac_ctx->rctx->allowed_uids_count, &pac_ctx->rctx->allowed_uids); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to set allowed UIDs.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to set allowed UIDs.\n"); goto fail; }
@@ -168,7 +168,7 @@ int pac_process_init(TALLOC_CTX *mem_ctx, CONFDB_SERVICE_RECON_RETRIES, 3, &max_retries); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Failed to set up automatic reconnection\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Failed to set up automatic reconnection\n"); goto fail; }
@@ -180,7 +180,7 @@ int pac_process_init(TALLOC_CTX *mem_ctx, err = sss_idmap_init(sss_idmap_talloc, pac_ctx, sss_idmap_talloc_free, &pac_ctx->idmap_ctx); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_idmap_init failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_idmap_init failed.\n"); ret = EFAULT; goto fail; } @@ -193,18 +193,18 @@ int pac_process_init(TALLOC_CTX *mem_ctx, &fd_limit); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set up file descriptor limit\n")); + "Failed to set up file descriptor limit\n"); goto fail; } responder_set_fd_limit(fd_limit);
ret = schedule_get_domains_task(rctx, rctx->ev, rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("schedule_get_domains_tasks failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("PAC Initialization complete\n")); + DEBUG(SSSDBG_TRACE_FUNC, "PAC Initialization complete\n");
return EOK;
@@ -253,7 +253,7 @@ int main(int argc, const char *argv[]) ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(SSSDBG_OP_FAILURE, ("Could not set up to exit when parent process does\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set up to exit when parent process does\n"); }
ret = pac_process_init(main_ctx, diff --git a/src/responder/pac/pacsrv_cmd.c b/src/responder/pac/pacsrv_cmd.c index f6e8aba..0a60494 100644 --- a/src/responder/pac/pacsrv_cmd.c +++ b/src/responder/pac/pacsrv_cmd.c @@ -36,8 +36,8 @@ static errno_t pac_cmd_done(struct cli_ctx *cctx, int cmd_ret) ret = sss_packet_new(cctx->creq, 0, sss_packet_get_cmd(cctx->creq->in), &cctx->creq->out); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_packet_new failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sss_packet_new failed [%d][%s].\n", + ret, strerror(ret)); return ret; }
@@ -110,7 +110,7 @@ static errno_t pac_add_pac_user(struct cli_ctx *cctx)
pr_ctx = talloc_zero(cctx, struct pac_req_ctx); if (pr_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
@@ -118,27 +118,27 @@ static errno_t pac_add_pac_user(struct cli_ctx *cctx)
pr_ctx->pac_ctx = talloc_get_type(cctx->rctx->pvt_ctx, struct pac_ctx); if (pr_ctx->pac_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Cannot find pac responder context.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Cannot find pac responder context.\n"); return EINVAL; }
ret = get_data_from_pac(pr_ctx, body, blen, &pr_ctx->logon_info); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("get_data_from_pac failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_data_from_pac failed.\n"); goto done; }
pr_ctx->domain_name = pr_ctx->logon_info->info3.base.logon_domain.string; if (pr_ctx->domain_name == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("No domain name in PAC")); + DEBUG(SSSDBG_FATAL_FAILURE, "No domain name in PAC"); ret = EINVAL; goto done; }
if (pr_ctx->logon_info->info3.base.account_name.string == NULL) { ret = EINVAL; - DEBUG(SSSDBG_FATAL_FAILURE, ("Missing account name in PAC.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Missing account name in PAC.\n"); goto done; }
@@ -148,7 +148,7 @@ static errno_t pac_add_pac_user(struct cli_ctx *cctx) pr_ctx->logon_info->info3.base.account_name.string); if (pr_ctx->user_name == NULL) { ret = ENOMEM; - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_tc_utf8_str_tolower failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_tc_utf8_str_tolower failed.\n"); goto done; }
@@ -156,7 +156,7 @@ static errno_t pac_add_pac_user(struct cli_ctx *cctx) pr_ctx->logon_info->info3.base.domain_sid, &pr_ctx->user_dom_sid_str); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_idmap_smb_sid_to_sid failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_idmap_smb_sid_to_sid failed.\n"); ret = EFAULT; goto done; } @@ -174,7 +174,7 @@ static errno_t pac_add_pac_user(struct cli_ctx *cctx) } goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("responder_get_domain_by_id failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "responder_get_domain_by_id failed.\n"); goto done; }
@@ -203,8 +203,8 @@ static void pac_get_domains_done(struct tevent_req *req) ret = responder_get_domain_by_id(cctx->rctx, pr_ctx->user_dom_sid_str, &pr_ctx->dom); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Corresponding domain [%s] has not been " - "found\n", pr_ctx->user_dom_sid_str)); + DEBUG(SSSDBG_OP_FAILURE, "Corresponding domain [%s] has not been " + "found\n", pr_ctx->user_dom_sid_str); ret = ENOENT; goto done; } @@ -228,14 +228,14 @@ static errno_t pac_resolve_sids_next(struct pac_req_ctx *pr_ctx) &pr_ctx->primary_group_sid_str, &pr_ctx->sid_table); if (ret != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("get_sids_from_pac failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_sids_from_pac failed.\n"); return ret; }
req = pac_lookup_sids_send(pr_ctx, pr_ctx->cctx->ev, pr_ctx, pr_ctx->pac_ctx, pr_ctx->sid_table); if (req == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("pac_lookup_sids_send failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "pac_lookup_sids_send failed.\n"); return ENOMEM; }
@@ -279,8 +279,8 @@ static void pac_lookup_sids_done(struct tevent_req *req) ret =responder_get_domain_by_id(cctx->rctx, entries[c].key.str, &dom); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("No domain found for SID [%s].\n", - entries[c].key.str)); + DEBUG(SSSDBG_OP_FAILURE, "No domain found for SID [%s].\n", + entries[c].key.str); continue; }
@@ -288,19 +288,19 @@ static void pac_lookup_sids_done(struct tevent_req *req) ret = sysdb_search_object_by_sid(pr_ctx, dom->sysdb, dom, entries[c].key.str, NULL, &msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_object_by_sid " \ - "failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_object_by_sid " \ + "failed.\n"); continue; }
if (msg->count == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("No entry found for SID [%s].\n", - entries[c].key.str)); + DEBUG(SSSDBG_OP_FAILURE, "No entry found for SID [%s].\n", + entries[c].key.str); continue; } else if (msg->count > 1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("More then one result returned " \ + DEBUG(SSSDBG_CRIT_FAILURE, "More then one result returned " \ "for SID [%s].\n", - entries[c].key.str)); + entries[c].key.str); talloc_free(msg); pac_cmd_done(cctx, EINVAL); return; @@ -314,7 +314,7 @@ static void pac_lookup_sids_done(struct tevent_req *req) }
if (id == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("No ID found in entry.\n")); + DEBUG(SSSDBG_OP_FAILURE, "No ID found in entry.\n"); talloc_free(msg); continue; } @@ -324,8 +324,8 @@ static void pac_lookup_sids_done(struct tevent_req *req)
ret = hash_enter(pr_ctx->sid_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed [%d][%s].\n", - ret, hash_error_string(ret))); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed [%d][%s].\n", + ret, hash_error_string(ret)); continue; } talloc_free(msg); @@ -343,7 +343,7 @@ static void pac_add_user_next(struct pac_req_ctx *pr_ctx)
ret = save_pac_user(pr_ctx); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("save_pac_user failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "save_pac_user failed.\n"); goto done; }
@@ -351,7 +351,7 @@ static void pac_add_user_next(struct pac_req_ctx *pr_ctx) &pr_ctx->del_grp_list, &pr_ctx->add_sid_count, &pr_ctx->add_sids); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("pac_user_get_grp_info failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "pac_user_get_grp_info failed.\n"); goto done; }
@@ -403,27 +403,27 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, sysdb = pr_ctx->dom->sysdb; if (sysdb == NULL) { ret = EINVAL; - DEBUG(SSSDBG_FATAL_FAILURE, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Fatal: Sysdb CTX not found for this domain!\n"); goto done; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { ret = ENOMEM; - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); goto done; }
ret = sysdb_initgroups(tmp_ctx, sysdb, pr_ctx->dom, pr_ctx->user_name, &res); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_initgroups failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_initgroups failed.\n"); goto done; }
if (res->count == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_initgroups did not found [%s].\n", - pr_ctx->user_name)); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_initgroups did not found [%s].\n", + pr_ctx->user_name); ret = ENOENT; goto done; } @@ -434,7 +434,7 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, del_grp_list = talloc_zero_array(tmp_ctx, struct grp_info, del_grp_count); if (del_grp_list == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n"); ret = ENOMEM; goto done; } @@ -446,7 +446,7 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, cur_sid = ldb_msg_find_attr_as_string(res->msgs[c + 1], SYSDB_SID_STR, NULL); if (cur_sid == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing SID in group entry.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing SID in group entry.\n"); ret = EINVAL; goto done; } @@ -454,20 +454,20 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, key.str = discard_const(cur_sid); ret = hash_lookup(pr_ctx->sid_table, &key, &value); if (ret == HASH_SUCCESS) { - DEBUG(SSSDBG_TRACE_ALL, ("User [%s] already member of group " \ + DEBUG(SSSDBG_TRACE_ALL, "User [%s] already member of group " \ "with SID [%s].\n", - pr_ctx->user_name, cur_sid)); + pr_ctx->user_name, cur_sid);
ret = hash_delete(pr_ctx->sid_table, &key); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to remove hash entry.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to remove hash entry.\n"); ret = EIO; goto done; } } else if (ret == HASH_ERROR_KEY_NOT_FOUND) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Group with SID [%s] is not in " \ + DEBUG(SSSDBG_TRACE_INTERNAL, "Group with SID [%s] is not in " \ "the PAC anymore, membership " \ - "must be removed.\n", cur_sid)); + "must be removed.\n", cur_sid);
tmp_str = ldb_msg_find_attr_as_string(res->msgs[c + 1], SYSDB_ORIG_DN, NULL); @@ -475,7 +475,7 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, del_grp_list[del_idx].orig_dn = talloc_strdup(del_grp_list, tmp_str); if (del_grp_list[del_idx].orig_dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -484,7 +484,7 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, del_grp_list[del_idx].dn = ldb_dn_copy(del_grp_list, res->msgs[c + 1]->dn); if (del_grp_list[del_idx].dn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ldb_dn_copy failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ldb_dn_copy failed.\n"); ret = ENOMEM; goto done; } @@ -499,7 +499,7 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, if (add_sid_count > 0) { add_sids = talloc_array(tmp_ctx, char *, add_sid_count); if (add_sids == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n"); ret = ENOMEM; goto done; } @@ -510,12 +510,12 @@ static errno_t pac_user_get_grp_info(TALLOC_CTX *mem_ctx, if (strcmp(entry->key.str, pr_ctx->user_sid_str) != 0) { add_sids[c] = talloc_strdup(add_sids, entry->key.str); if (add_sids[c] == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } - DEBUG(SSSDBG_TRACE_ALL, ("SID [%s] added to add_sids " \ - "list.\n", entry->key.str)); + DEBUG(SSSDBG_TRACE_ALL, "SID [%s] added to add_sids " \ + "list.\n", entry->key.str); c++; } } @@ -552,14 +552,14 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx) sysdb = pr_ctx->dom->sysdb; if (sysdb == NULL) { ret = EINVAL; - DEBUG(SSSDBG_FATAL_FAILURE, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Fatal: Sysdb CTX not found for this domain!\n"); goto done; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { ret = ENOMEM; - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); goto done; }
@@ -567,7 +567,7 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx) pr_ctx->primary_group_sid_str, pr_ctx->sid_table, pr_ctx->logon_info, &pwd, &user_attrs); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("get_pwd_from_pac failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_pwd_from_pac failed.\n"); goto done; }
@@ -575,7 +575,7 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx) pwd->pw_uid, attrs, &msg); if (ret == ENOENT) { if (pwd->pw_gid == 0 && !pr_ctx->dom->mpg) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Primary group RID from the PAC " \ + DEBUG(SSSDBG_CRIT_FAILURE, "Primary group RID from the PAC " \ "cannot be translated into a GID for " \ "user [%s]. Typically this happens " \ "when UIDs and GIDs are read from AD " \ @@ -583,7 +583,7 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx) "have a GID assigned. Make sure the " \ "user is created by the ID provider " \ "before GSSAPI based authentication " \ - "is used in this case.", pwd->pw_name)); + "is used in this case.", pwd->pw_name); ret = EINVAL; goto done; } @@ -594,12 +594,12 @@ static errno_t save_pac_user(struct pac_req_ctx *pr_ctx) pwd->pw_shell, NULL, user_attrs, NULL, pr_ctx->dom->user_timeout, 0); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_store_user failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_store_user failed [%d][%s].\n", + ret, strerror(ret)); goto done; } } else if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_user_by_id failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_user_by_id failed.\n"); goto done; }
@@ -638,7 +638,7 @@ struct tevent_req *pac_save_memberships_send(struct pac_req_ctx *pr_ctx)
dom_name = sss_get_domain_name(state, pr_ctx->user_name, dom); if (dom_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_sprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_sprintf failed.\n"); ret = ENOMEM; goto done; } @@ -646,8 +646,8 @@ struct tevent_req *pac_save_memberships_send(struct pac_req_ctx *pr_ctx) ret = sysdb_search_user_by_name(state, dom->sysdb, dom, dom_name, NULL, &msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_user_by_name failed " \ - "[%d][%s].\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_user_by_name failed " \ + "[%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -656,7 +656,7 @@ struct tevent_req *pac_save_memberships_send(struct pac_req_ctx *pr_ctx)
ret = pac_save_memberships_delete(state); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("pac_save_memberships_delete failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "pac_save_memberships_delete failed.\n"); goto done; }
@@ -694,19 +694,19 @@ pac_save_memberships_delete(struct pac_save_memberships_state *state) }
if (pr_ctx->del_grp_list == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing group list.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing group list.\n"); return EINVAL; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_new failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_new failed.\n"); return ENOMEM; }
ret = sysdb_transaction_start(pr_ctx->dom->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_transaction_start failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_transaction_start failed.\n"); goto done; } in_transaction = true; @@ -718,32 +718,32 @@ pac_save_memberships_delete(struct pac_save_memberships_state *state) pr_ctx->del_grp_list[c].dn, LDB_FLAG_MOD_DELETE); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_mod_group_member failed for " \ + DEBUG(SSSDBG_OP_FAILURE, "sysdb_mod_group_member failed for " \ "user [%s] and group[%s].\n", ldb_dn_get_linearized(state->user_dn), ldb_dn_get_linearized( - pr_ctx->del_grp_list[c].dn))); + pr_ctx->del_grp_list[c].dn)); continue; }
if (pr_ctx->del_grp_list[c].orig_dn != NULL) { user_attrs = sysdb_new_attrs(tmp_ctx); if (user_attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_new_attrs failed.\n"); continue; }
ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_MEMBEROF, pr_ctx->del_grp_list[c].orig_dn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); continue; }
ret = sysdb_set_entry_attr(pr_ctx->dom->sysdb, state->user_dn, user_attrs, LDB_FLAG_MOD_DELETE); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_set_entry_attr failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_set_entry_attr failed.\n"); continue; } talloc_free(user_attrs); @@ -752,7 +752,7 @@ pac_save_memberships_delete(struct pac_save_memberships_state *state)
ret = sysdb_transaction_commit(pr_ctx->dom->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_transaction_commit failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_transaction_commit failed.\n"); goto done; } in_transaction = false; @@ -762,7 +762,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(pr_ctx->dom->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_transaction_cancel failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_transaction_cancel failed.\n"); } }
@@ -788,7 +788,7 @@ static errno_t pac_save_memberships_next(struct tevent_req *req) }
if (pr_ctx->add_sids == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing list of SIDs.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing list of SIDs.\n"); return EINVAL; }
@@ -796,8 +796,8 @@ static errno_t pac_save_memberships_next(struct tevent_req *req) sid = pr_ctx->add_sids[state->sid_iter]; ret = responder_get_domain_by_id(pr_ctx->pac_ctx->rctx, sid, &grp_dom); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("responder_get_domain_by_id failed, " \ - "will try next group\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "responder_get_domain_by_id failed, " \ + "will try next group\n"); state->sid_iter++; continue; } @@ -818,8 +818,8 @@ static errno_t pac_save_memberships_next(struct tevent_req *req)
return EAGAIN; } else { - DEBUG(SSSDBG_OP_FAILURE, ("pac_store_membership failed, " - "trying next group.\n")); + DEBUG(SSSDBG_OP_FAILURE, "pac_store_membership failed, " + "trying next group.\n"); state->sid_iter++; continue; } @@ -858,14 +858,14 @@ static void pac_get_group_done(struct tevent_req *subreq) sid = pr_ctx->add_sids[state->sid_iter]; ret = responder_get_domain_by_id(pr_ctx->pac_ctx->rctx,sid, &grp_dom); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("responder_get_domain_by_id failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "responder_get_domain_by_id failed.\n"); goto error; }
ret = pac_store_membership(state->pr_ctx, state->user_dn, sid, grp_dom); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("pac_store_membership failed, " - "trying next group.\n")); + DEBUG(SSSDBG_OP_FAILURE, "pac_store_membership failed, " + "trying next group.\n"); } state->sid_iter++;
@@ -904,48 +904,48 @@ pac_store_membership(struct pac_req_ctx *pr_ctx, ret = sysdb_search_object_by_sid(tmp_ctx, grp_dom->sysdb, grp_dom, grp_sid_str, group_attrs, &group); if (ret != EOK) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("sysdb_search_object_by_sid " \ + DEBUG(SSSDBG_TRACE_INTERNAL, "sysdb_search_object_by_sid " \ "for SID [%s] failed [%d][%s].\n", - grp_sid_str, ret, strerror(ret))); + grp_sid_str, ret, strerror(ret)); goto done; }
if (group->count != 1) { - DEBUG(SSSDBG_OP_FAILURE, ("Unexpected number of groups returned.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Unexpected number of groups returned.\n"); ret = EINVAL; goto done; }
oc = ldb_msg_find_attr_as_string(group->msgs[0], SYSDB_OBJECTCLASS, NULL); if (oc == NULL || strcmp(oc, SYSDB_GROUP_CLASS) != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("Return object does not have group " \ - "objectclass.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Return object does not have group " \ + "objectclass.\n"); ret = EINVAL; goto done; }
- DEBUG(SSSDBG_TRACE_ALL, ("Adding user [%s] to group [%s][%s].\n", + DEBUG(SSSDBG_TRACE_ALL, "Adding user [%s] to group [%s][%s].\n", ldb_dn_get_linearized(user_dn), grp_sid_str, - ldb_dn_get_linearized(group->msgs[0]->dn))); + ldb_dn_get_linearized(group->msgs[0]->dn)); ret = sysdb_mod_group_member(grp_dom->sysdb, user_dn, group->msgs[0]->dn, LDB_FLAG_MOD_ADD); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_mod_group_member failed user [%s] " \ + DEBUG(SSSDBG_OP_FAILURE, "sysdb_mod_group_member failed user [%s] " \ "group [%s].\n", ldb_dn_get_linearized(user_dn), - ldb_dn_get_linearized(group->msgs[0]->dn))); + ldb_dn_get_linearized(group->msgs[0]->dn)); goto done; }
orig_group_dn = ldb_msg_find_attr_as_string(group->msgs[0], SYSDB_ORIG_DN, NULL); if (orig_group_dn != NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("Adding original group DN [%s] to user [%s].\n", + DEBUG(SSSDBG_TRACE_ALL, "Adding original group DN [%s] to user [%s].\n", orig_group_dn, - ldb_dn_get_linearized(user_dn))); + ldb_dn_get_linearized(user_dn)); user_attrs = sysdb_new_attrs(tmp_ctx); if (user_attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; } @@ -953,20 +953,20 @@ pac_store_membership(struct pac_req_ctx *pr_ctx, ret = sysdb_attrs_add_string(user_attrs, SYSDB_ORIG_MEMBEROF, orig_group_dn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
ret = sysdb_set_entry_attr(pr_ctx->dom->sysdb, user_dn, user_attrs, LDB_FLAG_MOD_ADD); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_set_entry_attr failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_set_entry_attr failed.\n"); goto done; } } else { - DEBUG(SSSDBG_MINOR_FAILURE, ("Original DN not available for group " \ + DEBUG(SSSDBG_MINOR_FAILURE, "Original DN not available for group " \ "[%s][%s].\n", grp_sid_str, - ldb_dn_get_linearized(group->msgs[0]->dn))); + ldb_dn_get_linearized(group->msgs[0]->dn)); }
done: diff --git a/src/responder/pac/pacsrv_utils.c b/src/responder/pac/pacsrv_utils.c index 05b53ed..befb9a1 100644 --- a/src/responder/pac/pacsrv_utils.c +++ b/src/responder/pac/pacsrv_utils.c @@ -86,7 +86,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, char *primary_group_sid_str = NULL;
if (pac_ctx == NULL || logon_info == NULL || _sid_table == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing parameter.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing parameter.\n"); return EINVAL; }
@@ -96,7 +96,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, info3->sidcount + info3->base.groups.count + 2, &sid_table); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_hash_create failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_hash_create failed.\n"); goto done; }
@@ -106,7 +106,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, err = sss_idmap_smb_sid_to_sid(pac_ctx->idmap_ctx, info3->base.domain_sid, &user_dom_sid_str); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_idmap_smb_sid_to_sid failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_idmap_smb_sid_to_sid failed.\n"); ret = EFAULT; goto done; } @@ -114,7 +114,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, ret = responder_get_domain_by_id(pac_ctx->rctx, user_dom_sid_str, &user_dom); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("responder_get_domain_by_id failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "responder_get_domain_by_id failed.\n"); ret = EINVAL; goto done; } @@ -122,7 +122,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, user_dom_sid_str_len = strlen(user_dom_sid_str); sid_str = talloc_zero_size(mem_ctx, user_dom_sid_str_len + 12); if (sid_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero_size failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero_size failed.\n"); ret = ENOMEM; goto done; } @@ -134,14 +134,14 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, ret = snprintf(rid_start, 12, "-%lu", (unsigned long) info3->base.rid); if (ret < 0 || ret > 12) { - DEBUG(SSSDBG_OP_FAILURE, ("snprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "snprintf failed.\n"); ret = EIO; goto done; }
user_sid_str = talloc_strdup(mem_ctx, sid_str); if (user_sid_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -158,8 +158,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
ret = hash_enter(sid_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed [%d][%s].\n", - ret, hash_error_string(ret))); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed [%d][%s].\n", + ret, hash_error_string(ret)); ret = EIO; goto done; } @@ -169,14 +169,14 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, ret = snprintf(rid_start, 12, "-%lu", (unsigned long) info3->base.primary_gid); if (ret < 0 || ret > 12) { - DEBUG(SSSDBG_OP_FAILURE, ("snprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "snprintf failed.\n"); ret = EIO; goto done; }
primary_group_sid_str = talloc_strdup(mem_ctx, sid_str); if (primary_group_sid_str == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -193,8 +193,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
ret = hash_enter(sid_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed [%d][%s].\n", - ret, hash_error_string(ret))); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed [%d][%s].\n", + ret, hash_error_string(ret)); ret = EIO; goto done; } @@ -205,7 +205,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, ret = snprintf(rid_start, 12, "-%lu", (unsigned long) info3->base.groups.rids[s].rid); if (ret < 0 || ret > 12) { - DEBUG(SSSDBG_OP_FAILURE, ("snprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "snprintf failed.\n"); ret = EIO; goto done; } @@ -223,8 +223,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
ret = hash_enter(sid_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed [%d][%s].\n", - ret, hash_error_string(ret))); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed [%d][%s].\n", + ret, hash_error_string(ret)); ret = EIO; goto done; } @@ -237,7 +237,7 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx, err = sss_idmap_smb_sid_to_sid(pac_ctx->idmap_ctx, info3->sids[s].sid, &sid_str); if (err != IDMAP_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_idmap_smb_sid_to_sid failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_idmap_smb_sid_to_sid failed.\n"); ret = EFAULT; goto done; } @@ -258,8 +258,8 @@ errno_t get_sids_from_pac(TALLOC_CTX *mem_ctx,
ret = hash_enter(sid_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_enter failed [%d][%s].\n", - ret, hash_error_string(ret))); + DEBUG(SSSDBG_OP_FAILURE, "hash_enter failed [%d][%s].\n", + ret, hash_error_string(ret)); ret = EIO; goto done; } @@ -305,20 +305,20 @@ errno_t get_data_from_pac(TALLOC_CTX *mem_ctx,
ndr_pull = ndr_pull_init_blob(&blob, mem_ctx); if (ndr_pull == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("ndr_pull_init_blob failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "ndr_pull_init_blob failed.\n"); return ENOMEM; } ndr_pull->flags |= LIBNDR_FLAG_REF_ALLOC; /* FIXME: is this really needed ? */
pac_data = talloc_zero(mem_ctx, struct PAC_DATA); if (pac_data == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); return ENOMEM; }
ndr_err = ndr_pull_PAC_DATA(ndr_pull, NDR_SCALARS|NDR_BUFFERS, pac_data); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - DEBUG(SSSDBG_OP_FAILURE, ("ndr_pull_PAC_DATA failed [%d]\n", ndr_err)); + DEBUG(SSSDBG_OP_FAILURE, "ndr_pull_PAC_DATA failed [%d]\n", ndr_err); return EBADMSG; }
@@ -360,19 +360,19 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx,
pwd = talloc_zero(mem_ctx, struct passwd); if (pwd == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); return ENOMEM; }
base_info = &logon_info->info3.base;
if (base_info->account_name.size == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing account name in PAC.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing account name in PAC.\n"); ret = EINVAL; goto done; } if (base_info->rid == 0) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing user RID in PAC.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing user RID in PAC.\n"); ret = EINVAL; goto done; } @@ -381,7 +381,7 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx, * case names only, effectively making the domain case-insenvitive. */ lname = sss_tc_utf8_str_tolower(pwd, base_info->account_name.string); if (lname == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sss_tc_utf8_str_tolower failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sss_tc_utf8_str_tolower failed.\n"); ret = ENOMEM; goto done; } @@ -389,7 +389,7 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx, /* Subdomain use fully qualified names */ pwd->pw_name = sss_get_domain_name(pwd, lname, dom); if (!pwd->pw_name) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_sprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_sprintf failed.\n"); ret = ENOMEM; goto done; } @@ -398,12 +398,12 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx, key.str = user_sid_str; ret = hash_lookup(sid_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_lookup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "hash_lookup failed.\n"); ret = EIO; goto done; } if (value.type != HASH_VALUE_ULONG) { - DEBUG(SSSDBG_OP_FAILURE, ("Wrong value type.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Wrong value type.\n"); ret = EIO; goto done; } @@ -416,12 +416,12 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx, key.str = primary_group_sid_str; ret = hash_lookup(sid_table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(SSSDBG_OP_FAILURE, ("hash_lookup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "hash_lookup failed.\n"); ret = EIO; goto done; } if (value.type != HASH_VALUE_ULONG) { - DEBUG(SSSDBG_OP_FAILURE, ("Wrong value type.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Wrong value type.\n"); ret = EIO; goto done; } @@ -431,13 +431,13 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx, if (base_info->full_name.size != 0) { pwd->pw_gecos = talloc_strdup(pwd, base_info->full_name.string); if (pwd->pw_gecos == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } } else { - DEBUG(SSSDBG_OP_FAILURE, ("Missing full name in PAC, " - "gecos field will by empty.\n ")); + DEBUG(SSSDBG_OP_FAILURE, "Missing full name in PAC, " + "gecos field will by empty.\n "); }
/* Check if there is a special homedir template for sub-domains. If not a @@ -456,14 +456,14 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx,
attrs = sysdb_new_attrs(mem_ctx); if (attrs == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_new_attrs failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_new_attrs failed.\n"); ret = ENOMEM; goto done; }
uc_realm = get_uppercase_realm(mem_ctx, dom->name); if (uc_realm == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("get_uppercase_realm failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_uppercase_realm failed.\n"); ret = ENOMEM; goto done; } @@ -471,7 +471,7 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx, upn = talloc_asprintf(mem_ctx, "%s@%s", lname, uc_realm); talloc_free(uc_realm); if (upn == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_asprintf failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n"); ret = ENOMEM; goto done; } @@ -479,19 +479,19 @@ errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx, ret = sysdb_attrs_add_string(attrs, SYSDB_UPN, upn); talloc_free(upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_NAME_ALIAS, pwd->pw_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
ret = sysdb_attrs_add_string(attrs, SYSDB_SID_STR, user_sid_str); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_attrs_add_string failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_add_string failed.\n"); goto done; }
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c index e7776cb..ede668b 100644 --- a/src/responder/pam/pam_LOCAL_domain.c +++ b/src/responder/pam/pam_LOCAL_domain.c @@ -31,7 +31,7 @@
#define NULL_CHECK_OR_JUMP(var, msg, ret, err, label) do { \ if (var == NULL) { \ - DEBUG(1, (msg)); \ + DEBUG(1, msg); \ ret = (err); \ goto label; \ } \ @@ -39,7 +39,7 @@
#define NEQ_CHECK_OR_JUMP(var, val, msg, ret, err, label) do { \ if (var != (val)) { \ - DEBUG(1, (msg)); \ + DEBUG(1, msg); \ ret = (err); \ goto label; \ } \ @@ -168,7 +168,7 @@ static void do_pam_chauthtok(struct LOCAL_request *lreq) if (ret) { /* TODO: should we allow null passwords via a config option ? */ if (ret == ENOENT) { - DEBUG(1, ("Empty passwords are not allowed!\n")); + DEBUG(1, "Empty passwords are not allowed!\n"); } lreq->error = EINVAL; goto done; @@ -177,12 +177,12 @@ static void do_pam_chauthtok(struct LOCAL_request *lreq) ret = s3crypt_gen_salt(lreq, &salt); NEQ_CHECK_OR_JUMP(ret, EOK, ("Salt generation failed.\n"), lreq->error, ret, done); - DEBUG(4, ("Using salt [%s]\n", salt)); + DEBUG(4, "Using salt [%s]\n", salt);
ret = s3crypt_sha512(lreq, password, salt, &new_hash); NEQ_CHECK_OR_JUMP(ret, EOK, ("Hash generation failed.\n"), lreq->error, ret, done); - DEBUG(4, ("New hash [%s]\n", new_hash)); + DEBUG(4, "New hash [%s]\n", new_hash);
lreq->mod_attrs = sysdb_new_attrs(lreq); NULL_CHECK_OR_JUMP(lreq->mod_attrs, ("sysdb_new_attrs failed.\n"), @@ -229,7 +229,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) struct pam_data *pd = preq->pd; int ret;
- DEBUG(4, ("LOCAL pam handler.\n")); + DEBUG(4, "LOCAL pam handler.\n");
lreq = talloc_zero(preq, struct LOCAL_request); if (!lreq) { @@ -238,7 +238,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq)
lreq->dbctx = preq->domain->sysdb; if (lreq->dbctx == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); talloc_free(lreq); return ENOENT; } @@ -251,26 +251,26 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) ret = sysdb_get_user_attr(lreq, lreq->dbctx, preq->domain, preq->pd->user, attrs, &res); if (ret != EOK) { - DEBUG(1, ("sysdb_get_user_attr failed.\n")); + DEBUG(1, "sysdb_get_user_attr failed.\n"); talloc_free(lreq); return ret; }
if (res->count < 1) { - DEBUG(4, ("No user found with filter ["SYSDB_PWNAM_FILTER"]\n", - pd->user, pd->user)); + DEBUG(4, "No user found with filter ["SYSDB_PWNAM_FILTER"]\n", + pd->user, pd->user); pd->pam_status = PAM_USER_UNKNOWN; goto done; } else if (res->count > 1) { - DEBUG(4, ("More than one object found with filter ["SYSDB_PWNAM_FILTER"]\n", - pd->user, pd->user)); + DEBUG(4, "More than one object found with filter ["SYSDB_PWNAM_FILTER"]\n", + pd->user, pd->user); lreq->error = EFAULT; goto done; }
username = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_NAME, NULL); if (strcmp(username, pd->user) != 0) { - DEBUG(1, ("Expected username [%s] get [%s].\n", pd->user, username)); + DEBUG(1, "Expected username [%s] get [%s].\n", pd->user, username); lreq->error = EINVAL; goto done; } @@ -285,7 +285,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) pd->cmd == SSS_PAM_CHAUTHTOK_PRELIM) && lreq->preq->cctx->priv == 1) { /* TODO: maybe this is a candiate for an explicit audit message. */ - DEBUG(4, ("allowing root to reset a password.\n")); + DEBUG(4, "allowing root to reset a password.\n"); break; } ret = sss_authtok_get_password(pd->authtok, &password, NULL); @@ -295,16 +295,16 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) pwdhash = ldb_msg_find_attr_as_string(res->msgs[0], SYSDB_PWD, NULL); NULL_CHECK_OR_JUMP(pwdhash, ("No password stored.\n"), lreq->error, LDB_ERR_NO_SUCH_ATTRIBUTE, done); - DEBUG(4, ("user: [%s], password hash: [%s]\n", username, pwdhash)); + DEBUG(4, "user: [%s], password hash: [%s]\n", username, pwdhash);
ret = s3crypt_sha512(lreq, password, pwdhash, &new_hash); NEQ_CHECK_OR_JUMP(ret, EOK, ("nss_sha512_crypt failed.\n"), lreq->error, ret, done);
- DEBUG(4, ("user: [%s], new hash: [%s]\n", username, new_hash)); + DEBUG(4, "user: [%s], new hash: [%s]\n", username, new_hash);
if (strcmp(new_hash, pwdhash) != 0) { - DEBUG(1, ("Passwords do not match.\n")); + DEBUG(1, "Passwords do not match.\n"); do_failed_login(lreq); goto done; } @@ -332,7 +332,7 @@ int LOCAL_pam_handler(struct pam_auth_req *preq) break; default: lreq->error = EINVAL; - DEBUG(SSSDBG_CRIT_FAILURE, ("Unknown PAM task [%d].\n", pd->cmd)); + DEBUG(SSSDBG_CRIT_FAILURE, "Unknown PAM task [%d].\n", pd->cmd); }
done: diff --git a/src/responder/pam/pam_helpers.c b/src/responder/pam/pam_helpers.c index d2068e5..1b94f7a 100644 --- a/src/responder/pam/pam_helpers.c +++ b/src/responder/pam/pam_helpers.c @@ -68,14 +68,14 @@ errno_t pam_initgr_cache_set(struct tevent_context *ev, hret = hash_enter(id_table, &key, &val); if (hret != HASH_SUCCESS) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not update initgr cache for [%s]: [%s]\n", - name, hash_error_string(hret))); + "Could not update initgr cache for [%s]: [%s]\n", + name, hash_error_string(hret)); ret = EIO; goto done; } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("[%s] added to PAM initgroup cache\n", - name)); + "[%s] added to PAM initgroup cache\n", + name); }
/* Create a timer event to remove the entry from the cache */ @@ -115,13 +115,13 @@ static void pam_initgr_cache_remove(struct tevent_context *ev, if (hret != HASH_SUCCESS && hret != HASH_ERROR_KEY_NOT_FOUND) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not clear [%s] from initgr cache: [%s]\n", + "Could not clear [%s] from initgr cache: [%s]\n", table_ctx->name, - hash_error_string(hret))); + hash_error_string(hret)); } else { DEBUG(SSSDBG_TRACE_INTERNAL, - ("[%s] removed from PAM initgroup cache\n", - table_ctx->name)); + "[%s] removed from PAM initgroup cache\n", + table_ctx->name); }
talloc_free(table_ctx); diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c index fad564a..8473ba5 100644 --- a/src/responder/pam/pamsrv.c +++ b/src/responder/pam/pamsrv.c @@ -82,7 +82,7 @@ static void pam_dp_reconnect_init(struct sbus_connection *conn, int status, void
/* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(1, ("Reconnected to the Data Provider.\n")); + DEBUG(1, "Reconnected to the Data Provider.\n");
/* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -96,8 +96,8 @@ static void pam_dp_reconnect_init(struct sbus_connection *conn, int status, void }
/* Handle failure */ - DEBUG(0, ("Could not reconnect to %s provider.\n", - be_conn->domain->name)); + DEBUG(0, "Could not reconnect to %s provider.\n", + be_conn->domain->name);
/* FIXME: kill the frontend and let the monitor restart it ? */ /* pam_shutdown(rctx); */ @@ -127,7 +127,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, "PAM", &pam_dp_interface, &rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n"); return ret; }
@@ -147,7 +147,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, ret = confdb_get_int(pctx->rctx->cdb, CONFDB_PAM_CONF_ENTRY, CONFDB_SERVICE_RECON_RETRIES, 3, &max_retries); if (ret != EOK) { - DEBUG(0, ("Failed to set up automatic reconnection\n")); + DEBUG(0, "Failed to set up automatic reconnection\n"); goto done; }
@@ -172,7 +172,7 @@ static int pam_process_init(TALLOC_CTX *mem_ctx,
ret = sss_ncache_init(pctx, &pctx->ncache); if (ret != EOK) { - DEBUG(0, ("fatal error initializing negative cache\n")); + DEBUG(0, "fatal error initializing negative cache\n"); goto done; }
@@ -185,8 +185,8 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, ret = sss_hash_create(pctx, 10, &pctx->id_table); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not create initgroups hash table: [%s]", - strerror(ret))); + "Could not create initgroups hash table: [%s]", + strerror(ret)); goto done; }
@@ -198,14 +198,14 @@ static int pam_process_init(TALLOC_CTX *mem_ctx, &fd_limit); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set up file descriptor limit\n")); + "Failed to set up file descriptor limit\n"); goto done; } responder_set_fd_limit(fd_limit);
ret = schedule_get_domains_task(rctx, rctx->ev, rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("schedule_get_domains_tasks failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n"); goto done; }
@@ -258,7 +258,7 @@ int main(int argc, const char *argv[]) ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(2, ("Could not set up to exit when parent process does\n")); + DEBUG(2, "Could not set up to exit when parent process does\n"); }
ret = pam_process_init(main_ctx, diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index 32efc4b..579c7a0 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -120,12 +120,12 @@ static int pd_set_primary_name(const struct ldb_message *msg,struct pam_data *pd
name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); if (!name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("A user with no name?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "A user with no name?\n"); return EIO; }
if (strcmp(pd->user, name)) { - DEBUG(SSSDBG_TRACE_FUNC, ("User's primary name is %s\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "User's primary name is %s\n", name); talloc_free(pd->user); pd->user = talloc_strdup(pd, name); if (!pd->user) return ENOMEM; @@ -149,7 +149,7 @@ static int pam_parse_in_data_v2(struct sss_domain_info *domains, if (blen < 4*sizeof(uint32_t)+2 || ((uint32_t *)body)[0] != SSS_START_OF_PAM_REQUEST || memcmp(&body[blen - sizeof(uint32_t)], &terminator, sizeof(uint32_t)) != 0) { - DEBUG(1, ("Received data is invalid.\n")); + DEBUG(1, "Received data is invalid.\n"); return EINVAL; }
@@ -164,7 +164,7 @@ static int pam_parse_in_data_v2(struct sss_domain_info *domains, /* the uint32_t end maker SSS_END_OF_PAM_REQUEST does not count to * the remaining buffer */ if (size > (blen - c - sizeof(uint32_t))) { - DEBUG(1, ("Invalid data size.\n")); + DEBUG(1, "Invalid data size.\n"); return EINVAL; }
@@ -210,7 +210,7 @@ static int pam_parse_in_data_v2(struct sss_domain_info *domains, if (ret != EOK) return ret; break; default: - DEBUG(1,("Ignoring unknown data type [%d].\n", type)); + DEBUG(1,"Ignoring unknown data type [%d].\n", type); c += size; } } @@ -234,12 +234,12 @@ static int pam_parse_in_data_v3(struct sss_domain_info *domains,
ret = pam_parse_in_data_v2(domains, default_domain, pd, body, blen); if (ret != EOK) { - DEBUG(1, ("pam_parse_in_data_v2 failed.\n")); + DEBUG(1, "pam_parse_in_data_v2 failed.\n"); return ret; }
if (pd->cli_pid == 0) { - DEBUG(1, ("Missing client PID.\n")); + DEBUG(1, "Missing client PID.\n"); return EINVAL; }
@@ -314,12 +314,12 @@ static int pam_parse_in_data(struct sss_domain_info *domains,
ret = extract_authtok_v1(pd->authtok, body, blen, &end); if (ret) { - DEBUG(1, ("Invalid auth token\n")); + DEBUG(1, "Invalid auth token\n"); return ret; } ret = extract_authtok_v1(pd->newauthtok, body, blen, &end); if (ret) { - DEBUG(1, ("Invalid new auth token\n")); + DEBUG(1, "Invalid new auth token\n"); return ret; }
@@ -354,7 +354,7 @@ static errno_t set_last_login(struct pam_auth_req *preq) ret = sysdb_set_user_attr(preq->domain->sysdb, preq->domain, preq->pd->user, attrs, SYSDB_MOD_REP); if (ret != EOK) { - DEBUG(2, ("set_last_login failed.\n")); + DEBUG(2, "set_last_login failed.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; goto fail; } else { @@ -381,7 +381,7 @@ static errno_t filter_responses(struct confdb_ctx *cdb, CONFDB_PAM_VERBOSITY, DEFAULT_PAM_VERBOSITY, &pam_verbosity); if (ret != EOK) { - DEBUG(1, ("Failed to read PAM verbosity, not fatal.\n")); + DEBUG(1, "Failed to read PAM verbosity, not fatal.\n"); pam_verbosity = DEFAULT_PAM_VERBOSITY; }
@@ -389,7 +389,7 @@ static errno_t filter_responses(struct confdb_ctx *cdb, while(resp != NULL) { if (resp->type == SSS_PAM_USER_INFO) { if (resp->len < sizeof(uint32_t)) { - DEBUG(1, ("User info entry is too short.\n")); + DEBUG(1, "User info entry is too short.\n"); return EINVAL; }
@@ -405,8 +405,8 @@ static errno_t filter_responses(struct confdb_ctx *cdb, switch (user_info_type) { case SSS_PAM_USER_INFO_OFFLINE_AUTH: if (resp->len != sizeof(uint32_t) + sizeof(int64_t)) { - DEBUG(1, ("User info offline auth entry is " - "too short.\n")); + DEBUG(1, "User info offline auth entry is " + "too short.\n"); return EINVAL; } memcpy(&expire_date, resp->data + sizeof(uint32_t), @@ -421,8 +421,8 @@ static errno_t filter_responses(struct confdb_ctx *cdb, break; default: DEBUG(SSSDBG_TRACE_LIBS, - ("User info type [%d] not filtered.\n", - user_info_type)); + "User info type [%d] not filtered.\n", + user_info_type); } } else if (resp->type & SSS_SERVER_INFO) { resp->do_not_send_to_client = true; @@ -439,7 +439,7 @@ static void pam_reply_delay(struct tevent_context *ev, struct tevent_timer *te, { struct pam_auth_req *preq;
- DEBUG(4, ("pam_reply_delay get called.\n")); + DEBUG(4, "pam_reply_delay get called.\n");
preq = talloc_get_type(pvt, struct pam_auth_req);
@@ -474,7 +474,7 @@ static void pam_reply(struct pam_auth_req *preq)
DEBUG(SSSDBG_FUNC_DATA, - ("pam_reply called with result [%d].\n", pd->pam_status)); + "pam_reply called with result [%d].\n", pd->pam_status);
if (pd->pam_status == PAM_AUTHINFO_UNAVAIL) { switch(pd->cmd) { @@ -488,14 +488,14 @@ static void pam_reply(struct pam_auth_req *preq) pd->offline_auth = true;
if (preq->domain->sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for domain" - " [%s]!\n", preq->domain->name)); + DEBUG(0, "Fatal: Sysdb CTX not found for domain" + " [%s]!\n", preq->domain->name); goto done; }
ret = sss_authtok_get_password(pd->authtok, &password, NULL); if (ret) { - DEBUG(0, ("Failed to get password.\n")); + DEBUG(0, "Failed to get password.\n"); goto done; }
@@ -510,13 +510,13 @@ static void pam_reply(struct pam_auth_req *preq) break; case SSS_PAM_CHAUTHTOK_PRELIM: case SSS_PAM_CHAUTHTOK: - DEBUG(5, ("Password change not possible while offline.\n")); + DEBUG(5, "Password change not possible while offline.\n"); pd->pam_status = PAM_AUTHTOK_ERR; user_info_type = SSS_PAM_USER_INFO_OFFLINE_CHPASS; ret = pam_add_response(pd, SSS_PAM_USER_INFO, sizeof(uint32_t), (const uint8_t *) &user_info_type); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); goto done; } break; @@ -526,12 +526,12 @@ static void pam_reply(struct pam_auth_req *preq) case SSS_PAM_ACCT_MGMT: case SSS_PAM_OPEN_SESSION: case SSS_PAM_CLOSE_SESSION: - DEBUG(2, ("Assuming offline authentication setting status for " - "pam call %d to PAM_SUCCESS.\n", pd->cmd)); + DEBUG(2, "Assuming offline authentication setting status for " + "pam call %d to PAM_SUCCESS.\n", pd->cmd); pd->pam_status = PAM_SUCCESS; break; default: - DEBUG(1, ("Unknown PAM call [%d].\n", pd->cmd)); + DEBUG(1, "Unknown PAM call [%d].\n", pd->cmd); pd->pam_status = PAM_MODULE_UNKNOWN; } } @@ -539,8 +539,8 @@ static void pam_reply(struct pam_auth_req *preq) if (pd->response_delay > 0) { ret = gettimeofday(&tv, NULL); if (ret != EOK) { - DEBUG(1, ("gettimeofday failed [%d][%s].\n", - errno, strerror(errno))); + DEBUG(1, "gettimeofday failed [%d][%s].\n", + errno, strerror(errno)); goto done; } tv.tv_sec += pd->response_delay; @@ -549,7 +549,7 @@ static void pam_reply(struct pam_auth_req *preq)
te = tevent_add_timer(cctx->ev, cctx, tv, pam_reply_delay, preq); if (te == NULL) { - DEBUG(1, ("Failed to add event pam_reply_delay.\n")); + DEBUG(1, "Failed to add event pam_reply_delay.\n"); goto done; }
@@ -578,14 +578,14 @@ static void pam_reply(struct pam_auth_req *preq)
ret = filter_responses(pctx->rctx->cdb, pd->resp_list); if (ret != EOK) { - DEBUG(1, ("filter_responses failed, not fatal.\n")); + DEBUG(1, "filter_responses failed, not fatal.\n"); }
if (pd->domain != NULL) { ret = pam_add_response(pd, SSS_PAM_DOMAIN_NAME, strlen(pd->domain)+1, (uint8_t *) pd->domain); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); goto done; } } @@ -610,7 +610,7 @@ static void pam_reply(struct pam_auth_req *preq) }
sss_packet_get_body(cctx->creq->out, &body, &blen); - DEBUG(SSSDBG_FUNC_DATA, ("blen: %zu\n", blen)); + DEBUG(SSSDBG_FUNC_DATA, "blen: %zu\n", blen); p = 0;
memcpy(&body[p], &pd->pam_status, sizeof(int32_t)); @@ -653,7 +653,7 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, resp_len = sizeof(uint32_t) + sizeof(int64_t); resp = talloc_size(preq->pd, resp_len); if (resp == NULL) { - DEBUG(1, ("talloc_size failed, cannot prepare user info.\n")); + DEBUG(1, "talloc_size failed, cannot prepare user info.\n"); } else { memcpy(resp, &resp_type, sizeof(uint32_t)); dummy = (int64_t) expire_date; @@ -661,7 +661,7 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, ret = pam_add_response(preq->pd, SSS_PAM_USER_INFO, resp_len, (const uint8_t *) resp); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } } break; @@ -671,7 +671,7 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, resp_len = sizeof(uint32_t) + sizeof(int64_t); resp = talloc_size(preq->pd, resp_len); if (resp == NULL) { - DEBUG(1, ("talloc_size failed, cannot prepare user info.\n")); + DEBUG(1, "talloc_size failed, cannot prepare user info.\n"); } else { memcpy(resp, &resp_type, sizeof(uint32_t)); dummy = (int64_t) delayed_until; @@ -679,14 +679,14 @@ static void pam_handle_cached_login(struct pam_auth_req *preq, int ret, ret = pam_add_response(preq->pd, SSS_PAM_USER_INFO, resp_len, (const uint8_t *) resp); if (ret != EOK) { - DEBUG(1, ("pam_add_response failed.\n")); + DEBUG(1, "pam_add_response failed.\n"); } } } break; default: DEBUG(SSSDBG_TRACE_LIBS, - ("cached login returned: %d\n", preq->pd->pam_status)); + "cached login returned: %d\n", preq->pd->pam_status); }
pam_reply(preq); @@ -714,7 +714,7 @@ errno_t pam_forwarder_parse_data(struct cli_ctx *cctx, struct pam_data *pd) sss_packet_get_body(cctx->creq->in, &body, &blen); if (blen >= sizeof(uint32_t) && memcmp(&body[blen - sizeof(uint32_t)], &terminator, sizeof(uint32_t)) != 0) { - DEBUG(1, ("Received data not terminated.\n")); + DEBUG(1, "Received data not terminated.\n"); ret = EINVAL; goto done; } @@ -736,8 +736,8 @@ errno_t pam_forwarder_parse_data(struct cli_ctx *cctx, struct pam_data *pd) body, blen); break; default: - DEBUG(1, ("Illegal protocol version [%d].\n", - cctx->cli_protocol_version->version)); + DEBUG(1, "Illegal protocol version [%d].\n", + cctx->cli_protocol_version->version); ret = EINVAL; }
@@ -831,8 +831,8 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd)
/* Try the next domain */ DEBUG(SSSDBG_TRACE_FUNC, - ("User [%s@%s] filtered out (negative cache). " - "Trying next domain.\n", pd->user, dom->name)); + "User [%s@%s] filtered out (negative cache). " + "Trying next domain.\n", pd->user, dom->name); } if (!dom) { ret = ENOENT; @@ -842,7 +842,7 @@ static int pam_forwarder(struct cli_ctx *cctx, int pam_cmd) }
if (preq->domain->provider == NULL) { - DEBUG(1, ("Domain [%s] has no auth provider.\n", preq->domain->name)); + DEBUG(1, "Domain [%s] has no auth provider.\n", preq->domain->name); ret = EINVAL; goto done; } @@ -945,7 +945,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not look up initgroup timout\n")); + "Could not look up initgroup timout\n"); return EIO; } else if (ret == ENOENT) { /* Call provider first */ @@ -954,23 +954,23 @@ static int pam_check_user_search(struct pam_auth_req *preq) /* Entry is still valid, get it from the sysdb */ }
- DEBUG(4, ("Requesting info for [%s@%s]\n", name, dom->name)); + DEBUG(4, "Requesting info for [%s@%s]\n", name, dom->name);
sysdb = dom->sysdb; if (sysdb == NULL) { - DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n")); + DEBUG(0, "Fatal: Sysdb CTX not found for this domain!\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; return EFAULT; }
ret = sysdb_getpwnam(preq, sysdb, dom, name, &preq->res); if (ret != EOK) { - DEBUG(1, ("Failed to make request to our cache!\n")); + DEBUG(1, "Failed to make request to our cache!\n"); return EIO; }
if (preq->res->count > 1) { - DEBUG(0, ("getpwnam call returned more than one result !?!\n")); + DEBUG(0, "getpwnam call returned more than one result !?!\n"); return ENOENT; }
@@ -981,8 +981,8 @@ static int pam_check_user_search(struct pam_auth_req *preq) if (ret != EOK) { /* Should not be fatal, just slower next time */ DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot set ncache for [%s@%s]\n", name, - dom->name)); + "Cannot set ncache for [%s@%s]\n", name, + dom->name); } }
@@ -992,7 +992,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) continue; }
- DEBUG(2, ("No results for getpwnam call\n")); + DEBUG(2, "No results for getpwnam call\n");
/* TODO: store negative cache ? */
@@ -1010,12 +1010,12 @@ static int pam_check_user_search(struct pam_auth_req *preq) } }
- DEBUG(6, ("Returning info for user [%s@%s]\n", name, dom->name)); + DEBUG(6, "Returning info for user [%s@%s]\n", name, dom->name);
/* We might have searched by alias. Pass on the primary name */ ret = pd_set_primary_name(preq->res->msgs[0], preq->pd); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not canonicalize username\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not canonicalize username\n"); return ret; }
@@ -1039,7 +1039,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) name, 0, NULL); if (!dpreq) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending data provider request\n")); + "Out of memory sending data provider request\n"); return ENOMEM; }
@@ -1061,7 +1061,7 @@ static int pam_check_user_search(struct pam_auth_req *preq) }
DEBUG(SSSDBG_MINOR_FAILURE, - ("No matching domain found for [%s], fail!\n", preq->pd->user)); + "No matching domain found for [%s], fail!\n", preq->pd->user); return ENOENT; }
@@ -1081,7 +1081,7 @@ static void pam_dp_send_acct_req_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Fatal error, killing connection!\n")); + "Fatal error, killing connection!\n"); talloc_free(cb_ctx->cctx); return; } @@ -1123,9 +1123,9 @@ static void pam_check_user_dp_callback(uint16_t err_maj, uint32_t err_min, char *name;
if (err_maj) { - DEBUG(2, ("Unable to get information from Data Provider\n" + DEBUG(2, "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); }
ret = pam_check_user_search(preq); @@ -1144,8 +1144,8 @@ static void pam_check_user_dp_callback(uint16_t err_maj, uint32_t err_min, talloc_free(name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not save initgr timestamp. " - "Proceeding with PAM actions\n")); + "Could not save initgr timestamp. " + "Proceeding with PAM actions\n"); /* This is non-fatal, we'll just end up going to the * data provider again next time. */ @@ -1178,7 +1178,7 @@ static void pam_dom_forwarder(struct pam_auth_req *preq) else { preq->callback = pam_reply; ret = pam_dp_send_req(preq, SSS_CLI_SOCKET_TIMEOUT/2); - DEBUG(4, ("pam_dp_send_req returned %d\n", ret)); + DEBUG(4, "pam_dp_send_req returned %d\n", ret); }
if (ret != EOK) { @@ -1188,37 +1188,37 @@ static void pam_dom_forwarder(struct pam_auth_req *preq) }
static int pam_cmd_authenticate(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_authenticate\n")); + DEBUG(4, "entering pam_cmd_authenticate\n"); return pam_forwarder(cctx, SSS_PAM_AUTHENTICATE); }
static int pam_cmd_setcred(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_setcred\n")); + DEBUG(4, "entering pam_cmd_setcred\n"); return pam_forwarder(cctx, SSS_PAM_SETCRED); }
static int pam_cmd_acct_mgmt(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_acct_mgmt\n")); + DEBUG(4, "entering pam_cmd_acct_mgmt\n"); return pam_forwarder(cctx, SSS_PAM_ACCT_MGMT); }
static int pam_cmd_open_session(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_open_session\n")); + DEBUG(4, "entering pam_cmd_open_session\n"); return pam_forwarder(cctx, SSS_PAM_OPEN_SESSION); }
static int pam_cmd_close_session(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_close_session\n")); + DEBUG(4, "entering pam_cmd_close_session\n"); return pam_forwarder(cctx, SSS_PAM_CLOSE_SESSION); }
static int pam_cmd_chauthtok(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_chauthtok\n")); + DEBUG(4, "entering pam_cmd_chauthtok\n"); return pam_forwarder(cctx, SSS_PAM_CHAUTHTOK); }
static int pam_cmd_chauthtok_prelim(struct cli_ctx *cctx) { - DEBUG(4, ("entering pam_cmd_chauthtok_prelim\n")); + DEBUG(4, "entering pam_cmd_chauthtok_prelim\n"); return pam_forwarder(cctx, SSS_PAM_CHAUTHTOK_PRELIM); }
diff --git a/src/responder/pam/pamsrv_dp.c b/src/responder/pam/pamsrv_dp.c index d5a5244..a35627e 100644 --- a/src/responder/pam/pamsrv_dp.c +++ b/src/responder/pam/pamsrv_dp.c @@ -50,7 +50,7 @@ static void pam_dp_process_reply(DBusPendingCall *pending, void *ptr) /* Check if the client still exists. If not, simply free all the resources * and quit */ if (preq == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Client already disconnected\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Client already disconnected\n"); dbus_pending_call_unref(pending); dbus_message_unref(msg); return; @@ -58,8 +58,8 @@ static void pam_dp_process_reply(DBusPendingCall *pending, void *ptr)
/* Sanity-check of message validity */ if (msg == NULL) { - DEBUG(0, ("Severe error. A reply callback was called but no reply was" - "received and no timeout occurred\n")); + DEBUG(0, "Severe error. A reply callback was called but no reply was" + "received and no timeout occurred\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; goto done; } @@ -69,18 +69,18 @@ static void pam_dp_process_reply(DBusPendingCall *pending, void *ptr) case DBUS_MESSAGE_TYPE_METHOD_RETURN: ret = dp_unpack_pam_response(msg, preq->pd, &dbus_error); if (!ret) { - DEBUG(0, ("Failed to parse reply.\n")); + DEBUG(0, "Failed to parse reply.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; goto done; } - DEBUG(4, ("received: [%d][%s]\n", preq->pd->pam_status, preq->pd->domain)); + DEBUG(4, "received: [%d][%s]\n", preq->pd->pam_status, preq->pd->domain); break; case DBUS_MESSAGE_TYPE_ERROR: - DEBUG(0, ("Reply error.\n")); + DEBUG(0, "Reply error.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; break; default: - DEBUG(0, ("Default... what now?.\n")); + DEBUG(0, "Default... what now?.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; }
@@ -118,9 +118,9 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout) preq->domain->conn_name, &be_conn); if (res != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("The Data Provider connection for %s is not available!" + "The Data Provider connection for %s is not available!" " This maybe a bug, it shouldn't happen!\n", - preq->domain->conn_name)); + preq->domain->conn_name); return EIO; }
@@ -129,17 +129,17 @@ int pam_dp_send_req(struct pam_auth_req *preq, int timeout) DP_INTERFACE, DP_METHOD_PAMHANDLER); if (msg == NULL) { - DEBUG(0,("Out of memory?!\n")); + DEBUG(0,"Out of memory?!\n"); return ENOMEM; }
- DEBUG(4, ("Sending request with the following data:\n")); + DEBUG(4, "Sending request with the following data:\n"); DEBUG_PAM_DATA(4, pd);
ret = dp_pack_pam_request(msg, pd); if (!ret) { - DEBUG(1,("Failed to build message\n")); + DEBUG(1,"Failed to build message\n"); return EIO; }
diff --git a/src/responder/ssh/sshsrv.c b/src/responder/ssh/sshsrv.c index a1d1f6c..ea943af 100644 --- a/src/responder/ssh/sshsrv.c +++ b/src/responder/ssh/sshsrv.c @@ -63,7 +63,7 @@ static void ssh_dp_reconnect_init(struct sbus_connection *conn,
/* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(SSSDBG_TRACE_FUNC, ("Reconnected to the Data Provider.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reconnected to the Data Provider.\n");
/* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -77,8 +77,8 @@ static void ssh_dp_reconnect_init(struct sbus_connection *conn, }
/* Failed to reconnect */ - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not reconnect to %s provider.\n", - be_conn->domain->name)); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not reconnect to %s provider.\n", + be_conn->domain->name); }
int ssh_process_init(TALLOC_CTX *mem_ctx, @@ -104,13 +104,13 @@ int ssh_process_init(TALLOC_CTX *mem_ctx, &ssh_dp_interface, &rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n"); return ret; }
ssh_ctx = talloc_zero(rctx, struct ssh_ctx); if (!ssh_ctx) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing ssh_ctx\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing ssh_ctx\n"); ret = ENOMEM; goto fail; } @@ -122,7 +122,7 @@ int ssh_process_init(TALLOC_CTX *mem_ctx, "(?P<name>[^@]+)@?(?P<domain>[^@]*$)", "%1$s@%2$s", &ssh_ctx->snctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing regex data\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing regex data\n"); goto fail; }
@@ -133,7 +133,7 @@ int ssh_process_init(TALLOC_CTX *mem_ctx, 3, &max_retries); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set up automatic reconnection\n")); + "Failed to set up automatic reconnection\n"); goto fail; }
@@ -150,8 +150,8 @@ int ssh_process_init(TALLOC_CTX *mem_ctx, CONFDB_DEFAULT_SSH_HASH_KNOWN_HOSTS, &ssh_ctx->hash_known_hosts); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n", + ret, strerror(ret)); goto fail; }
@@ -161,18 +161,18 @@ int ssh_process_init(TALLOC_CTX *mem_ctx, CONFDB_DEFAULT_SSH_KNOWN_HOSTS_TIMEOUT, &ssh_ctx->known_hosts_timeout); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n", + ret, strerror(ret)); goto fail; }
ret = schedule_get_domains_task(rctx, rctx->ev, rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("schedule_get_domains_tasks failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("SSH Initialization complete\n")); + DEBUG(SSSDBG_TRACE_FUNC, "SSH Initialization complete\n");
return EOK;
@@ -223,8 +223,8 @@ int main(int argc, const char *argv[]) ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(SSSDBG_OP_FAILURE, ("Could not set up to exit " - "when parent process does\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set up to exit " + "when parent process does\n"); }
ret = ssh_process_init(main_ctx, diff --git a/src/responder/ssh/sshsrv_cmd.c b/src/responder/ssh/sshsrv_cmd.c index efa4513..ff7afd4 100644 --- a/src/responder/ssh/sshsrv_cmd.c +++ b/src/responder/ssh/sshsrv_cmd.c @@ -62,8 +62,8 @@ sss_ssh_cmd_get_user_pubkeys(struct cli_ctx *cctx) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting SSH user public keys for [%s] from [%s]\n", - cmd_ctx->name, cmd_ctx->domname ? cmd_ctx->domname : "<ALL>")); + "Requesting SSH user public keys for [%s] from [%s]\n", + cmd_ctx->name, cmd_ctx->domname ? cmd_ctx->domname : "<ALL>");
if (strcmp(cmd_ctx->name, "root") == 0) { ret = ENOENT; @@ -112,9 +112,9 @@ sss_ssh_cmd_get_host_pubkeys(struct cli_ctx *cctx) }
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting SSH host public keys for [%s][%s] from [%s]\n", + "Requesting SSH host public keys for [%s][%s] from [%s]\n", cmd_ctx->name, cmd_ctx->alias ? cmd_ctx->alias : "", - cmd_ctx->domname ? cmd_ctx->domname : "<ALL>")); + cmd_ctx->domname ? cmd_ctx->domname : "<ALL>");
if (cmd_ctx->domname) { cmd_ctx->domain = responder_get_domain(cctx->rctx, cmd_ctx->domname); @@ -150,7 +150,7 @@ ssh_dp_send_req_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Fatal error, killing connection!\n")); + "Fatal error, killing connection!\n"); talloc_free(cb_ctx->cctx); return; } @@ -180,7 +180,7 @@ ssh_user_pubkeys_search(struct ssh_cmd_ctx *cmd_ctx)
if (!cmd_ctx->domain) { DEBUG(SSSDBG_OP_FAILURE, - ("No matching domain found for [%s], fail!\n", cmd_ctx->name)); + "No matching domain found for [%s], fail!\n", cmd_ctx->name); return ENOENT; }
@@ -191,7 +191,7 @@ ssh_user_pubkeys_search(struct ssh_cmd_ctx *cmd_ctx) cmd_ctx->name, 0, NULL); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending data provider request\n")); + "Out of memory sending data provider request\n"); return ENOMEM; }
@@ -224,13 +224,13 @@ ssh_user_pubkeys_search_next(struct ssh_cmd_ctx *cmd_ctx) struct ldb_result *res;
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting SSH user public keys for [%s@%s]\n", - cmd_ctx->name, cmd_ctx->domain->name)); + "Requesting SSH user public keys for [%s@%s]\n", + cmd_ctx->name, cmd_ctx->domain->name);
sysdb = cmd_ctx->domain->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Fatal: Sysdb CTX not found for this domain!\n")); + "Fatal: Sysdb CTX not found for this domain!\n"); return EFAULT; }
@@ -238,14 +238,14 @@ ssh_user_pubkeys_search_next(struct ssh_cmd_ctx *cmd_ctx) cmd_ctx->name, attrs, &res); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to make request to our cache!\n")); + "Failed to make request to our cache!\n"); return EIO; }
if (res->count > 1) { DEBUG(SSSDBG_FATAL_FAILURE, - ("User search by name (%s) returned > 1 results!\n", - cmd_ctx->name)); + "User search by name (%s) returned > 1 results!\n", + cmd_ctx->name); return EINVAL; }
@@ -257,7 +257,7 @@ ssh_user_pubkeys_search_next(struct ssh_cmd_ctx *cmd_ctx) }
DEBUG(SSSDBG_OP_FAILURE, - ("No attributes for user [%s] found.\n", cmd_ctx->name)); + "No attributes for user [%s] found.\n", cmd_ctx->name);
return ENOENT; } @@ -279,9 +279,9 @@ ssh_user_pubkeys_search_dp_callback(uint16_t err_maj,
if (err_maj) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to get information from Data Provider\n" + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); }
ret = ssh_user_pubkeys_search_next(cmd_ctx); @@ -304,7 +304,7 @@ ssh_host_pubkeys_search(struct ssh_cmd_ctx *cmd_ctx)
if (!cmd_ctx->domain) { DEBUG(SSSDBG_OP_FAILURE, - ("No matching domain found for [%s], fail!\n", cmd_ctx->name)); + "No matching domain found for [%s], fail!\n", cmd_ctx->name); return ENOENT; }
@@ -315,7 +315,7 @@ ssh_host_pubkeys_search(struct ssh_cmd_ctx *cmd_ctx) cmd_ctx->name, cmd_ctx->alias); if (!req) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending data provider request\n")); + "Out of memory sending data provider request\n"); return ENOMEM; }
@@ -347,13 +347,13 @@ ssh_host_pubkeys_search_next(struct ssh_cmd_ctx *cmd_ctx) const char *attrs[] = { SYSDB_NAME, SYSDB_SSH_PUBKEY, NULL };
DEBUG(SSSDBG_TRACE_FUNC, - ("Requesting SSH host public keys for [%s@%s]\n", - cmd_ctx->name, cmd_ctx->domain->name)); + "Requesting SSH host public keys for [%s@%s]\n", + cmd_ctx->name, cmd_ctx->domain->name);
sysdb = cmd_ctx->domain->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Fatal: Sysdb CTX not found for this domain!\n")); + "Fatal: Sysdb CTX not found for this domain!\n"); return EFAULT; }
@@ -361,7 +361,7 @@ ssh_host_pubkeys_search_next(struct ssh_cmd_ctx *cmd_ctx) cmd_ctx->name, attrs, &cmd_ctx->result); if (ret != EOK && ret != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to make request to our cache!\n")); + "Failed to make request to our cache!\n"); return EIO; }
@@ -373,7 +373,7 @@ ssh_host_pubkeys_search_next(struct ssh_cmd_ctx *cmd_ctx) }
DEBUG(SSSDBG_OP_FAILURE, - ("No attributes for host [%s] found.\n", cmd_ctx->name)); + "No attributes for host [%s] found.\n", cmd_ctx->name);
return ENOENT; } @@ -392,9 +392,9 @@ ssh_host_pubkeys_search_dp_callback(uint16_t err_maj,
if (err_maj) { DEBUG(SSSDBG_OP_FAILURE, - ("Unable to get information from Data Provider\n" + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); }
ret = ssh_host_pubkeys_search_next(cmd_ctx); @@ -495,8 +495,8 @@ ssh_host_pubkeys_format_known_host_hashed(TALLOC_CTX *mem_ctx, hash); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sss_hmac_sha1() failed (%d): %s\n", - ret, strerror(ret))); + "sss_hmac_sha1() failed (%d): %s\n", + ret, strerror(ret)); result = NULL; goto done; } @@ -594,7 +594,7 @@ ssh_host_pubkeys_update_known_hosts(struct ssh_cmd_ctx *cmd_ctx) sysdb = dom->sysdb; if (sysdb == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Fatal: Sysdb CTX not found for this domain!\n")); + "Fatal: Sysdb CTX not found for this domain!\n"); ret = EFAULT; goto done; } @@ -604,7 +604,7 @@ ssh_host_pubkeys_update_known_hosts(struct ssh_cmd_ctx *cmd_ctx) if (ret != EOK) { if (ret != ENOENT) { DEBUG(SSSDBG_OP_FAILURE, - ("Host search failed for domain [%s]\n", dom->name)); + "Host search failed for domain [%s]\n", dom->name); } continue; } @@ -613,7 +613,7 @@ ssh_host_pubkeys_update_known_hosts(struct ssh_cmd_ctx *cmd_ctx) ret = sss_ssh_make_ent(tmp_ctx, hosts[i], &ent); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to get SSH host public keys\n")); + "Failed to get SSH host public keys\n"); continue; }
@@ -624,8 +624,8 @@ ssh_host_pubkeys_update_known_hosts(struct ssh_cmd_ctx *cmd_ctx) } if (!entstr) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to format known_hosts data for [%s]\n", - ent->name)); + "Failed to format known_hosts data for [%s]\n", + ent->name); continue; }
@@ -685,20 +685,20 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx)
SAFEALIGN_COPY_UINT32_CHECK(&flags, body+c, body_len, &c); if (flags & ~(uint32_t)SSS_SSH_REQ_MASK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid flags received [0x%x]\n", flags)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid flags received [0x%x]\n", flags); return EINVAL; }
SAFEALIGN_COPY_UINT32_CHECK(&name_len, body+c, body_len, &c); if (name_len == 0 || name_len > body_len - c) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid name length\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid name length\n"); return EINVAL; }
name = (char *)(body+c); if (!sss_utf8_check((const uint8_t *)name, name_len-1) || name[name_len-1] != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Name is not valid UTF-8 string\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Name is not valid UTF-8 string\n"); return EINVAL; } c += name_len; @@ -706,14 +706,14 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx) if (flags & SSS_SSH_REQ_ALIAS) { SAFEALIGN_COPY_UINT32_CHECK(&alias_len, body+c, body_len, &c); if (alias_len == 0 || alias_len > body_len - c) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid alias length\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid alias length\n"); return EINVAL; }
alias = (char *)(body+c); if (!sss_utf8_check((const uint8_t *)alias, alias_len-1) || alias[alias_len-1] != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Alias is not valid UTF-8 string\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Alias is not valid UTF-8 string\n"); return EINVAL; } c += alias_len; @@ -723,7 +723,7 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx) SAFEALIGN_COPY_UINT32_CHECK(&domain_len, body+c, body_len, &c); if (domain_len > 0) { if (domain_len > body_len - c) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid domain length\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid domain length\n"); return EINVAL; }
@@ -731,21 +731,21 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx) if (!sss_utf8_check((const uint8_t *)domain, domain_len-1) || domain[domain_len-1] != 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Domain is not valid UTF-8 string\n")); + "Domain is not valid UTF-8 string\n"); return EINVAL; } c += domain_len; }
DEBUG(SSSDBG_TRACE_FUNC, - ("Requested domain [%s]\n", domain ? domain : "<ALL>")); + "Requested domain [%s]\n", domain ? domain : "<ALL>"); } else { - DEBUG(SSSDBG_TRACE_FUNC, ("Splitting domain from name [%s]\n", name)); + DEBUG(SSSDBG_TRACE_FUNC, "Splitting domain from name [%s]\n", name);
ret = sss_parse_name(cmd_ctx, ssh_ctx->snctx, name, &cmd_ctx->domname, &cmd_ctx->name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Invalid name received [%s]\n", name)); + DEBUG(SSSDBG_OP_FAILURE, "Invalid name received [%s]\n", name); return ENOENT; }
@@ -754,7 +754,7 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx)
if (cmd_ctx->is_user && cmd_ctx->domname == NULL) { DEBUG(SSSDBG_TRACE_FUNC, - ("Parsing name [%s][%s]\n", name, domain ? domain : "<ALL>")); + "Parsing name [%s][%s]\n", name, domain ? domain : "<ALL>");
ret = sss_parse_name_for_domains(cmd_ctx, cctx->rctx->domains, domain, name, @@ -762,7 +762,7 @@ ssh_cmd_parse_request(struct ssh_cmd_ctx *cmd_ctx) &cmd_ctx->name); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Invalid name received [%s]\n", name)); + "Invalid name received [%s]\n", name); return ENOENT; } } else { @@ -830,8 +830,8 @@ ssh_cmd_build_reply(struct ssh_cmd_ctx *cmd_ctx) name = ldb_msg_find_attr_as_string(cmd_ctx->result, SYSDB_NAME, NULL); if (!name) { DEBUG(SSSDBG_OP_FAILURE, - ("Got unnamed result for [%s@%s]\n", - cmd_ctx->name, cmd_ctx->domain->name)); + "Got unnamed result for [%s@%s]\n", + cmd_ctx->name, cmd_ctx->domain->name); return ENOENT; }
@@ -928,7 +928,7 @@ ssh_cmd_done(struct ssh_cmd_ctx *cmd_ctx, }
if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Fatal error, killing connection!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Fatal error, killing connection!\n"); talloc_free(cmd_ctx->cctx); return EFAULT; } diff --git a/src/responder/ssh/sshsrv_dp.c b/src/responder/ssh/sshsrv_dp.c index 812e0c7..7ba65b1 100644 --- a/src/responder/ssh/sshsrv_dp.c +++ b/src/responder/ssh/sshsrv_dp.c @@ -86,8 +86,8 @@ sss_dp_get_ssh_host_send(TALLOC_CTX *mem_ctx, talloc_free(key); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not issue DP request [%d]: %s\n", - ret, strerror(ret))); + "Could not issue DP request [%d]: %s\n", + ret, strerror(ret)); goto error; }
@@ -120,7 +120,7 @@ sss_dp_get_ssh_host_msg(void *pvt) filter = talloc_asprintf(info, "name=%s", info->name); } if (!filter) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return NULL; }
@@ -129,15 +129,15 @@ sss_dp_get_ssh_host_msg(void *pvt) DP_INTERFACE, DP_METHOD_HOSTHANDLER); if (msg == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); talloc_free(filter); return NULL; }
/* create the message */ DEBUG(SSSDBG_TRACE_FUNC, - ("Creating SSH host request for [%s][%u][%s]\n", - info->dom->name, be_type, filter)); + "Creating SSH host request for [%s][%u][%s]\n", + info->dom->name, be_type, filter);
dbret = dbus_message_append_args(msg, DBUS_TYPE_UINT32, &be_type, @@ -145,7 +145,7 @@ sss_dp_get_ssh_host_msg(void *pvt) DBUS_TYPE_INVALID); talloc_free(filter); if (!dbret) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build message\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build message\n"); dbus_message_unref(msg); return NULL; } diff --git a/src/responder/sudo/sudosrv.c b/src/responder/sudo/sudosrv.c index e6bd997..b821c96 100644 --- a/src/responder/sudo/sudosrv.c +++ b/src/responder/sudo/sudosrv.c @@ -64,7 +64,7 @@ static void sudo_dp_reconnect_init(struct sbus_connection *conn,
/* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { - DEBUG(SSSDBG_TRACE_FUNC, ("Reconnected to the Data Provider.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Reconnected to the Data Provider.\n");
/* Identify ourselves to the data provider */ ret = dp_common_send_id(be_conn->conn, @@ -78,8 +78,8 @@ static void sudo_dp_reconnect_init(struct sbus_connection *conn, }
/* Failed to reconnect */ - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not reconnect to %s provider.\n", - be_conn->domain->name)); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not reconnect to %s provider.\n", + be_conn->domain->name); }
int sudo_process_init(TALLOC_CTX *mem_ctx, @@ -105,13 +105,13 @@ int sudo_process_init(TALLOC_CTX *mem_ctx, &sudo_dp_interface, &rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sss_process_init() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sss_process_init() failed\n"); return ret; }
sudo_ctx = talloc_zero(rctx, struct sudo_ctx); if (!sudo_ctx) { - DEBUG(SSSDBG_FATAL_FAILURE, ("fatal error initializing sudo_ctx\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "fatal error initializing sudo_ctx\n"); ret = ENOMEM; goto fail; } @@ -126,7 +126,7 @@ int sudo_process_init(TALLOC_CTX *mem_ctx, 3, &max_retries); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to set up automatic reconnection\n")); + "Failed to set up automatic reconnection\n"); goto fail; }
@@ -143,18 +143,18 @@ int sudo_process_init(TALLOC_CTX *mem_ctx, CONFDB_DEFAULT_SUDO_TIMED, &sudo_ctx->timed); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n", + ret, strerror(ret)); goto fail; }
ret = schedule_get_domains_task(rctx, rctx->ev, rctx); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("schedule_get_domains_tasks failed.\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "schedule_get_domains_tasks failed.\n"); goto fail; }
- DEBUG(SSSDBG_TRACE_FUNC, ("SUDO Initialization complete\n")); + DEBUG(SSSDBG_TRACE_FUNC, "SUDO Initialization complete\n");
return EOK;
@@ -205,8 +205,8 @@ int main(int argc, const char *argv[]) ret = die_if_parent_died(); if (ret != EOK) { /* This is not fatal, don't return */ - DEBUG(SSSDBG_OP_FAILURE, ("Could not set up to exit " - "when parent process does\n")); + DEBUG(SSSDBG_OP_FAILURE, "Could not set up to exit " + "when parent process does\n"); }
ret = sudo_process_init(main_ctx, diff --git a/src/responder/sudo/sudosrv_cmd.c b/src/responder/sudo/sudosrv_cmd.c index 8f07e8b..fd8c46d 100644 --- a/src/responder/sudo/sudosrv_cmd.c +++ b/src/responder/sudo/sudosrv_cmd.c @@ -47,15 +47,15 @@ static errno_t sudosrv_cmd_send_reply(struct sudo_cmd_ctx *cmd_ctx, &cli_ctx->creq->out); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to create a new packet [%d]; %s\n", - ret, strerror(ret))); + "Unable to create a new packet [%d]; %s\n", + ret, strerror(ret)); goto done; }
ret = sss_packet_grow(cli_ctx->creq->out, response_len); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to create response: %s\n", strerror(ret))); + "Unable to create response: %s\n", strerror(ret)); goto done; } sss_packet_get_body(cli_ctx->creq->out, &packet_body, &packet_len); @@ -80,8 +80,8 @@ static errno_t sudosrv_cmd_send_error(TALLOC_CTX *mem_ctx, int ret = EOK;
if (error == EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Everything is fine but we are " - "returning error?\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Everything is fine but we are " + "returning error?\n"); return EFAULT; }
@@ -109,8 +109,8 @@ errno_t sudosrv_cmd_done(struct sudo_cmd_ctx *cmd_ctx, int ret) if (cmd_ctx->sudo_ctx->timed) { /* filter rules by time */
- DEBUG(SSSDBG_TRACE_FUNC, ("Applying time restrictions on" - "%u rules\n", cmd_ctx->num_rules)); + DEBUG(SSSDBG_TRACE_FUNC, "Applying time restrictions on" + "%u rules\n", cmd_ctx->num_rules);
ret = sysdb_sudo_filter_rules_by_time(cmd_ctx, cmd_ctx->num_rules, cmd_ctx->rules, 0, @@ -119,8 +119,8 @@ errno_t sudosrv_cmd_done(struct sudo_cmd_ctx *cmd_ctx, int ret) return EFAULT; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Got %u rules after time filter\n", - num_rules)); + DEBUG(SSSDBG_TRACE_FUNC, "Got %u rules after time filter\n", + num_rules); }
/* send result */ @@ -155,7 +155,7 @@ errno_t sudosrv_cmd_done(struct sudo_cmd_ctx *cmd_ctx, int ret) }
if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Fatal error, killing connection!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Fatal error, killing connection!\n"); talloc_free(cmd_ctx->cli_ctx); return EFAULT; } @@ -179,7 +179,7 @@ static int sudosrv_cmd(enum sss_sudo_type type, struct cli_ctx *cli_ctx) cmd_ctx = talloc_zero(cli_ctx, struct sudo_cmd_ctx); if (cmd_ctx == NULL) { /* kill the connection here as we have no context for reply */ - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory?\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory?\n"); return ENOMEM; }
@@ -188,25 +188,25 @@ static int sudosrv_cmd(enum sss_sudo_type type, struct cli_ctx *cli_ctx) cmd_ctx->type = type; cmd_ctx->sudo_ctx = talloc_get_type(cli_ctx->rctx->pvt_ctx, struct sudo_ctx); if (cmd_ctx->sudo_ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("sudo_ctx not set, killing connection!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "sudo_ctx not set, killing connection!\n"); return EFAULT; }
/* if protocol is invalid return */ switch (protocol) { case 0: - DEBUG(SSSDBG_FATAL_FAILURE, ("Protocol [%d] is not secure. " - "SSSD does not allow to use this protocol.\n", protocol)); + DEBUG(SSSDBG_FATAL_FAILURE, "Protocol [%d] is not secure. " + "SSSD does not allow to use this protocol.\n", protocol); ret = EFAULT; goto done; break; case SSS_SUDO_PROTOCOL_VERSION: - DEBUG(SSSDBG_TRACE_INTERNAL, ("Using protocol version [%d]\n", - protocol)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Using protocol version [%d]\n", + protocol); break; default: - DEBUG(SSSDBG_FATAL_FAILURE, ("Invalid protocol version [%d]!\n", - protocol)); + DEBUG(SSSDBG_FATAL_FAILURE, "Invalid protocol version [%d]!\n", + protocol); ret = EFAULT; goto done; } @@ -215,7 +215,7 @@ static int sudosrv_cmd(enum sss_sudo_type type, struct cli_ctx *cli_ctx)
sss_packet_get_body(cli_ctx->creq->in, &query_body, &query_len); if (query_len <= 0 || query_body == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Query is empty\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Query is empty\n"); ret = EINVAL; goto done; } @@ -247,8 +247,8 @@ static void sudosrv_cmd_parse_query_done(struct tevent_req *req) &cmd_ctx->username, &cmd_ctx->domain); talloc_zfree(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid query [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid query [%d]: %s\n", + ret, strerror(ret)); goto done; }
@@ -256,14 +256,14 @@ static void sudosrv_cmd_parse_query_done(struct tevent_req *req)
switch (cmd_ctx->type) { case SSS_SUDO_DEFAULTS: - DEBUG(SSSDBG_FUNC_DATA, ("Requesting default options " + DEBUG(SSSDBG_FUNC_DATA, "Requesting default options " "for [%s] from [%s]\n", cmd_ctx->username, - cmd_ctx->domain ? cmd_ctx->domain->name : "<ALL>")); + cmd_ctx->domain ? cmd_ctx->domain->name : "<ALL>"); break; case SSS_SUDO_USER: - DEBUG(SSSDBG_FUNC_DATA, ("Requesting rules " + DEBUG(SSSDBG_FUNC_DATA, "Requesting rules " "for [%s] from [%s]\n", cmd_ctx->username, - cmd_ctx->domain ? cmd_ctx->domain->name : "<ALL>")); + cmd_ctx->domain ? cmd_ctx->domain->name : "<ALL>"); break; }
diff --git a/src/responder/sudo/sudosrv_dp.c b/src/responder/sudo/sudosrv_dp.c index 3cd8fe8..483533c 100644 --- a/src/responder/sudo/sudosrv_dp.c +++ b/src/responder/sudo/sudosrv_dp.c @@ -99,8 +99,8 @@ sss_dp_get_sudoers_send(TALLOC_CTX *mem_ctx, talloc_free(key); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not issue DP request [%d]: %s\n", - ret, strerror(ret))); + "Could not issue DP request [%d]: %s\n", + ret, strerror(ret)); goto error; }
@@ -144,14 +144,14 @@ sss_dp_get_sudoers_msg(void *pvt) DP_INTERFACE, DP_METHOD_SUDOHANDLER); if (msg == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory?!\n"); return NULL; }
/* create the message */ DEBUG(SSSDBG_TRACE_FUNC, - ("Creating SUDOers request for [%s][%u][%s][%u]\n", - info->dom->name, be_type, info->name, info->num_rules)); + "Creating SUDOers request for [%s][%u][%s][%u]\n", + info->dom->name, be_type, info->name, info->num_rules);
dbus_message_iter_init_append(msg, &iter);
@@ -172,8 +172,8 @@ sss_dp_get_sudoers_msg(void *pvt) for (i = 0; i < info->num_rules; i++) { ret = sysdb_attrs_get_string(info->rules[i], SYSDB_NAME, &rule_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not get rule name [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not get rule name [%d]: %s\n", + ret, strerror(ret)); goto fail; }
@@ -188,7 +188,7 @@ sss_dp_get_sudoers_msg(void *pvt) return msg;
fail: - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to build message\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build message\n"); dbus_message_unref(msg); return NULL; } diff --git a/src/responder/sudo/sudosrv_get_sudorules.c b/src/responder/sudo/sudosrv_get_sudorules.c index 4a121fe..9333bfe 100644 --- a/src/responder/sudo/sudosrv_get_sudorules.c +++ b/src/responder/sudo/sudosrv_get_sudorules.c @@ -39,11 +39,11 @@ errno_t sudosrv_get_sudorules(struct sudo_dom_ctx *dctx) ret = sudosrv_get_user(dctx); if (ret == EAGAIN) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Looking up the user info from Data Provider\n")); + "Looking up the user info from Data Provider\n"); return EAGAIN; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error looking up user information [%d]: %s\n", ret, strerror(ret))); + "Error looking up user information [%d]: %s\n", ret, strerror(ret)); return ret; }
@@ -51,11 +51,11 @@ errno_t sudosrv_get_sudorules(struct sudo_dom_ctx *dctx) ret = sudosrv_get_rules(dctx->cmd_ctx); if (ret == EAGAIN) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Looking up the sudo rules from Data Provider\n")); + "Looking up the sudo rules from Data Provider\n"); return EAGAIN; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error looking up sudo rules [%d]: %s\n", ret, strerror(ret))); + "Error looking up sudo rules [%d]: %s\n", ret, strerror(ret)); return ret; }
@@ -83,7 +83,7 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -103,26 +103,26 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) name = sss_get_cased_name(tmp_ctx, cmd_ctx->username, dom->case_sensitive); if (name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); ret = ENOMEM; goto done; }
- DEBUG(SSSDBG_FUNC_DATA, ("Requesting info about [%s@%s]\n", - name, dom->name)); + DEBUG(SSSDBG_FUNC_DATA, "Requesting info about [%s@%s]\n", + name, dom->name);
ret = sysdb_getpwnam(dctx, dctx->domain->sysdb, dctx->domain, name, &user); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to make request to our cache!\n")); + "Failed to make request to our cache!\n"); ret = EIO; goto done; }
if (user->count > 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("getpwnam call returned more than one result !?!\n")); + "getpwnam call returned more than one result !?!\n"); ret = EIO; goto done; } @@ -135,7 +135,7 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) if (dom) continue; }
- DEBUG(SSSDBG_MINOR_FAILURE, ("No results for getpwnam call\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "No results for getpwnam call\n"); ret = ENOENT; goto done; } @@ -155,7 +155,7 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) cmd_ctx->username, 0, NULL); if (!dpreq) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory sending data provider request\n")); + "Out of memory sending data provider request\n"); ret = ENOMEM; goto done; } @@ -189,7 +189,7 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) if (dom) continue; }
- DEBUG(SSSDBG_MINOR_FAILURE, ("UID does not match\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "UID does not match\n"); ret = ENOENT; goto done; } @@ -198,7 +198,7 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) original_name = ldb_msg_find_attr_as_string(user->msgs[0], SYSDB_NAME, NULL); if (original_name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("A user with no name?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "A user with no name?\n"); ret = EFAULT; goto done; } @@ -206,7 +206,7 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) cmd_ctx->cased_username = talloc_move(cmd_ctx, &name); cmd_ctx->orig_username = talloc_strdup(cmd_ctx, original_name); if (cmd_ctx->orig_username == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); ret = ENOMEM; goto done; } @@ -214,8 +214,8 @@ static errno_t sudosrv_get_user(struct sudo_dom_ctx *dctx) /* and set domain */ cmd_ctx->domain = dom;
- DEBUG(SSSDBG_TRACE_FUNC, ("Returning info for user [%s@%s]\n", - cmd_ctx->username, dctx->domain->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Returning info for user [%s@%s]\n", + cmd_ctx->username, dctx->domain->name); ret = EOK; goto done; } @@ -242,7 +242,7 @@ static void sudosrv_dp_send_acct_req_done(struct tevent_req *req) talloc_zfree(req); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Fatal error, killing connection!\n")); + "Fatal error, killing connection!\n"); talloc_free(cb_ctx->cctx); return; } @@ -258,33 +258,33 @@ static void sudosrv_check_user_dp_callback(uint16_t err_maj, uint32_t err_min,
if (err_maj) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to get information from Data Provider\n" + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); }
DEBUG(SSSDBG_TRACE_INTERNAL, - ("Data Provider returned, check the cache again\n")); + "Data Provider returned, check the cache again\n"); dctx->check_provider = false; ret = sudosrv_get_user(dctx); if (ret == EAGAIN) { goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not look up the user [%d]: %s\n", - ret, strerror(ret))); + "Could not look up the user [%d]: %s\n", + ret, strerror(ret)); sudosrv_cmd_done(dctx->cmd_ctx, ret); return; }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("Looking up sudo rules..\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Looking up sudo rules..\n"); ret = sudosrv_get_rules(dctx->cmd_ctx); if (ret == EAGAIN) { goto done; } else if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Error getting sudo rules [%d]: %s\n", - ret, strerror(ret))); + "Error getting sudo rules [%d]: %s\n", + ret, strerror(ret)); sudosrv_cmd_done(dctx->cmd_ctx, EIO); return; } @@ -328,26 +328,26 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx) NULL };
if (cmd_ctx->domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Domain is not set!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Domain is not set!\n"); return EFAULT; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
switch (cmd_ctx->type) { case SSS_SUDO_DEFAULTS: - DEBUG(SSSDBG_TRACE_FUNC, ("Retrieving default options " + DEBUG(SSSDBG_TRACE_FUNC, "Retrieving default options " "for [%s] from [%s]\n", cmd_ctx->orig_username, - cmd_ctx->domain->name)); + cmd_ctx->domain->name); break; case SSS_SUDO_USER: - DEBUG(SSSDBG_TRACE_FUNC, ("Retrieving rules " + DEBUG(SSSDBG_TRACE_FUNC, "Retrieving rules " "for [%s] from [%s]\n", cmd_ctx->orig_username, - cmd_ctx->domain->name)); + cmd_ctx->domain->name); break; }
@@ -360,7 +360,7 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx) cmd_ctx->orig_username, NULL, &groupnames); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to retrieve user info [%d]: %s\n", ret, strerror(ret))); + "Unable to retrieve user info [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -374,16 +374,16 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx) cmd_ctx->uid, groupnames, &expired_rules, &expired_rules_num); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to retrieve expired sudo rules " - "[%d]: %s\n", ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to retrieve expired sudo rules " + "[%d]: %s\n", ret, strerror(ret)); goto done; }
cmd_ctx->expired_rules_num = expired_rules_num; if (expired_rules_num > 0) { /* refresh expired rules then continue */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("Refreshing %d expired rules\n", - expired_rules_num)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Refreshing %d expired rules\n", + expired_rules_num); dpreq = sss_dp_get_sudoers_send(tmp_ctx, cmd_ctx->cli_ctx->rctx, cmd_ctx->domain, false, SSS_DP_SUDO_REFRESH_RULES, @@ -391,7 +391,7 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx) expired_rules_num, expired_rules); if (dpreq == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot issue DP request.\n")); + "Cannot issue DP request.\n"); ret = EIO; goto done; } @@ -413,14 +413,14 @@ errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx)
} else { /* nothing is expired return what we have in the cache */ - DEBUG(SSSDBG_TRACE_INTERNAL, ("About to get sudo rules from cache\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "About to get sudo rules from cache\n"); ret = sudosrv_get_sudorules_from_cache(cmd_ctx, cmd_ctx, &cmd_ctx->rules, &cmd_ctx->num_rules); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to make a request to our cache [%d]: %s\n", - ret, strerror(ret))); + "Failed to make a request to our cache [%d]: %s\n", + ret, strerror(ret)); goto done; } } @@ -457,7 +457,7 @@ sudosrv_dp_req_done(struct tevent_req *req) &err_msg); talloc_free(req); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Fatal error, killing connection!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Fatal error, killing connection!\n"); talloc_free(cli_ctx); return; } @@ -468,7 +468,7 @@ sudosrv_dp_req_done(struct tevent_req *req) static void sudosrv_dp_oob_req_done(struct tevent_req *req) { - DEBUG(SSSDBG_TRACE_FUNC, ("Out of band refresh finished\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Out of band refresh finished\n"); talloc_free(req); }
@@ -482,19 +482,19 @@ sudosrv_get_sudorules_dp_callback(uint16_t err_maj, uint32_t err_min,
if (err_maj) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to get information from Data Provider\n" + "Unable to get information from Data Provider\n" "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", - (unsigned int)err_maj, (unsigned int)err_min, err_msg)); + (unsigned int)err_maj, (unsigned int)err_min, err_msg); }
- DEBUG(SSSDBG_TRACE_INTERNAL, ("About to get sudo rules from cache\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "About to get sudo rules from cache\n"); ret = sudosrv_get_sudorules_from_cache(cmd_ctx, cmd_ctx, &cmd_ctx->rules, &cmd_ctx->num_rules); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to make a request to our cache [%d]: %s\n", - ret, strerror(ret))); + "Failed to make a request to our cache [%d]: %s\n", + ret, strerror(ret)); sudosrv_cmd_done(cmd_ctx, EIO); return; } @@ -502,8 +502,8 @@ sudosrv_get_sudorules_dp_callback(uint16_t err_maj, uint32_t err_min, if (cmd_ctx->expired_rules_num > 0 && err_min == ENOENT) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("Some expired rules were removed from the server, " - "scheduling full refresh out of band\n")); + "Some expired rules were removed from the server, " + "scheduling full refresh out of band\n"); dpreq = sss_dp_get_sudoers_send(cmd_ctx->cli_ctx->rctx, cmd_ctx->cli_ctx->rctx, cmd_ctx->domain, false, @@ -512,7 +512,7 @@ sudosrv_get_sudorules_dp_callback(uint16_t err_maj, uint32_t err_min, 0, NULL); if (dpreq == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot issue DP request.\n")); + "Cannot issue DP request.\n"); } else { tevent_req_set_callback(dpreq, sudosrv_dp_oob_req_done, NULL); } @@ -547,13 +547,13 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx, NULL };
if (cmd_ctx->domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Domain is not set!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Domain is not set!\n"); return EFAULT; }
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -566,8 +566,8 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx, NULL, &groupnames); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to retrieve user info [%d]: %s\n", - ret, strerror(ret))); + "Unable to retrieve user info [%d]: %s\n", + ret, strerror(ret)); goto done; } flags = SYSDB_SUDO_FILTER_USERINFO | SYSDB_SUDO_FILTER_INCLUDE_ALL; @@ -585,12 +585,12 @@ static errno_t sudosrv_get_sudorules_from_cache(TALLOC_CTX *mem_ctx, &rules, &num_rules); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to retrieve sudo rules [%d]: %s\n", ret, strerror(ret))); + "Unable to retrieve sudo rules [%d]: %s\n", ret, strerror(ret)); goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Returning %d rules for [%s@%s]\n", - num_rules, debug_name, cmd_ctx->domain->name)); + DEBUG(SSSDBG_TRACE_FUNC, "Returning %d rules for [%s@%s]\n", + num_rules, debug_name, cmd_ctx->domain->name);
if (_rules != NULL) { *_rules = talloc_steal(mem_ctx, rules); @@ -634,12 +634,12 @@ static errno_t sudosrv_get_sudorules_query_cache(TALLOC_CTX *mem_ctx, flags, &filter); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not construct the search filter [%d]: %s\n", - ret, strerror(ret))); + "Could not construct the search filter [%d]: %s\n", + ret, strerror(ret)); goto done; }
- DEBUG(SSSDBG_FUNC_DATA, ("Searching sysdb with [%s]\n", filter)); + DEBUG(SSSDBG_FUNC_DATA, "Searching sysdb with [%s]\n", filter);
if (IS_SUBDOMAIN(domain)) { /* rules are stored inside parent domain tree */ @@ -650,7 +650,7 @@ static errno_t sudosrv_get_sudorules_query_cache(TALLOC_CTX *mem_ctx, SUDORULE_SUBDIR, attrs, &count, &msgs); if (ret != EOK && ret != ENOENT) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error looking up SUDO rules")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error looking up SUDO rules"); goto done; } if (ret == ENOENT) { *_rules = NULL; @@ -662,14 +662,14 @@ static errno_t sudosrv_get_sudorules_query_cache(TALLOC_CTX *mem_ctx, ret = sysdb_msg2attrs(tmp_ctx, count, msgs, &rules); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not convert ldb message to sysdb_attrs\n")); + "Could not convert ldb message to sysdb_attrs\n"); goto done; }
ret = sort_sudo_rules(rules, count); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Could not sort rules by sudoOrder\n")); + "Could not sort rules by sudoOrder\n"); goto done; }
@@ -692,7 +692,7 @@ sudo_order_cmp_fn(const void *a, const void *b) r1 = * (struct sysdb_attrs * const *) a; r2 = * (struct sysdb_attrs * const *) b; if (!r1 || !r2) { - DEBUG(SSSDBG_CRIT_FAILURE, ("BUG: Wrong data?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "BUG: Wrong data?\n"); return 0; }
@@ -702,7 +702,7 @@ sudo_order_cmp_fn(const void *a, const void *b) * a value of 0 is assumed */ o1 = 0; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get sudoOrder value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get sudoOrder value\n"); return 0; }
@@ -712,7 +712,7 @@ sudo_order_cmp_fn(const void *a, const void *b) * a value of 0 is assumed */ o2 = 0; } else if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot get sudoOrder value\n")); + DEBUG(SSSDBG_OP_FAILURE, "Cannot get sudoOrder value\n"); return 0; }
diff --git a/src/responder/sudo/sudosrv_query.c b/src/responder/sudo/sudosrv_query.c index c60202f..632afa7 100644 --- a/src/responder/sudo/sudosrv_query.c +++ b/src/responder/sudo/sudosrv_query.c @@ -39,7 +39,7 @@ static int sudosrv_response_append_string(TALLOC_CTX *mem_ctx, response_body = talloc_realloc(mem_ctx, response_body, uint8_t, response_len + (str_len * sizeof(char))); if (response_body == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_realloc() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_realloc() failed\n"); return ENOMEM; } memcpy(response_body + response_len, str, str_len); @@ -62,7 +62,7 @@ static int sudosrv_response_append_uint32(TALLOC_CTX *mem_ctx, response_body = talloc_realloc(mem_ctx, response_body, uint8_t, response_len + sizeof(uint32_t)); if (response_body == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_realloc() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_realloc() failed\n"); return ENOMEM; } SAFEALIGN_SET_UINT32(response_body + response_len, number, &response_len); @@ -88,7 +88,7 @@ static int sudosrv_response_append_attr(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -109,7 +109,7 @@ static int sudosrv_response_append_attr(TALLOC_CTX *mem_ctx, /* values */ for (i = 0; i < values_num; i++) { if (strlen((char*)(values[i].data)) != values[i].length) { - DEBUG(SSSDBG_CRIT_FAILURE, ("value is not a string")); + DEBUG(SSSDBG_CRIT_FAILURE, "value is not a string"); ret = EINVAL; goto done; } @@ -147,7 +147,7 @@ static int sudosrv_response_append_rule(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -201,7 +201,7 @@ errno_t sudosrv_build_response(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
@@ -277,7 +277,7 @@ struct tevent_req *sudosrv_parse_query_send(TALLOC_CTX *mem_ctx, req = tevent_req_create(mem_ctx, &state, struct sudosrv_parse_query_state); if (req == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("tevent_req_create() failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "tevent_req_create() failed\n"); return NULL; }
@@ -286,7 +286,7 @@ struct tevent_req *sudosrv_parse_query_send(TALLOC_CTX *mem_ctx, /* uid */
if (query_len < sizeof(uid_t)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Query is too small\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Query is too small\n"); ret = EINVAL; goto done; } @@ -298,19 +298,19 @@ struct tevent_req *sudosrv_parse_query_send(TALLOC_CTX *mem_ctx, rawname_len = query_len - offset; /* strlen + zero */
if (rawname[rawname_len - 1] != '\0') { - DEBUG(SSSDBG_CRIT_FAILURE, ("Username is not zero terminated\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Username is not zero terminated\n"); ret = EINVAL; goto done; }
if (rawname_len < 2) { /* at least one character and zero */ - DEBUG(SSSDBG_CRIT_FAILURE, ("Query does not contain username\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Query does not contain username\n"); ret = EINVAL; goto done; }
if (!sss_utf8_check((uint8_t*)rawname, rawname_len - 1)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Supplied data is not valid UTF-8 string\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Supplied data is not valid UTF-8 string\n"); ret = EINVAL; goto done; } @@ -322,8 +322,8 @@ struct tevent_req *sudosrv_parse_query_send(TALLOC_CTX *mem_ctx, rctx->default_domain, state->rawname, &domainname, NULL); if (ret == EAGAIN) { - DEBUG(SSSDBG_TRACE_FUNC, ("Domain [%s] not found, " - "sending subdomain request\n", domainname)); + DEBUG(SSSDBG_TRACE_FUNC, "Domain [%s] not found, " + "sending subdomain request\n", domainname);
subreq = sss_dp_get_domains_send(state, rctx, true, domainname); if (subreq == NULL) { @@ -334,7 +334,7 @@ struct tevent_req *sudosrv_parse_query_send(TALLOC_CTX *mem_ctx, } goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Invalid name received [%s]\n", rawname)); + DEBUG(SSSDBG_CRIT_FAILURE, "Invalid name received [%s]\n", rawname); goto done; }
@@ -386,7 +386,7 @@ errno_t sudosrv_parse_query_recv(TALLOC_CTX *mem_ctx, TEVENT_REQ_RETURN_ON_ERROR(req);
if (state->rawname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No query specified?!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No query specified?!\n"); return EINVAL; }
@@ -399,13 +399,13 @@ errno_t sudosrv_parse_query_recv(TALLOC_CTX *mem_ctx, state->rawname, &domainname, &username); if (ret != EOK) { - DEBUG(SSSDBG_TRACE_FUNC, ("Unable to parse domain [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_FUNC, "Unable to parse domain [%d]: %s\n", + ret, strerror(ret)); return ret; }
if (username == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No username specified!\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No username specified!\n"); return EINVAL; }
@@ -414,8 +414,8 @@ errno_t sudosrv_parse_query_recv(TALLOC_CTX *mem_ctx, * so I cannot easily steal it */ domain = responder_get_domain(state->rctx, domainname); if (domain == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Corresponding domain [%s] has not been " - "found\n", domainname)); + DEBUG(SSSDBG_OP_FAILURE, "Corresponding domain [%s] has not been " + "found\n", domainname); return ENOENT; } } diff --git a/src/sbus/sbus_client.c b/src/sbus/sbus_client.c index a06b28d..fe79f42 100644 --- a/src/sbus/sbus_client.c +++ b/src/sbus/sbus_client.c @@ -42,13 +42,13 @@ int sbus_client_init(TALLOC_CTX *mem_ctx,
filename = strchr(server_address, '/'); if (filename == NULL) { - DEBUG(1, ("Unexpected dbus address [%s].\n", server_address)); + DEBUG(1, "Unexpected dbus address [%s].\n", server_address); return EIO; }
ret = check_file(filename, 0, 0, 0600, CHECK_SOCK, NULL, true); if (ret != EOK) { - DEBUG(1, ("check_file failed for [%s].\n", filename)); + DEBUG(1, "check_file failed for [%s].\n", filename); return EIO; }
diff --git a/src/sbus/sssd_dbus_common.c b/src/sbus/sssd_dbus_common.c index d16a763..0894036 100644 --- a/src/sbus/sssd_dbus_common.c +++ b/src/sbus/sssd_dbus_common.c @@ -129,7 +129,7 @@ dbus_bool_t sbus_add_watch(DBusWatch *dbus_watch, void *data) /* does not exist, allocate new one */ watch = talloc_zero(conn, struct sbus_watch_ctx); if (!watch) { - DEBUG(0, ("Out of Memory!\n")); + DEBUG(0, "Out of Memory!\n"); return FALSE; } watch->conn = conn; @@ -169,7 +169,7 @@ dbus_bool_t sbus_add_watch(DBusWatch *dbus_watch, void *data) watch, fd, event_flags, sbus_watch_handler, watch); if (!watch->fde) { - DEBUG(0, ("Failed to set up fd event!\n")); + DEBUG(0, "Failed to set up fd event!\n"); talloc_zfree(watch); return FALSE; } @@ -177,11 +177,11 @@ dbus_bool_t sbus_add_watch(DBusWatch *dbus_watch, void *data) DLIST_ADD(conn->watch_list, watch); talloc_set_destructor((TALLOC_CTX *)watch, watch_destructor);
- DEBUG(8, ("%p/%p (%d), %s/%s (%s)\n", + DEBUG(8, "%p/%p (%d), %s/%s (%s)\n", watch, dbus_watch, fd, ((flags & DBUS_WATCH_READABLE)?"R":"-"), ((flags & DBUS_WATCH_WRITABLE)?"W":"-"), - enabled?"enabled":"disabled")); + enabled?"enabled":"disabled");
return TRUE; } @@ -205,7 +205,7 @@ void sbus_toggle_watch(DBusWatch *dbus_watch, void *data) watch_data = dbus_watch_get_data(dbus_watch); watch = talloc_get_type(watch_data, struct sbus_watch_ctx); if (!watch) { - DEBUG(2, ("[%p] does not carry watch context?!\n", dbus_watch)); + DEBUG(2, "[%p] does not carry watch context?!\n", dbus_watch); /* abort ? */ return; } @@ -234,11 +234,11 @@ void sbus_toggle_watch(DBusWatch *dbus_watch, void *data) #endif } DEBUG(SSSDBG_TRACE_ALL, - ("%p/%p (%d), %s/%s (%s)\n", + "%p/%p (%d), %s/%s (%s)\n", watch, dbus_watch, fd, ((flags & DBUS_WATCH_READABLE)?"R":"-"), ((flags & DBUS_WATCH_WRITABLE)?"W":"-"), - enabled?"enabled":"disabled")); + enabled?"enabled":"disabled"); }
/* @@ -254,10 +254,10 @@ void sbus_remove_watch(DBusWatch *dbus_watch, void *data) watch_data = dbus_watch_get_data(dbus_watch); watch = talloc_get_type(watch_data, struct sbus_watch_ctx);
- DEBUG(8, ("%p/%p\n", watch, dbus_watch)); + DEBUG(8, "%p/%p\n", watch, dbus_watch);
if (!watch) { - DEBUG(2, ("DBUS trying to remove unknown watch!\n")); + DEBUG(2, "DBUS trying to remove unknown watch!\n"); return; }
@@ -313,7 +313,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data) struct sbus_timeout_ctx *timeout; struct timeval tv;
- DEBUG(8, ("%p\n", dbus_timeout)); + DEBUG(8, "%p\n", dbus_timeout);
if (!dbus_timeout_get_enabled(dbus_timeout)) { return TRUE; @@ -323,7 +323,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data)
timeout = talloc_zero(conn, struct sbus_timeout_ctx); if (!timeout) { - DEBUG(0, ("Out of Memory!\n")); + DEBUG(0, "Out of Memory!\n"); return FALSE; } timeout->dbus_timeout = dbus_timeout; @@ -332,7 +332,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data) timeout->te = tevent_add_timer(conn->ev, timeout, tv, sbus_timeout_handler, timeout); if (!timeout->te) { - DEBUG(0, ("Failed to set up timeout event!\n")); + DEBUG(0, "Failed to set up timeout event!\n"); return FALSE; }
@@ -349,7 +349,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data) */ void sbus_toggle_timeout(DBusTimeout *dbus_timeout, void *data) { - DEBUG(8, ("%p\n", dbus_timeout)); + DEBUG(8, "%p\n", dbus_timeout);
if (dbus_timeout_get_enabled(dbus_timeout)) { sbus_add_timeout(dbus_timeout, data); @@ -366,7 +366,7 @@ void sbus_remove_timeout(DBusTimeout *dbus_timeout, void *data) { void *timeout;
- DEBUG(8, ("%p\n", dbus_timeout)); + DEBUG(8, "%p\n", dbus_timeout);
timeout = dbus_timeout_get_data(dbus_timeout);
diff --git a/src/sbus/sssd_dbus_connection.c b/src/sbus/sssd_dbus_connection.c index ccea88e..60b06a4 100644 --- a/src/sbus/sssd_dbus_connection.c +++ b/src/sbus/sssd_dbus_connection.c @@ -54,15 +54,15 @@ static void sbus_dispatch(struct tevent_context *ev, conn = talloc_get_type(data, struct sbus_connection);
dbus_conn = conn->dbus.conn; - DEBUG(SSSDBG_TRACE_ALL, ("dbus conn: %p\n", dbus_conn)); + DEBUG(SSSDBG_TRACE_ALL, "dbus conn: %p\n", dbus_conn);
if (conn->retries > 0) { - DEBUG(6, ("SBUS is reconnecting. Deferring.\n")); + DEBUG(6, "SBUS is reconnecting. Deferring.\n"); /* Currently trying to reconnect, defer dispatch for 30ms */ tv = tevent_timeval_current_ofs(0, 30); new_event = tevent_add_timer(ev, conn, tv, sbus_dispatch, conn); if (new_event == NULL) { - DEBUG(0,("Could not defer dispatch!\n")); + DEBUG(0,"Could not defer dispatch!\n"); } return; } @@ -72,11 +72,11 @@ static void sbus_dispatch(struct tevent_context *ev, /* Attempt to reconnect automatically */ ret = sbus_auto_reconnect(conn); if (ret == EOK) { - DEBUG(1, ("Performing auto-reconnect\n")); + DEBUG(1, "Performing auto-reconnect\n"); return; }
- DEBUG(0, ("Cannot start auto-reconnection.\n")); + DEBUG(0, "Cannot start auto-reconnection.\n"); conn->reconnect_callback(conn, SBUS_RECONNECT_ERROR, conn->reconnect_pvt); @@ -85,7 +85,7 @@ static void sbus_dispatch(struct tevent_context *ev,
if ((conn->disconnect) || (!dbus_connection_get_is_connected(dbus_conn))) { - DEBUG(3,("Connection is not open for dispatching.\n")); + DEBUG(3,"Connection is not open for dispatching.\n"); /* * Free the connection object. * This will invoke the destructor for the connection @@ -100,7 +100,7 @@ static void sbus_dispatch(struct tevent_context *ev, */ ret = dbus_connection_get_dispatch_status(dbus_conn); if (ret != DBUS_DISPATCH_COMPLETE) { - DEBUG(9,("Dispatching.\n")); + DEBUG(9,"Dispatching.\n"); dbus_connection_dispatch(dbus_conn); }
@@ -111,7 +111,7 @@ static void sbus_dispatch(struct tevent_context *ev, if (ret != DBUS_DISPATCH_COMPLETE) { new_event = tevent_add_timer(ev, conn, tv, sbus_dispatch, conn); if (new_event == NULL) { - DEBUG(2,("Could not add dispatch event!\n")); + DEBUG(2,"Could not add dispatch event!\n");
/* TODO: Calling exit here is bad */ exit(1); @@ -139,7 +139,7 @@ static void sbus_conn_wakeup_main(void *data) /* D-BUS calls this function when it is time to do a dispatch */ te = tevent_add_timer(conn->ev, conn, tv, sbus_dispatch, conn); if (te == NULL) { - DEBUG(2,("Could not add dispatch event!\n")); + DEBUG(2,"Could not add dispatch event!\n"); /* TODO: Calling exit here is bad */ exit(1); } @@ -162,7 +162,7 @@ int sbus_init_connection(TALLOC_CTX *ctx, struct sbus_connection *conn; int ret;
- DEBUG(SSSDBG_TRACE_FUNC,("Adding connection %p\n", dbus_conn)); + DEBUG(SSSDBG_TRACE_FUNC,"Adding connection %p\n", dbus_conn); conn = talloc_zero(ctx, struct sbus_connection);
conn->ev = ev; @@ -204,7 +204,7 @@ static int sbus_conn_set_fns(struct sbus_connection *conn) sbus_toggle_watch, conn, NULL); if (!dbret) { - DEBUG(2,("Error setting up D-BUS connection watch functions\n")); + DEBUG(2,"Error setting up D-BUS connection watch functions\n"); return EIO; }
@@ -215,7 +215,7 @@ static int sbus_conn_set_fns(struct sbus_connection *conn) sbus_toggle_timeout, conn, NULL); if (!dbret) { - DEBUG(2,("Error setting up D-BUS server timeout functions\n")); + DEBUG(2,"Error setting up D-BUS server timeout functions\n"); /* FIXME: free resources ? */ return EIO; } @@ -251,8 +251,8 @@ int sbus_new_connection(TALLOC_CTX *ctx, struct tevent_context *ev, /* Open a shared D-BUS connection to the address */ dbus_conn = dbus_connection_open(address, &dbus_error); if (!dbus_conn) { - DEBUG(1, ("Failed to open connection: name=%s, message=%s\n", - dbus_error.name, dbus_error.message)); + DEBUG(1, "Failed to open connection: name=%s, message=%s\n", + dbus_error.name, dbus_error.message); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); return EIO; } @@ -296,8 +296,8 @@ int sbus_default_connection_destructor(void *ctx) struct sbus_connection *conn; conn = talloc_get_type(ctx, struct sbus_connection);
- DEBUG(SSSDBG_TRACE_FUNC, ("Invoking default destructor on connection %p\n", - conn->dbus.conn)); + DEBUG(SSSDBG_TRACE_FUNC, "Invoking default destructor on connection %p\n", + conn->dbus.conn); if (conn->connection_type == SBUS_CONN_TYPE_PRIVATE) { /* Private connections must be closed explicitly */ dbus_connection_close(conn->dbus.conn); @@ -307,7 +307,7 @@ int sbus_default_connection_destructor(void *ctx) } else { /* Critical Error! */ - DEBUG(1,("Critical Error, connection_type is neither shared nor private!\n")); + DEBUG(1,"Critical Error, connection_type is neither shared nor private!\n"); return -1; }
@@ -334,7 +334,7 @@ void sbus_disconnect (struct sbus_connection *conn) return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Disconnecting %p\n", conn->dbus.conn)); + DEBUG(SSSDBG_TRACE_FUNC, "Disconnecting %p\n", conn->dbus.conn);
/******************************* * Referencing conn->dbus.conn */ @@ -374,7 +374,7 @@ void sbus_disconnect (struct sbus_connection *conn) /* Unreferenced conn->dbus_conn * ******************************/
- DEBUG(SSSDBG_TRACE_FUNC ,("Disconnected %p\n", conn->dbus.conn)); + DEBUG(SSSDBG_TRACE_FUNC ,"Disconnected %p\n", conn->dbus.conn); }
static int sbus_reply_internal_error(DBusMessage *message, @@ -410,7 +410,7 @@ DBusHandlerResult sbus_message_handler(DBusConnection *dbus_conn, intf_p = talloc_get_type(user_data, struct sbus_interface_p);
method = dbus_message_get_member(message); - DEBUG(9, ("Received SBUS method [%s]\n", method)); + DEBUG(9, "Received SBUS method [%s]\n", method); path = dbus_message_get_path(message); msg_interface = dbus_message_get_interface(message);
@@ -437,7 +437,7 @@ DBusHandlerResult sbus_message_handler(DBusConnection *dbus_conn,
if (!found) { /* Reply DBUS_ERROR_UNKNOWN_METHOD */ - DEBUG(1, ("No matching method found for %s.\n", method)); + DEBUG(1, "No matching method found for %s.\n", method); reply = dbus_message_new_error(message, DBUS_ERROR_UNKNOWN_METHOD, NULL); sbus_conn_send_reply(intf_p->conn, reply); dbus_message_unref(reply); @@ -484,7 +484,7 @@ int sbus_conn_add_interface(struct sbus_connection *conn, path = intf->path;
if (path_in_interface_list(conn->intf_list, path)) { - DEBUG(0, ("Cannot add method context with identical path.\n")); + DEBUG(0, "Cannot add method context with identical path.\n"); return EINVAL; }
@@ -500,7 +500,7 @@ int sbus_conn_add_interface(struct sbus_connection *conn, dbret = dbus_connection_register_object_path(conn->dbus.conn, path, &intf->vtable, intf_p); if (!dbret) { - DEBUG(0, ("Could not register object path to the connection.\n")); + DEBUG(0, "Could not register object path to the connection.\n"); return ENOMEM; }
@@ -561,12 +561,12 @@ static void sbus_reconnect(struct tevent_context *ev, conn = talloc_get_type(data, struct sbus_connection); dbus_error_init(&dbus_error);
- DEBUG(3, ("Making reconnection attempt %d to [%s]\n", - conn->retries, conn->address)); + DEBUG(3, "Making reconnection attempt %d to [%s]\n", + conn->retries, conn->address); conn->dbus.conn = dbus_connection_open(conn->address, &dbus_error); if (conn->dbus.conn) { /* We successfully reconnected. Set up mainloop integration. */ - DEBUG(3, ("Reconnected to [%s]\n", conn->address)); + DEBUG(3, "Reconnected to [%s]\n", conn->address); ret = sbus_conn_set_fns(conn); if (ret != EOK) { dbus_connection_unref(conn->dbus.conn); @@ -581,7 +581,7 @@ static void sbus_reconnect(struct tevent_context *ev, &iter->intf->vtable, iter); if (!dbret) { - DEBUG(0, ("Could not register object path.\n")); + DEBUG(0, "Could not register object path.\n"); dbus_connection_unref(conn->dbus.conn); goto failed; } @@ -602,8 +602,8 @@ static void sbus_reconnect(struct tevent_context *ev,
failed: /* Reconnection failed, try again in a few seconds */ - DEBUG(1, ("Failed to open connection: name=%s, message=%s\n", - dbus_error.name, dbus_error.message)); + DEBUG(1, "Failed to open connection: name=%s, message=%s\n", + dbus_error.name, dbus_error.message); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error);
conn->retries++; @@ -708,7 +708,7 @@ int sbus_conn_send(struct sbus_connection *conn,
dbus_conn = sbus_get_connection(conn); if (!dbus_conn) { - DEBUG(SSSDBG_CRIT_FAILURE, ("D-BUS not connected\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "D-BUS not connected\n"); return ENOTCONN; }
@@ -720,7 +720,7 @@ int sbus_conn_send(struct sbus_connection *conn, * Critical Failure * Insufficient memory to send message */ - DEBUG(0, ("D-BUS send failed.\n")); + DEBUG(0, "D-BUS send failed.\n"); return ENOMEM; }
@@ -733,7 +733,7 @@ int sbus_conn_send(struct sbus_connection *conn, * Critical Failure * Insufficient memory to create pending call notify */ - DEBUG(0, ("D-BUS send failed.\n")); + DEBUG(0, "D-BUS send failed.\n"); dbus_pending_call_cancel(pending_reply); dbus_pending_call_unref(pending_reply); return ENOMEM; diff --git a/src/sbus/sssd_dbus_server.c b/src/sbus/sssd_dbus_server.c index 3ada25b..0278137 100644 --- a/src/sbus/sssd_dbus_server.c +++ b/src/sbus/sssd_dbus_server.c @@ -45,25 +45,25 @@ static void sbus_server_init_new_connection(DBusServer *dbus_server, struct sbus_connection *conn; int ret;
- DEBUG(5,("Entering.\n")); + DEBUG(5,"Entering.\n"); server = talloc_get_type(data, struct sbus_connection); if (!server) { return; }
- DEBUG(5,("Adding connection %p.\n", dbus_conn)); + DEBUG(5,"Adding connection %p.\n", dbus_conn); ret = sbus_init_connection(server, server->ev, dbus_conn, server->server_intf, SBUS_CONN_TYPE_PRIVATE, &conn); if (ret != 0) { dbus_connection_close(dbus_conn); - DEBUG(5,("Closing connection (failed setup)")); + DEBUG(5,"Closing connection (failed setup)"); return; }
dbus_connection_ref(dbus_conn);
- DEBUG(5,("Got a connection\n")); + DEBUG(5,"Got a connection\n");
/* * Initialize connection-specific features @@ -75,7 +75,7 @@ static void sbus_server_init_new_connection(DBusServer *dbus_server, */ ret = server->srv_init_fn(conn, server->srv_init_data); if (ret != EOK) { - DEBUG(1,("Initialization failed!\n")); + DEBUG(1,"Initialization failed!\n"); dbus_connection_close(dbus_conn); talloc_zfree(conn); } @@ -97,8 +97,8 @@ create_socket_symlink(const char *filename, const char *symlink_filename) { errno_t ret;
- DEBUG(7, ("Symlinking the dbus path %s to a link %s\n", - filename, symlink_filename)); + DEBUG(7, "Symlinking the dbus path %s to a link %s\n", + filename, symlink_filename); errno = 0; ret = symlink(filename, symlink_filename); if (ret != 0 && errno == EEXIST) { @@ -107,8 +107,8 @@ create_socket_symlink(const char *filename, const char *symlink_filename) ret = unlink(symlink_filename); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot remove old symlink: [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "Cannot remove old symlink: [%d][%s].\n", + ret, strerror(ret)); return EIO; } errno = 0; @@ -117,8 +117,8 @@ create_socket_symlink(const char *filename, const char *symlink_filename)
if (ret != 0) { ret = errno; - DEBUG(1, ("symlink() failed on file '%s': [%d][%s].\n", - filename, ret, strerror(ret))); + DEBUG(1, "symlink() failed on file '%s': [%d][%s].\n", + filename, ret, strerror(ret)); return EIO; }
@@ -137,28 +137,28 @@ remove_socket_symlink(const char *symlink_name) numread = readlink(symlink_name, target, PATH_MAX-1); if (numread < 0) { ret = errno; - DEBUG(2, ("readlink failed [%d]: %s\n", ret, strerror(ret))); + DEBUG(2, "readlink failed [%d]: %s\n", ret, strerror(ret)); return ret; } target[numread] = '\0'; - DEBUG(9, ("The symlink points to [%s]\n", target)); + DEBUG(9, "The symlink points to [%s]\n", target);
/* We can only remove the symlink if it points to a socket with * the same PID */ ret = snprintf(pidpath, PATH_MAX, "%s.%lu", symlink_name, (unsigned long) getpid()); if (ret < 0) { - DEBUG(2, ("snprintf failed")); + DEBUG(2, "snprintf failed"); return EIO; } else if (ret >= PATH_MAX) { - DEBUG(2, ("path too long?!?!\n")); + DEBUG(2, "path too long?!?!\n"); return EIO; } - DEBUG(9, ("The path including our pid is [%s]\n", pidpath)); + DEBUG(9, "The path including our pid is [%s]\n", pidpath);
if (strcmp(pidpath, target) != 0) { - DEBUG(4, ("Will not remove symlink, seems to be owned by " - "another process\n")); + DEBUG(4, "Will not remove symlink, seems to be owned by " + "another process\n"); return EOK; }
@@ -166,12 +166,12 @@ remove_socket_symlink(const char *symlink_name) if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("unlink failed to remove [%s] [%d]: %s\n", - symlink_name, ret, strerror(ret))); + "unlink failed to remove [%s] [%d]: %s\n", + symlink_name, ret, strerror(ret)); return ret; }
- DEBUG(9, ("Removed the symlink\n")); + DEBUG(9, "Removed the symlink\n"); return EOK; }
@@ -216,8 +216,8 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, dbus_error_init(&dbus_error); dbus_server = dbus_server_listen(socket_address, &dbus_error); if (!dbus_server) { - DEBUG(1,("dbus_server_listen failed! (name=%s, message=%s)\n", - dbus_error.name, dbus_error.message)); + DEBUG(1,"dbus_server_listen failed! (name=%s, message=%s)\n", + dbus_error.name, dbus_error.message); if (dbus_error_is_set(&dbus_error)) dbus_error_free(&dbus_error); ret = EIO; goto done; @@ -225,7 +225,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx,
filename = strchr(socket_address, '/'); if (filename == NULL) { - DEBUG(1, ("Unexpected dbus address [%s].\n", socket_address)); + DEBUG(1, "Unexpected dbus address [%s].\n", socket_address); ret = EIO; goto done; } @@ -233,15 +233,15 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, if (use_symlink) { symlink_filename = strchr(address, '/'); if (symlink_filename == NULL) { - DEBUG(1, ("Unexpected dbus address [%s].\n", address)); + DEBUG(1, "Unexpected dbus address [%s].\n", address); ret = EIO; goto done; }
ret = create_socket_symlink(filename, symlink_filename); if (ret != EOK) { - DEBUG(1, ("Could not create symlink [%d]: %s\n", - ret, strerror(ret))); + DEBUG(1, "Could not create symlink [%d]: %s\n", + ret, strerror(ret)); ret = EIO; goto done; } @@ -251,7 +251,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, * the socket */ ret = check_file(filename, 0, 0, -1, CHECK_SOCK, &stat_buf, true); if (ret != EOK) { - DEBUG(1, ("check_file failed for [%s].\n", filename)); + DEBUG(1, "check_file failed for [%s].\n", filename); ret = EIO; goto done; } @@ -259,15 +259,15 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, if ((stat_buf.st_mode & ~S_IFMT) != 0600) { ret = chmod(filename, 0600); if (ret != EOK) { - DEBUG(1, ("chmod failed for [%s]: [%d][%s].\n", filename, errno, - strerror(errno))); + DEBUG(1, "chmod failed for [%s]: [%d][%s].\n", filename, errno, + strerror(errno)); ret = EIO; goto done; } }
tmp = dbus_server_get_address(dbus_server); - DEBUG(SSSDBG_TRACE_FUNC, ("D-BUS Server listening on %s\n", tmp)); + DEBUG(SSSDBG_TRACE_FUNC, "D-BUS Server listening on %s\n", tmp); free(tmp);
server = talloc_zero(tmp_ctx, struct sbus_connection); @@ -305,7 +305,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, sbus_toggle_watch, server, NULL); if (!dbret) { - DEBUG(4, ("Error setting up D-BUS server watch functions\n")); + DEBUG(4, "Error setting up D-BUS server watch functions\n"); ret = EIO; goto done; } @@ -317,7 +317,7 @@ int sbus_new_server(TALLOC_CTX *mem_ctx, sbus_toggle_timeout, server, NULL); if (!dbret) { - DEBUG(4,("Error setting up D-BUS server timeout functions\n")); + DEBUG(4,"Error setting up D-BUS server timeout functions\n"); dbus_server_set_watch_functions(server->dbus.server, NULL, NULL, NULL, NULL, NULL); ret = EIO; @@ -345,7 +345,7 @@ static int sbus_server_destructor(void *ctx) if (server->symlink) { ret = remove_socket_symlink(server->symlink); if (ret != EOK) { - DEBUG(3, ("Could not remove the server symlink\n")); + DEBUG(3, "Could not remove the server symlink\n"); } }
diff --git a/src/sss_client/ssh/sss_ssh_authorizedkeys.c b/src/sss_client/ssh/sss_ssh_authorizedkeys.c index bc991a8..89eda23 100644 --- a/src/sss_client/ssh/sss_ssh_authorizedkeys.c +++ b/src/sss_client/ssh/sss_ssh_authorizedkeys.c @@ -53,7 +53,7 @@ int main(int argc, const char **argv) ret = set_locale(); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("set_locale() failed (%d): %s\n", ret, strerror(ret))); + "set_locale() failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -88,7 +88,7 @@ int main(int argc, const char **argv) pc_user, pc_domain, NULL, &ent); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret))); + "sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret)); ERROR("Error looking up public keys\n"); ret = EXIT_FAILURE; goto fini; @@ -99,8 +99,8 @@ int main(int argc, const char **argv) ret = sss_ssh_format_pubkey(mem_ctx, &ent->pubkeys[i], &repr); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sss_ssh_format_pubkey() failed (%d): %s\n", - ret, strerror(ret))); + "sss_ssh_format_pubkey() failed (%d): %s\n", + ret, strerror(ret)); continue; }
diff --git a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c index e2202b1..adb8228 100644 --- a/src/sss_client/ssh/sss_ssh_knownhostsproxy.c +++ b/src/sss_client/ssh/sss_ssh_knownhostsproxy.c @@ -54,16 +54,16 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len) flags = fcntl(0, F_GETFL); if (flags == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n", + ret, strerror(ret)); goto done; }
ret = fcntl(0, F_SETFL, flags | O_NONBLOCK); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n", + ret, strerror(ret)); goto done; }
@@ -71,8 +71,8 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len) sock = socket(family, SOCK_STREAM, IPPROTO_TCP); if (sock == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("socket() failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "socket() failed (%d): %s\n", + ret, strerror(ret)); goto done; }
@@ -80,8 +80,8 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len) ret = connect(sock, addr, addr_len); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("connect() failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "connect() failed (%d): %s\n", + ret, strerror(ret)); goto done; }
@@ -89,16 +89,16 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len) flags = fcntl(sock, F_GETFL); if (flags == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n", + ret, strerror(ret)); goto done; }
ret = fcntl(sock, F_SETFL, flags | O_NONBLOCK); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("fcntl() failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "fcntl() failed (%d): %s\n", + ret, strerror(ret)); goto done; }
@@ -115,7 +115,7 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len) continue; } DEBUG(SSSDBG_OP_FAILURE, - ("poll() failed (%d): %s\n", ret, strerror(ret))); + "poll() failed (%d): %s\n", ret, strerror(ret)); goto done; }
@@ -130,7 +130,7 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len) continue; } DEBUG(SSSDBG_OP_FAILURE, - ("read() failed (%d): %s\n", ret, strerror(ret))); + "read() failed (%d): %s\n", ret, strerror(ret)); goto done; } else if (res == 0) { ret = EOK; @@ -142,8 +142,8 @@ connect_socket(int family, struct sockaddr *addr, size_t addr_len) ret = errno; if (res == -1) { DEBUG(SSSDBG_OP_FAILURE, - ("sss_atomic_write_s() failed (%d): %s\n", - ret, strerror(ret))); + "sss_atomic_write_s() failed (%d): %s\n", + ret, strerror(ret)); goto done; } else if (ret == EPIPE) { ret = EOK; @@ -172,8 +172,8 @@ connect_proxy_command(char **args) execv(args[0], (char * const *)args);
ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("execv() failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "execv() failed (%d): %s\n", + ret, strerror(ret));
return ret; } @@ -210,14 +210,14 @@ int main(int argc, const char **argv) ret = set_locale(); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("set_locale() failed (%d): %s\n", ret, strerror(ret))); + "set_locale() failed (%d): %s\n", ret, strerror(ret)); ret = EXIT_FAILURE; goto fini; }
mem_ctx = talloc_new(NULL); if (!mem_ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Not enough memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Not enough memory\n"); ret = EXIT_FAILURE; goto fini; } @@ -266,7 +266,7 @@ int main(int argc, const char **argv) ret = getaddrinfo(pc_host, strport, &ai_hint, &ai); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getaddrinfo() failed (%d): %s\n", ret, gai_strerror(ret))); + "getaddrinfo() failed (%d): %s\n", ret, gai_strerror(ret)); } else { host = ai[0].ai_canonname; } @@ -275,7 +275,7 @@ int main(int argc, const char **argv) canonhost, NI_MAXHOST, NULL, 0, NI_NAMEREQD); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("getnameinfo() failed (%d): %s\n", ret, gai_strerror(ret))); + "getnameinfo() failed (%d): %s\n", ret, gai_strerror(ret)); } else { host = canonhost; } @@ -287,7 +287,7 @@ int main(int argc, const char **argv) host, pc_domain, pc_host, &ent); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret))); + "sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret)); } }
diff --git a/src/tests/auth-tests.c b/src/tests/auth-tests.c index 02fb39c..1a93eb1 100644 --- a/src/tests/auth-tests.c +++ b/src/tests/auth-tests.c @@ -88,7 +88,7 @@ static int setup_sysdb_tests(struct sysdb_test_ctx **ctx) talloc_free(test_ctx); return ENOMEM; } - DEBUG(3, ("CONFDB: %s\n", conf_db)); + DEBUG(3, "CONFDB: %s\n", conf_db);
/* Connect to the conf db */ ret = confdb_init(test_ctx, &test_ctx->confdb, conf_db); diff --git a/src/tests/cmocka/test_dyndns.c b/src/tests/cmocka/test_dyndns.c index f819dc9..66b2409 100644 --- a/src/tests/cmocka/test_dyndns.c +++ b/src/tests/cmocka/test_dyndns.c @@ -66,25 +66,25 @@ void __wrap_execv(const char *path, char *const argv[])
switch (dyndns_test_ctx->state) { case MOCK_NSUPDATE_OK: - DEBUG(SSSDBG_FUNC_DATA, ("nsupdate success test case\n")); + DEBUG(SSSDBG_FUNC_DATA, "nsupdate success test case\n"); err = 0; break; case MOCK_NSUPDATE_ERR: - DEBUG(SSSDBG_FUNC_DATA, ("nsupdate error test case\n")); + DEBUG(SSSDBG_FUNC_DATA, "nsupdate error test case\n"); err = 1; break; case MOCK_NSUPDATE_TIMEOUT: - DEBUG(SSSDBG_FUNC_DATA, ("nsupdate timeout test case\n")); + DEBUG(SSSDBG_FUNC_DATA, "nsupdate timeout test case\n"); err = 2; sleep(3); break; default: - DEBUG(SSSDBG_CRIT_FAILURE, ("unknown test case\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "unknown test case\n"); err = 255; break; }
- DEBUG(SSSDBG_TRACE_LIBS, ("Child exiting with status %d\n", err)); + DEBUG(SSSDBG_TRACE_LIBS, "Child exiting with status %d\n", err); _exit(err); }
@@ -218,7 +218,7 @@ void dyndns_test_ok(void **state) /* Wait until the test finishes with EOK */ ret = test_ev_loop(dyndns_test_ctx->tctx); DEBUG(SSSDBG_TRACE_LIBS, - ("Child request returned [%d]: %s\n", ret, strerror(ret))); + "Child request returned [%d]: %s\n", ret, strerror(ret)); assert_int_equal(ret, EOK);
assert_true(WIFEXITED(dyndns_test_ctx->child_status)); @@ -249,7 +249,7 @@ void dyndns_test_error(void **state) /* Wait until the test finishes with EIO (child error) */ ret = test_ev_loop(dyndns_test_ctx->tctx); DEBUG(SSSDBG_TRACE_LIBS, - ("Child request returned [%d]: %s\n", ret, strerror(ret))); + "Child request returned [%d]: %s\n", ret, strerror(ret)); assert_int_equal(ret, ERR_DYNDNS_FAILED);
assert_true(WIFEXITED(dyndns_test_ctx->child_status)); @@ -292,7 +292,7 @@ void dyndns_test_timeout(void **state) tevent_loop_once(dyndns_test_ctx->tctx->ev); /* nsupdate_child_handler */
DEBUG(SSSDBG_TRACE_LIBS, - ("Child request returned [%d]: %s\n", ret, strerror(ret))); + "Child request returned [%d]: %s\n", ret, strerror(ret)); assert_int_equal(ret, ERR_DYNDNS_TIMEOUT);
assert_true(check_leaks_pop(tmp_ctx) == true); @@ -334,7 +334,7 @@ void dyndns_test_interval(void **state) /* Wait until the timer hits */ ret = test_ev_loop(dyndns_test_ctx->tctx); DEBUG(SSSDBG_TRACE_LIBS, - ("Child request returned [%d]: %s\n", ret, strerror(ret))); + "Child request returned [%d]: %s\n", ret, strerror(ret)); assert_int_equal(ret, ERR_OK);
talloc_free(dyndns_test_ctx->update_ctx); diff --git a/src/tests/cmocka/test_fqnames.c b/src/tests/cmocka/test_fqnames.c index e073508..1c628a5 100644 --- a/src/tests/cmocka/test_fqnames.c +++ b/src/tests/cmocka/test_fqnames.c @@ -58,7 +58,7 @@ void fqdn_test_teardown(void **state) struct fqdn_test_ctx);
if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Type mismatch\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Type mismatch\n"); return; }
@@ -79,7 +79,7 @@ void test_default(void **state) size_t domsize;
if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Type mismatch\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Type mismatch\n"); return; }
@@ -116,7 +116,7 @@ void test_all(void **state) size_t domsize;
if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Type mismatch\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Type mismatch\n"); return; }
@@ -154,7 +154,7 @@ void test_flat(void **state) size_t domsize;
if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Type mismatch\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Type mismatch\n"); return; }
@@ -191,7 +191,7 @@ void test_flat_fallback(void **state) size_t domsize;
if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Type mismatch\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Type mismatch\n"); return; }
@@ -228,7 +228,7 @@ void test_init_nouser(void **state) errno_t ret;
if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Type mismatch\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Type mismatch\n"); return; }
diff --git a/src/tests/common_dom.c b/src/tests/common_dom.c index 9edb237..c0b4445 100644 --- a/src/tests/common_dom.c +++ b/src/tests/common_dom.c @@ -44,20 +44,20 @@ create_dom_test_ctx(TALLOC_CTX *mem_ctx,
test_ctx = create_ev_test_ctx(mem_ctx); if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed\n"); goto fail; }
conf_db = talloc_asprintf(test_ctx, "%s/%s", tests_path, confdb_path); if (conf_db == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed\n"); goto fail; }
/* Connect to the conf db */ ret = confdb_init(test_ctx, &test_ctx->confdb, conf_db); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("confdb_init failed: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "confdb_init failed: %d\n", ret); goto fail; }
@@ -65,13 +65,13 @@ create_dom_test_ctx(TALLOC_CTX *mem_ctx, ret = confdb_add_param(test_ctx->confdb, true, "config/sssd", "domains", val); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("cannot add domain: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "cannot add domain: %d\n", ret); goto fail; }
dompath = talloc_asprintf(test_ctx, "config/domain/%s", domain_name); if (dompath == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed\n"); goto fail; }
@@ -79,7 +79,7 @@ create_dom_test_ctx(TALLOC_CTX *mem_ctx, ret = confdb_add_param(test_ctx->confdb, true, dompath, "id_provider", val); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("cannot add id_provider: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "cannot add id_provider: %d\n", ret); goto fail; }
@@ -91,7 +91,7 @@ create_dom_test_ctx(TALLOC_CTX *mem_ctx, val); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("cannot add parameter %s: %d\n", params[i].key, ret)); + "cannot add parameter %s: %d\n", params[i].key, ret); goto fail; } } @@ -100,7 +100,7 @@ create_dom_test_ctx(TALLOC_CTX *mem_ctx, ret = sssd_domain_init(test_ctx, test_ctx->confdb, domain_name, tests_path, &test_ctx->dom); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("cannot add id_provider: %d\n", ret)); + DEBUG(SSSDBG_CRIT_FAILURE, "cannot add id_provider: %d\n", ret); goto fail; } test_ctx->sysdb = test_ctx->dom->sysdb; @@ -121,7 +121,7 @@ void test_dom_suite_setup(const char *tests_path) ret = mkdir(tests_path, 0775); if (ret != 0 && errno != EEXIST) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not create test directory\n")); + "Could not create test directory\n"); } }
@@ -136,14 +136,14 @@ void test_dom_suite_cleanup(const char *tests_path,
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed\n"); return; }
conf_db = talloc_asprintf(tmp_ctx, "%s/%s", tests_path, confdb_path); if (!conf_db) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not construct conf_db path\n")); + "Could not construct conf_db path\n"); goto done; }
@@ -151,14 +151,14 @@ void test_dom_suite_cleanup(const char *tests_path, ret = unlink(conf_db); if (ret != 0 && errno != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not delete the test config ldb file (%d) (%s)\n", - errno, strerror(errno))); + "Could not delete the test config ldb file (%d) (%s)\n", + errno, strerror(errno)); }
sys_db = talloc_asprintf(tmp_ctx, "%s/%s", tests_path, sysdb_path); if (!sys_db) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not construct sys_db path\n")); + "Could not construct sys_db path\n"); goto done; }
@@ -166,16 +166,16 @@ void test_dom_suite_cleanup(const char *tests_path, ret = unlink(sys_db); if (ret != 0 && errno != ENOENT) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not delete the test ldb file (%d) (%s)\n", - errno, strerror(errno))); + "Could not delete the test ldb file (%d) (%s)\n", + errno, strerror(errno)); }
errno = 0; ret = rmdir(tests_path); if (ret != 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not delete the test dir (%d) (%s)\n", - errno, strerror(errno))); + "Could not delete the test dir (%d) (%s)\n", + errno, strerror(errno)); }
done: diff --git a/src/tests/common_tev.c b/src/tests/common_tev.c index 81b97d3..770f97d 100644 --- a/src/tests/common_tev.c +++ b/src/tests/common_tev.c @@ -33,14 +33,14 @@ create_ev_test_ctx(TALLOC_CTX *mem_ctx)
test_ctx = talloc_zero(mem_ctx, struct sss_test_ctx); if (test_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed\n"); goto fail; }
/* Create an event context */ test_ctx->ev = tevent_context_init(test_ctx); if (test_ctx->ev == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("tevent_context_init failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "tevent_context_init failed\n"); goto fail; }
diff --git a/src/tests/debug-tests.c b/src/tests/debug-tests.c index 0902005..0d2fe39 100644 --- a/src/tests/debug-tests.c +++ b/src/tests/debug-tests.c @@ -221,7 +221,7 @@ int test_helper_debug_check_message(int level) goto done; }
- DEBUG(level, ("%s", body)); + DEBUG(level, "%s", body);
ret = fseek(file, 0, SEEK_END); if (ret == -1) { @@ -358,7 +358,7 @@ int test_helper_debug_is_empty_message(int level) goto done; }
- DEBUG(level, ("some error\n")); + DEBUG(level, "some error\n");
ret = fseek(file, 0, SEEK_END); if (ret == -1) { diff --git a/src/tests/files-tests.c b/src/tests/files-tests.c index 5851a72..8e1ac0c 100644 --- a/src/tests/files-tests.c +++ b/src/tests/files-tests.c @@ -64,14 +64,14 @@ static void teardown_files_test(void) cmd = talloc_asprintf(test_ctx, "/bin/rm -rf %s\n", dir_path); ret = system(cmd); if (ret == -1) { - DEBUG(1, ("Removing [%s] failed.\n", dir_path)); + DEBUG(1, "Removing [%s] failed.\n", dir_path); } } if (dst_path && test_ctx) { cmd = talloc_asprintf(test_ctx, "/bin/rm -rf %s\n", dst_path); ret = system(cmd); if (ret == -1) { - DEBUG(1, ("Removing [%s] failed.\n", dst_path)); + DEBUG(1, "Removing [%s] failed.\n", dst_path); } }
@@ -109,7 +109,7 @@ START_TEST(test_remove_tree) fail_unless(getcwd(origpath, PATH_MAX) == origpath, "Cannot getcwd\n"); fail_unless(errno == 0, "Cannot getcwd\n");
- DEBUG(5, ("About to delete %s\n", dir_path)); + DEBUG(5, "About to delete %s\n", dir_path);
/* create a file */ ret = chdir(dir_path); @@ -182,7 +182,7 @@ START_TEST(test_simple_copy) fail_if(ret == -1, "Cannot chdir\n");
/* and finally copy.. */ - DEBUG(5, ("Will copy from '%s' to '%s'\n", dir_path, dst_path)); + DEBUG(5, "Will copy from '%s' to '%s'\n", dir_path, dst_path); ret = copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n");
@@ -224,7 +224,7 @@ START_TEST(test_copy_symlink) fail_if(ret == -1, "Cannot chdir\n");
/* and finally copy.. */ - DEBUG(5, ("Will copy from '%s' to '%s'\n", dir_path, dst_path)); + DEBUG(5, "Will copy from '%s' to '%s'\n", dir_path, dst_path); ret = copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n");
@@ -262,7 +262,7 @@ START_TEST(test_copy_node) fail_if(ret == -1, "Cannot chdir\n");
/* and finally copy.. */ - DEBUG(5, ("Will copy from '%s' to '%s'\n", dir_path, dst_path)); + DEBUG(5, "Will copy from '%s' to '%s'\n", dir_path, dst_path); ret = copy_tree(dir_path, dst_path, 0700, uid, gid); fail_unless(ret == EOK, "copy_tree failed\n");
diff --git a/src/tests/krb5_child-test.c b/src/tests/krb5_child-test.c index 0c6b68b..8eb3b86 100644 --- a/src/tests/krb5_child-test.c +++ b/src/tests/krb5_child-test.c @@ -79,7 +79,7 @@ setup_krb5_child_test(TALLOC_CTX *mem_ctx, struct krb5_child_test_ctx **_ctx)
ctx->ev = tevent_context_init(ctx); if (ctx->ev == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not init tevent context")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not init tevent context"); talloc_free(ctx); return EFAULT; } @@ -116,8 +116,8 @@ create_dummy_krb5_ctx(TALLOC_CTX *mem_ctx, const char *realm) &errval, &errstr, &errpos, NULL); if (krb5_ctx->illegal_path_re == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("Invalid Regular Expression pattern at position %d. " - "(Error: %d [%s])\n", errpos, errval, errstr)); + "Invalid Regular Expression pattern at position %d. " + "(Error: %d [%s])\n", errpos, errval, errstr); goto fail; } talloc_set_destructor((TALLOC_CTX *) krb5_ctx, re_destructor); @@ -180,8 +180,8 @@ create_dummy_pam_data(TALLOC_CTX *mem_ctx, const char *user, if (ret) goto fail;
(void)sss_authtok_get_password(pd->authtok, &authtok, &authtok_len); - DEBUG(SSSDBG_FUNC_DATA, ("Authtok [%s] len [%d]\n", - authtok, (int)authtok_len)); + DEBUG(SSSDBG_FUNC_DATA, "Authtok [%s] len [%d]\n", + authtok, (int)authtok_len);
return pd;
@@ -207,7 +207,7 @@ create_dummy_req(TALLOC_CTX *mem_ctx, const char *user, pwd = getpwnam(user); if (!pwd) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Cannot get info on user [%s]\n", user)); + "Cannot get info on user [%s]\n", user); goto fail; }
@@ -222,7 +222,7 @@ create_dummy_req(TALLOC_CTX *mem_ctx, const char *user, ret = krb5_get_simple_upn(kr, kr->krb5_ctx, NULL, kr->pd->user, NULL, &kr->upn); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_get_simple_upn failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_get_simple_upn failed.\n"); goto fail; }
@@ -236,7 +236,7 @@ create_dummy_req(TALLOC_CTX *mem_ctx, const char *user, if (timeout) { ret = dp_opt_set_int(kr->krb5_ctx->opts, KRB5_AUTH_TIMEOUT, timeout); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to set value for krb5_auth_timeout\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to set value for krb5_auth_timeout\n"); goto fail; } } @@ -248,22 +248,22 @@ create_dummy_req(TALLOC_CTX *mem_ctx, const char *user, true, true); if (!kr->ccname) goto fail;
- DEBUG(SSSDBG_FUNC_DATA, ("ccname [%s] uid [%llu] gid [%llu]\n", + DEBUG(SSSDBG_FUNC_DATA, "ccname [%s] uid [%llu] gid [%llu]\n", kr->ccname, (unsigned long long) kr->uid, - (unsigned long long) kr->gid)); + (unsigned long long) kr->gid); } else { kr->ccname = talloc_strdup(kr, ccname); } if (!kr->ccname) goto fail;
- DEBUG(SSSDBG_FUNC_DATA, ("ccname [%s] uid [%u] gid [%u]\n", - kr->ccname, kr->uid, kr->gid)); + DEBUG(SSSDBG_FUNC_DATA, "ccname [%s] uid [%u] gid [%u]\n", + kr->ccname, kr->uid, kr->gid);
ret = sss_krb5_precreate_ccache(kr->ccname, kr->krb5_ctx->illegal_path_re, kr->uid, kr->gid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("create_ccache_dir failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "create_ccache_dir failed.\n"); goto fail; }
@@ -445,7 +445,7 @@ main(int argc, const char *argv[]) rm_ccache = false; break; default: - DEBUG(SSSDBG_FATAL_FAILURE, ("Unexpected option\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Unexpected option\n"); return 1; } } @@ -459,28 +459,28 @@ main(int argc, const char *argv[]) }
if (!pc_user) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Please specify the user\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Please specify the user\n"); poptPrintUsage(pc, stderr, 0); return 1; }
if (!pc_realm) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Please specify the realm\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Please specify the realm\n"); poptPrintUsage(pc, stderr, 0); return 1; }
if (!password && !pc_passwd) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Password was not provided or asked for\n")); + "Password was not provided or asked for\n"); poptPrintUsage(pc, stderr, 0); return 1; }
if (pc_ccname && pc_ccname_tp) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Both ccname and ccname template specified, " - "will prefer ccname\n")); + "Both ccname and ccname template specified, " + "will prefer ccname\n"); }
ret = setup_krb5_child_test(NULL, &ctx); @@ -493,14 +493,14 @@ main(int argc, const char *argv[]) ctx->kr = create_dummy_req(ctx, pc_user, password ? password : pc_passwd, pc_realm, pc_ccname, pc_ccname_tp, pc_timeout); if (!ctx->kr) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Cannot create Kerberos request\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Cannot create Kerberos request\n"); ret = 4; goto done; }
req = handle_child_send(ctx, ctx->ev, ctx->kr); if (!req) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Cannot create child request\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Cannot create child request\n"); ret = 4; goto done; } @@ -515,7 +515,7 @@ main(int argc, const char *argv[]) ret = parse_krb5_child_response(ctx, ctx->buf, ctx->len, ctx->kr->pd, 0, &ctx->res); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not parse child response\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not parse child response\n"); ret = 5; goto done; } diff --git a/src/tests/resolv-tests.c b/src/tests/resolv-tests.c index 8fde675..eb54e2c 100644 --- a/src/tests/resolv-tests.c +++ b/src/tests/resolv-tests.c @@ -273,11 +273,11 @@ static void test_ip_addr(struct tevent_req *req) &status, NULL, &rhostent); talloc_zfree(req); if (recv_status != EOK) { - DEBUG(2, ("resolv_gethostbyname_recv failed: %d\n", recv_status)); + DEBUG(2, "resolv_gethostbyname_recv failed: %d\n", recv_status); test_ctx->error = recv_status; return; } - DEBUG(7, ("resolv_gethostbyname_recv status: %d\n", status)); + DEBUG(7, "resolv_gethostbyname_recv status: %d\n", status);
test_ctx->error = ENOENT; for (i = 0; rhostent->addr_list[i]; i++) { @@ -310,7 +310,7 @@ START_TEST(test_resolv_ip_addr) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_ONLY, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -342,11 +342,11 @@ static void test_localhost(struct tevent_req *req) &status, NULL, &rhostent); talloc_zfree(req); if (recv_status != EOK) { - DEBUG(2, ("resolv_gethostbyname_recv failed: %d\n", recv_status)); + DEBUG(2, "resolv_gethostbyname_recv failed: %d\n", recv_status); test_ctx->error = recv_status; return; } - DEBUG(7, ("resolv_gethostbyname_recv status: %d\n", status)); + DEBUG(7, "resolv_gethostbyname_recv status: %d\n", status);
test_ctx->error = ENOENT; for (i = 0; rhostent->addr_list[i]; i++) { @@ -379,7 +379,7 @@ START_TEST(test_resolv_localhost) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -410,12 +410,12 @@ static void test_negative(struct tevent_req *req) &status, NULL, &hostent); talloc_zfree(req); if (recv_status == EOK) { - DEBUG(7, ("resolv_gethostbyname_recv succeeded in a negative test\n")); + DEBUG(7, "resolv_gethostbyname_recv succeeded in a negative test\n"); return; }
test_ctx->error = status; - DEBUG(2, ("resolv_gethostbyname_recv status: %d: %s\n", status, resolv_strerror(status))); + DEBUG(2, "resolv_gethostbyname_recv status: %d: %s\n", status, resolv_strerror(status)); }
START_TEST(test_resolv_negative) @@ -435,7 +435,7 @@ START_TEST(test_resolv_negative) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -482,8 +482,8 @@ static void test_internet(struct tevent_req *req) inet_ntop(rhostent->family, rhostent->addr_list[i]->ipaddr, addr_buf, sizeof(addr_buf)); - DEBUG(2, ("Found address %s with TTL %d\n", - addr_buf, rhostent->addr_list[i]->ttl)); + DEBUG(2, "Found address %s with TTL %d\n", + addr_buf, rhostent->addr_list[i]->ttl); } } break; @@ -492,7 +492,7 @@ static void test_internet(struct tevent_req *req) &txt_replies); test_ctx->error = (txt_replies == NULL) ? ENOENT : EOK; for (txtptr = txt_replies; txtptr != NULL; txtptr = txtptr->next) { - DEBUG(2, ("TXT Record: %s\n", txtptr->txt)); + DEBUG(2, "TXT Record: %s\n", txtptr->txt); } break; case TESTING_SRV: @@ -500,9 +500,9 @@ static void test_internet(struct tevent_req *req) &srv_replies); test_ctx->error = (srv_replies == NULL) ? ENOENT : EOK; for (srvptr = srv_replies; srvptr != NULL; srvptr = srvptr->next) { - DEBUG(2, ("SRV Record: %d %d %d %s\n", srvptr->weight, + DEBUG(2, "SRV Record: %d %d %d %s\n", srvptr->weight, srvptr->priority, srvptr->port, - srvptr->host)); + srvptr->host); } break; default: @@ -511,7 +511,7 @@ static void test_internet(struct tevent_req *req) } talloc_zfree(req); fail_if(recv_status != EOK, "The recv function failed: %d", recv_status); - DEBUG(7, ("recv status: %d\n", status)); + DEBUG(7, "recv status: %d\n", status);
if (rhostent != NULL) { talloc_free(rhostent); @@ -541,7 +541,7 @@ START_TEST(test_resolv_internet) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } @@ -612,7 +612,7 @@ static void resolv_free_context(struct tevent_context *ev, struct timeval t, void *ptr) { struct resolv_ctx *rctx = talloc_get_type(ptr, struct resolv_ctx); - DEBUG(7, ("freeing the context\n")); + DEBUG(7, "freeing the context\n");
talloc_free(rctx); } @@ -622,7 +622,7 @@ static void resolv_free_done(struct tevent_context *ev, struct timeval t, void *ptr) { struct resolv_test_ctx *tctx = talloc_get_type(ptr, struct resolv_test_ctx); - DEBUG(7, ("marking test as done\n")); + DEBUG(7, "marking test as done\n");
tctx->error = EOK; tctx->done = true; @@ -646,7 +646,7 @@ START_TEST(test_resolv_free_context) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { fail("Error calling resolv_gethostbyname_send"); goto done; @@ -683,7 +683,7 @@ static void resolv_free_req(struct tevent_context *ev, struct timeval t, void *ptr) { struct tevent_req *req = talloc_get_type(ptr, struct tevent_req); - DEBUG(7, ("freeing the request\n")); + DEBUG(7, "freeing the request\n");
talloc_free(req); } @@ -794,7 +794,7 @@ START_TEST(test_resolv_free_req) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { fail("Error calling resolv_gethostbyname_send"); goto done; @@ -871,7 +871,7 @@ START_TEST(test_resolv_timeout) req = resolv_gethostbyname_send(test_ctx, test_ctx->ev, test_ctx->resolv, hostname, IPV4_FIRST, default_host_dbs); - DEBUG(7, ("Sent resolv_gethostbyname\n")); + DEBUG(7, "Sent resolv_gethostbyname\n"); if (req == NULL) { ret = ENOMEM; } diff --git a/src/tests/simple_access-tests.c b/src/tests/simple_access-tests.c index 6d214dc..728f4ce 100644 --- a/src/tests/simple_access-tests.c +++ b/src/tests/simple_access-tests.c @@ -95,7 +95,7 @@ void setup_simple(void)
conf_db = talloc_asprintf(test_ctx, "%s/%s", TESTS_PATH, TEST_CONF_FILE); fail_if(conf_db == NULL, "Out of memory, aborting!"); - DEBUG(SSSDBG_TRACE_LIBS, ("CONFDB: %s\n", conf_db)); + DEBUG(SSSDBG_TRACE_LIBS, "CONFDB: %s\n", conf_db);
/* Connect to the conf db */ ret = confdb_init(test_ctx, &test_ctx->confdb, conf_db); @@ -589,16 +589,16 @@ START_TEST(test_provider_init) ret = sssm_simple_access_init(test_ctx->be_ctx, &bet_ops, (void**)&ctx); fail_if(ret != EOK);
- DEBUG(SSSDBG_TRACE_FUNC, ("Checking allow users list\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Checking allow users list\n"); check_access_list(ctx->allow_users, correct);
- DEBUG(SSSDBG_TRACE_FUNC, ("Checking deny users list\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Checking deny users list\n"); check_access_list(ctx->deny_users, correct);
- DEBUG(SSSDBG_TRACE_FUNC, ("Checking allow groups list\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Checking allow groups list\n"); check_access_list(ctx->allow_groups, correct);
- DEBUG(SSSDBG_TRACE_FUNC, ("Checking deny groups list\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Checking deny groups list\n"); check_access_list(ctx->deny_groups, correct); } END_TEST diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c index 74b7891..dc2d442 100644 --- a/src/tests/sysdb-tests.c +++ b/src/tests/sysdb-tests.c @@ -99,7 +99,7 @@ static int _setup_sysdb_tests(struct sysdb_test_ctx **ctx, bool enumerate) talloc_free(test_ctx); return ENOMEM; } - DEBUG(3, ("CONFDB: %s\n", conf_db)); + DEBUG(3, "CONFDB: %s\n", conf_db);
/* Connect to the conf db */ ret = confdb_init(test_ctx, &test_ctx->confdb, conf_db); @@ -1808,7 +1808,7 @@ static void cached_authentication_with_expiration(const char *username,
now = time(NULL); expected_expire_date = now + (24 * 60 * 60); - DEBUG(9, ("Setting SYSDB_LAST_ONLINE_AUTH to [%lld].\n", (long long) now)); + DEBUG(9, "Setting SYSDB_LAST_ONLINE_AUTH to [%lld].\n", (long long) now);
data->attrs = sysdb_new_attrs(data); ret = sysdb_attrs_add_time_t(data->attrs, SYSDB_LAST_ONLINE_AUTH, now); diff --git a/src/tests/sysdb_ssh-tests.c b/src/tests/sysdb_ssh-tests.c index 95c57a7..2df8e15 100644 --- a/src/tests/sysdb_ssh-tests.c +++ b/src/tests/sysdb_ssh-tests.c @@ -84,7 +84,7 @@ static int setup_sysdb_tests(struct sysdb_test_ctx **ctx) talloc_free(test_ctx); return ENOMEM; } - DEBUG(3, ("CONFDB: %s\n", conf_db)); + DEBUG(3, "CONFDB: %s\n", conf_db);
/* Connect to the conf db */ ret = confdb_init(test_ctx, &test_ctx->confdb, conf_db); diff --git a/src/tools/files.c b/src/tools/files.c index 7fc8422..f1cede0 100644 --- a/src/tools/files.c +++ b/src/tools/files.c @@ -174,8 +174,8 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx, O_RDONLY | O_DIRECTORY | O_NOFOLLOW, &ret); if (dir_fd == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot open %s: [%d]: %s\n", - dir_name, ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot open %s: [%d]: %s\n", + dir_name, ret, strerror(ret)); return ret; }
@@ -183,7 +183,7 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx, if (rootdir == NULL) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot open directory: [%d][%s]\n", ret, strerror(ret))); + "Cannot open directory: [%d][%s]\n", ret, strerror(ret)); close(dir_fd); goto fail; } @@ -199,7 +199,7 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx, if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("stat failed: [%d][%s]\n", ret, strerror(ret))); + "stat failed: [%d][%s]\n", ret, strerror(ret)); goto fail; }
@@ -207,8 +207,8 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx, /* if directory, recursively descend, but check if on the same FS */ if (parent_dev && parent_dev != statres.st_dev) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Directory %s is on different filesystem, " - "will not follow\n", result->d_name)); + "Directory %s is on different filesystem, " + "will not follow\n", result->d_name); ret = EFAULT; goto fail; } @@ -216,8 +216,8 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx, ret = remove_tree_with_ctx(mem_ctx, dir_fd, result->d_name, statres.st_dev); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Removing subdirectory failed: [%d][%s]\n", - ret, strerror(ret))); + "Removing subdirectory failed: [%d][%s]\n", + ret, strerror(ret)); goto fail; } } else { @@ -225,7 +225,7 @@ static int remove_tree_with_ctx(TALLOC_CTX *mem_ctx, if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Removing file failed: [%d][%s]\n", ret, strerror(ret))); + "Removing file failed: [%d][%s]\n", ret, strerror(ret)); goto fail; } } @@ -248,7 +248,7 @@ fail: if (rootdir) { /* clean up on abnormal exit but retain return code */ err = closedir(rootdir); if (err) { - DEBUG(SSSDBG_CRIT_FAILURE, ("closedir failed, bad dirp?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "closedir failed, bad dirp?\n"); } } return ret; @@ -313,7 +313,7 @@ copy_symlink(int src_dir_fd, ret = selinux_file_context(full_path); if (ret != 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to set SELinux context for [%s]\n", full_path)); + "Failed to set SELinux context for [%s]\n", full_path); /* Not fatal */ }
@@ -323,11 +323,11 @@ copy_symlink(int src_dir_fd, ret = errno; if (ret == EEXIST) { DEBUG(SSSDBG_MINOR_FAILURE, - ("symlink pointing to already exists at '%s'\n", full_path)); + "symlink pointing to already exists at '%s'\n", full_path); return EOK; }
- DEBUG(SSSDBG_CRIT_FAILURE, ("symlinkat failed: %s\n", strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "symlinkat failed: %s\n", strerror(ret)); return ret; }
@@ -336,15 +336,15 @@ copy_symlink(int src_dir_fd, if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fchownat failed: %s\n", strerror(ret))); + "fchownat failed: %s\n", strerror(ret)); return ret; }
ret = sss_timeat_set(dst_dir_fd, file_name, statp, AT_SYMLINK_NOFOLLOW); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("utimensat failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "utimensat failed [%d]: %s\n", + ret, strerror(ret)); /* Do not fail */ }
@@ -371,7 +371,7 @@ copy_file(int ifd, ret = selinux_file_context(full_path); if (ret != 0) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to set SELinux context for [%s]\n", full_path)); + "Failed to set SELinux context for [%s]\n", full_path); /* Not fatal */ }
@@ -382,8 +382,8 @@ copy_file(int ifd, if (ofd < 0 && errno != EEXIST) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("Cannot open() destination file '%s': [%d][%s].\n", - full_path, ret, strerror(ret))); + "Cannot open() destination file '%s': [%d][%s].\n", + full_path, ret, strerror(ret)); goto done; }
@@ -391,8 +391,8 @@ copy_file(int ifd, if (cnt == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot read() from source file: [%d][%s].\n", - ret, strerror(ret))); + "Cannot read() from source file: [%d][%s].\n", + ret, strerror(ret)); goto done; }
@@ -401,14 +401,14 @@ copy_file(int ifd, if (written == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Cannot write() to destination file: [%d][%s].\n", - ret, strerror(ret))); + "Cannot write() to destination file: [%d][%s].\n", + ret, strerror(ret)); goto done; }
if (written != cnt) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Wrote %zd bytes, expected %zd\n", written, cnt)); + "Wrote %zd bytes, expected %zd\n", written, cnt); goto done; } } @@ -419,8 +419,8 @@ copy_file(int ifd, if (ret == -1 && errno != EPERM) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("Error changing owner of '%s': %s\n", - full_path, strerror(ret))); + "Error changing owner of '%s': %s\n", + full_path, strerror(ret)); goto done; }
@@ -428,15 +428,15 @@ copy_file(int ifd, ret = fchmod(ofd, statp->st_mode); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("Error changing owner of '%s': %s\n", - full_path, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error changing owner of '%s': %s\n", + full_path, strerror(ret)); goto done; }
ret = sss_futime_set(ofd, statp); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("sss_futime_set failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "sss_futime_set failed [%d]: %s\n", + ret, strerror(ret)); /* Do not fail */ }
@@ -489,16 +489,16 @@ copy_entry(struct copy_ctx *cctx, O_RDONLY | O_NOFOLLOW | O_NONBLOCK, &ret); if (ifd == -1 && ret != ELOOP) { /* openat error */ - DEBUG(SSSDBG_CRIT_FAILURE, ("openat failed on '%s': %s\n", - src_ent_path, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "openat failed on '%s': %s\n", + src_ent_path, strerror(ret)); goto done; } else if (ifd == -1 && ret == ELOOP) { /* Should be a symlink.. */ ret = fstatat(src_dir_fd, ent_name, &st, AT_SYMLINK_NOFOLLOW); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("fstatat failed on '%s': %s\n", - src_ent_path, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "fstatat failed on '%s': %s\n", + src_ent_path, strerror(ret)); goto done; }
@@ -506,8 +506,8 @@ copy_entry(struct copy_ctx *cctx, ret = copy_symlink(src_dir_fd, dest_dir_fd, ent_name, dest_ent_path, &st, cctx->uid, cctx->gid); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot copy '%s' to '%s'\n", - src_ent_path, dest_ent_path)); + DEBUG(SSSDBG_OP_FAILURE, "Cannot copy '%s' to '%s'\n", + src_ent_path, dest_ent_path); } goto done; } @@ -516,7 +516,7 @@ copy_entry(struct copy_ctx *cctx, if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("couldn't stat '%s': %s", src_ent_path, strerror(ret))); + "couldn't stat '%s': %s", src_ent_path, strerror(ret)); goto done; }
@@ -528,8 +528,8 @@ copy_entry(struct copy_ctx *cctx, &st); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Couldn't recursively copy '%s' to '%s': %s\n", - src_ent_path, dest_ent_path, strerror(ret))); + "Couldn't recursively copy '%s' to '%s': %s\n", + src_ent_path, dest_ent_path, strerror(ret)); goto done; } } else if (S_ISREG(st.st_mode)) { @@ -537,14 +537,14 @@ copy_entry(struct copy_ctx *cctx, ret = copy_file(ifd, dest_dir_fd, ent_name, dest_ent_path, &st, cctx->uid, cctx->gid); if (ret) { - DEBUG(SSSDBG_OP_FAILURE, ("Cannot copy '%s' to '%s'\n", - src_ent_path, dest_ent_path)); + DEBUG(SSSDBG_OP_FAILURE, "Cannot copy '%s' to '%s'\n", + src_ent_path, dest_ent_path); goto done; } } else { /* Is a special file */ - DEBUG(SSSDBG_FUNC_DATA, ("'%s' is a special file, skipping.\n", - src_ent_path)); + DEBUG(SSSDBG_FUNC_DATA, "'%s' is a special file, skipping.\n", + src_ent_path); }
ret = EOK; @@ -577,7 +577,7 @@ copy_dir(struct copy_ctx *cctx, if (dir == NULL) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Error reading '%s': %s", src_dir_path, strerror(ret))); + "Error reading '%s': %s", src_dir_path, strerror(ret)); goto done; }
@@ -590,7 +590,7 @@ copy_dir(struct copy_ctx *cctx, if (ret == -1 && errno != EEXIST) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Error reading '%s': %s", dest_dir_path, strerror(ret))); + "Error reading '%s': %s", dest_dir_path, strerror(ret)); goto done; }
@@ -599,7 +599,7 @@ copy_dir(struct copy_ctx *cctx, if (dest_dir_fd == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Error opening '%s': %s", dest_dir_path, strerror(ret))); + "Error opening '%s': %s", dest_dir_path, strerror(ret)); goto done; }
@@ -616,8 +616,8 @@ copy_dir(struct copy_ctx *cctx, dest_dir_fd, dest_dir_path, ent->d_name); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not copy [%s] to [%s]\n", - src_dir_path, dest_dir_path)); + DEBUG(SSSDBG_OP_FAILURE, "Could not copy [%s] to [%s]\n", + src_dir_path, dest_dir_path); goto done; } } @@ -628,8 +628,8 @@ copy_dir(struct copy_ctx *cctx, if (ret == -1 && errno != EPERM) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("Error changing owner of '%s': %s", - dest_dir_path, strerror(ret))); + "Error changing owner of '%s': %s", + dest_dir_path, strerror(ret)); goto done; }
@@ -640,15 +640,15 @@ copy_dir(struct copy_ctx *cctx, if (ret == -1) { ret = errno; DEBUG(SSSDBG_OP_FAILURE, - ("Error setting mode of '%s': %s", - dest_dir_path, strerror(ret))); + "Error setting mode of '%s': %s", + dest_dir_path, strerror(ret)); goto done; }
sss_futime_set(dest_dir_fd, src_dir_stat); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("sss_futime_set failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "sss_futime_set failed [%d]: %s\n", + ret, strerror(ret)); /* Do not fail */ }
@@ -659,7 +659,7 @@ done: if (dret != 0) { dret = errno; DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to close directory: %s.\n", strerror(dret))); + "Failed to close directory: %s.\n", strerror(dret)); } }
@@ -708,7 +708,7 @@ int copy_tree(const char *src_root, const char *dst_root, dst_root, dst_root, mode_root, &s_src); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("copy_dir failed: [%d][%s]\n", ret, strerror(ret))); + "copy_dir failed: [%d][%s]\n", ret, strerror(ret)); goto fail; }
diff --git a/src/tools/selinux.c b/src/tools/selinux.c index e82e586..35f166d 100644 --- a/src/tools/selinux.c +++ b/src/tools/selinux.c @@ -132,7 +132,7 @@ static semanage_handle_t *sss_semanage_init(void)
handle = semanage_handle_create(); if (!handle) { - DEBUG(1, ("Cannot create SELinux management handle\n")); + DEBUG(1, "Cannot create SELinux management handle\n"); return NULL; }
@@ -142,25 +142,25 @@ static semanage_handle_t *sss_semanage_init(void)
ret = semanage_is_managed(handle); if (ret != 1) { - DEBUG(1, ("SELinux policy not managed\n")); + DEBUG(1, "SELinux policy not managed\n"); goto fail; }
ret = semanage_access_check(handle); if (ret < SEMANAGE_CAN_READ) { - DEBUG(1, ("Cannot read SELinux policy store\n")); + DEBUG(1, "Cannot read SELinux policy store\n"); goto fail; }
ret = semanage_connect(handle); if (ret != 0) { - DEBUG(1, ("Cannot estabilish SELinux management connection\n")); + DEBUG(1, "Cannot estabilish SELinux management connection\n"); goto fail; }
ret = semanage_begin_transaction(handle); if (ret != 0) { - DEBUG(1, ("Cannot begin SELinux transaction\n")); + DEBUG(1, "Cannot begin SELinux transaction\n"); goto fail; }
@@ -180,35 +180,35 @@ static int sss_semanage_user_add(semanage_handle_t *handle,
ret = semanage_seuser_create(handle, &seuser); if (ret != 0) { - DEBUG(1, ("Cannot create SELinux login mapping for %s\n", login_name)); + DEBUG(1, "Cannot create SELinux login mapping for %s\n", login_name); ret = EIO; goto done; }
ret = semanage_seuser_set_name(handle, seuser, login_name); if (ret != 0) { - DEBUG(1, ("Could not set name for %s\n", login_name)); + DEBUG(1, "Could not set name for %s\n", login_name); ret = EIO; goto done; }
ret = semanage_seuser_set_mlsrange(handle, seuser, DEFAULT_SERANGE); if (ret != 0) { - DEBUG(1, ("Could not set serange for %s\n", login_name)); + DEBUG(1, "Could not set serange for %s\n", login_name); ret = EIO; goto done; }
ret = semanage_seuser_set_sename(handle, seuser, seuser_name); if (ret != 0) { - DEBUG(1, ("Could not set SELinux user for %s\n", login_name)); + DEBUG(1, "Could not set SELinux user for %s\n", login_name); ret = EIO; goto done; }
ret = semanage_seuser_modify_local(handle, key, seuser); if (ret != 0) { - DEBUG(1, ("Could not add login mapping for %s\n", login_name)); + DEBUG(1, "Could not add login mapping for %s\n", login_name); ret = EIO; goto done; } @@ -229,28 +229,28 @@ static int sss_semanage_user_mod(semanage_handle_t *handle,
semanage_seuser_query(handle, key, &seuser); if (seuser == NULL) { - DEBUG(1, ("Could not query seuser for %s\n", login_name)); + DEBUG(1, "Could not query seuser for %s\n", login_name); ret = EIO; goto done; }
ret = semanage_seuser_set_mlsrange(handle, seuser, DEFAULT_SERANGE); if (ret != 0) { - DEBUG(1, ("Could not set serange for %s\n", login_name)); + DEBUG(1, "Could not set serange for %s\n", login_name); ret = EIO; goto done; }
ret = semanage_seuser_set_sename(handle, seuser, seuser_name); if (ret != 0) { - DEBUG(1, ("Could not set sename for %s\n", login_name)); + DEBUG(1, "Could not set sename for %s\n", login_name); ret = EIO; goto done; }
ret = semanage_seuser_modify_local(handle, key, seuser); if (ret != 0) { - DEBUG(1, (("Could not modify login mapping for %s\n"), login_name)); + DEBUG(1, ("Could not modify login mapping for %s\n"), login_name); ret = EIO; goto done; } @@ -275,21 +275,21 @@ int set_seuser(const char *login_name, const char *seuser_name)
handle = sss_semanage_init(); if (!handle) { - DEBUG(1, ("Cannot init SELinux management\n")); + DEBUG(1, "Cannot init SELinux management\n"); ret = EIO; goto done; }
ret = semanage_seuser_key_create(handle, login_name, &key); if (ret != 0) { - DEBUG(1, ("Cannot create SELinux user key\n")); + DEBUG(1, "Cannot create SELinux user key\n"); ret = EIO; goto done; }
ret = semanage_seuser_exists(handle, key, &seuser_exists); if (ret < 0) { - DEBUG(1, ("Cannot verify the SELinux user\n")); + DEBUG(1, "Cannot verify the SELinux user\n"); ret = EIO; goto done; } @@ -297,14 +297,14 @@ int set_seuser(const char *login_name, const char *seuser_name) if (seuser_exists) { ret = sss_semanage_user_mod(handle, key, login_name, seuser_name); if (ret != 0) { - DEBUG(1, ("Cannot modify SELinux user mapping\n")); + DEBUG(1, "Cannot modify SELinux user mapping\n"); ret = EIO; goto done; } } else { ret = sss_semanage_user_add(handle, key, login_name, seuser_name); if (ret != 0) { - DEBUG(1, ("Cannot add SELinux user mapping\n")); + DEBUG(1, "Cannot add SELinux user mapping\n"); ret = EIO; goto done; } @@ -312,7 +312,7 @@ int set_seuser(const char *login_name, const char *seuser_name)
ret = semanage_commit(handle); if (ret < 0) { - DEBUG(1, ("Cannot commit SELinux transaction\n")); + DEBUG(1, "Cannot commit SELinux transaction\n"); ret = EIO; goto done; } @@ -333,56 +333,56 @@ int del_seuser(const char *login_name)
handle = sss_semanage_init(); if (!handle) { - DEBUG(1, ("Cannot init SELinux management\n")); + DEBUG(1, "Cannot init SELinux management\n"); ret = EIO; goto done; }
ret = semanage_seuser_key_create(handle, login_name, &key); if (ret != 0) { - DEBUG(1, ("Cannot create SELinux user key\n")); + DEBUG(1, "Cannot create SELinux user key\n"); ret = EIO; goto done; }
ret = semanage_seuser_exists(handle, key, &exists); if (ret < 0) { - DEBUG(1, ("Cannot verify the SELinux user\n")); + DEBUG(1, "Cannot verify the SELinux user\n"); ret = EIO; goto done; }
if (!exists) { - DEBUG(5, ("Login mapping for %s is not defined, OK if default mapping " - "was used\n", login_name)); + DEBUG(5, "Login mapping for %s is not defined, OK if default mapping " + "was used\n", login_name); ret = EOK; /* probably default mapping */ goto done; }
ret = semanage_seuser_exists_local(handle, key, &exists); if (ret < 0) { - DEBUG(1, ("Cannot verify the SELinux user\n")); + DEBUG(1, "Cannot verify the SELinux user\n"); ret = EIO; goto done; }
if (!exists) { - DEBUG(1, ("Login mapping for %s is defined in policy, " - "cannot be deleted", login_name)); + DEBUG(1, "Login mapping for %s is defined in policy, " + "cannot be deleted", login_name); ret = ENOENT; goto done; }
ret = semanage_seuser_del_local(handle, key); if (ret != 0) { - DEBUG(1, ("Could not delete login mapping for %s", login_name)); + DEBUG(1, "Could not delete login mapping for %s", login_name); ret = EIO; goto done; }
ret = semanage_commit(handle); if (ret < 0) { - DEBUG(1, ("Cannot commit SELinux transaction\n")); + DEBUG(1, "Cannot commit SELinux transaction\n"); ret = EIO; goto done; } diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c index fa2e29d..5a6524f 100644 --- a/src/tools/sss_cache.c +++ b/src/tools/sss_cache.c @@ -108,7 +108,7 @@ int main(int argc, const char *argv[]) ret = init_context(argc, argv, &tctx); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error initializing context for the application\n")); + "Error initializing context for the application\n"); goto done; }
@@ -120,7 +120,7 @@ int main(int argc, const char *argv[]) ret = sysdb_update_subdomains(dinfo); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to update subdomains for domain %s.\n", dinfo->name)); + "Failed to update subdomains for domain %s.\n", dinfo->name); } }
@@ -128,14 +128,14 @@ int main(int argc, const char *argv[]) /* Update filters for each domain */ ret = update_all_filters(tctx, dinfo); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to update filters.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to update filters.\n"); goto done; }
ret = sysdb_transaction_start(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not start the transaction!\n")); + "Could not start the transaction!\n"); goto done; }
@@ -158,11 +158,11 @@ int main(int argc, const char *argv[]) ret = sysdb_transaction_commit(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not commit the transaction!\n")); + "Could not commit the transaction!\n"); ret = sysdb_transaction_cancel(sysdb); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to cancel transaction\n")); + "Failed to cancel transaction\n"); } } } @@ -174,7 +174,7 @@ int main(int argc, const char *argv[]) } else { ret = sss_memcache_clear_all(); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to clear memory cache.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to clear memory cache.\n"); goto done; } } @@ -205,21 +205,21 @@ static errno_t update_filter(struct cache_tool_ctx *tctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory.\n"); return ENOMEM; }
ret = sss_parse_name(tmp_ctx, tctx->nctx, name, &parsed_domain, &parsed_name); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_parse_name failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_parse_name failed\n"); goto done; }
if (!dinfo->case_sensitive && !force_case_sensitivity) { use_name = sss_tc_utf8_str_tolower(tmp_ctx, parsed_name); if (!use_name) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); ret = ENOMEM; goto done; } @@ -242,7 +242,7 @@ static errno_t update_filter(struct cache_tool_ctx *tctx, filter = talloc_strdup(tmp_ctx, use_name); } if (filter == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); ret = ENOMEM; goto done; } @@ -258,7 +258,7 @@ static errno_t update_filter(struct cache_tool_ctx *tctx, filter = talloc_strdup(tmp_ctx, name); } if (filter == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Out of memory\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Out of memory\n"); ret = ENOMEM; goto done; } @@ -287,7 +287,7 @@ static errno_t update_all_filters(struct cache_tool_ctx *tctx, ret = sss_names_init(tctx, tctx->confdb, dinfo->name, &tctx->nctx); } if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sss_names_init() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sss_names_init() failed\n"); return ret; }
@@ -381,12 +381,12 @@ static bool invalidate_entries(TALLOC_CTX *ctx,
if (ret != EOK) { if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC, ("'%s' %s: Not found in domain '%s'\n", - type_string, name ? name : "", dinfo->name)); + DEBUG(SSSDBG_TRACE_FUNC, "'%s' %s: Not found in domain '%s'\n", + type_string, name ? name : "", dinfo->name); } else { DEBUG(SSSDBG_CRIT_FAILURE, - ("Searching for %s in domain %s with filter %s failed\n", - type_string, dinfo->name, filter)); + "Searching for %s in domain %s with filter %s failed\n", + type_string, dinfo->name, filter); } return false; } @@ -396,14 +396,14 @@ static bool invalidate_entries(TALLOC_CTX *ctx, c_name = ldb_msg_find_attr_as_string(msgs[i], SYSDB_NAME, NULL); if (c_name == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Something bad happened, can't find attribute %s", SYSDB_NAME)); + "Something bad happened, can't find attribute %s", SYSDB_NAME); ERROR("Couldn't invalidate %1$s", type_string); iret = false; } else { ret = invalidate_entry(ctx, sysdb, dinfo, c_name, entry_type); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Couldn't invalidate %s %s", type_string, c_name)); + "Couldn't invalidate %s %s", type_string, c_name); ERROR("Couldn't invalidate %1$s %2$s", type_string, c_name); iret = false; } @@ -450,14 +450,14 @@ static errno_t invalidate_entry(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb, return EINVAL; } if (ret != EOK) { - DEBUG(3, ("Could not set entry attributes\n")); + DEBUG(3, "Could not set entry attributes\n"); } } else { - DEBUG(3, ("Could not add expiration time to attributes\n")); + DEBUG(3, "Could not add expiration time to attributes\n"); } talloc_zfree(sys_attrs); } else { - DEBUG(3, ("Could not create sysdb attributes\n")); + DEBUG(3, "Could not create sysdb attributes\n"); ret = ENOMEM; } return ret; @@ -477,7 +477,7 @@ errno_t init_domains(struct cache_tool_ctx *ctx, const char *domain) ret = confdb_init(ctx, &ctx->confdb, confdb_path); talloc_free(confdb_path); if (ret != EOK) { - DEBUG(1, ("Could not initialize connection to the confdb\n")); + DEBUG(1, "Could not initialize connection to the confdb\n"); return ret; }
@@ -486,21 +486,21 @@ errno_t init_domains(struct cache_tool_ctx *ctx, const char *domain) domain, DB_PATH, &ctx->domains); if (ret != EOK) { SYSDB_VERSION_ERROR(ret); - DEBUG(1, ("Could not initialize connection to the sysdb\n")); + DEBUG(1, "Could not initialize connection to the sysdb\n"); return ret; }
} else { ret = confdb_get_domains(ctx->confdb, &ctx->domains); if (ret != EOK) { - DEBUG(1, ("Could not initialize domains\n")); + DEBUG(1, "Could not initialize domains\n"); return ret; }
ret = sysdb_init(ctx, ctx->domains, false); SYSDB_VERSION_ERROR(ret); if (ret != EOK) { - DEBUG(1, ("Could not initialize connection to the sysdb\n")); + DEBUG(1, "Could not initialize connection to the sysdb\n"); return ret; } } @@ -557,7 +557,7 @@ errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); goto fini; } @@ -604,7 +604,7 @@ errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx)
ctx = talloc_zero(NULL, struct cache_tool_ctx); if (ctx == NULL) { - DEBUG(1, ("Could not allocate memory for tools context\n")); + DEBUG(1, "Could not allocate memory for tools context\n"); ret = ENOMEM; goto fini; } @@ -658,7 +658,7 @@ errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx) (user && !ctx->user_name) || (group && !ctx->group_name) || (netgroup && !ctx->netgroup_name) || (map && !ctx->autofs_name) || (service && !ctx->service_name)) { - DEBUG(1, ("Construction of filters failed\n")); + DEBUG(1, "Construction of filters failed\n"); ret = ENOMEM; goto fini; } @@ -673,7 +673,7 @@ errno_t init_context(int argc, const char *argv[], struct cache_tool_ctx **tctx) ERROR("Could not open available domains\n"); } DEBUG(SSSDBG_OP_FAILURE, - ("Initialization of sysdb connections failed\n")); + "Initialization of sysdb connections failed\n"); goto fini; }
diff --git a/src/tools/sss_debuglevel.c b/src/tools/sss_debuglevel.c index 3fe634e..906f1c0 100644 --- a/src/tools/sss_debuglevel.c +++ b/src/tools/sss_debuglevel.c @@ -111,7 +111,7 @@ int main(int argc, const char **argv) }
if (config_file == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto fini; } @@ -128,7 +128,7 @@ int main(int argc, const char **argv) ctx = talloc_zero(NULL, struct debuglevel_tool_ctx); if (ctx == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not allocate memory for tools context\n")); + "Could not allocate memory for tools context\n"); ret = ENOMEM; goto fini; } @@ -163,15 +163,15 @@ errno_t set_debug_level(struct debuglevel_tool_ctx *tool_ctx, TALLOC_CTX *tmp_ctx = talloc_new(NULL);
if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
/* convert debug_to_set to string */ values[0] = talloc_asprintf(tmp_ctx, "0x%.4x", debug_to_set); if (values[0] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not allocate memory for " - "debug_to_set to string conversion\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not allocate memory for " + "debug_to_set to string conversion\n"); ret = ENOMEM; goto done; } @@ -193,8 +193,8 @@ errno_t set_debug_level(struct debuglevel_tool_ctx *tool_ctx, errno = 0; if (utime(config_file, NULL) == -1 ) { err = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to change mtime of "%s": %s\n", - config_file, strerror(err))); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to change mtime of "%s": %s\n", + config_file, strerror(err)); }
ret = EOK; @@ -212,14 +212,14 @@ errno_t connect_to_confdb(TALLOC_CTX *ctx, struct confdb_ctx **cdb_ctx) confdb_path = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE); if (confdb_path == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not allocate memory for confdb path\n")); + "Could not allocate memory for confdb path\n"); return ENOMEM; }
ret = confdb_init(ctx, cdb_ctx, confdb_path); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not initialize connection to the confdb\n")); + "Could not initialize connection to the confdb\n"); }
talloc_free(confdb_path); @@ -249,14 +249,14 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb, TALLOC_CTX *tmp_ctx = talloc_new(NULL);
if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return ENOMEM; }
/* get domains */ ret = confdb_get_domains(confdb, &domain_list); if (ret != EOK) - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to get domain list\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to get domain list\n");
for (domain = domain_list; domain; @@ -269,7 +269,7 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb, domain_count + known_services_count + 1); if (sections == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not allocate memory for sections\n")); + "Could not allocate memory for sections\n"); ret = ENOMEM; goto fail; } @@ -277,7 +277,7 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb, for (i = 0; i < known_services_count; i++) { sections[i] = talloc_strdup(tmp_ctx, known_services[i]); if (sections[i] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); ret = ENOMEM; goto fail; } @@ -289,7 +289,7 @@ errno_t get_confdb_sections(TALLOC_CTX *ctx, struct confdb_ctx *confdb, sections[i] = talloc_asprintf(tmp_ctx, CONFDB_DOMAIN_PATH_TMPL, domain->name); if (sections[i] == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf() failed\n"); ret = ENOMEM; goto fail; } diff --git a/src/tools/sss_groupadd.c b/src/tools/sss_groupadd.c index 5667e9a..f4a425a 100644 --- a/src/tools/sss_groupadd.c +++ b/src/tools/sss_groupadd.c @@ -54,7 +54,7 @@ int main(int argc, const char **argv)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -79,7 +79,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx); if (ret != EOK) { - DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret)); if (ret == ENOENT) { ERROR("Error initializing the tools - no local domain\n"); } else { @@ -108,7 +108,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_start(tctx->sysdb); if (tctx->error != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -121,7 +121,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_commit(tctx->sysdb); if (tctx->error != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -130,7 +130,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(tctx->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } }
@@ -146,7 +146,7 @@ done: break;
default: - DEBUG(1, ("sysdb operation failed (%d)[%s]\n", ret, strerror(ret))); + DEBUG(1, "sysdb operation failed (%d)[%s]\n", ret, strerror(ret)); ERROR("Transaction error. Could not add group.\n"); break; } diff --git a/src/tools/sss_groupdel.c b/src/tools/sss_groupdel.c index 456b2b4..827432d 100644 --- a/src/tools/sss_groupdel.c +++ b/src/tools/sss_groupdel.c @@ -49,7 +49,7 @@ int main(int argc, const char **argv)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -73,7 +73,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx); if (ret != EOK) { - DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret)); if (ret == ENOENT) { ERROR("Error initializing the tools - no local domain\n"); } else { @@ -123,7 +123,7 @@ int main(int argc, const char **argv)
done: if (ret) { - DEBUG(1, ("sysdb operation failed (%d)[%s]\n", ret, strerror(ret))); + DEBUG(1, "sysdb operation failed (%d)[%s]\n", ret, strerror(ret)); switch (ret) { case ENOENT: ERROR("No such group in local domain. " diff --git a/src/tools/sss_groupmod.c b/src/tools/sss_groupmod.c index 29113d3..77eaf31 100644 --- a/src/tools/sss_groupmod.c +++ b/src/tools/sss_groupmod.c @@ -61,7 +61,7 @@ int main(int argc, const char **argv)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -106,7 +106,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx); if (ret != EOK) { - DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret)); if (ret == ENOENT) { ERROR("Error initializing the tools - no local domain\n"); } else { @@ -137,7 +137,7 @@ int main(int argc, const char **argv) if (addgroups) { ret = parse_groups(tctx, addgroups, &tctx->octx->addgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse groups to add the group to\n")); + DEBUG(1, "Cannot parse groups to add the group to\n"); ERROR("Internal error while parsing parameters\n"); ret = EXIT_FAILURE; goto fini; @@ -145,7 +145,7 @@ int main(int argc, const char **argv)
ret = parse_group_name_domain(tctx, tctx->octx->addgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse FQDN groups to add the group to\n")); + DEBUG(1, "Cannot parse FQDN groups to add the group to\n"); ERROR("Member groups must be in the same domain as parent group\n"); ret = EXIT_FAILURE; goto fini; @@ -164,7 +164,7 @@ int main(int argc, const char **argv) if (rmgroups) { ret = parse_groups(tctx, rmgroups, &tctx->octx->rmgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse groups to remove the group from\n")); + DEBUG(1, "Cannot parse groups to remove the group from\n"); ERROR("Internal error while parsing parameters\n"); ret = EXIT_FAILURE; goto fini; @@ -172,7 +172,7 @@ int main(int argc, const char **argv)
ret = parse_group_name_domain(tctx, tctx->octx->rmgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse FQDN groups to remove the group from\n")); + DEBUG(1, "Cannot parse FQDN groups to remove the group from\n"); ERROR("Member groups must be in the same domain as parent group\n"); ret = EXIT_FAILURE; goto fini; @@ -196,7 +196,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_start(tctx->sysdb); if (tctx->error != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -209,7 +209,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_commit(tctx->sysdb); if (tctx->error != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -239,12 +239,12 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(tctx->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } } if (tctx->error) { ret = tctx->error; - DEBUG(1, ("sysdb operation failed (%d)[%s]\n", ret, strerror(ret))); + DEBUG(1, "sysdb operation failed (%d)[%s]\n", ret, strerror(ret)); switch (ret) { case ENOENT: ERROR("Could not modify group - check if member group names are correct\n"); diff --git a/src/tools/sss_groupshow.c b/src/tools/sss_groupshow.c index 56adf2a..4e72736 100644 --- a/src/tools/sss_groupshow.c +++ b/src/tools/sss_groupshow.c @@ -80,7 +80,7 @@ static int parse_memberofs(struct ldb_context *ldb, if (gi->memberofs[i] == NULL) { return ENOMEM; } - DEBUG(6, ("memberof value: %s\n", gi->memberofs[i])); + DEBUG(6, "memberof value: %s\n", gi->memberofs[i]); } gi->memberofs[el->num_values] = NULL;
@@ -140,7 +140,7 @@ static int parse_members(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto fail; } - DEBUG(6, ("User member %s\n", um[um_index])); + DEBUG(6, "User member %s\n", um[um_index]); um_index++; } else if (ldb_dn_compare_base(parent_dn, group_basedn) == 0) { gm[gm_index] = rdn_as_string(mem_ctx, dn); @@ -149,15 +149,15 @@ static int parse_members(TALLOC_CTX *mem_ctx, goto fail; } if (parent_name && strcmp(gm[gm_index], parent_name) == 0) { - DEBUG(6, ("Skipping circular nesting for group %s\n", - gm[gm_index])); + DEBUG(6, "Skipping circular nesting for group %s\n", + gm[gm_index]); continue; } - DEBUG(6, ("Group member %s\n", gm[gm_index])); + DEBUG(6, "Group member %s\n", gm[gm_index]); gm_index++; } else { - DEBUG(2, ("Group member not a user nor group: %s\n", - ldb_dn_get_linearized(dn))); + DEBUG(2, "Group member not a user nor group: %s\n", + ldb_dn_get_linearized(dn)); ret = EIO; goto fail; } @@ -216,7 +216,7 @@ static int process_group(TALLOC_CTX *mem_ctx, struct group_info *gi = NULL; const char **user_members;
- DEBUG(6, ("Found entry %s\n", ldb_dn_get_linearized(msg->dn))); + DEBUG(6, "Found entry %s\n", ldb_dn_get_linearized(msg->dn));
gi = talloc_zero(mem_ctx, struct group_info); if (!gi) { @@ -232,7 +232,7 @@ static int process_group(TALLOC_CTX *mem_ctx, gi->gid = ldb_msg_find_attr_as_uint64(msg, SYSDB_GIDNUM, 0); if (gi->gid == 0 || gi->name == NULL) { - DEBUG(3, ("No name or no GID?\n")); + DEBUG(3, "No name or no GID?\n"); ret = EIO; goto done; } @@ -335,7 +335,7 @@ int group_show(TALLOC_CTX *mem_ctx, /* First, search for the root group */ ret = sysdb_search_group_by_name(mem_ctx, sysdb, domain, name, attrs, &msg); if (ret) { - DEBUG(2, ("Search failed: %s (%d)\n", strerror(ret), ret)); + DEBUG(2, "Search failed: %s (%d)\n", strerror(ret), ret); goto done; }
@@ -343,8 +343,8 @@ int group_show(TALLOC_CTX *mem_ctx, msg, domain, NULL, &root, &group_members, &nmembers); if (ret != EOK) { - DEBUG(2, ("Group processing failed: %s (%d)\n", - strerror(ret), ret)); + DEBUG(2, "Group processing failed: %s (%d)\n", + strerror(ret), ret); goto done; }
@@ -393,7 +393,7 @@ int group_show(TALLOC_CTX *mem_ctx, group_members, nmembers, &root->group_members); if (ret) { - DEBUG(2, ("Recursive search failed: %s (%d)\n", strerror(ret), ret)); + DEBUG(2, "Recursive search failed: %s (%d)\n", strerror(ret), ret); goto done; }
@@ -448,8 +448,8 @@ static int group_show_trim_memberof(TALLOC_CTX *mem_ctx, name = ldb_msg_find_attr_as_string(msgs[0], SYSDB_NAME, NULL); if (!name) { - DEBUG(2, ("Entry %s has no Name Attribute ?!?\n", - ldb_dn_get_linearized(msgs[0]->dn))); + DEBUG(2, "Entry %s has no Name Attribute ?!?\n", + ldb_dn_get_linearized(msgs[0]->dn)); return EFAULT; }
@@ -509,7 +509,7 @@ int group_show_recurse(TALLOC_CTX *mem_ctx, ret = sysdb_search_group_by_name(mem_ctx, sysdb, domain, group_members[i], attrs, &msg); if (ret) { - DEBUG(2, ("Search failed: %s (%d)\n", strerror(ret), ret)); + DEBUG(2, "Search failed: %s (%d)\n", strerror(ret), ret); return EIO; }
@@ -517,8 +517,8 @@ int group_show_recurse(TALLOC_CTX *mem_ctx, msg, domain, parent->name, &groups[i], &new_group_members, &new_nmembers); if (ret != EOK) { - DEBUG(2, ("Group processing failed: %s (%d)\n", - strerror(ret), ret)); + DEBUG(2, "Group processing failed: %s (%d)\n", + strerror(ret), ret); return ret; }
@@ -529,8 +529,8 @@ int group_show_recurse(TALLOC_CTX *mem_ctx, new_group_members, new_nmembers, &parent->group_members); if (ret != EOK) { - DEBUG(2, ("Recursive search failed: %s (%d)\n", - strerror(ret), ret)); + DEBUG(2, "Recursive search failed: %s (%d)\n", + strerror(ret), ret); return ret; } talloc_zfree(new_group_members); @@ -562,7 +562,7 @@ static int group_show_mpg(TALLOC_CTX *mem_ctx,
ret = sysdb_search_user_by_name(info, sysdb, domain, name, attrs, &msg); if (ret) { - DEBUG(2, ("Search failed: %s (%d)\n", strerror(ret), ret)); + DEBUG(2, "Search failed: %s (%d)\n", strerror(ret), ret); goto fail; }
@@ -571,7 +571,7 @@ static int group_show_mpg(TALLOC_CTX *mem_ctx, SYSDB_NAME, NULL)); info->gid = ldb_msg_find_attr_as_uint64(msg, SYSDB_UIDNUM, 0); if (info->gid == 0 || info->name == NULL) { - DEBUG(3, ("No name or no GID?\n")); + DEBUG(3, "No name or no GID?\n"); ret = EIO; goto fail; } @@ -659,7 +659,7 @@ int main(int argc, const char **argv)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -691,7 +691,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx); if (ret != EOK) { - DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret)); if (ret == ENOENT) { ERROR("Error initializing the tools - no local domain\n"); } else { @@ -720,7 +720,7 @@ int main(int argc, const char **argv)
/* Process result */ if (ret) { - DEBUG(1, ("sysdb operation failed (%d)[%s]\n", ret, strerror(ret))); + DEBUG(1, "sysdb operation failed (%d)[%s]\n", ret, strerror(ret)); switch (ret) { case ENOENT: ERROR("No such group in local domain. " diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c index 78e0274..d1bc184 100644 --- a/src/tools/sss_seed.c +++ b/src/tools/sss_seed.c @@ -78,8 +78,8 @@ static int seed_prompt(const char *req) len = sss_atomic_write_s(STDOUT_FILENO, &prompt[i++], 1); if (len == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("write failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "write failed [%d][%s].\n", + ret, strerror(ret)); goto done; } } @@ -107,8 +107,8 @@ static int seed_str_input(TALLOC_CTX *mem_ctx, while ((bytes_read = sss_atomic_read_s(STDIN_FILENO, buf+len, 1)) != 0) { if (bytes_read == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("read failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "read failed [%d][%s].\n", + ret, strerror(ret)); return ret; } if (buf[len] == '\n' || len == BUFSIZE) { @@ -121,7 +121,7 @@ static int seed_str_input(TALLOC_CTX *mem_ctx, *_input = talloc_strdup(mem_ctx, buf); if (*_input == NULL) { ret = ENOMEM; - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to allocate input\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to allocate input\n"); }
return ret; @@ -145,8 +145,8 @@ static int seed_id_input(const char *req, while ((bytes_read = sss_atomic_read_s(STDIN_FILENO, buf+len, 1)) != 0) { if (bytes_read == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("read failed [%d][%s].\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "read failed [%d][%s].\n", + ret, strerror(ret)); return ret; } if (buf[len] == '\n' || len == BUFSIZE) { @@ -161,18 +161,18 @@ static int seed_id_input(const char *req, *_id_input = (uid_t)strtoll(buf, &endptr, 10); if (errno != 0) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("strtoll failed on [%s]: [%d][%s].\n", - (char *)buf, ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "strtoll failed on [%s]: [%d][%s].\n", + (char *)buf, ret, strerror(ret)); return ret; } if (*endptr != '\0') { DEBUG(SSSDBG_MINOR_FAILURE, - ("extra characters [%s] after ID [%"SPRIuid"]\n", - endptr, *_id_input)); + "extra characters [%s] after ID [%"SPRIuid"]\n", + endptr, *_id_input); } } else { ret = EINVAL; - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get %s input.\n", req)); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get %s input.\n", req); }
return ret; @@ -187,14 +187,14 @@ static int seed_password_input_prompt(TALLOC_CTX *mem_ctx, char **_password)
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not allocate temp context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not allocate temp context\n"); ret = ENOMEM; goto done; }
temp = getpass("Enter temporary password:"); if (temp == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get prompted password\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get prompted password\n"); ret = EINVAL; goto done; } @@ -216,14 +216,14 @@ static int seed_password_input_prompt(TALLOC_CTX *mem_ctx, char **_password)
temp = getpass("Enter temporary password again:"); if (temp == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get prompted password\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get prompted password\n"); ret = EINVAL; goto done; }
if (strncmp(temp,password,strlen(password)) != 0) { ERROR("Passwords do not match\n"); - DEBUG(SSSDBG_MINOR_FAILURE, ("Provided passwords do not match\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Provided passwords do not match\n"); ret = EINVAL; goto done; } @@ -250,16 +250,16 @@ static int seed_password_input_file(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not allocate temp context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not allocate temp context\n"); ret = ENOMEM; goto done; }
fd = open(filename, O_RDONLY); if (fd == -1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to open password file " + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to open password file " "[%s] [%d][%s]\n", - filename, errno, strerror(errno))); + filename, errno, strerror(errno)); ret = EINVAL; goto done; } @@ -268,9 +268,9 @@ static int seed_password_input_file(TALLOC_CTX *mem_ctx, len = sss_atomic_read_s(fd, buf, PASS_MAX + 1); if (len == -1) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to read password from file " + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to read password from file " "[%s] [%d][%s]\n", - filename, ret, strerror(ret))); + filename, ret, strerror(ret)); close(fd); goto done; } @@ -341,7 +341,7 @@ static int seed_interactive_input(TALLOC_CTX *mem_ctx, ret = seed_str_input(input_uctx, _("username"), &input_uctx->name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Username interactive input failed.\n")); + "Username interactive input failed.\n"); goto done; } } else { @@ -355,7 +355,7 @@ static int seed_interactive_input(TALLOC_CTX *mem_ctx, if (uctx->uid == 0) { ret = seed_id_input(_("UID"), &input_uctx->uid); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("UID interactive input failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "UID interactive input failed.\n"); goto done; } } else { @@ -365,7 +365,7 @@ static int seed_interactive_input(TALLOC_CTX *mem_ctx, if (uctx->gid == 0) { ret = seed_id_input(_("GID"), &input_uctx->gid); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("GID interactive input failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "GID interactive input failed.\n"); goto done; } } else { @@ -376,7 +376,7 @@ static int seed_interactive_input(TALLOC_CTX *mem_ctx, ret = seed_str_input(input_uctx, _("user comment (gecos)"), &input_uctx->gecos); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Gecos interactive input failed.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Gecos interactive input failed.\n"); goto done; } } else { @@ -392,7 +392,7 @@ static int seed_interactive_input(TALLOC_CTX *mem_ctx, &input_uctx->home); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Home directory interactive input fialed.\n")); + "Home directory interactive input fialed.\n"); goto done; } } else { @@ -407,7 +407,7 @@ static int seed_interactive_input(TALLOC_CTX *mem_ctx, ret = seed_str_input(input_uctx, _("user login shell"), &input_uctx->shell); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Shell interactive input failed\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Shell interactive input failed\n"); goto done; } } else { @@ -479,14 +479,14 @@ static int seed_init(TALLOC_CTX *mem_ctx,
sctx = talloc_zero(tmp_ctx, struct seed_ctx); if (sctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not allocate tools context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not allocate tools context\n"); ret = ENOMEM; goto fini; }
sctx->uctx = talloc_zero(sctx, struct user_ctx); if (sctx->uctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not allocate user data context\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Could not allocate user data context\n"); ret = ENOMEM; goto fini; } @@ -494,8 +494,8 @@ static int seed_init(TALLOC_CTX *mem_ctx, debug_prg_name = argv[0]; ret = set_locale(); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("set_locale failed (%d): %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "set_locale failed (%d): %s\n", + ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EINVAL; goto fini; @@ -513,7 +513,7 @@ static int seed_init(TALLOC_CTX *mem_ctx, while ((ret = poptGetNextOpt(pc)) > 0) { switch (ret) { case 'i': - DEBUG(SSSDBG_TRACE_INTERNAL, ("Interactive mode selected\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "Interactive mode selected\n"); sctx->interact = true; break; } @@ -625,7 +625,7 @@ static int seed_init_db(TALLOC_CTX *mem_ctx, ret = confdb_init(tmp_ctx, &confdb, confdb_path); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not initialize connection to the confdb\n")); + "Could not initialize connection to the confdb\n"); ERROR("Could not initialize connection to the confdb\n"); goto done; } @@ -634,8 +634,8 @@ static int seed_init_db(TALLOC_CTX *mem_ctx, if (ret != EOK) { SYSDB_VERSION_ERROR(ret); DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not initialize connection to domain '%s' in sysdb.%s\n", - domain_name, ret == ENOENT ? " Domain not found." : "")); + "Could not initialize connection to domain '%s' in sysdb.%s\n", + domain_name, ret == ENOENT ? " Domain not found." : ""); ERROR("Could not initialize connection to domain '%1$s' in sysdb.%2$s\n", domain_name, ret == ENOENT ? " Domain not found." : "");
@@ -679,8 +679,8 @@ static int seed_domain_user_info(const char *name, passwd = getpwnam(fq_name); if (passwd == NULL) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("getpwnam failed [%d] [%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "getpwnam failed [%d] [%s]\n", + ret, strerror(ret)); goto done; }
@@ -688,38 +688,38 @@ static int seed_domain_user_info(const char *name, ret = sysdb_getpwnam(tmp_ctx, sysdb, domain, name, &res); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Couldn't lookup user (%s) in the cache\n", name)); + "Couldn't lookup user (%s) in the cache\n", name); goto done; }
if (res->count == 0) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("User (%s) wasn't found in the cache\n", name)); + "User (%s) wasn't found in the cache\n", name); *is_cached = false; ret = ENOENT; goto done; } else if (res->count > 1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Multiple user (%s) entries were found in the cache\n", name)); + "Multiple user (%s) entries were found in the cache\n", name); ret = EINVAL; goto done; } else { - DEBUG(SSSDBG_TRACE_INTERNAL, ("User found in cache\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, "User found in cache\n"); *is_cached = true;
errno = 0; ret = initgroups(fq_name, passwd->pw_gid); if (ret != EOK) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("initgroups failed [%d] [%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "initgroups failed [%d] [%s]\n", + ret, strerror(ret)); goto done; } }
done: if (ret == ENOMEM) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to allocate user information\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to allocate user information\n"); } talloc_zfree(tmp_ctx); return ret; @@ -733,7 +733,7 @@ static int seed_cache_user(struct seed_ctx *sctx)
ret = sysdb_transaction_start(sctx->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb transaction start failure\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb transaction start failure\n"); goto done; }
@@ -746,8 +746,8 @@ static int seed_cache_user(struct seed_ctx *sctx) sctx->uctx->shell, NULL, NULL, 0, 0); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("Failed to add user to the cache. (%d)[%s]\n", - ret, strerror(ret))); + "Failed to add user to the cache. (%d)[%s]\n", + ret, strerror(ret)); ERROR("Failed to create user cache entry\n"); goto done; } @@ -756,15 +756,15 @@ static int seed_cache_user(struct seed_ctx *sctx) ret = sysdb_cache_password(sctx->sysdb, sctx->domain, sctx->uctx->name, sctx->uctx->password); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to cache password. (%d)[%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Failed to cache password. (%d)[%s]\n", + ret, strerror(ret)); ERROR("Failed to cache password\n"); goto done; }
ret = sysdb_transaction_commit(sctx->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("sysdb transaction commit failure\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "sysdb transaction commit failure\n"); goto done; }
@@ -774,7 +774,7 @@ done: if (in_transaction == true) { sret = sysdb_transaction_cancel(sctx->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to cancel transaction\n"); } }
@@ -790,8 +790,8 @@ int main(int argc, const char **argv) /* initialize seed context and parse options */ ret = seed_init(sctx, argc, argv, &sctx); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE,("Seed init failed [%d][%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE,"Seed init failed [%d][%s]\n", + ret, strerror(ret)); goto done; }
@@ -799,7 +799,7 @@ int main(int argc, const char **argv) ret = seed_init_db(sctx, sctx->uctx->domain_name, &sctx->confdb, &sctx->domain, &sctx->sysdb); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to initialize db and domain\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to initialize db and domain\n"); goto done; }
@@ -807,8 +807,8 @@ int main(int argc, const char **argv) ret = seed_domain_user_info(sctx->uctx->name, sctx->uctx->domain_name, sctx->sysdb, sctx->domain, &sctx->user_cached); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed lookup of user [%s] in domain [%s]\n", - sctx->uctx->name, sctx->uctx->domain_name)); + DEBUG(SSSDBG_OP_FAILURE, "Failed lookup of user [%s] in domain [%s]\n", + sctx->uctx->name, sctx->uctx->domain_name); }
/* interactive mode to fill in user information */ @@ -820,7 +820,7 @@ int main(int argc, const char **argv) } else { ret = seed_interactive_input(sctx, sctx->uctx, &input_uctx); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to get seed input.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to get seed input.\n"); ret = EINVAL; goto done; } @@ -832,7 +832,7 @@ int main(int argc, const char **argv) if (sctx->user_cached == false) { if (sctx->uctx->uid == 0 || sctx->uctx->gid == 0) { /* require username, UID, and GID to continue */ - DEBUG(SSSDBG_MINOR_FAILURE, ("Not enough information provided\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Not enough information provided\n"); ERROR("UID and primary GID not provided.\n"); ret = EINVAL; goto done; @@ -844,13 +844,13 @@ int main(int argc, const char **argv) ret = seed_password_input_file(sctx->uctx, sctx->password_file, &sctx->uctx->password); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Password input failure\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Password input failure\n"); goto done; } } else { ret = seed_password_input_prompt(sctx->uctx, &sctx->uctx->password); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Password input failure\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Password input failure\n"); goto done; } } @@ -858,7 +858,7 @@ int main(int argc, const char **argv) /* Add user info and password to sysdb cache */ ret = seed_cache_user(sctx); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Failed to modify cache.\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Failed to modify cache.\n"); goto done; } else { if (sctx->user_cached == false) { @@ -871,8 +871,8 @@ int main(int argc, const char **argv) done: talloc_zfree(sctx); if (ret != EOK) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Exit error: [%d] [%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_TRACE_INTERNAL, "Exit error: [%d] [%s]\n", + ret, strerror(ret)); ret = EXIT_FAILURE; } else { ret = EXIT_SUCCESS; diff --git a/src/tools/sss_sync_ops.c b/src/tools/sss_sync_ops.c index 25c9763..7ce2db0 100644 --- a/src/tools/sss_sync_ops.c +++ b/src/tools/sss_sync_ops.c @@ -38,7 +38,7 @@
#define VAR_CHECK(var, val, attr, msg) do { \ if (var != (val)) { \ - DEBUG(1, (msg" attribute: %s", attr)); \ + DEBUG(1, msg" attribute: %s", attr); \ return val; \ } \ } while(0) @@ -367,7 +367,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(7, ("Gecos: %s\n", data->gecos)); + DEBUG(7, "Gecos: %s\n", data->gecos);
/* homedir */ if (homedir) { @@ -385,7 +385,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, ret = ENOMEM; goto done; } - DEBUG(7, ("Homedir: %s\n", data->home)); + DEBUG(7, "Homedir: %s\n", data->home);
/* default shell */ if (!shell) { @@ -402,7 +402,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, goto done; } } - DEBUG(7, ("Shell: %s\n", data->shell)); + DEBUG(7, "Shell: %s\n", data->shell);
/* create homedir on user creation? */ if (!create_home) { @@ -415,7 +415,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, } else { data->create_homedir = (create_home == DO_CREATE_HOME); } - DEBUG(7, ("Auto create homedir: %s\n", data->create_homedir?"True":"False")); + DEBUG(7, "Auto create homedir: %s\n", data->create_homedir?"True":"False");
/* umask to create homedirs */ ret = confdb_get_int(confdb, @@ -424,7 +424,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, if (ret != EOK) { goto done; } - DEBUG(7, ("Umask: %o\n", data->umask)); + DEBUG(7, "Umask: %o\n", data->umask);
/* a directory to create mail spools in */ ret = confdb_get_string(confdb, mem_ctx, @@ -433,7 +433,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, if (ret != EOK) { goto done; } - DEBUG(7, ("Mail dir: %s\n", data->maildir)); + DEBUG(7, "Mail dir: %s\n", data->maildir);
/* skeleton dir */ if (!skeldir) { @@ -450,7 +450,7 @@ int useradd_defaults(TALLOC_CTX *mem_ctx, goto done; } } - DEBUG(7, ("Skeleton dir: %s\n", data->skeldir)); + DEBUG(7, "Skeleton dir: %s\n", data->skeldir);
ret = EOK; done: @@ -510,13 +510,13 @@ int userdel(TALLOC_CTX *mem_ctx,
user_dn = sysdb_user_dn(sysdb, mem_ctx, data->domain, data->name); if (!user_dn) { - DEBUG(1, ("Could not construct a user DN\n")); + DEBUG(1, "Could not construct a user DN\n"); return ENOMEM; }
ret = sysdb_delete_entry(sysdb, user_dn, false); if (ret) { - DEBUG(2, ("Removing user failed: %s (%d)\n", strerror(ret), ret)); + DEBUG(2, "Removing user failed: %s (%d)\n", strerror(ret), ret); }
flush_nscd_cache(NSCD_DB_PASSWD); @@ -553,13 +553,13 @@ int groupdel(TALLOC_CTX *mem_ctx,
group_dn = sysdb_group_dn(sysdb, mem_ctx, data->domain, data->name); if (group_dn == NULL) { - DEBUG(1, ("Could not construct a group DN\n")); + DEBUG(1, "Could not construct a group DN\n"); return ENOMEM; }
ret = sysdb_delete_entry(sysdb, group_dn, false); if (ret) { - DEBUG(2, ("Removing group failed: %s (%d)\n", strerror(ret), ret)); + DEBUG(2, "Removing group failed: %s (%d)\n", strerror(ret), ret); }
flush_nscd_cache(NSCD_DB_GROUP); @@ -586,7 +586,7 @@ int sysdb_getpwnam_sync(TALLOC_CTX *mem_ctx,
switch (res->count) { case 0: - DEBUG(1, ("No result for sysdb_getpwnam call\n")); + DEBUG(1, "No result for sysdb_getpwnam call\n"); return ENOENT;
case 1: @@ -628,15 +628,15 @@ int sysdb_getpwnam_sync(TALLOC_CTX *mem_ctx, } else if (strcasecmp(str, "false") == 0) { out->lock = DO_UNLOCK; } else { /* Invalid value */ - DEBUG(2, ("Invalid value for %s attribute: %s\n", - SYSDB_DISABLED, str ? str : "NULL")); + DEBUG(2, "Invalid value for %s attribute: %s\n", + SYSDB_DISABLED, str ? str : "NULL"); return EIO; } } break;
default: - DEBUG(1, ("More than one result for sysdb_getpwnam call\n")); + DEBUG(1, "More than one result for sysdb_getpwnam call\n"); return EIO; }
@@ -659,7 +659,7 @@ int sysdb_getgrnam_sync(TALLOC_CTX *mem_ctx,
switch (res->count) { case 0: - DEBUG(1, ("No result for sysdb_getgrnam call\n")); + DEBUG(1, "No result for sysdb_getgrnam call\n"); return ENOENT;
case 1: @@ -673,7 +673,7 @@ int sysdb_getgrnam_sync(TALLOC_CTX *mem_ctx, break;
default: - DEBUG(1, ("More than one result for sysdb_getgrnam call\n")); + DEBUG(1, "More than one result for sysdb_getgrnam call\n"); return EIO; }
diff --git a/src/tools/sss_useradd.c b/src/tools/sss_useradd.c index ef594ae..169a349 100644 --- a/src/tools/sss_useradd.c +++ b/src/tools/sss_useradd.c @@ -69,7 +69,7 @@ int main(int argc, const char **argv)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -114,7 +114,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx); if (ret != EOK) { - DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret)); if (ret == ENOENT) { ERROR("Error initializing the tools - no local domain\n"); } else { @@ -135,7 +135,7 @@ int main(int argc, const char **argv) if (groups) { ret = parse_groups(tctx, groups, &tctx->octx->addgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse groups to add the user to\n")); + DEBUG(1, "Cannot parse groups to add the user to\n"); ERROR("Internal error while parsing parameters\n"); ret = EXIT_FAILURE; goto fini; @@ -143,7 +143,7 @@ int main(int argc, const char **argv)
ret = parse_group_name_domain(tctx, tctx->octx->addgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse FQDN groups to add the user to\n")); + DEBUG(1, "Cannot parse FQDN groups to add the user to\n"); ERROR("Groups must be in the same domain as user\n"); ret = EXIT_FAILURE; goto fini; @@ -181,7 +181,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_start(tctx->sysdb); if (tctx->error != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -194,7 +194,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_commit(tctx->sysdb); if (tctx->error) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -245,8 +245,8 @@ int main(int argc, const char **argv) tctx->octx->gid); if (ret != EOK) { ERROR("Cannot create user's mail spool: %1$s\n", strerror(ret)); - DEBUG(1, ("Cannot create user's mail spool: [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "Cannot create user's mail spool: [%d][%s].\n", + ret, strerror(ret)); ret = EXIT_FAILURE; goto fini; } @@ -256,7 +256,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(tctx->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } }
@@ -271,8 +271,8 @@ done: break;
default: - DEBUG(1, ("sysdb operation failed (%d)[%s]\n", - tctx->error, strerror(tctx->error))); + DEBUG(1, "sysdb operation failed (%d)[%s]\n", + tctx->error, strerror(tctx->error)); ERROR("Transaction error. Could not add user.\n"); break; } diff --git a/src/tools/sss_userdel.c b/src/tools/sss_userdel.c index d61a457..9eb1332 100644 --- a/src/tools/sss_userdel.c +++ b/src/tools/sss_userdel.c @@ -59,7 +59,7 @@ static int is_logged_in(TALLOC_CTX *mem_ctx, uid_t uid) ret = get_uid_table(mem_ctx, &uid_table); if (ret == ENOSYS) return ret; if (ret != EOK) { - DEBUG(1, ("Cannot initialize hash table.\n")); + DEBUG(1, "Cannot initialize hash table.\n"); return ret; }
@@ -98,7 +98,7 @@ static int kick_user(struct tools_ctx *tctx) if (pid == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fork failed [%d]: %s\n", ret, strerror(ret))); + "fork failed [%d]: %s\n", ret, strerror(ret)); return ret; }
@@ -109,7 +109,7 @@ static int kick_user(struct tools_ctx *tctx) } } if (child_pid == -1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("waitpid failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "waitpid failed\n"); return errno; } } @@ -147,7 +147,7 @@ int main(int argc, const char **argv)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -191,7 +191,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx); if (ret != EOK) { - DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret)); if (ret == ENOENT) { ERROR("Error initializing the tools - no local domain\n"); } else { @@ -316,7 +316,7 @@ int main(int argc, const char **argv)
done: if (ret) { - DEBUG(1, ("sysdb operation failed (%d)[%s]\n", ret, strerror(ret))); + DEBUG(1, "sysdb operation failed (%d)[%s]\n", ret, strerror(ret)); switch (ret) { case ENOENT: ERROR("No such user in local domain. " diff --git a/src/tools/sss_usermod.c b/src/tools/sss_usermod.c index fa2c27b..a7837ad 100644 --- a/src/tools/sss_usermod.c +++ b/src/tools/sss_usermod.c @@ -70,7 +70,7 @@ int main(int argc, const char **argv)
ret = set_locale(); if (ret != EOK) { - DEBUG(1, ("set_locale failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "set_locale failed (%d): %s\n", ret, strerror(ret)); ERROR("Error setting the locale\n"); ret = EXIT_FAILURE; goto fini; @@ -123,7 +123,7 @@ int main(int argc, const char **argv)
ret = init_sss_tools(&tctx); if (ret != EOK) { - DEBUG(1, ("init_sss_tools failed (%d): %s\n", ret, strerror(ret))); + DEBUG(1, "init_sss_tools failed (%d): %s\n", ret, strerror(ret)); if (ret == ENOENT) { ERROR("Error initializing the tools - no local domain\n"); } else { @@ -158,7 +158,7 @@ int main(int argc, const char **argv) if (addgroups) { ret = parse_groups(tctx, addgroups, &tctx->octx->addgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse groups to add the user to\n")); + DEBUG(1, "Cannot parse groups to add the user to\n"); ERROR("Internal error while parsing parameters\n"); ret = EXIT_FAILURE; goto fini; @@ -166,7 +166,7 @@ int main(int argc, const char **argv)
ret = parse_group_name_domain(tctx, tctx->octx->addgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse FQDN groups to add the user to\n")); + DEBUG(1, "Cannot parse FQDN groups to add the user to\n"); ERROR("Groups must be in the same domain as user\n"); ret = EXIT_FAILURE; goto fini; @@ -185,7 +185,7 @@ int main(int argc, const char **argv) if (rmgroups) { ret = parse_groups(tctx, rmgroups, &tctx->octx->rmgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse groups to remove the user from\n")); + DEBUG(1, "Cannot parse groups to remove the user from\n"); ERROR("Internal error while parsing parameters\n"); ret = EXIT_FAILURE; goto fini; @@ -193,7 +193,7 @@ int main(int argc, const char **argv)
ret = parse_group_name_domain(tctx, tctx->octx->rmgroups); if (ret != EOK) { - DEBUG(1, ("Cannot parse FQDN groups to remove the user from\n")); + DEBUG(1, "Cannot parse FQDN groups to remove the user from\n"); ERROR("Groups must be in the same domain as user\n"); ret = EXIT_FAILURE; goto fini; @@ -218,7 +218,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_start(tctx->sysdb); if (tctx->error != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to start transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to start transaction\n"); goto done; } in_transaction = true; @@ -231,7 +231,7 @@ int main(int argc, const char **argv)
tctx->error = sysdb_transaction_commit(tctx->sysdb); if (tctx->error) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to commit transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to commit transaction\n"); goto done; } in_transaction = false; @@ -270,7 +270,7 @@ done: if (in_transaction) { sret = sysdb_transaction_cancel(tctx->sysdb); if (sret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to cancel transaction\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to cancel transaction\n"); } }
diff --git a/src/tools/tools_mc_util.c b/src/tools/tools_mc_util.c index 5d4300f..adb8015 100644 --- a/src/tools/tools_mc_util.c +++ b/src/tools/tools_mc_util.c @@ -78,12 +78,12 @@ errno_t sss_memcache_invalidate(const char *mc_filename) if (mc_fd == -1) { ret = errno; if (ret == ENOENT) { - DEBUG(SSSDBG_TRACE_FUNC,("Memory cache file %s " - "does not exist.\n", mc_filename)); + DEBUG(SSSDBG_TRACE_FUNC,"Memory cache file %s " + "does not exist.\n", mc_filename); return EOK; } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to open file %s: %s\n", - mc_filename, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to open file %s: %s\n", + mc_filename, strerror(ret)); return ret; } } @@ -91,17 +91,17 @@ errno_t sss_memcache_invalidate(const char *mc_filename) ret = sss_br_lock_file(mc_fd, 0, 1, retries, t); if (ret == EACCES) { DEBUG(SSSDBG_TRACE_FUNC, - ("File %s already locked by someone else.\n", mc_filename)); + "File %s already locked by someone else.\n", mc_filename); goto done; } else if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to lock file %s.\n", mc_filename)); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to lock file %s.\n", mc_filename); goto done; } /* Mark the mc file as recycled. */ ret = sss_mc_set_recycled(mc_fd); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to mark memory cache file %s " - "as recycled.\n", mc_filename)); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to mark memory cache file %s " + "as recycled.\n", mc_filename); goto done; }
@@ -116,9 +116,9 @@ done: pret = unlink(mc_filename); if (pret == -1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Failed to unlink file %s. " + "Failed to unlink file %s. " "Will be unlinked later by sssd_nss.\n", - mc_filename)); + mc_filename); } } } @@ -160,7 +160,7 @@ errno_t sss_memcache_clear_all(void)
ret = clear_fastcache(&sssd_nss_is_off); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failed to clear caches.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failed to clear caches.\n"); return EIO; } if (!sssd_nss_is_off) { @@ -168,23 +168,23 @@ errno_t sss_memcache_clear_all(void) clear_mc_flag = fopen(SSS_NSS_MCACHE_DIR"/"CLEAR_MC_FLAG, "w"); if (clear_mc_flag == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to create clear_mc_flag file. " - "Memory cache will not be cleared.\n")); + "Failed to create clear_mc_flag file. " + "Memory cache will not be cleared.\n"); return EIO; } ret = fclose(clear_mc_flag); if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to close file descriptor: %s\n", - strerror(ret))); + "Unable to close file descriptor: %s\n", + strerror(ret)); return EIO; } - DEBUG(SSSDBG_TRACE_FUNC, ("Sending SIGHUP to monitor.\n")); + DEBUG(SSSDBG_TRACE_FUNC, "Sending SIGHUP to monitor.\n"); ret = signal_sssd(SIGHUP); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to send SIGHUP to monitor.\n")); + "Failed to send SIGHUP to monitor.\n"); return EIO; } } @@ -217,7 +217,7 @@ static errno_t sss_mc_refresh_ent(const char *name, enum sss_tools_ent ent) }
if (cmd == SSS_CLI_NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Unknown object %d to refresh\n", cmd)); + DEBUG(SSSDBG_OP_FAILURE, "Unknown object %d to refresh\n", cmd); return EINVAL; }
@@ -261,7 +261,7 @@ errno_t sss_mc_refresh_nested_group(struct tools_ctx *tctx, ret = sss_mc_refresh_group(name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot refresh group %s from memory cache\n", name)); + "Cannot refresh group %s from memory cache\n", name); /* try to carry on */ }
@@ -269,13 +269,13 @@ errno_t sss_mc_refresh_nested_group(struct tools_ctx *tctx, name, attrs, &msg); if (ret) { DEBUG(SSSDBG_OP_FAILURE, - ("Search failed: %s (%d)\n", strerror(ret), ret)); + "Search failed: %s (%d)\n", strerror(ret), ret); return ret; }
el = ldb_msg_find_element(msg, SYSDB_MEMBEROF); if (!el || el->num_values == 0) { - DEBUG(SSSDBG_TRACE_INTERNAL, ("Group %s has no parents\n", name)); + DEBUG(SSSDBG_TRACE_INTERNAL, "Group %s has no parents\n", name); talloc_free(msg); return EOK; } @@ -286,8 +286,8 @@ errno_t sss_mc_refresh_nested_group(struct tools_ctx *tctx, (const char *) el->values[i].data, &parent_name); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Malformed DN [%s]? Skipping\n", - (const char *) el->values[i].data)); + DEBUG(SSSDBG_MINOR_FAILURE, "Malformed DN [%s]? Skipping\n", + (const char *) el->values[i].data); talloc_free(parent_name); continue; } @@ -296,7 +296,7 @@ errno_t sss_mc_refresh_nested_group(struct tools_ctx *tctx, talloc_free(parent_name); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot refresh group %s from memory cache\n", name)); + "Cannot refresh group %s from memory cache\n", name); /* try to carry on */ } } @@ -318,8 +318,8 @@ errno_t sss_mc_refresh_grouplist(struct tools_ctx *tctx, ret = sss_mc_refresh_nested_group(tctx, groupnames[i]); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Cannot refresh group %s from memory cache\n", - groupnames[i])); + "Cannot refresh group %s from memory cache\n", + groupnames[i]); failed = true; continue; } diff --git a/src/tools/tools_util.c b/src/tools/tools_util.c index 0e1b3b4..cddd98b 100644 --- a/src/tools/tools_util.c +++ b/src/tools/tools_util.c @@ -49,14 +49,14 @@ static int setup_db(struct tools_ctx *ctx) /* Connect to the conf db */ ret = confdb_init(ctx, &ctx->confdb, confdb_path); if (ret != EOK) { - DEBUG(1, ("Could not initialize connection to the confdb\n")); + DEBUG(1, "Could not initialize connection to the confdb\n"); return ret; }
ret = sssd_domain_init(ctx, ctx->confdb, "local", DB_PATH, &ctx->local); if (ret != EOK) { SYSDB_VERSION_ERROR(ret); - DEBUG(1, ("Could not initialize connection to the sysdb\n")); + DEBUG(1, "Could not initialize connection to the sysdb\n"); return ret; } ctx->sysdb = ctx->local->sysdb; @@ -144,8 +144,8 @@ int parse_group_name_domain(struct tools_ctx *tctx, for (i = 0; groups[i]; ++i) { ret = sss_parse_name(tctx, tctx->snctx, groups[i], &domain, &name); if (ret != EOK) { - DEBUG(1, ("Invalid name in group list, skipping: [%s] (%d)\n", - groups[i], ret)); + DEBUG(1, "Invalid name in group list, skipping: [%s] (%d)\n", + groups[i], ret); continue; }
@@ -180,23 +180,23 @@ int parse_name_domain(struct tools_ctx *tctx,
ret = sss_parse_name(tctx, tctx->snctx, fullname, &domain, &tctx->octx->name); if (ret != EOK) { - DEBUG(0, ("Cannot parse full name\n")); + DEBUG(0, "Cannot parse full name\n"); return ret; } - DEBUG(5, ("Parsed username: %s\n", tctx->octx->name)); + DEBUG(5, "Parsed username: %s\n", tctx->octx->name);
if (domain) { - DEBUG(5, ("Parsed domain: %s\n", domain)); + DEBUG(5, "Parsed domain: %s\n", domain); /* only the local domain, whatever named is allowed in tools */ if (strcasecmp(domain, tctx->local->name) != 0) { - DEBUG(1, ("Invalid domain %s specified in FQDN\n", domain)); + DEBUG(1, "Invalid domain %s specified in FQDN\n", domain); return EINVAL; } } else { if (tctx->local->fqnames) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Name '%s' does not seem to be FQDN " - "('%s = TRUE' is set)\n", fullname, CONFDB_DOMAIN_FQ)); + "Name '%s' does not seem to be FQDN " + "('%s = TRUE' is set)\n", fullname, CONFDB_DOMAIN_FQ); ERROR("Name '%1$s' does not seem to be FQDN " "('%2$s = TRUE' is set)\n", fullname, CONFDB_DOMAIN_FQ); return EINVAL; @@ -227,7 +227,7 @@ int check_group_names(struct tools_ctx *tctx, grouplist[i], groupinfo); if (ret) { - DEBUG(6, ("Cannot find group %s, ret: %d\n", grouplist[i], ret)); + DEBUG(6, "Cannot find group %s, ret: %d\n", grouplist[i], ret); break; } } @@ -280,26 +280,26 @@ int init_sss_tools(struct tools_ctx **_tctx)
tctx = talloc_zero(NULL, struct tools_ctx); if (tctx == NULL) { - DEBUG(1, ("Could not allocate memory for tools context\n")); + DEBUG(1, "Could not allocate memory for tools context\n"); return ENOMEM; }
/* Connect to the database */ ret = setup_db(tctx); if (ret != EOK) { - DEBUG(1, ("Could not set up database\n")); + DEBUG(1, "Could not set up database\n"); goto fini; }
ret = sss_names_init(tctx, tctx->confdb, tctx->local->name, &tctx->snctx); if (ret != EOK) { - DEBUG(1, ("Could not set up parsing\n")); + DEBUG(1, "Could not set up parsing\n"); goto fini; }
tctx->octx = talloc_zero(tctx, struct ops_ctx); if (!tctx->octx) { - DEBUG(1, ("Could not allocate memory for data context\n")); + DEBUG(1, "Could not allocate memory for data context\n"); ERROR("Out of memory\n"); ret = ENOMEM; goto fini; @@ -328,7 +328,7 @@ static int is_owner(uid_t uid, const char *path) ret = stat(path, &statres); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot stat %s: [%d][%s]\n", path, ret, strerror(ret))); + DEBUG(1, "Cannot stat %s: [%d][%s]\n", path, ret, strerror(ret)); return ret; }
@@ -361,8 +361,8 @@ static int remove_mail_spool(TALLOC_CTX *mem_ctx, break; case -1: DEBUG(SSSDBG_MINOR_FAILURE, - ("%s not owned by %"SPRIuid", not removing\n", - spool_file, uid)); + "%s not owned by %"SPRIuid", not removing\n", + spool_file, uid); ret = EACCES; /* FALLTHROUGH */ default: @@ -373,8 +373,8 @@ static int remove_mail_spool(TALLOC_CTX *mem_ctx, ret = unlink(spool_file); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot remove() the spool file %s: [%d][%s]\n", - spool_file, ret, strerror(ret))); + DEBUG(1, "Cannot remove() the spool file %s: [%d][%s]\n", + spool_file, ret, strerror(ret)); goto fail; }
@@ -393,20 +393,20 @@ int remove_homedir(TALLOC_CTX *mem_ctx,
ret = remove_mail_spool(mem_ctx, maildir, username, uid, force); if (ret != EOK) { - DEBUG(1, ("Cannot remove user's mail spool\n")); + DEBUG(1, "Cannot remove user's mail spool\n"); /* Should this be fatal? I don't think so. Maybe convert to ERROR? */ }
if (force == false && is_owner(uid, homedir) == -1) { - DEBUG(1, ("Not removing home dir - not owned by user\n")); + DEBUG(1, "Not removing home dir - not owned by user\n"); return EPERM; }
/* Remove the tree */ ret = remove_tree(homedir); if (ret != EOK) { - DEBUG(1, ("Cannot remove homedir %s: %d\n", - homedir, ret)); + DEBUG(1, "Cannot remove homedir %s: %d\n", + homedir, ret); return ret; }
@@ -437,32 +437,32 @@ int create_mail_spool(TALLOC_CTX *mem_ctx, fd = open(spool_file, O_CREAT | O_WRONLY | O_EXCL, 0); if (fd < 0) { ret = errno; - DEBUG(1, ("Cannot open() the spool file: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Cannot open() the spool file: [%d][%s]\n", + ret, strerror(ret)); goto fail; }
ret = fchmod(fd, 0600); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot fchmod() the spool file: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Cannot fchmod() the spool file: [%d][%s]\n", + ret, strerror(ret)); goto fail; }
ret = fchown(fd, uid, gid); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot fchown() the spool file: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Cannot fchown() the spool file: [%d][%s]\n", + ret, strerror(ret)); goto fail; }
ret = fsync(fd); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot fsync() the spool file: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Cannot fsync() the spool file: [%d][%s]\n", + ret, strerror(ret)); }
fail: @@ -470,8 +470,8 @@ fail: ret = close(fd); if (ret != 0) { ret = errno; - DEBUG(1, ("Cannot close() the spool file: [%d][%s]\n", - ret, strerror(ret))); + DEBUG(1, "Cannot close() the spool file: [%d][%s]\n", + ret, strerror(ret)); } }
@@ -492,8 +492,8 @@ int create_homedir(const char *skeldir,
ret = copy_tree(skeldir, homedir, 0777 & ~default_umask, uid, gid); if (ret != EOK) { - DEBUG(1, ("Cannot populate user's home directory: [%d][%s].\n", - ret, strerror(ret))); + DEBUG(1, "Cannot populate user's home directory: [%d][%s].\n", + ret, strerror(ret)); goto done; }
@@ -535,7 +535,7 @@ int run_userdel_cmd(struct tools_ctx *tctx) if (pid == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fork failed [%d]: %s\n", ret, strerror(ret))); + "fork failed [%d]: %s\n", ret, strerror(ret)); goto done; }
@@ -543,28 +543,28 @@ int run_userdel_cmd(struct tools_ctx *tctx) if (WIFEXITED(status)) { ret = WEXITSTATUS(status); if (ret != 0) { - DEBUG(5, ("command [%s] returned nonzero status %d.\n", - userdel_cmd, ret)); + DEBUG(5, "command [%s] returned nonzero status %d.\n", + userdel_cmd, ret); ret = EOK; /* Ignore return code of the command */ goto done; } } else if (WIFSIGNALED(status)) { - DEBUG(5, ("command [%s] was terminated by signal %d.\n", - userdel_cmd, WTERMSIG(status))); + DEBUG(5, "command [%s] was terminated by signal %d.\n", + userdel_cmd, WTERMSIG(status)); ret = EIO; goto done; } else if (WIFSTOPPED(status)) { - DEBUG(5, ("command [%s] was stopped by signal %d.\n", - userdel_cmd, WSTOPSIG(status))); + DEBUG(5, "command [%s] was stopped by signal %d.\n", + userdel_cmd, WSTOPSIG(status)); continue; } else { - DEBUG(1, ("Unknown status from WAITPID\n")); + DEBUG(1, "Unknown status from WAITPID\n"); ret = EIO; goto done; } } if (child_pid == -1) { - DEBUG(SSSDBG_CRIT_FAILURE, ("waitpid failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "waitpid failed\n"); ret = errno; goto done; } @@ -605,8 +605,8 @@ static errno_t get_sssd_pid(pid_t *out_pid) pid_file = fopen(SSSD_PIDFILE, "r"); if (pid_file == NULL) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("Unable to open pid file "%s": %s\n", - SSSD_PIDFILE, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "Unable to open pid file "%s": %s\n", + SSSD_PIDFILE, strerror(ret)); goto done; }
@@ -616,17 +616,17 @@ static errno_t get_sssd_pid(pid_t *out_pid) /* eof not reached */ ret = ferror(pid_file); if (ret != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to read from file "%s": %s\n", - SSSD_PIDFILE, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to read from file "%s": %s\n", + SSSD_PIDFILE, strerror(ret)); } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("File "%s" contains invalid pid.\n", - SSSD_PIDFILE)); + DEBUG(SSSDBG_CRIT_FAILURE, "File "%s" contains invalid pid.\n", + SSSD_PIDFILE); } goto done; } if (fsize == 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("File "%s" contains no pid.\n", - SSSD_PIDFILE)); + DEBUG(SSSDBG_CRIT_FAILURE, "File "%s" contains no pid.\n", + SSSD_PIDFILE); ret = EINVAL; goto done; } @@ -635,7 +635,7 @@ static errno_t get_sssd_pid(pid_t *out_pid) *out_pid = parse_pid(pid_str); if (*out_pid == 0) { DEBUG(SSSDBG_CRIT_FAILURE, - ("File "%s" contains invalid pid.\n", SSSD_PIDFILE)); + "File "%s" contains invalid pid.\n", SSSD_PIDFILE); ret = EINVAL; goto done; } @@ -662,8 +662,8 @@ errno_t signal_sssd(int signum) if (kill(pid, signum) != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("Could not send signal %d to process %d: %s\n", - signum, pid, strerror(errno))); + "Could not send signal %d to process %d: %s\n", + signum, pid, strerror(errno)); return ret; }
diff --git a/src/tools/tools_util.h b/src/tools/tools_util.h index cc35475..c0a1fa2 100644 --- a/src/tools/tools_util.h +++ b/src/tools/tools_util.h @@ -39,7 +39,7 @@ #define CHECK_ROOT(val, prg_name) do { \ val = getuid(); \ if (val != 0) { \ - DEBUG(1, ("Running under %d, must be root\n", val)); \ + DEBUG(1, "Running under %d, must be root\n", val); \ ERROR("%1$s must be run as root\n", prg_name); \ val = EXIT_FAILURE; \ goto fini; \ diff --git a/src/util/authtok.c b/src/util/authtok.c index 83e6a1c..14ba085 100644 --- a/src/util/authtok.c +++ b/src/util/authtok.c @@ -196,7 +196,7 @@ struct sss_auth_token *sss_authtok_new(TALLOC_CTX *mem_ctx)
token = talloc_zero(mem_ctx, struct sss_auth_token); if (token == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n"); }
return token; diff --git a/src/util/backup_file.c b/src/util/backup_file.c index 316c1cf..a164a86 100644 --- a/src/util/backup_file.c +++ b/src/util/backup_file.c @@ -40,8 +40,8 @@ int backup_file(const char *src_file, int dbglvl) src_fd = open(src_file, O_RDONLY); if (src_fd < 0) { ret = errno; - DEBUG(dbglvl, ("Error (%d [%s]) opening source file %s\n", - ret, strerror(ret), src_file)); + DEBUG(dbglvl, "Error (%d [%s]) opening source file %s\n", + ret, strerror(ret), src_file); goto done; }
@@ -70,14 +70,14 @@ int backup_file(const char *src_file, int dbglvl) if (dst_fd >= 0) break;
if (ret != EEXIST) { - DEBUG(dbglvl, ("Error (%d [%s]) opening destination file %s\n", - ret, strerror(ret), dst_file)); + DEBUG(dbglvl, "Error (%d [%s]) opening destination file %s\n", + ret, strerror(ret), dst_file); goto done; } } if (ret != 0) { - DEBUG(dbglvl, ("Error (%d [%s]) opening destination file %s\n", - ret, strerror(ret), dst_file)); + DEBUG(dbglvl, "Error (%d [%s]) opening destination file %s\n", + ret, strerror(ret), dst_file); goto done; }
@@ -87,8 +87,8 @@ int backup_file(const char *src_file, int dbglvl) numread = sss_atomic_read_s(src_fd, buf, BUFFER_SIZE); if (numread < 0) { ret = errno; - DEBUG(dbglvl, ("Error (%d [%s]) reading from source %s\n", - ret, strerror(ret), src_file)); + DEBUG(dbglvl, "Error (%d [%s]) reading from source %s\n", + ret, strerror(ret), src_file); goto done; } if (numread == 0) break; @@ -97,14 +97,14 @@ int backup_file(const char *src_file, int dbglvl) written = sss_atomic_write_s(dst_fd, buf, numread); if (written == -1) { ret = errno; - DEBUG(dbglvl, ("Error (%d [%s]) writing to destination %s\n", - ret, strerror(ret), dst_file)); + DEBUG(dbglvl, "Error (%d [%s]) writing to destination %s\n", + ret, strerror(ret), dst_file); goto done; }
if (written != numread) { - DEBUG(dbglvl, ("Wrote %zd bytes expected %zd bytes\n", - written, numread)); + DEBUG(dbglvl, "Wrote %zd bytes expected %zd bytes\n", + written, numread); ret = EIO; goto done; } diff --git a/src/util/check_and_open.c b/src/util/check_and_open.c index c626191..50eee6b 100644 --- a/src/util/check_and_open.c +++ b/src/util/check_and_open.c @@ -50,8 +50,8 @@ errno_t check_file(const char *filename, const int uid, const int gid, ret = follow_symlink ? stat(filename, stat_buf) : \ lstat(filename, stat_buf); if (ret == -1) { - DEBUG(SSSDBG_TRACE_FUNC, ("lstat for [%s] failed: [%d][%s].\n", filename, errno, - strerror(errno))); + DEBUG(SSSDBG_TRACE_FUNC, "lstat for [%s] failed: [%d][%s].\n", filename, errno, + strerror(errno)); return errno; }
@@ -74,8 +74,8 @@ errno_t check_fd(int fd, const int uid, const int gid,
ret = fstat(fd, stat_buf); if (ret == -1) { - DEBUG(1, ("fstat for [%d] failed: [%d][%s].\n", fd, errno, - strerror(errno))); + DEBUG(1, "fstat for [%d] failed: [%d][%s].\n", fd, errno, + strerror(errno)); return errno; }
@@ -114,28 +114,28 @@ static errno_t perform_checks(struct stat *stat_buf, type_check = S_ISSOCK(stat_buf->st_mode); break; default: - DEBUG(1, ("Unsupported file type.\n")); + DEBUG(1, "Unsupported file type.\n"); return EINVAL; }
if (!type_check) { - DEBUG(1, ("File is not the right type.\n")); + DEBUG(1, "File is not the right type.\n"); return EINVAL; }
if (mode >= 0 && (stat_buf->st_mode & ~S_IFMT) != mode) { - DEBUG(1, ("File has the wrong mode [%.7o], expected [%.7o].\n", - (stat_buf->st_mode & ~S_IFMT), mode)); + DEBUG(1, "File has the wrong mode [%.7o], expected [%.7o].\n", + (stat_buf->st_mode & ~S_IFMT), mode); return EINVAL; }
if (uid >= 0 && stat_buf->st_uid != uid) { - DEBUG(1, ("File must be owned by uid [%d].\n", uid)); + DEBUG(1, "File must be owned by uid [%d].\n", uid); return EINVAL; }
if (gid >= 0 && stat_buf->st_gid != gid) { - DEBUG(1, ("File must be owned by gid [%d].\n", gid)); + DEBUG(1, "File must be owned by gid [%d].\n", gid); return EINVAL; }
@@ -151,8 +151,8 @@ errno_t check_and_open_readonly(const char *filename, int *fd, const uid_t uid,
*fd = open(filename, O_RDONLY); if (*fd == -1) { - DEBUG(1, ("open [%s] failed: [%d][%s].\n", filename, errno, - strerror(errno))); + DEBUG(1, "open [%s] failed: [%d][%s].\n", filename, errno, + strerror(errno)); return errno; }
@@ -160,7 +160,7 @@ errno_t check_and_open_readonly(const char *filename, int *fd, const uid_t uid, if (ret != EOK) { close(*fd); *fd = -1; - DEBUG(1, ("check_fd failed.\n")); + DEBUG(1, "check_fd failed.\n"); return ret; }
diff --git a/src/util/child_common.c b/src/util/child_common.c index 55b3672..285eadb 100644 --- a/src/util/child_common.c +++ b/src/util/child_common.c @@ -56,7 +56,7 @@ errno_t sss_sigchld_init(TALLOC_CTX *mem_ctx,
sigchld_ctx = talloc_zero(mem_ctx, struct sss_sigchild_ctx); if (!sigchld_ctx) { - DEBUG(0, ("fatal error initializing sss_sigchild_ctx\n")); + DEBUG(0, "fatal error initializing sss_sigchild_ctx\n"); return ENOMEM; } sigchld_ctx->ev = ev; @@ -64,8 +64,8 @@ errno_t sss_sigchld_init(TALLOC_CTX *mem_ctx, ret = sss_hash_create(sigchld_ctx, 10, &sigchld_ctx->children); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("fatal error initializing children hash table: [%s]\n", - strerror(ret))); + "fatal error initializing children hash table: [%s]\n", + strerror(ret)); talloc_free(sigchld_ctx); return ret; } @@ -95,8 +95,8 @@ static int sss_child_destructor(void *ptr) error = hash_delete(child_ctx->sigchld_ctx->children, &key); if (error != HASH_SUCCESS && error != HASH_ERROR_KEY_NOT_FOUND) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("failed to delete child_ctx from hash table [%d]: %s\n", - error, hash_error_string(error))); + "failed to delete child_ctx from hash table [%d]: %s\n", + error, hash_error_string(error)); }
return 0; @@ -165,8 +165,8 @@ static void sss_child_invoke_cb(struct tevent_context *ev, error = hash_delete(child_ctx->sigchld_ctx->children, &key); if (error != HASH_SUCCESS && error != HASH_ERROR_KEY_NOT_FOUND) { DEBUG(SSSDBG_OP_FAILURE, - ("failed to delete child_ctx from hash table [%d]: %s\n", - error, hash_error_string(error))); + "failed to delete child_ctx from hash table [%d]: %s\n", + error, hash_error_string(error)); }
if (child_ctx->cb) { @@ -204,7 +204,7 @@ void sss_child_handler(struct tevent_context *ev,
if (pid == -1) { DEBUG(SSSDBG_TRACE_INTERNAL, - ("waitpid failed [%d]: %s\n", errno, strerror(errno))); + "waitpid failed [%d]: %s\n", errno, strerror(errno)); return; } else if (pid == 0) continue;
@@ -216,14 +216,14 @@ void sss_child_handler(struct tevent_context *ev, imm = tevent_create_immediate(child_ctx); if (imm == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Out of memory invoking SIGCHLD callback\n")); + "Out of memory invoking SIGCHLD callback\n"); return; }
invoke_pvt = talloc_zero(child_ctx, struct sss_child_cb_pvt); if (invoke_pvt == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("out of memory invoking SIGCHLD callback\n")); + "out of memory invoking SIGCHLD callback\n"); return; } invoke_pvt->child_ctx = child_ctx; @@ -233,10 +233,10 @@ void sss_child_handler(struct tevent_context *ev, sss_child_invoke_cb, invoke_pvt); } else if (error == HASH_ERROR_KEY_NOT_FOUND) { DEBUG(SSSDBG_TRACE_LIBS, - ("BUG: waitpid() returned [%d] but it was not in the table. " + "BUG: waitpid() returned [%d] but it was not in the table. " "This could be due to a linked library creating processes " "without registering them with the sigchld handler\n", - pid)); + pid); /* We will simply ignore this and return to the loop * This will prevent a zombie, but may cause unexpected * behavior in the code that was trying to handle this @@ -244,8 +244,8 @@ void sss_child_handler(struct tevent_context *ev, */ } else { DEBUG(SSSDBG_OP_FAILURE, - ("SIGCHLD hash table error [%d]: %s\n", - error, hash_error_string(error))); + "SIGCHLD hash table error [%d]: %s\n", + error, hash_error_string(error)); /* This is bad, but we should try to check for other * children anyway, to avoid potential zombies. */ @@ -267,7 +267,7 @@ int child_handler_setup(struct tevent_context *ev, int pid, { struct sss_child_ctx_old *child_ctx;
- DEBUG(8, ("Setting up signal handler up for pid [%d]\n", pid)); + DEBUG(8, "Setting up signal handler up for pid [%d]\n", pid);
child_ctx = talloc_zero(ev, struct sss_child_ctx_old); if (child_ctx == NULL) { @@ -286,7 +286,7 @@ int child_handler_setup(struct tevent_context *ev, int pid, child_ctx->cb = cb; child_ctx->pvt = pvt;
- DEBUG(8, ("Signal handler set up for pid [%d]\n", pid)); + DEBUG(8, "Signal handler set up for pid [%d]\n", pid);
if (_child_ctx != NULL) { *_child_ctx = child_ctx; @@ -307,7 +307,7 @@ void child_handler_destroy(struct sss_child_ctx_old *ctx) ret = kill(ctx->pid, SIGKILL); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_MINOR_FAILURE, ("kill failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(SSSDBG_MINOR_FAILURE, "kill failed [%d][%s].\n", ret, strerror(ret)); } }
@@ -343,7 +343,7 @@ struct tevent_req *write_pipe_send(TALLOC_CTX *mem_ctx, fde = tevent_add_fd(ev, state, fd, TEVENT_FD_WRITE, write_pipe_handler, req); if (fde == NULL) { - DEBUG(1, ("tevent_add_fd failed.\n")); + DEBUG(1, "tevent_add_fd failed.\n"); goto fail; }
@@ -365,8 +365,8 @@ static void write_pipe_handler(struct tevent_context *ev,
if (flags & TEVENT_FD_READ) { DEBUG(SSSDBG_CRIT_FAILURE, - ("write_pipe_done called with TEVENT_FD_READ," - " this should not happen.\n")); + "write_pipe_done called with TEVENT_FD_READ," + " this should not happen.\n"); tevent_req_error(req, EINVAL); return; } @@ -376,19 +376,19 @@ static void write_pipe_handler(struct tevent_context *ev, if (state->written == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("write failed [%d][%s].\n", ret, strerror(ret))); + "write failed [%d][%s].\n", ret, strerror(ret)); tevent_req_error(req, ret); return; }
if (state->len != state->written) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Wrote %zu bytes, expected %zu\n", - state->written, state->len)); + DEBUG(SSSDBG_CRIT_FAILURE, "Wrote %zu bytes, expected %zu\n", + state->written, state->len); tevent_req_error(req, EIO); return; }
- DEBUG(SSSDBG_TRACE_FUNC, ("All data has been sent!\n")); + DEBUG(SSSDBG_TRACE_FUNC, "All data has been sent!\n"); tevent_req_done(req); return; } @@ -427,7 +427,7 @@ struct tevent_req *read_pipe_send(TALLOC_CTX *mem_ctx, fde = tevent_add_fd(ev, state, fd, TEVENT_FD_READ, read_pipe_handler, req); if (fde == NULL) { - DEBUG(1, ("tevent_add_fd failed.\n")); + DEBUG(1, "tevent_add_fd failed.\n"); goto fail; }
@@ -450,8 +450,8 @@ static void read_pipe_handler(struct tevent_context *ev, uint8_t buf[CHILD_MSG_CHUNK];
if (flags & TEVENT_FD_WRITE) { - DEBUG(1, ("read_pipe_done called with TEVENT_FD_WRITE," - " this should not happen.\n")); + DEBUG(1, "read_pipe_done called with TEVENT_FD_WRITE," + " this should not happen.\n"); tevent_req_error(req, EINVAL); return; } @@ -462,7 +462,7 @@ static void read_pipe_handler(struct tevent_context *ev, if (size == -1) { err = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("read failed [%d][%s].\n", err, strerror(err))); + "read failed [%d][%s].\n", err, strerror(err)); tevent_req_error(req, err); return;
@@ -479,13 +479,13 @@ static void read_pipe_handler(struct tevent_context *ev, return;
} else if (size == 0) { - DEBUG(6, ("EOF received, client finished\n")); + DEBUG(6, "EOF received, client finished\n"); tevent_req_done(req); return;
} else { DEBUG(SSSDBG_CRIT_FAILURE, - ("unexpected return value of read [%zd].\n", size)); + "unexpected return value of read [%zd].\n", size); tevent_req_error(req, EINVAL); return; } @@ -514,13 +514,13 @@ void fd_nonblocking(int fd) flags = fcntl(fd, F_GETFL, 0); if (flags == -1) { ret = errno; - DEBUG(1, ("F_GETFL failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "F_GETFL failed [%d][%s].\n", ret, strerror(ret)); return; }
if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) { ret = errno; - DEBUG(1, ("F_SETFL failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "F_SETFL failed [%d][%s].\n", ret, strerror(ret)); }
return; @@ -538,40 +538,40 @@ void child_sig_handler(struct tevent_context *ev, struct tevent_immediate *imm;
if (count <= 0) { - DEBUG(0, ("SIGCHLD handler called with invalid child count\n")); + DEBUG(0, "SIGCHLD handler called with invalid child count\n"); return; }
child_ctx = talloc_get_type(pvt, struct sss_child_ctx_old); - DEBUG(7, ("Waiting for child [%d].\n", child_ctx->pid)); + DEBUG(7, "Waiting for child [%d].\n", child_ctx->pid);
errno = 0; ret = waitpid(child_ctx->pid, &child_ctx->child_status, WNOHANG);
if (ret == -1) { err = errno; - DEBUG(1, ("waitpid failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "waitpid failed [%d][%s].\n", err, strerror(err)); } else if (ret == 0) { - DEBUG(1, ("waitpid did not found a child with changed status.\n")); + DEBUG(1, "waitpid did not found a child with changed status.\n"); } else { if (WIFEXITED(child_ctx->child_status)) { if (WEXITSTATUS(child_ctx->child_status) != 0) { - DEBUG(1, ("child [%d] failed with status [%d].\n", ret, - WEXITSTATUS(child_ctx->child_status))); + DEBUG(1, "child [%d] failed with status [%d].\n", ret, + WEXITSTATUS(child_ctx->child_status)); } else { - DEBUG(4, ("child [%d] finished successfully.\n", ret)); + DEBUG(4, "child [%d] finished successfully.\n", ret); } } else if (WIFSIGNALED(child_ctx->child_status)) { - DEBUG(1, ("child [%d] was terminated by signal [%d].\n", ret, - WTERMSIG(child_ctx->child_status))); + DEBUG(1, "child [%d] was terminated by signal [%d].\n", ret, + WTERMSIG(child_ctx->child_status)); } else { if (WIFSTOPPED(child_ctx->child_status)) { - DEBUG(7, ("child [%d] was stopped by signal [%d].\n", ret, - WSTOPSIG(child_ctx->child_status))); + DEBUG(7, "child [%d] was stopped by signal [%d].\n", ret, + WSTOPSIG(child_ctx->child_status)); } if (WIFCONTINUED(child_ctx->child_status)) { - DEBUG(7, ("child [%d] was resumed by delivery of SIGCONT.\n", - ret)); + DEBUG(7, "child [%d] was resumed by delivery of SIGCONT.\n", + ret); }
return; @@ -582,7 +582,7 @@ void child_sig_handler(struct tevent_context *ev, */ imm = tevent_create_immediate(child_ctx); if (imm == NULL) { - DEBUG(0, ("Out of memory invoking sig handler callback\n")); + DEBUG(0, "Out of memory invoking sig handler callback\n"); return; }
@@ -633,7 +633,7 @@ static errno_t prepare_child_argv(TALLOC_CTX *mem_ctx, */ argv = talloc_array(mem_ctx, char *, argc); if (argv == NULL) { - DEBUG(1, ("talloc_array failed.\n")); + DEBUG(1, "talloc_array failed.\n"); return ENOMEM; }
@@ -701,7 +701,7 @@ errno_t exec_child(TALLOC_CTX *mem_ctx, ret = dup2(pipefd_to_child[0], STDIN_FILENO); if (ret == -1) { err = errno; - DEBUG(1, ("dup2 failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "dup2 failed [%d][%s].\n", err, strerror(err)); return err; }
@@ -709,20 +709,20 @@ errno_t exec_child(TALLOC_CTX *mem_ctx, ret = dup2(pipefd_from_child[1], STDOUT_FILENO); if (ret == -1) { err = errno; - DEBUG(1, ("dup2 failed [%d][%s].\n", err, strerror(err))); + DEBUG(1, "dup2 failed [%d][%s].\n", err, strerror(err)); return err; }
ret = prepare_child_argv(mem_ctx, debug_fd, binary, &argv); if (ret != EOK) { - DEBUG(1, ("prepare_child_argv.\n")); + DEBUG(1, "prepare_child_argv.\n"); return ret; }
execv(binary, argv); err = errno; - DEBUG(SSSDBG_OP_FAILURE, ("execv failed [%d][%s].\n", err, strerror(err))); + DEBUG(SSSDBG_OP_FAILURE, "execv failed [%d][%s].\n", err, strerror(err)); return err; }
@@ -734,14 +734,14 @@ void child_cleanup(int readfd, int writefd) ret = close(readfd); if (ret != EOK) { ret = errno; - DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "close failed [%d][%s].\n", ret, strerror(ret)); } } if (writefd != -1) { ret = close(writefd); if (ret != EOK) { ret = errno; - DEBUG(1, ("close failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "close failed [%d][%s].\n", ret, strerror(ret)); } } } diff --git a/src/util/crypto/libcrypto/crypto_base64.c b/src/util/crypto/libcrypto/crypto_base64.c index 15734a0..11a0648 100644 --- a/src/util/crypto/libcrypto/crypto_base64.c +++ b/src/util/crypto/libcrypto/crypto_base64.c @@ -122,7 +122,7 @@ unsigned char *sss_base64_decode(TALLOC_CTX *mem_ctx,
*outsize = size; } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot get decoded data\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot get decoded data\n"); } BIO_free_all(b64); BIO_free(bmem_out); diff --git a/src/util/crypto/libcrypto/crypto_obfuscate.c b/src/util/crypto/libcrypto/crypto_obfuscate.c index e303e8c..50ea469 100644 --- a/src/util/crypto/libcrypto/crypto_obfuscate.c +++ b/src/util/crypto/libcrypto/crypto_obfuscate.c @@ -60,7 +60,7 @@ static struct crypto_mech_data cmdata[] = { static struct crypto_mech_data *get_crypto_mech_data(enum obfmethod meth) { if (meth >= NUM_OBFMETHODS) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unsupported cipher type\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unsupported cipher type\n"); return NULL; } return &cmdata[meth]; @@ -122,20 +122,20 @@ int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen, }
if (!EVP_EncryptInit_ex(&ctx, mech_props->cipher(), 0, keybuf, ivbuf)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Failure to initialize cipher contex\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Failure to initialize cipher contex\n"); ret = EIO; goto done; }
/* sample data we'll encrypt and decrypt */ if (!EVP_EncryptUpdate(&ctx, cryptotext, &ctlen, (const unsigned char*)password, plen)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot execute the encryption operation\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot execute the encryption operation\n"); ret = EIO; goto done; }
if(!EVP_EncryptFinal_ex(&ctx, cryptotext+ctlen, &digestlen)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot finialize the encryption operation\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot finialize the encryption operation\n"); ret = EIO; goto done; } @@ -160,9 +160,9 @@ int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen, goto done; }
- DEBUG(SSSDBG_TRACE_FUNC, ("Writing method: %d\n", meth)); + DEBUG(SSSDBG_TRACE_FUNC, "Writing method: %d\n", meth); SAFEALIGN_SET_UINT16(&obfbuf[p], meth, &p); - DEBUG(SSSDBG_TRACE_FUNC, ("Writing bufsize: %d\n", result_len)); + DEBUG(SSSDBG_TRACE_FUNC, "Writing bufsize: %d\n", result_len); SAFEALIGN_SET_UINT16(&obfbuf[p], result_len, &p); safealign_memcpy(&obfbuf[p], keybuf, mech_props->keylen, &p); safealign_memcpy(&obfbuf[p], ivbuf, mech_props->bsize, &p); @@ -224,9 +224,9 @@ int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded,
/* unpack obfuscation buffer */ SAFEALIGN_COPY_UINT16_CHECK(&meth, obfbuf+p, obflen, &p); - DEBUG(SSSDBG_TRACE_FUNC, ("Read method: %d\n", meth)); + DEBUG(SSSDBG_TRACE_FUNC, "Read method: %d\n", meth); SAFEALIGN_COPY_UINT16_CHECK(&ctsize, obfbuf+p, obflen, &p); - DEBUG(SSSDBG_TRACE_FUNC, ("Read bufsize: %d\n", ctsize)); + DEBUG(SSSDBG_TRACE_FUNC, "Read bufsize: %d\n", ctsize);
mech_props = get_crypto_mech_data(meth); if (mech_props == NULL) { @@ -239,7 +239,7 @@ int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded, obfbuf + p + mech_props->keylen + mech_props->bsize + ctsize, OBF_BUFFER_SENTINEL_SIZE); if (memcmp(sentinel_check, OBF_BUFFER_SENTINEL, OBF_BUFFER_SENTINEL_SIZE) != 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Obfuscation buffer seems corrupt, aborting\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Obfuscation buffer seems corrupt, aborting\n"); ret = EFAULT; goto done; } diff --git a/src/util/crypto/nss/nss_obfuscate.c b/src/util/crypto/nss/nss_obfuscate.c index 842b58d..ebe87be 100644 --- a/src/util/crypto/nss/nss_obfuscate.c +++ b/src/util/crypto/nss/nss_obfuscate.c @@ -77,7 +77,7 @@ static struct crypto_mech_data cmdata[] = { static struct crypto_mech_data *get_crypto_mech_data(enum obfmethod meth) { if (meth >= NUM_OBFMETHODS) { - DEBUG(1, ("Unsupported cipher type\n")); + DEBUG(1, "Unsupported cipher type\n"); return NULL; } return &cmdata[meth]; @@ -97,24 +97,24 @@ static int generate_random_key(TALLOC_CTX *mem_ctx, randkey = PK11_KeyGen(slot, mech_props->cipher, NULL, mech_props->keylen, NULL); if (randkey == NULL) { - DEBUG(1, ("Failure to generate key (err %d)\n", - PR_GetError())); + DEBUG(1, "Failure to generate key (err %d)\n", + PR_GetError()); ret = EIO; goto done; }
sret = PK11_ExtractKeyValue(randkey); if (sret != SECSuccess) { - DEBUG(1, ("Failure to extract key value (err %d)\n", - PR_GetError())); + DEBUG(1, "Failure to extract key value (err %d)\n", + PR_GetError()); ret = EIO; goto done; }
randkeydata = PK11_GetKeyData(randkey); if (randkeydata == NULL) { - DEBUG(1, ("Failure to get key data (err %d)\n", - PR_GetError())); + DEBUG(1, "Failure to get key data (err %d)\n", + PR_GetError()); ret = EIO; goto done; } @@ -168,8 +168,8 @@ static int nss_ctx_init(TALLOC_CTX *mem_ctx,
cctx->slot = PK11_GetBestSlot(mech_props->cipher, NULL); if (cctx->slot == NULL) { - DEBUG(1, ("Unable to find security device (err %d)\n", - PR_GetError())); + DEBUG(1, "Unable to find security device (err %d)\n", + PR_GetError()); ret = EIO; goto done; } @@ -194,8 +194,8 @@ static int nss_encrypt_decrypt_init(struct crypto_mech_data *mech_props, cctx->keyobj = PK11_ImportSymKey(cctx->slot, mech_props->cipher, PK11_OriginUnwrap, op, cctx->key, NULL); if (cctx->keyobj == NULL) { - DEBUG(1, ("Failure to import key into NSS (err %d)\n", - PR_GetError())); + DEBUG(1, "Failure to import key into NSS (err %d)\n", + PR_GetError()); ret = EIO; goto done; } @@ -203,8 +203,8 @@ static int nss_encrypt_decrypt_init(struct crypto_mech_data *mech_props, /* turn the raw IV into a initialization vector object */ cctx->sparam = PK11_ParamFromIV(mech_props->cipher, cctx->iv); if (cctx->sparam == NULL) { - DEBUG(1, ("Failure to set up PKCS11 param (err %d)\n", - PR_GetError())); + DEBUG(1, "Failure to set up PKCS11 param (err %d)\n", + PR_GetError()); ret = EIO; goto done; } @@ -213,8 +213,8 @@ static int nss_encrypt_decrypt_init(struct crypto_mech_data *mech_props, cctx->ectx = PK11_CreateContextBySymKey(mech_props->cipher, op, cctx->keyobj, cctx->sparam); if (cctx->ectx == NULL) { - DEBUG(1, ("Cannot create cipher context (err %d)\n", - PORT_GetError())); + DEBUG(1, "Cannot create cipher context (err %d)\n", + PORT_GetError()); ret = EIO; goto done; } @@ -265,26 +265,26 @@ int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen,
ret = nss_ctx_init(tmp_ctx, mech_props, &cctx); if (ret) { - DEBUG(1, ("Cannot initialize NSS context\n")); + DEBUG(1, "Cannot initialize NSS context\n"); goto done; }
/* generate random encryption and IV key */ ret = generate_random_key(cctx, cctx->slot, mech_props, &cctx->key); if (ret != EOK) { - DEBUG(1, ("Could not generate encryption key\n")); + DEBUG(1, "Could not generate encryption key\n"); goto done; }
ret = generate_random_key(cctx, cctx->slot, mech_props, &cctx->iv); if (ret != EOK) { - DEBUG(1, ("Could not generate initialization vector\n")); + DEBUG(1, "Could not generate initialization vector\n"); goto done; }
ret = nss_encrypt_decrypt_init(mech_props, true, cctx); if (ret) { - DEBUG(1, ("Cannot initialize NSS context properties\n")); + DEBUG(1, "Cannot initialize NSS context properties\n"); goto done; }
@@ -306,8 +306,8 @@ int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen, sret = PK11_CipherOp(cctx->ectx, cryptotext, &ctlen, ct_maxsize, plaintext, plen); if (sret != SECSuccess) { - DEBUG(1, ("Cannot execute the encryption operation (err %d)\n", - PR_GetError())); + DEBUG(1, "Cannot execute the encryption operation (err %d)\n", + PR_GetError()); ret = EIO; goto done; } @@ -315,8 +315,8 @@ int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen, sret = PK11_DigestFinal(cctx->ectx, cryptotext+ctlen, &digestlen, ct_maxsize-ctlen); if (sret != SECSuccess) { - DEBUG(1, ("Cannot execute the digest operation (err %d)\n", - PR_GetError())); + DEBUG(1, "Cannot execute the digest operation (err %d)\n", + PR_GetError()); ret = EIO; goto done; } @@ -340,9 +340,9 @@ int sss_password_encrypt(TALLOC_CTX *mem_ctx, const char *password, int plen, goto done; }
- DEBUG(8, ("Writing method: %d\n", meth)); + DEBUG(8, "Writing method: %d\n", meth); SAFEALIGN_SET_UINT16(&obfbuf[p], meth, &p); - DEBUG(8, ("Writing bufsize: %d\n", result_len)); + DEBUG(8, "Writing bufsize: %d\n", result_len); SAFEALIGN_SET_UINT16(&obfbuf[p], result_len, &p); safealign_memcpy(&obfbuf[p], cctx->key->data, mech_props->keylen, &p); safealign_memcpy(&obfbuf[p], cctx->iv->data, mech_props->bsize, &p); @@ -409,9 +409,9 @@ int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded,
/* unpack obfuscation buffer */ SAFEALIGN_COPY_UINT16_CHECK(&meth, obfbuf+p, obflen, &p); - DEBUG(8, ("Read method: %d\n", meth)); + DEBUG(8, "Read method: %d\n", meth); SAFEALIGN_COPY_UINT16_CHECK(&ctsize, obfbuf+p, obflen, &p); - DEBUG(8, ("Read bufsize: %d\n", ctsize)); + DEBUG(8, "Read bufsize: %d\n", ctsize);
mech_props = get_crypto_mech_data(meth); if (mech_props == NULL) { @@ -424,7 +424,7 @@ int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded, obfbuf + p + mech_props->keylen + mech_props->bsize + ctsize, OBF_BUFFER_SENTINEL_SIZE); if (memcmp(sentinel_check, OBF_BUFFER_SENTINEL, OBF_BUFFER_SENTINEL_SIZE) != 0) { - DEBUG(0, ("Obfuscation buffer seems corrupt, aborting\n")); + DEBUG(0, "Obfuscation buffer seems corrupt, aborting\n"); ret = EFAULT; goto done; } @@ -453,7 +453,7 @@ int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded,
ret = nss_ctx_init(tmp_ctx, mech_props, &cctx); if (ret) { - DEBUG(1, ("Cannot initialize NSS context\n")); + DEBUG(1, "Cannot initialize NSS context\n"); goto done; }
@@ -481,8 +481,8 @@ int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded, sret = PK11_CipherOp(cctx->ectx, (unsigned char *) pwdbuf, &plainlen, ctsize, cryptotext, ctsize); if (sret != SECSuccess) { - DEBUG(1, ("Cannot execute the encryption operation (err %d)\n", - PR_GetError())); + DEBUG(1, "Cannot execute the encryption operation (err %d)\n", + PR_GetError()); ret = EIO; goto done; } @@ -490,8 +490,8 @@ int sss_password_decrypt(TALLOC_CTX *mem_ctx, char *b64encoded, sret = PK11_DigestFinal(cctx->ectx, (unsigned char *) pwdbuf+plainlen, &digestlen, ctsize - plainlen); if (sret != SECSuccess) { - DEBUG(1, ("Cannot execute the encryption operation (err %d)\n", - PR_GetError())); + DEBUG(1, "Cannot execute the encryption operation (err %d)\n", + PR_GetError()); ret = EIO; goto done; } diff --git a/src/util/crypto/nss/nss_util.c b/src/util/crypto/nss/nss_util.c index 9a272ca..e93bf20 100644 --- a/src/util/crypto/nss/nss_util.c +++ b/src/util/crypto/nss/nss_util.c @@ -46,8 +46,8 @@ int nspr_nss_init(void)
sret = NSS_NoDB_Init(NULL); if (sret != SECSuccess) { - DEBUG(1, ("Error initializing connection to NSS [%d]\n", - PR_GetError())); + DEBUG(1, "Error initializing connection to NSS [%d]\n", + PR_GetError()); return EIO; }
@@ -64,8 +64,8 @@ int nspr_nss_cleanup(void)
sret = NSS_Shutdown(); if (sret != SECSuccess) { - DEBUG(1, ("Error shutting down connection to NSS [%d]\n", - PR_GetError())); + DEBUG(1, "Error shutting down connection to NSS [%d]\n", + PR_GetError()); return EIO; }
diff --git a/src/util/debug.c b/src/util/debug.c index 9f87468..c2e2571 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -50,7 +50,7 @@ errno_t set_debug_file_from_fd(const int fd) dummy = fdopen(fd, "a"); if (dummy == NULL) { ret = errno; - DEBUG(1, ("fdopen failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "fdopen failed [%d][%s].\n", ret, strerror(ret)); sss_log(SSS_LOG_ERR, "Could not open debug file descriptor [%d]. " "Debug messages will not be written to the file " @@ -318,5 +318,5 @@ int rotate_debug_files(void)
void talloc_log_fn(const char *message) { - DEBUG(SSSDBG_FATAL_FAILURE, ("%s", message)); + DEBUG(SSSDBG_FATAL_FAILURE, "%s", message); } diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index 9d7bb5f..6a0a69e 100644 --- a/src/util/domain_info_utils.c +++ b/src/util/domain_info_utils.c @@ -68,7 +68,7 @@ bool subdomain_enumerates(struct sss_domain_info *parent, if (parent->sd_enumerate == NULL || parent->sd_enumerate[0] == NULL) { DEBUG(SSSDBG_MINOR_FAILURE, - ("Subdomain_enumerate not set\n")); + "Subdomain_enumerate not set\n"); return false; }
@@ -153,15 +153,15 @@ find_subdomain_by_object_name(struct sss_domain_info *domain,
tmp_ctx = talloc_new(NULL); if (tmp_ctx == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_new() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new() failed\n"); return NULL; }
ret = sss_parse_name(tmp_ctx, domain->names, object_name, &domainname, &name); if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to parse name '%s' [%d]: %s\n", - object_name, ret, sss_strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse name '%s' [%d]: %s\n", + object_name, ret, sss_strerror(ret)); goto done; }
@@ -189,37 +189,37 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, struct sss_domain_info *dom;
DEBUG(SSSDBG_TRACE_FUNC, - ("Creating [%s] as subdomain of [%s]!\n", name, parent->name)); + "Creating [%s] as subdomain of [%s]!\n", name, parent->name);
dom = talloc_zero(mem_ctx, struct sss_domain_info); if (dom == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_zero failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n"); return NULL; }
dom->parent = parent; dom->name = talloc_strdup(dom, name); if (dom->name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy domain name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to copy domain name.\n"); goto fail; }
dom->provider = talloc_strdup(dom, parent->provider); if (dom->provider == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy provider name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to copy provider name.\n"); goto fail; }
dom->conn_name = talloc_strdup(dom, parent->conn_name); if (dom->conn_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy connection name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to copy connection name.\n"); goto fail; }
if (realm != NULL) { dom->realm = talloc_strdup(dom, realm); if (dom->realm == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy realm name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to copy realm name.\n"); goto fail; } } @@ -227,7 +227,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, if (flat_name != NULL) { dom->flat_name = talloc_strdup(dom, flat_name); if (dom->flat_name == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy flat name.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to copy flat name.\n"); goto fail; } } @@ -235,7 +235,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, if (id != NULL) { dom->domain_id = talloc_strdup(dom, id); if (dom->domain_id == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy id.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to copy id.\n"); goto fail; } } @@ -243,7 +243,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, if (forest != NULL) { dom->forest = talloc_strdup(dom, forest); if (dom->forest == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to copy forest.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to copy forest.\n"); goto fail; } } @@ -267,7 +267,7 @@ struct sss_domain_info *new_subdomain(TALLOC_CTX *mem_ctx, dom->subdomain_homedir = parent->subdomain_homedir;
if (parent->sysdb == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing sysdb context in parent domain.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing sysdb context in parent domain.\n"); goto fail; } dom->sysdb = parent->sysdb; @@ -291,18 +291,18 @@ errno_t sssd_domain_init(TALLOC_CTX *mem_ctx,
ret = confdb_get_domain(cdb, domain_name, &dom); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Error retrieving domain configuration.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Error retrieving domain configuration.\n"); return ret; }
if (dom->sysdb != NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Sysdb context already initialized.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Sysdb context already initialized.\n"); return EEXIST; }
ret = sysdb_domain_init(mem_ctx, dom, db_path, &sysdb); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Error opening cache database.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Error opening cache database.\n"); return ret; }
@@ -327,8 +327,8 @@ sss_krb5_touch_config(void) ret = utime(config, NULL); if (ret == -1) { ret = errno; - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to change mtime of "%s" " - "[%d]: %s\n", config, ret, strerror(ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to change mtime of "%s" " + "[%d]: %s\n", config, ret, strerror(ret)); return ret; }
@@ -355,7 +355,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) char *uc_parent;
if (domain == NULL || domain->name == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No domain name provided\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No domain name provided\n"); return EINVAL; }
@@ -364,7 +364,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths)
sanitized_domain = talloc_strdup(tmp_ctx, domain->name); if (sanitized_domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup() failed\n"); return ENOMEM; }
@@ -384,8 +384,8 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) goto done; }
- DEBUG(SSSDBG_FUNC_DATA, ("Mapping file for domain [%s] is [%s]\n", - domain->name, mapping_file)); + DEBUG(SSSDBG_FUNC_DATA, "Mapping file for domain [%s] is [%s]\n", + domain->name, mapping_file);
tmp_file = talloc_asprintf(tmp_ctx, "%sXXXXXX", mapping_file); if (tmp_file == NULL) { @@ -397,8 +397,8 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) fd = mkstemp(tmp_file); umask(old_mode); if (fd < 0) { - DEBUG(SSSDBG_OP_FAILURE, ("creating the temp file [%s] for domain-realm " - "mappings failed.", tmp_file)); + DEBUG(SSSDBG_OP_FAILURE, "creating the temp file [%s] for domain-realm " + "mappings failed.", tmp_file); ret = EIO; talloc_zfree(tmp_ctx); goto done; @@ -407,13 +407,13 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) fstream = fdopen(fd, "a"); if (!fstream) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("fdopen failed [%d]: %s\n", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "fdopen failed [%d]: %s\n", + ret, strerror(ret)); ret = close(fd); if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fclose failed [%d][%s].\n", ret, strerror(ret))); + "fclose failed [%d][%s].\n", ret, strerror(ret)); /* Nothing to do here, just report the failure */ } ret = EIO; @@ -422,7 +422,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths)
ret = fprintf(fstream, "[domain_realm]\n"); if (ret < 0) { - DEBUG(SSSDBG_OP_FAILURE, ("fprintf failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "fprintf failed\n"); ret = EIO; goto done; } @@ -433,7 +433,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) ret = fprintf(fstream, ".%s = %s\n%s = %s\n", dom->name, dom->realm, dom->name, dom->realm); if (ret < 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("fprintf failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "fprintf failed\n"); goto done; } } @@ -443,7 +443,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) parent_dom = domain; uc_parent = get_uppercase_realm(tmp_ctx, parent_dom->name); if (uc_parent == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("get_uppercase_realm failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_uppercase_realm failed.\n"); ret = ENOMEM; goto done; } @@ -458,7 +458,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths)
uc_forest = get_uppercase_realm(tmp_ctx, dom->forest); if (uc_forest == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("get_uppercase_realm failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "get_uppercase_realm failed.\n"); ret = ENOMEM; goto done; } @@ -466,7 +466,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) if (!capaths_started) { ret = fprintf(fstream, "[capaths]\n"); if (ret < 0) { - DEBUG(SSSDBG_OP_FAILURE, ("fprintf failed\n")); + DEBUG(SSSDBG_OP_FAILURE, "fprintf failed\n"); ret = EIO; goto done; } @@ -477,7 +477,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) dom->realm, uc_parent, uc_forest, uc_parent, dom->realm, uc_forest); if (ret < 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("fprintf failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "fprintf failed\n"); goto done; } } @@ -488,7 +488,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) if (ret != 0) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fclose failed [%d][%s].\n", ret, strerror(ret))); + "fclose failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -496,7 +496,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("rename failed [%d][%s].\n", ret, strerror(ret))); + "rename failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -506,7 +506,7 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) if (ret == -1) { ret = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fchmod failed [%d][%s].\n", ret, strerror(ret))); + "fchmod failed [%d][%s].\n", ret, strerror(ret)); goto done; }
@@ -514,8 +514,8 @@ sss_write_domain_mappings(struct sss_domain_info *domain, bool add_capaths) done: err = sss_krb5_touch_config(); if (err != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to change last modification time " - "of krb5.conf. Created mappings may not be loaded.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to change last modification time " + "of krb5.conf. Created mappings may not be loaded.\n"); /* Ignore */ }
@@ -524,7 +524,7 @@ done: if (err != 0) { err = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("fclose failed [%d][%s].\n", err, strerror(err))); + "fclose failed [%d][%s].\n", err, strerror(err)); /* Nothing to do here, just report the failure */ } } @@ -534,8 +534,8 @@ done: if (err < 0) { err = errno; DEBUG(SSSDBG_MINOR_FAILURE, - ("Could not remove file [%s]: [%d]: %s", - tmp_file, err, strerror(err))); + "Could not remove file [%s]: [%d]: %s", + tmp_file, err, strerror(err)); } } talloc_free(tmp_ctx); diff --git a/src/util/find_uid.c b/src/util/find_uid.c index 6d1478e..0c1a41f 100644 --- a/src/util/find_uid.c +++ b/src/util/find_uid.c @@ -74,10 +74,10 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid)
ret = snprintf(path, PATHLEN, "/proc/%d/status", pid); if (ret < 0) { - DEBUG(1, ("snprintf failed")); + DEBUG(1, "snprintf failed"); return EINVAL; } else if (ret >= PATHLEN) { - DEBUG(1, ("path too long?!?!\n")); + DEBUG(1, "path too long?!?!\n"); return EINVAL; }
@@ -85,11 +85,11 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) if (fd == -1) { error = errno; if (error == ENOENT) { - DEBUG(7, ("Proc file [%s] is not available anymore, continuing.\n", - path)); + DEBUG(7, "Proc file [%s] is not available anymore, continuing.\n", + path); return EOK; } - DEBUG(1, ("open failed [%d][%s].\n", error, strerror(error))); + DEBUG(1, "open failed [%d][%s].\n", error, strerror(error)); return error; }
@@ -97,17 +97,17 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) if (ret == -1) { error = errno; if (error == ENOENT) { - DEBUG(7, ("Proc file [%s] is not available anymore, continuing.\n", - path)); + DEBUG(7, "Proc file [%s] is not available anymore, continuing.\n", + path); error = EOK; goto fail_fd; } - DEBUG(1, ("fstat failed [%d][%s].\n", error, strerror(error))); + DEBUG(1, "fstat failed [%d][%s].\n", error, strerror(error)); goto fail_fd; }
if (!S_ISREG(stat_buf.st_mode)) { - DEBUG(1, ("not a regular file\n")); + DEBUG(1, "not a regular file\n"); error = EINVAL; goto fail_fd; } @@ -117,7 +117,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) if (ret == -1) { error = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("read failed [%d][%s].\n", error, strerror(error))); + "read failed [%d][%s].\n", error, strerror(error)); goto fail_fd; }
@@ -127,7 +127,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) ret = close(fd); if (ret == -1) { error = errno; - DEBUG(1, ("close failed [%d][%s].\n", error, strerror(error))); + DEBUG(1, "close failed [%d][%s].\n", error, strerror(error)); }
p = strstr(buf, "\nUid:\t"); @@ -135,7 +135,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) p += 6; e = strchr(p,'\t'); if (e == NULL) { - DEBUG(1, ("missing delimiter.\n")); + DEBUG(1, "missing delimiter.\n"); return EINVAL; } else { *e = '\0'; @@ -143,16 +143,16 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) num = (uint32_t) strtoint32(p, &endptr, 10); error = errno; if (error != 0) { - DEBUG(1, ("strtol failed [%s].\n", strerror(error))); + DEBUG(1, "strtol failed [%s].\n", strerror(error)); return error; } if (*endptr != '\0') { - DEBUG(1, ("uid contains extra characters\n")); + DEBUG(1, "uid contains extra characters\n"); return EINVAL; }
} else { - DEBUG(1, ("format error\n")); + DEBUG(1, "format error\n"); return EINVAL; }
@@ -180,12 +180,12 @@ static errno_t name_to_pid(const char *name, pid_t *pid) }
if (*endptr != '\0') { - DEBUG(1, ("pid string contains extra characters.\n")); + DEBUG(1, "pid string contains extra characters.\n"); return EINVAL; }
if (num <= 0 || num >= INT_MAX) { - DEBUG(1, ("pid out of range.\n")); + DEBUG(1, "pid out of range.\n"); return ERANGE; }
@@ -214,7 +214,7 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid) proc_dir = opendir("/proc"); if (proc_dir == NULL) { ret = errno; - DEBUG(1, ("Cannot open proc dir.\n")); + DEBUG(1, "Cannot open proc dir.\n"); goto done; };
@@ -223,13 +223,13 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid) if (only_numbers(dirent->d_name) != 0) continue; ret = name_to_pid(dirent->d_name, &pid); if (ret != EOK) { - DEBUG(1, ("name_to_pid failed.\n")); + DEBUG(1, "name_to_pid failed.\n"); goto done; }
ret = get_uid_from_pid(pid, &uid); if (ret != EOK) { - DEBUG(1, ("get_uid_from_pid failed.\n")); + DEBUG(1, "get_uid_from_pid failed.\n"); goto done; }
@@ -241,7 +241,7 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid)
ret = hash_enter(table, &key, &value); if (ret != HASH_SUCCESS) { - DEBUG(1, ("cannot add to table [%s]\n", hash_error_string(ret))); + DEBUG(1, "cannot add to table [%s]\n", hash_error_string(ret)); ret = ENOMEM; goto done; } @@ -257,14 +257,14 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid) } if (errno != 0 && dirent == NULL) { ret = errno; - DEBUG(1, ("readdir failed.\n")); + DEBUG(1, "readdir failed.\n"); goto done; }
ret = closedir(proc_dir); proc_dir = NULL; if (ret == -1) { - DEBUG(1, ("closedir failed, watch out.\n")); + DEBUG(1, "closedir failed, watch out.\n"); }
if (table != NULL) { @@ -277,7 +277,7 @@ done: if (proc_dir != NULL) { err = closedir(proc_dir); if (err) { - DEBUG(1, ("closedir failed, bad dirp?\n")); + DEBUG(1, "closedir failed, bad dirp?\n"); } } return ret; @@ -292,7 +292,7 @@ errno_t get_uid_table(TALLOC_CTX *mem_ctx, hash_table_t **table) hash_talloc, hash_talloc_free, mem_ctx, NULL, NULL); if (ret != HASH_SUCCESS) { - DEBUG(1, ("hash_create_ex failed [%s]\n", hash_error_string(ret))); + DEBUG(1, "hash_create_ex failed [%s]\n", hash_error_string(ret)); return ENOMEM; }
@@ -316,15 +316,15 @@ errno_t check_if_uid_is_active(uid_t uid, bool *result) *result = false; } if (ret < 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("systemd-login gave error %d: %s\n", - -ret, strerror(-ret))); + DEBUG(SSSDBG_CRIT_FAILURE, "systemd-login gave error %d: %s\n", + -ret, strerror(-ret)); } /* fall back to the old method */ #endif
ret = get_active_uid_linux(NULL, uid); if (ret != EOK && ret != ENOENT) { - DEBUG(1, ("get_uid_table failed.\n")); + DEBUG(1, "get_uid_table failed.\n"); return ret; }
diff --git a/src/util/nscd.c b/src/util/nscd.c index 6c9cc77..e73c3fa 100644 --- a/src/util/nscd.c +++ b/src/util/nscd.c @@ -49,7 +49,7 @@ int flush_nscd_cache(enum nscd_db flush_db) break;
default: - DEBUG(1, ("Unknown nscd database\n")); + DEBUG(1, "Unknown nscd database\n"); ret = EINVAL; goto done; } @@ -59,10 +59,10 @@ int flush_nscd_cache(enum nscd_db flush_db) case 0: execl(NSCD_PATH, "nscd", NSCD_RELOAD_ARG, service, NULL); /* if this returns it is an error */ - DEBUG(1, ("execl(3) failed: %d(%s)\n", errno, strerror(errno))); + DEBUG(1, "execl(3) failed: %d(%s)\n", errno, strerror(errno)); exit(errno); case -1: - DEBUG(1, ("fork failed\n")); + DEBUG(1, "fork failed\n"); ret = EFAULT; break; default: @@ -76,11 +76,11 @@ int flush_nscd_cache(enum nscd_db flush_db) if (ret > 0) { /* The flush fails if nscd is not running, so do not care * about the return code */ - DEBUG(8, ("Error flushing cache, is nscd running?\n")); + DEBUG(8, "Error flushing cache, is nscd running?\n"); } } } else { - DEBUG(5, ("Failed to wait for children %d\n", nscd_pid)); + DEBUG(5, "Failed to wait for children %d\n", nscd_pid); ret = EIO; } } @@ -140,8 +140,8 @@ errno_t sss_nscd_parse_conf(const char *conf_path)
fp = fopen(conf_path, "r"); if (fp == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Couldn't open NSCD configuration " - "file [%s]\n", NSCD_CONF_PATH)); + DEBUG(SSSDBG_MINOR_FAILURE, "Couldn't open NSCD configuration " + "file [%s]\n", NSCD_CONF_PATH); return ENOENT; }
@@ -196,9 +196,9 @@ errno_t sss_nscd_parse_conf(const char *conf_path)
ret = ferror(fp); if (ret) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Reading NSCD configuration file [%s] " + DEBUG(SSSDBG_MINOR_FAILURE, "Reading NSCD configuration file [%s] " "ended with failure [%d]: %s.\n", - NSCD_CONF_PATH, ret, strerror(ret))); + NSCD_CONF_PATH, ret, strerror(ret)); ret = ENOENT; goto done; } diff --git a/src/util/server.c b/src/util/server.c index b1c59e1..e6eac62 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -57,11 +57,11 @@ static void close_low_fds(void) if (fd < 0) fd = open("/dev/null", O_WRONLY, 0); if (fd < 0) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Can't open /dev/null\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Can't open /dev/null\n"); return; } if (fd != i) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Didn't get file descriptor %d\n",i)); + DEBUG(SSSDBG_FATAL_FAILURE, "Didn't get file descriptor %d\n",i); return; } } @@ -101,8 +101,8 @@ void become_daemon(bool Fork) error = errno; if (error != EINTR) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Error [%d][%s] while waiting for child\n", - error, strerror(error))); + "Error [%d][%s] while waiting for child\n", + error, strerror(error)); /* Forcibly kill this child */ kill(pid, SIGKILL); ret = 1; @@ -130,8 +130,8 @@ void become_daemon(bool Fork) errno = 0; if(chdir("/") == -1) { ret = errno; - DEBUG(SSSDBG_FATAL_FAILURE, ("Cannot change directory (%d [%s])\n", - ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Cannot change directory (%d [%s])\n", + ret, strerror(ret)); return; }
@@ -164,7 +164,7 @@ int pidfile(const char *path, const char *name) ret = errno; if (len == -1) { DEBUG(SSSDBG_CRIT_FAILURE, - ("read failed [%d][%s].\n", ret, strerror(ret))); + "read failed [%d][%s].\n", ret, strerror(ret)); close(fd); talloc_free(file); return EINVAL; @@ -220,14 +220,14 @@ int pidfile(const char *path, const char *name) if (written == -1) { err = errno; DEBUG(SSSDBG_CRIT_FAILURE, - ("write failed [%d][%s]\n", err, strerror(err))); + "write failed [%d][%s]\n", err, strerror(err)); close(fd); return err; }
if (written != size) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Wrote %zd bytes expected %zu\n", written, size)); + "Wrote %zd bytes expected %zu\n", written, size); close(fd); return EIO; } @@ -248,7 +248,7 @@ void sig_term(int sig) #if HAVE_GETPGRP static int done_sigterm; if (done_sigterm == 0 && getpgrp() == getpid()) { - DEBUG(SSSDBG_FATAL_FAILURE, ("SIGTERM: killing children\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "SIGTERM: killing children\n"); done_sigterm = 1; kill(-getpgrp(), SIGTERM); } @@ -267,7 +267,7 @@ static void default_quit(struct tevent_context *ev, #if HAVE_GETPGRP static int done_sigterm; if (done_sigterm == 0 && getpgrp() == getpid()) { - DEBUG(SSSDBG_FATAL_FAILURE, ("SIGTERM: killing children\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "SIGTERM: killing children\n"); done_sigterm = 1; kill(-getpgrp(), SIGTERM); } @@ -282,8 +282,8 @@ static void sig_segv_abrt(int sig) #if HAVE_GETPGRP static int done; if (done == 0 && getpgrp() == getpid()) { - DEBUG(SSSDBG_FATAL_FAILURE, ("%s: killing children\n", - strsignal(sig))); + DEBUG(SSSDBG_FATAL_FAILURE, "%s: killing children\n", + strsignal(sig)); done = 1; kill(-getpgrp(), SIGTERM); } @@ -344,8 +344,8 @@ static void server_stdin_handler(struct tevent_context *event_ctx,
errno = 0; if (sss_atomic_read_s(0, &c, 1) == 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("%s: EOF on stdin - terminating\n", - binary_name)); + DEBUG(SSSDBG_CRIT_FAILURE, "%s: EOF on stdin - terminating\n", + binary_name); #if HAVE_GETPGRP if (getpgrp() == getpid()) { kill(-getpgrp(), SIGTERM); @@ -368,8 +368,8 @@ int die_if_parent_died(void) ret = prctl(PR_SET_PDEATHSIG, SIGTERM, 0, 0, 0); if (ret != 0) { ret = errno; - DEBUG(SSSDBG_OP_FAILURE, ("prctl failed [%d]: %s", - ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "prctl failed [%d]: %s", + ret, strerror(ret)); return ret; } #endif @@ -392,12 +392,12 @@ static void te_server_hup(struct tevent_context *ev, struct logrotate_ctx *lctx = talloc_get_type(private_data, struct logrotate_ctx);
- DEBUG(SSSDBG_CRIT_FAILURE, ("Received SIGHUP. Rotating logfiles.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Received SIGHUP. Rotating logfiles.\n");
ret = monitor_common_rotate_logs(lctx->confdb, lctx->confdb_path); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Could not reopen log file [%s]\n", - strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Could not reopen log file [%s]\n", + strerror(ret)); } }
@@ -428,8 +428,8 @@ int server_setup(const char *name, int flags, * value after reading domain from the configuration */ ret = unsetenv(SSS_DOM_ENV); if (ret != 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Unsetting "SSS_DOM_ENV" failed, journald " - "logging mightnot work as expected\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Unsetting "SSS_DOM_ENV" failed, journald " + "logging mightnot work as expected\n"); }
setup_signals(); @@ -439,15 +439,15 @@ int server_setup(const char *name, int flags, umask(0177);
if (flags & FLAGS_DAEMON) { - DEBUG(SSSDBG_IMPORTANT_INFO, ("Becoming a daemon.\n")); + DEBUG(SSSDBG_IMPORTANT_INFO, "Becoming a daemon.\n"); become_daemon(true); }
if (flags & FLAGS_PID_FILE) { ret = pidfile(PID_PATH, name); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error creating pidfile: %s/%s! " - "(%d [%s])\n", PID_PATH, name, ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error creating pidfile: %s/%s! " + "(%d [%s])\n", PID_PATH, name, ret, strerror(ret)); return ret; } } @@ -462,7 +462,7 @@ int server_setup(const char *name, int flags, event_ctx = tevent_context_init(talloc_autofree_context()); if (event_ctx == NULL) { DEBUG(SSSDBG_FATAL_FAILURE, - ("The event context initialiaziton failed\n")); + "The event context initialiaziton failed\n"); return 1; }
@@ -482,7 +482,7 @@ int server_setup(const char *name, int flags,
ctx = talloc(event_ctx, struct main_context); if (ctx == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory, aborting!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory, aborting!\n"); return ENOMEM; }
@@ -491,13 +491,13 @@ int server_setup(const char *name, int flags,
conf_db = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE); if (conf_db == NULL) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Out of memory, aborting!\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "Out of memory, aborting!\n"); return ENOMEM; }
ret = confdb_init(ctx, &ctx->confdb_ctx, conf_db); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("The confdb initialization failed\n")); + DEBUG(SSSDBG_FATAL_FAILURE, "The confdb initialization failed\n"); return ret; }
@@ -508,8 +508,8 @@ int server_setup(const char *name, int flags, SSSDBG_DEFAULT, &debug_level); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) " - "[%s]\n", ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) " + "[%s]\n", ret, strerror(ret)); return ret; }
@@ -523,8 +523,8 @@ int server_setup(const char *name, int flags, SSSDBG_TIMESTAMP_DEFAULT, &dt); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) " - "[%s]\n", ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) " + "[%s]\n", ret, strerror(ret)); return ret; } if (dt) debug_timestamps = 1; @@ -538,8 +538,8 @@ int server_setup(const char *name, int flags, SSSDBG_MICROSECONDS_DEFAULT, &dm); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) " - "[%s]\n", ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) " + "[%s]\n", ret, strerror(ret)); return ret; } if (dm) debug_microseconds = 1; @@ -552,8 +552,8 @@ int server_setup(const char *name, int flags, CONFDB_SERVICE_DEBUG_TO_FILES, dl, &dl); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error reading from confdb (%d) [%s]\n", - ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error reading from confdb (%d) [%s]\n", + ret, strerror(ret)); return ret; } if (dl) debug_to_file = 1; @@ -575,15 +575,15 @@ int server_setup(const char *name, int flags, if (debug_to_file) { ret = open_debug_file(); if (ret != EOK) { - DEBUG(SSSDBG_FATAL_FAILURE, ("Error setting up logging (%d) " - "[%s]\n", ret, strerror(ret))); + DEBUG(SSSDBG_FATAL_FAILURE, "Error setting up logging (%d) " + "[%s]\n", ret, strerror(ret)); return ret; } }
sss_log(SSS_LOG_INFO, "Starting up");
- DEBUG(SSSDBG_TRACE_FUNC, ("CONFDB: %s\n", conf_db)); + DEBUG(SSSDBG_TRACE_FUNC, "CONFDB: %s\n", conf_db);
if (flags & FLAGS_INTERACTIVE) { /* terminate when stdin goes away */ diff --git a/src/util/signal.c b/src/util/signal.c index e4a782d..a6a5690 100644 --- a/src/util/signal.c +++ b/src/util/signal.c @@ -88,7 +88,7 @@ void BlockSignals(bool block, int signum) /* yikes! This platform can't block signals? */ static int done; if (!done) { - DEBUG(0,("WARNING: No signal blocking available\n")); + DEBUG(0,"WARNING: No signal blocking available\n"); done=1; } #endif diff --git a/src/util/sss_ini.c b/src/util/sss_ini.c index 6d93b16..1aac8f7 100644 --- a/src/util/sss_ini.c +++ b/src/util/sss_ini.c @@ -193,7 +193,7 @@ void sss_ini_config_print_errors(char **error_list) }
while (error_list[count]) { - DEBUG(SSSDBG_CRIT_FAILURE, ("%s\n", error_list[count])); + DEBUG(SSSDBG_CRIT_FAILURE, "%s\n", error_list[count]); count++; } #endif @@ -215,7 +215,7 @@ int sss_ini_get_config(struct sss_ini_initdata *init_data, ret = ini_config_create(&(init_data->sssd_config)); if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to create config object. Error %d.\n", ret)); + "Failed to create config object. Error %d.\n", ret); return ret; }
@@ -228,12 +228,12 @@ int sss_ini_get_config(struct sss_ini_initdata *init_data,
if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to parse configuration. Error %d.\n", ret)); + "Failed to parse configuration. Error %d.\n", ret);
if (ini_config_error_count(init_data->sssd_config)) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Errors detected while parsing: %s\n", - ini_config_get_filename(init_data->file))); + "Errors detected while parsing: %s\n", + ini_config_get_filename(init_data->file));
ini_config_get_errors(init_data->sssd_config, &init_data->error_list); @@ -259,8 +259,8 @@ int sss_ini_get_config(struct sss_ini_initdata *init_data,
if (ret != EOK) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Parse error reading configuration file [%s]\n", - config_file)); + "Parse error reading configuration file [%s]\n", + config_file);
print_file_parsing_errors(stderr, init_data->error_list);
@@ -382,7 +382,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx, for (i = 0; i < section_count; i++) { const char *rdn = NULL; DEBUG(SSSDBG_TRACE_FUNC, - ("Processing config section [%s]\n", sections[i])); + "Processing config section [%s]\n", sections[i]); ret = parse_section(tmp_ctx, sections[i], &sec_dn, &rdn); if (ret != EOK) { goto error; @@ -409,7 +409,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx,
for (j = 0; j < attr_count; j++) { DEBUG(SSSDBG_TRACE_FUNC, - ("Processing attribute [%s]\n", attrs[j])); + "Processing attribute [%s]\n", attrs[j]); ret = sss_ini_get_config_obj(sections[i], attrs[j], init_data->sssd_config, INI_GET_FIRST_VALUE, &obj); @@ -419,14 +419,14 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx, if (ret != EOK) goto error; if (value && value[0] == '\0') { DEBUG(SSSDBG_CRIT_FAILURE, - ("Attribute '%s' has empty value, ignoring\n", - attrs[j])); + "Attribute '%s' has empty value, ignoring\n", + attrs[j]); continue; }
ldif_attr = talloc_asprintf(tmp_ctx, "%s: %s\n", attrs[j], value); - DEBUG(SSSDBG_TRACE_ALL, ("%s", ldif_attr)); + DEBUG(SSSDBG_TRACE_ALL, "%s", ldif_attr);
attr_len = strlen(ldif_attr);
@@ -456,7 +456,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx, dn[dn_size-1] = '\n'; dn[dn_size] = '\0';
- DEBUG(SSSDBG_TRACE_ALL, ("Section dn\n%s", dn)); + DEBUG(SSSDBG_TRACE_ALL, "Section dn\n%s", dn);
tmp_ldif = talloc_realloc(mem_ctx, ldif, char, ldif_len+dn_size+1); diff --git a/src/util/sss_krb5.c b/src/util/sss_krb5.c index f8a7e6f..ea5dee0 100644 --- a/src/util/sss_krb5.c +++ b/src/util/sss_krb5.c @@ -94,16 +94,16 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, const char *realm_patterns[] = {"%s", "%s", "%s", "%s", "%s", NULL, NULL};
- DEBUG(5, ("trying to select the most appropriate principal from keytab\n")); + DEBUG(5, "trying to select the most appropriate principal from keytab\n"); tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { - DEBUG(1, ("talloc_new failed\n")); + DEBUG(1, "talloc_new failed\n"); return ENOMEM; }
kerr = krb5_init_context(&krb_ctx); if (kerr) { - DEBUG(2, ("Failed to init kerberos context\n")); + DEBUG(2, "Failed to init kerberos context\n"); ret = EFAULT; goto done; } @@ -115,9 +115,9 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, } if (kerr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Failed to read keytab [%s]: %s\n", + "Failed to read keytab [%s]: %s\n", KEYTAB_CLEAN_NAME, - sss_krb5_get_error_message(krb_ctx, kerr))); + sss_krb5_get_error_message(krb_ctx, kerr)); ret = EFAULT; goto done; } @@ -167,7 +167,7 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, if (_principal) { kerr = krb5_unparse_name(krb_ctx, client_princ, &principal_string); if (kerr) { - DEBUG(1, ("krb5_unparse_name failed")); + DEBUG(1, "krb5_unparse_name failed"); ret = EFAULT; goto done; } @@ -175,11 +175,11 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, *_principal = talloc_strdup(mem_ctx, principal_string); free(principal_string); if (!*_principal) { - DEBUG(1, ("talloc_strdup failed")); + DEBUG(1, "talloc_strdup failed"); ret = ENOMEM; goto done; } - DEBUG(5, ("Selected principal: %s\n", *_principal)); + DEBUG(5, "Selected principal: %s\n", *_principal); }
if (_primary) { @@ -187,7 +187,7 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, KRB5_PRINCIPAL_UNPARSE_NO_REALM, &principal_string); if (kerr) { - DEBUG(1, ("krb5_unparse_name failed")); + DEBUG(1, "krb5_unparse_name failed"); ret = EFAULT; goto done; } @@ -195,12 +195,12 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, *_primary = talloc_strdup(mem_ctx, principal_string); free(principal_string); if (!*_primary) { - DEBUG(1, ("talloc_strdup failed")); + DEBUG(1, "talloc_strdup failed"); if (_principal) talloc_zfree(*_principal); ret = ENOMEM; goto done; } - DEBUG(5, ("Selected primary: %s\n", *_primary)); + DEBUG(5, "Selected primary: %s\n", *_primary); }
if (_realm) { @@ -210,18 +210,18 @@ errno_t select_principal_from_keytab(TALLOC_CTX *mem_ctx, *_realm = talloc_asprintf(mem_ctx, "%.*s", realm_len, realm_name); if (!*_realm) { - DEBUG(1, ("talloc_asprintf failed")); + DEBUG(1, "talloc_asprintf failed"); if (_principal) talloc_zfree(*_principal); if (_primary) talloc_zfree(*_primary); ret = ENOMEM; goto done; } - DEBUG(5, ("Selected realm: %s\n", *_realm)); + DEBUG(5, "Selected realm: %s\n", *_realm); }
ret = EOK; } else { - DEBUG(3, ("No suitable principal found in keytab\n")); + DEBUG(3, "No suitable principal found in keytab\n"); ret = ENOENT; }
@@ -248,7 +248,7 @@ int sss_krb5_verify_keytab_ex(const char *principal, const char *keytab_name, krberr = krb5_kt_start_seq_get(context, keytab, &cursor); if (krberr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Cannot read keytab [%s].\n", KEYTAB_CLEAN_NAME)); + "Cannot read keytab [%s].\n", KEYTAB_CLEAN_NAME);
sss_log(SSS_LOG_ERR, "Error reading keytab file [%s]: [%d][%s]. " "Unable to create GSSAPI-encrypted LDAP " @@ -264,7 +264,7 @@ int sss_krb5_verify_keytab_ex(const char *principal, const char *keytab_name, krberr = krb5_unparse_name(context, entry.principal, &kt_principal); if (krberr) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Could not parse keytab entry\n")); + "Could not parse keytab entry\n"); sss_log(SSS_LOG_ERR, "Could not parse keytab entry\n"); return EIO; } @@ -278,7 +278,7 @@ int sss_krb5_verify_keytab_ex(const char *principal, const char *keytab_name, /* This should never happen. The API docs for this function * specify only success for this function */ - DEBUG(1,("Could not free keytab entry contents\n")); + DEBUG(1,"Could not free keytab entry contents\n"); /* This is non-fatal, so we'll continue here */ }
@@ -289,7 +289,7 @@ int sss_krb5_verify_keytab_ex(const char *principal, const char *keytab_name,
krberr = krb5_kt_end_seq_get(context, keytab, &cursor); if (krberr) { - DEBUG(0, ("Could not close keytab.\n")); + DEBUG(0, "Could not close keytab.\n"); sss_log(SSS_LOG_ERR, "Could not close keytab file [%s].", KEYTAB_CLEAN_NAME); return EIO; @@ -297,9 +297,9 @@ int sss_krb5_verify_keytab_ex(const char *principal, const char *keytab_name,
if (!found) { DEBUG(SSSDBG_FATAL_FAILURE, - ("Principal [%s] not found in keytab [%s]\n", + "Principal [%s] not found in keytab [%s]\n", principal, - KEYTAB_CLEAN_NAME)); + KEYTAB_CLEAN_NAME); sss_log(SSS_LOG_ERR, "Error processing keytab file [%s]: " "Principal [%s] was not found. " "Unable to create GSSAPI-encrypted LDAP connection.", @@ -347,7 +347,7 @@ static bool match_principal(krb5_context ctx,
tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { - DEBUG(1, ("talloc_new failed\n")); + DEBUG(1, "talloc_new failed\n"); return false; }
@@ -381,8 +381,8 @@ static bool match_principal(krb5_context ctx,
if (!pattern_realm || (realm_len == strlen(pattern_realm) && strncmp(realm_name, pattern_realm, realm_len) == 0)) { - DEBUG(7, ("Principal matched to the sample (%s@%s).\n", pattern_primary, - pattern_realm)); + DEBUG(7, "Principal matched to the sample (%s@%s).\n", pattern_primary, + pattern_realm); ret = true; }
@@ -408,11 +408,11 @@ krb5_error_code find_principal_in_keytab(krb5_context ctx, memset(&cursor, 0, sizeof(cursor)); kerr = krb5_kt_start_seq_get(ctx, keytab, &cursor); if (kerr != 0) { - DEBUG(1, ("krb5_kt_start_seq_get failed.\n")); + DEBUG(1, "krb5_kt_start_seq_get failed.\n"); return kerr; }
- DEBUG(9, ("Trying to find principal %s@%s in keytab.\n", pattern_primary, pattern_realm)); + DEBUG(9, "Trying to find principal %s@%s in keytab.\n", pattern_primary, pattern_realm); memset(&entry, 0, sizeof(entry)); while ((kt_err = krb5_kt_next_entry(ctx, keytab, &entry, &cursor)) == 0) { principal_found = match_principal(ctx, entry.principal, pattern_primary, pattern_realm); @@ -422,7 +422,7 @@ krb5_error_code find_principal_in_keytab(krb5_context ctx,
kerr = sss_krb5_free_keytab_entry_contents(ctx, &entry); if (kerr != 0) { - DEBUG(1, ("Failed to free keytab entry.\n")); + DEBUG(1, "Failed to free keytab entry.\n"); } memset(&entry, 0, sizeof(entry)); } @@ -432,27 +432,27 @@ krb5_error_code find_principal_in_keytab(krb5_context ctx, * overwritten by other keytab calls, creating a leak. */ kerr = krb5_kt_end_seq_get(ctx, keytab, &cursor); if (kerr != 0) { - DEBUG(1, ("krb5_kt_end_seq_get failed.\n")); + DEBUG(1, "krb5_kt_end_seq_get failed.\n"); goto done; }
if (!principal_found) { kerr = KRB5_KT_NOTFOUND; DEBUG(SSSDBG_TRACE_FUNC, - ("No principal matching %s@%s found in keytab.\n", - pattern_primary, pattern_realm)); + "No principal matching %s@%s found in keytab.\n", + pattern_primary, pattern_realm); goto done; }
/* check if we got any errors from krb5_kt_next_entry */ if (kt_err != 0 && kt_err != KRB5_KT_END) { - DEBUG(1, ("Error while reading keytab.\n")); + DEBUG(1, "Error while reading keytab.\n"); goto done; }
kerr = krb5_copy_principal(ctx, entry.principal, princ); if (kerr != 0) { - DEBUG(1, ("krb5_copy_principal failed.\n")); + DEBUG(1, "krb5_copy_principal failed.\n"); goto done; }
@@ -461,7 +461,7 @@ krb5_error_code find_principal_in_keytab(krb5_context ctx, done: kerr_d = sss_krb5_free_keytab_entry_contents(ctx, &entry); if (kerr_d != 0) { - DEBUG(1, ("Failed to free keytab entry.\n")); + DEBUG(1, "Failed to free keytab entry.\n"); }
return kerr; @@ -555,7 +555,7 @@ krb5_error_code KRB5_CALLCONV sss_krb5_get_init_creds_opt_set_expire_callback( #ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_EXPIRE_CALLBACK return krb5_get_init_creds_opt_set_expire_callback(context, opt, cb, data); #else - DEBUG(5, ("krb5_get_init_creds_opt_set_expire_callback not available.\n")); + DEBUG(5, "krb5_get_init_creds_opt_set_expire_callback not available.\n"); return 0; #endif } @@ -590,7 +590,7 @@ krb5_error_code KRB5_CALLCONV sss_krb5_get_init_creds_opt_set_fast_ccache_name( return krb5_get_init_creds_opt_set_fast_ccache_name(context, opt, fast_ccache_name); #else - DEBUG(5, ("krb5_get_init_creds_opt_set_fast_ccache_name not available.\n")); + DEBUG(5, "krb5_get_init_creds_opt_set_fast_ccache_name not available.\n"); return 0; #endif } @@ -603,7 +603,7 @@ krb5_error_code KRB5_CALLCONV sss_krb5_get_init_creds_opt_set_fast_flags( #ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_FAST_FLAGS return krb5_get_init_creds_opt_set_fast_flags(context, opt, flags); #else - DEBUG(5, ("krb5_get_init_creds_opt_set_fast_flags not available.\n")); + DEBUG(5, "krb5_get_init_creds_opt_set_fast_flags not available.\n"); return 0; #endif } @@ -702,11 +702,11 @@ sss_krb5_parse_name_flags(krb5_context context, const char *name, int flags, return krb5_parse_name_flags(context, name, flags, principal); #else if (flags != 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("krb5_parse_name_flags not available on " \ + DEBUG(SSSDBG_MINOR_FAILURE, "krb5_parse_name_flags not available on " \ "this plattform, names are parsed " \ "without flags. Some features like " \ "enterprise principals might not work " \ - "as expected.\n")); + "as expected.\n"); }
return krb5_parse_name(context, name, principal); @@ -810,7 +810,7 @@ void sss_krb5_get_init_creds_opt_set_canonicalize(krb5_get_init_creds_opt *opts, #if defined(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_CANONICALIZE) && defined(HAVE_KRB5_TICKET_TIMES) krb5_get_init_creds_opt_set_canonicalize(opts, canonicalize); #else - DEBUG(SSSDBG_OP_FAILURE, ("Kerberos principal canonicalization is not available!\n")); + DEBUG(SSSDBG_OP_FAILURE, "Kerberos principal canonicalization is not available!\n"); #endif }
@@ -871,7 +871,7 @@ sss_child_krb5_trace_cb(krb5_context context, return; }
- DEBUG(SSSDBG_TRACE_ALL, ("%s\n", info->message)); + DEBUG(SSSDBG_TRACE_ALL, "%s\n", info->message); }
errno_t @@ -883,7 +883,7 @@ sss_child_set_krb5_tracing(krb5_context ctx) errno_t sss_child_set_krb5_tracing(krb5_context ctx) { - DEBUG(SSSDBG_CONF_SETTINGS, ("krb5 tracing is not available\n")); + DEBUG(SSSDBG_CONF_SETTINGS, "krb5 tracing is not available\n"); return 0; } #endif /* HAVE_KRB5_SET_TRACE_CALLBACK */ @@ -928,19 +928,19 @@ krb5_error_code sss_extract_pac(krb5_context ctx,
kerr = krb5_cc_retrieve_cred(ctx, ccache, 0, &mcred, &cred); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_cc_retrieve_cred failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_cc_retrieve_cred failed.\n"); goto done; }
kerr = krb5_decode_ticket(&cred.ticket, &ticket); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_decode_ticket failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_decode_ticket failed.\n"); goto done; }
kerr = krb5_server_decrypt_ticket_keytab(ctx, keytab, ticket); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_server_decrypt_ticket_keytab failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_server_decrypt_ticket_keytab failed.\n"); goto done; }
@@ -948,18 +948,18 @@ krb5_error_code sss_extract_pac(krb5_context ctx, ticket->enc_part2->authorization_data, NULL, KRB5_AUTHDATA_WIN2K_PAC, &pac_authdata); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_find_authdata failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_find_authdata failed.\n"); goto done; }
if (pac_authdata == NULL || pac_authdata[0] == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("No PAC authdata available.\n")); + DEBUG(SSSDBG_OP_FAILURE, "No PAC authdata available.\n"); kerr = ENOENT; goto done; }
if (pac_authdata[1] != NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("More than one PAC autdata found.\n")); + DEBUG(SSSDBG_OP_FAILURE, "More than one PAC autdata found.\n"); kerr = EINVAL; goto done; } @@ -967,7 +967,7 @@ krb5_error_code sss_extract_pac(krb5_context ctx, kerr = krb5_pac_parse(ctx, pac_authdata[0]->contents, pac_authdata[0]->length, &pac); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_pac_parse failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_pac_parse failed.\n"); goto done; }
@@ -975,20 +975,20 @@ krb5_error_code sss_extract_pac(krb5_context ctx, ticket->enc_part.kvno, ticket->enc_part.enctype, &entry); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_kt_get_entry failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_kt_get_entry failed.\n"); goto done; }
kerr = krb5_pac_verify(ctx, pac, 0, NULL, &entry.key, NULL); if (kerr != 0) { - DEBUG(SSSDBG_OP_FAILURE, ("krb5_pac_verify failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "krb5_pac_verify failed.\n"); goto done; }
ret = unsetenv("_SSS_LOOPS"); if (ret != EOK) { - DEBUG(1, ("Failed to unset _SSS_LOOPS, " - "sss_pac_make_request will most certainly fail.\n")); + DEBUG(1, "Failed to unset _SSS_LOOPS, " + "sss_pac_make_request will most certainly fail.\n"); }
*_pac_authdata = pac_authdata; @@ -1025,7 +1025,7 @@ char * sss_get_ccache_name_for_principal(TALLOC_CTX *mem_ctx, char *ret_ccname = NULL;
DEBUG(SSSDBG_TRACE_ALL, - ("Location: [%s]\n", location)); + "Location: [%s]\n", location);
kerr = krb5_cc_set_default_name(ctx, location); if (kerr != 0) { @@ -1037,7 +1037,7 @@ char * sss_get_ccache_name_for_principal(TALLOC_CTX *mem_ctx, if (kerr != 0) { const char *err_msg = sss_krb5_get_error_message(ctx, kerr); DEBUG(SSSDBG_TRACE_INTERNAL, - ("krb5_cc_cache_match failed: [%d][%s]\n", kerr, err_msg)); + "krb5_cc_cache_match failed: [%d][%s]\n", kerr, err_msg); sss_krb5_free_error_message(ctx, err_msg); return NULL; } @@ -1049,11 +1049,11 @@ char * sss_get_ccache_name_for_principal(TALLOC_CTX *mem_ctx, }
DEBUG(SSSDBG_TRACE_ALL, - ("tmp_ccname: [%s]\n", tmp_ccname)); + "tmp_ccname: [%s]\n", tmp_ccname);
ret_ccname = talloc_strdup(mem_ctx, tmp_ccname); if (ret_ccname == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed (ENOMEM).\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed (ENOMEM).\n"); }
done: diff --git a/src/util/sss_krb5.h b/src/util/sss_krb5.h index db47e0a..8838a9a 100644 --- a/src/util/sss_krb5.h +++ b/src/util/sss_krb5.h @@ -56,7 +56,7 @@ void KRB5_CALLCONV sss_krb5_free_error_message(krb5_context, const char *); #define KRB5_DEBUG(level, errctx, krb5_error) do { \ const char *__krb5_error_msg; \ __krb5_error_msg = sss_krb5_get_error_message(errctx, krb5_error); \ - DEBUG(level, ("%d: [%d][%s]\n", __LINE__, krb5_error, __krb5_error_msg)); \ + DEBUG(level, "%d: [%d][%s]\n", __LINE__, krb5_error, __krb5_error_msg); \ sss_log(SSS_LOG_ERR, "%s", __krb5_error_msg); \ sss_krb5_free_error_message(errctx, __krb5_error_msg); \ } while(0) diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index 6d7b090..d5ef2f8 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -129,14 +129,14 @@ static struct tevent_req *sdap_async_sys_connect_send(TALLOC_CTX *mem_ctx,
flags = fcntl(fd, F_GETFL, 0); if (flags == -1) { - DEBUG(1, ("fcntl F_GETFL failed.\n")); + DEBUG(1, "fcntl F_GETFL failed.\n"); return NULL; }
req = tevent_req_create(mem_ctx, &state, struct sdap_async_sys_connect_state); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; }
@@ -147,7 +147,7 @@ static struct tevent_req *sdap_async_sys_connect_send(TALLOC_CTX *mem_ctx,
ret = fcntl(fd, F_SETFL, flags | O_NONBLOCK); if (ret != EOK) { - DEBUG(1, ("fcntl F_SETFL failed.\n")); + DEBUG(1, "fcntl F_SETFL failed.\n"); goto done; }
@@ -164,7 +164,7 @@ static struct tevent_req *sdap_async_sys_connect_send(TALLOC_CTX *mem_ctx, TEVENT_FD_READ | TEVENT_FD_WRITE, sdap_async_sys_connect_done, req); if (state->fde == NULL) { - DEBUG(1, ("tevent_add_fd failed.\n")); + DEBUG(1, "tevent_add_fd failed.\n"); ret = ENOMEM; goto done; } @@ -173,13 +173,13 @@ static struct tevent_req *sdap_async_sys_connect_send(TALLOC_CTX *mem_ctx,
break; default: - DEBUG(1, ("connect failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "connect failed [%d][%s].\n", ret, strerror(ret)); }
done: fret = fcntl(fd, F_SETFL, flags); if (fret != EOK) { - DEBUG(1, ("fcntl F_SETFL failed.\n")); + DEBUG(1, "fcntl F_SETFL failed.\n"); }
if (ret == EOK) { @@ -210,14 +210,14 @@ static void sdap_async_sys_connect_done(struct tevent_context *ev, if (ret == EINPROGRESS || ret == EINTR) { return; /* Try again later */ } - DEBUG(1, ("connect failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "connect failed [%d][%s].\n", ret, strerror(ret)); }
talloc_zfree(fde);
fret = fcntl(state->fd, F_SETFL, state->old_flags); if (fret != EOK) { - DEBUG(1, ("fcntl F_SETFL failed.\n")); + DEBUG(1, "fcntl F_SETFL failed.\n"); }
if (ret == EOK) { @@ -245,14 +245,14 @@ static errno_t set_fd_flags_and_opts(int fd) flags = fcntl(fd, F_GETFD, 0); if (flags == -1) { ret = errno; - DEBUG(1, ("fcntl F_GETFD failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "fcntl F_GETFD failed [%d][%s].\n", ret, strerror(ret)); return ret; }
flags = fcntl(fd, F_SETFD, flags| FD_CLOEXEC); if (flags == -1) { ret = errno; - DEBUG(1, ("fcntl F_SETFD failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "fcntl F_SETFD failed [%d][%s].\n", ret, strerror(ret)); return ret; }
@@ -261,15 +261,15 @@ static errno_t set_fd_flags_and_opts(int fd) ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &dummy, sizeof(dummy)); if (ret != 0) { ret = errno; - DEBUG(5, ("setsockopt SO_KEEPALIVE failed.[%d][%s].\n", ret, - strerror(ret))); + DEBUG(5, "setsockopt SO_KEEPALIVE failed.[%d][%s].\n", ret, + strerror(ret)); }
ret = setsockopt(fd, SOL_TCP, TCP_NODELAY, &dummy, sizeof(dummy)); if (ret != 0) { ret = errno; - DEBUG(5, ("setsockopt TCP_NODELAY failed.[%d][%s].\n", ret, - strerror(ret))); + DEBUG(5, "setsockopt TCP_NODELAY failed.[%d][%s].\n", ret, + strerror(ret)); }
return EOK; @@ -311,7 +311,7 @@ struct tevent_req *sss_ldap_init_send(TALLOC_CTX *mem_ctx,
req = tevent_req_create(mem_ctx, &state, struct sss_ldap_init_state); if (req == NULL) { - DEBUG(1, ("tevent_req_create failed.\n")); + DEBUG(1, "tevent_req_create failed.\n"); return NULL; }
@@ -325,34 +325,34 @@ struct tevent_req *sss_ldap_init_send(TALLOC_CTX *mem_ctx, state->sd = socket(addr->ss_family, SOCK_STREAM, 0); if (state->sd == -1) { ret = errno; - DEBUG(1, ("socket failed [%d][%s].\n", ret, strerror(ret))); + DEBUG(1, "socket failed [%d][%s].\n", ret, strerror(ret)); goto fail; }
ret = set_fd_flags_and_opts(state->sd); if (ret != EOK) { - DEBUG(1, ("set_fd_flags_and_opts failed.\n")); + DEBUG(1, "set_fd_flags_and_opts failed.\n"); goto fail; }
- DEBUG(9, ("Using file descriptor [%d] for LDAP connection.\n", state->sd)); + DEBUG(9, "Using file descriptor [%d] for LDAP connection.\n", state->sd);
subreq = sdap_async_sys_connect_send(state, ev, state->sd, (struct sockaddr *) addr, addr_len); if (subreq == NULL) { ret = ENOMEM; - DEBUG(1, ("sdap_async_sys_connect_send failed.\n")); + DEBUG(1, "sdap_async_sys_connect_send failed.\n"); goto fail; }
- DEBUG(6, ("Setting %d seconds timeout for connecting\n", timeout)); + DEBUG(6, "Setting %d seconds timeout for connecting\n", timeout); tv = tevent_timeval_current_ofs(timeout, 0);
state->connect_timeout = tevent_add_timer(ev, subreq, tv, sdap_async_sys_connect_timeout, subreq); if (state->connect_timeout == NULL) { - DEBUG(1, ("tevent_add_timer failed.\n")); + DEBUG(1, "tevent_add_timer failed.\n"); ret = ENOMEM; goto fail; } @@ -366,14 +366,14 @@ fail: } tevent_req_error(req, ret); #else - DEBUG(3, ("ldap_init_fd not available, " - "will use ldap_initialize with uri [%s].\n", uri)); + DEBUG(3, "ldap_init_fd not available, " + "will use ldap_initialize with uri [%s].\n", uri); state->sd = -1; ret = ldap_initialize(&state->ldap, uri); if (ret == LDAP_SUCCESS) { tevent_req_done(req); } else { - DEBUG(1, ("ldap_initialize failed [%s].\n", sss_ldap_err2string(ret))); + DEBUG(1, "ldap_initialize failed [%s].\n", sss_ldap_err2string(ret)); if (ret == LDAP_SERVER_DOWN) { tevent_req_error(req, ETIMEDOUT); } else { @@ -393,7 +393,7 @@ static void sdap_async_sys_connect_timeout(struct tevent_context *ev, { struct tevent_req *connection_request;
- DEBUG(4, ("The LDAP connection timed out\n")); + DEBUG(4, "The LDAP connection timed out\n");
connection_request = talloc_get_type(pvt, struct tevent_req); tevent_req_error(connection_request, ETIMEDOUT); @@ -413,7 +413,7 @@ static void sss_ldap_init_sys_connect_done(struct tevent_req *subreq) ret = sdap_async_sys_connect_recv(subreq); talloc_zfree(subreq); if (ret != EOK) { - DEBUG(1, ("sdap_async_sys_connect request failed.\n")); + DEBUG(1, "sdap_async_sys_connect request failed.\n"); goto fail; } /* Initialize LDAP handler */ @@ -421,8 +421,8 @@ static void sss_ldap_init_sys_connect_done(struct tevent_req *subreq) lret = ldap_init_fd(state->sd, LDAP_PROTO_TCP, state->uri, &state->ldap); if (lret != LDAP_SUCCESS) { DEBUG(SSSDBG_CRIT_FAILURE, - ("ldap_init_fd failed: %s. [%d][%s]\n", - sss_ldap_err2string(lret), state->sd, state->uri)); + "ldap_init_fd failed: %s. [%d][%s]\n", + sss_ldap_err2string(lret), state->sd, state->uri); ret = lret == LDAP_SERVER_DOWN ? ETIMEDOUT : EIO; goto fail; } @@ -431,10 +431,10 @@ static void sss_ldap_init_sys_connect_done(struct tevent_req *subreq) lret = ldap_install_tls(state->ldap); if (lret != LDAP_SUCCESS) { if (lret == LDAP_LOCAL_ERROR) { - DEBUG(5, ("TLS/SSL already in place.\n")); + DEBUG(5, "TLS/SSL already in place.\n"); } else { - DEBUG(1, ("ldap_install_tls failed: %s\n", - sss_ldap_err2string(lret))); + DEBUG(1, "ldap_install_tls failed: %s\n", + sss_ldap_err2string(lret)); ret = EIO; goto fail; } @@ -486,13 +486,13 @@ bool sss_ldap_dn_in_search_bases(TALLOC_CTX *mem_ctx, bool ret = false;
if (dn == NULL) { - DEBUG(SSSDBG_FUNC_DATA, ("dn is NULL\n")); + DEBUG(SSSDBG_FUNC_DATA, "dn is NULL\n"); ret = false; goto done; }
if (search_bases == NULL) { - DEBUG(SSSDBG_FUNC_DATA, ("search_bases is NULL\n")); + DEBUG(SSSDBG_FUNC_DATA, "search_bases is NULL\n"); ret = false; goto done; } @@ -548,7 +548,7 @@ bool sss_ldap_dn_in_search_bases(TALLOC_CTX *mem_ctx, /* dn length >= base dn length && base_confirmed == true */ break; default: - DEBUG(SSSDBG_FUNC_DATA, ("Unsupported scope: %d\n", base->scope)); + DEBUG(SSSDBG_FUNC_DATA, "Unsupported scope: %d\n", base->scope); continue; }
@@ -564,7 +564,7 @@ bool sss_ldap_dn_in_search_bases(TALLOC_CTX *mem_ctx, } else { filter = talloc_strdup_append(filter, base->filter); if (filter == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup_append() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup_append() failed\n"); ret = false; goto done; } @@ -575,7 +575,7 @@ bool sss_ldap_dn_in_search_bases(TALLOC_CTX *mem_ctx, if (filter != NULL) { *_filter = talloc_asprintf(mem_ctx, "(|%s)", filter); if (*_filter == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf_append() failed\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf_append() failed\n"); ret = false; goto done; } diff --git a/src/util/sss_nss.c b/src/util/sss_nss.c index 2b73383..406c95c 100644 --- a/src/util/sss_nss.c +++ b/src/util/sss_nss.c @@ -36,7 +36,7 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template, const char *orig = NULL;
if (template == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Missing template.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Missing template.\n"); return NULL; }
@@ -45,13 +45,13 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
copy = talloc_strdup(tmp_ctx, template); if (copy == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n"); goto done; }
result = talloc_strdup(tmp_ctx, ""); if (result == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_strdup failed.\n"); goto done; }
@@ -60,15 +60,15 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template, *n = '\0'; n++; if ( *n == '\0' ) { - DEBUG(SSSDBG_CRIT_FAILURE, ("format error, single %% at the end of " - "the template.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "format error, single %% at the end of " + "the template.\n"); goto done; } switch( *n ) { case 'u': if (username == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand user name template " - "because user name is empty.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand user name template " + "because user name is empty.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s", p, @@ -77,8 +77,8 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'U': if (uid == 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand uid template " - "because uid is invalid.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand uid template " + "because uid is invalid.\n"); goto done; } result = talloc_asprintf_append(result, "%s%d", p, @@ -87,9 +87,9 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'd': if (domain == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand domain name " + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand domain name " "template because domain name " - "is empty.\n")); + "is empty.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s", p, @@ -98,9 +98,9 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'f': if (domain == NULL || username == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand fully qualified " + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand fully qualified " "name template because domain " - "or user name is empty.\n")); + "or user name is empty.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s@%s", p, @@ -110,8 +110,8 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template, case 'o': if (original == NULL) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Original home directory for %s is not available, " - "using empty string\n", username)); + "Original home directory for %s is not available, " + "using empty string\n", username); orig = ""; } else { orig = original; @@ -121,9 +121,9 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
case 'F': if (flatname == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Cannot expand domain name " + DEBUG(SSSDBG_CRIT_FAILURE, "Cannot expand domain name " "template because domain flat " - "name is empty.\n")); + "name is empty.\n"); goto done; } result = talloc_asprintf_append(result, "%s%s", p, flatname); @@ -134,13 +134,13 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template, break;
default: - DEBUG(SSSDBG_CRIT_FAILURE, ("format error, unknown template " - "[%%%c].\n", *n)); + DEBUG(SSSDBG_CRIT_FAILURE, "format error, unknown template " + "[%%%c].\n", *n); goto done; }
if (result == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf_append failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf_append failed.\n"); goto done; }
@@ -149,7 +149,7 @@ char *expand_homedir_template(TALLOC_CTX *mem_ctx, const char *template,
result = talloc_asprintf_append(result, "%s", p); if (result == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_asprintf_append failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf_append failed.\n"); goto done; }
diff --git a/src/util/sss_selinux.c b/src/util/sss_selinux.c index dcac9ee..d6b939b 100644 --- a/src/util/sss_selinux.c +++ b/src/util/sss_selinux.c @@ -66,7 +66,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap, errno_t ret;
if (usermap == NULL) { - DEBUG(SSSDBG_MINOR_FAILURE, ("NULL given as usermap! Skipping ...\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "NULL given as usermap! Skipping ...\n"); return false; }
@@ -86,14 +86,14 @@ bool sss_selinux_match(struct sysdb_attrs *usermap, if (user) { ret = sysdb_attrs_get_el(user, SYSDB_ORIG_DN, &dn); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("User does not have origDN\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "User does not have origDN\n"); return false; } ret = sysdb_attrs_get_el(user, SYSDB_ORIG_MEMBEROF, &memberof); if (ret != EOK) { DEBUG(SSSDBG_TRACE_ALL, - ("User does not have orig memberof, " - "therefore it can't match to any rule\n")); + "User does not have orig memberof, " + "therefore it can't match to any rule\n"); return false; }
@@ -113,7 +113,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap,
if (!matched_category) { if (users_el == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("No users specified in the rule!\n")); + DEBUG(SSSDBG_TRACE_ALL, "No users specified in the rule!\n"); return false; } else { matched_name = match_entity(users_el, dn); @@ -123,7 +123,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap, } else if (matched_group) { priority |= SELINUX_PRIORITY_USER_GROUP; } else { - DEBUG(SSSDBG_TRACE_ALL, ("User did not match\n")); + DEBUG(SSSDBG_TRACE_ALL, "User did not match\n"); return false; } } @@ -135,14 +135,14 @@ bool sss_selinux_match(struct sysdb_attrs *usermap, if (host) { ret = sysdb_attrs_get_el(host, SYSDB_ORIG_DN, &dn); if (ret != EOK) { - DEBUG(SSSDBG_MINOR_FAILURE, ("Host does not have origDN\n")); + DEBUG(SSSDBG_MINOR_FAILURE, "Host does not have origDN\n"); return false; } ret = sysdb_attrs_get_el(host, SYSDB_ORIG_MEMBEROF, &memberof); if (ret != EOK) { DEBUG(SSSDBG_TRACE_ALL, - ("Host does not have orig memberof, " - "therefore it can't match to any rule\n")); + "Host does not have orig memberof, " + "therefore it can't match to any rule\n"); return false; }
@@ -161,7 +161,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap, } if (!matched_category) { if (hosts_el == NULL) { - DEBUG(SSSDBG_TRACE_ALL, ("No users specified in the rule!\n")); + DEBUG(SSSDBG_TRACE_ALL, "No users specified in the rule!\n"); return false; } else { matched_name = match_entity(hosts_el, dn); @@ -171,7 +171,7 @@ bool sss_selinux_match(struct sysdb_attrs *usermap, } else if (matched_group) { priority |= SELINUX_PRIORITY_HOST_GROUP; } else { - DEBUG(SSSDBG_TRACE_ALL, ("Host did not match\n")); + DEBUG(SSSDBG_TRACE_ALL, "Host did not match\n"); return false; } } @@ -208,7 +208,7 @@ errno_t sss_selinux_extract_user(TALLOC_CTX *mem_ctx,
attrs = talloc_array(tmp_ctx, const char *, 3); if (attrs == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_array failed.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "talloc_array failed.\n"); ret = ENOMEM; goto done; } @@ -219,7 +219,7 @@ errno_t sss_selinux_extract_user(TALLOC_CTX *mem_ctx, ret = sysdb_search_user_by_name(tmp_ctx, sysdb, domain, username, attrs, &user_msg); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("sysdb_search_user_by_name failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "sysdb_search_user_by_name failed.\n"); goto done; }
diff --git a/src/util/sss_ssh.c b/src/util/sss_ssh.c index e318762..8690375 100644 --- a/src/util/sss_ssh.c +++ b/src/util/sss_ssh.c @@ -45,7 +45,7 @@ sss_ssh_make_ent(TALLOC_CTX *mem_ctx, name = ldb_msg_find_attr_as_string(msg, SYSDB_NAME, NULL); if (!name) { ret = EINVAL; - DEBUG(SSSDBG_CRIT_FAILURE, ("Host is missing name attribute\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Host is missing name attribute\n"); goto done; }
diff --git a/src/util/user_info_msg.c b/src/util/user_info_msg.c index 25e99d2..89d7456 100644 --- a/src/util/user_info_msg.c +++ b/src/util/user_info_msg.c @@ -40,7 +40,7 @@ errno_t pack_user_info_chpass_error(TALLOC_CTX *mem_ctx, *resp_len = 2 * sizeof(uint32_t) + err_len; resp = talloc_size(mem_ctx, *resp_len); if (resp == NULL) { - DEBUG(1, ("talloc_size failed.\n")); + DEBUG(1, "talloc_size failed.\n"); return ENOMEM; }
@@ -49,7 +49,7 @@ errno_t pack_user_info_chpass_error(TALLOC_CTX *mem_ctx, SAFEALIGN_SET_UINT32(&resp[p], err_len, &p); safealign_memcpy(&resp[p], user_error_message, err_len, &p); if (p != *resp_len) { - DEBUG(0, ("Size mismatch\n")); + DEBUG(0, "Size mismatch\n"); }
*_resp = resp; diff --git a/src/util/usertools.c b/src/util/usertools.c index 88f6480..d602349 100644 --- a/src/util/usertools.c +++ b/src/util/usertools.c @@ -87,9 +87,9 @@ static errno_t get_id_provider_default_re(TALLOC_CTX *mem_ctx, { #ifdef HAVE_LIBPCRE_LESSER_THAN_7 DEBUG(SSSDBG_MINOR_FAILURE, - ("The libpcre version on this system is too old. Only " + "The libpcre version on this system is too old. Only " "the user@DOMAIN name fully qualified name format will " - "be supported\n")); + "be supported\n"); *re_pattern = NULL; return EOK; #else @@ -107,8 +107,8 @@ static errno_t get_id_provider_default_re(TALLOC_CTX *mem_ctx, ret = confdb_get_string(cdb, mem_ctx, conf_path, CONFDB_DOMAIN_ID_PROVIDER, NULL, &id_provider); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to read ID provider " \ - "from conf db.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Failed to read ID provider " \ + "from conf db.\n"); goto done; }
@@ -119,7 +119,7 @@ static errno_t get_id_provider_default_re(TALLOC_CTX *mem_ctx, if (strcmp(id_provider, provider_default_re[c].name) == 0) { *re_pattern = talloc_strdup(mem_ctx, provider_default_re[c].re); if (*re_pattern == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -156,14 +156,14 @@ static errno_t sss_fqnames_init(struct sss_names_ctx *nctx, const char *fq_fmt) return ENOMEM; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Using fq format [%s].\n", nctx->fq_fmt)); + DEBUG(SSSDBG_CONF_SETTINGS, "Using fq format [%s].\n", nctx->fq_fmt);
/* Fail if the name specifier is missing and warn if the domain * specifier is missing */ if (strstr(fq_fmt, fqname_patterns[0].pattern) == NULL) { DEBUG(SSSDBG_OP_FAILURE, - ("Username pattern not found in [%s]\n", nctx->fq_fmt)); + "Username pattern not found in [%s]\n", nctx->fq_fmt); return ENOENT; } nctx->fq_flags = FQ_FMT_NAME; @@ -182,7 +182,7 @@ static errno_t sss_fqnames_init(struct sss_names_ctx *nctx, const char *fq_fmt) }
DEBUG(SSSDBG_CONF_SETTINGS, - ("Found the pattern for %s\n", fqname_patterns[i].desc)); + "Found the pattern for %s\n", fqname_patterns[i].desc); nctx->fq_flags |= fqname_patterns[i].flag; }
@@ -208,12 +208,12 @@ int sss_names_init_from_args(TALLOC_CTX *mem_ctx, const char *re_pattern, goto done; }
- DEBUG(SSSDBG_CONF_SETTINGS, ("Using re [%s].\n", ctx->re_pattern)); + DEBUG(SSSDBG_CONF_SETTINGS, "Using re [%s].\n", ctx->re_pattern);
ret = sss_fqnames_init(ctx, fq_fmt); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Could not check the FQ names format" - "[%d]: %s\n", ret, sss_strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Could not check the FQ names format" + "[%d]: %s\n", ret, sss_strerror(ret)); goto done; }
@@ -221,8 +221,8 @@ int sss_names_init_from_args(TALLOC_CTX *mem_ctx, const char *re_pattern, NAME_DOMAIN_PATTERN_OPTIONS, &errval, &errstr, &errpos, NULL); if (!ctx->re) { - DEBUG(1, ("Invalid Regular Expression pattern at position %d." - " (Error: %d [%s])\n", errpos, errval, errstr)); + DEBUG(1, "Invalid Regular Expression pattern at position %d." + " (Error: %d [%s])\n", errpos, errval, errstr); ret = EFAULT; goto done; } @@ -272,8 +272,8 @@ int sss_names_init(TALLOC_CTX *mem_ctx, struct confdb_ctx *cdb, if (re_pattern == NULL) { ret = get_id_provider_default_re(tmpctx, cdb, conf_path, &re_pattern); if (ret != EOK) { - DEBUG(SSSDBG_OP_FAILURE, ("Failed to get provider default regular " \ - "expression for domain [%s].\n", domain)); + DEBUG(SSSDBG_OP_FAILURE, "Failed to get provider default regular " \ + "expression for domain [%s].\n", domain); goto done; } } @@ -287,11 +287,11 @@ int sss_names_init(TALLOC_CTX *mem_ctx, struct confdb_ctx *cdb, } #ifdef HAVE_LIBPCRE_LESSER_THAN_7 } else { - DEBUG(2, ("This binary was build with a version of libpcre that does " - "not support non-unique named subpatterns.\n")); - DEBUG(2, ("Please make sure that your pattern [%s] only contains " + DEBUG(2, "This binary was build with a version of libpcre that does " + "not support non-unique named subpatterns.\n"); + DEBUG(2, "Please make sure that your pattern [%s] only contains " "subpatterns with a unique name and uses " - "the Python syntax (?P<name>).\n", re_pattern)); + "the Python syntax (?P<name>).\n", re_pattern); #endif }
@@ -337,12 +337,12 @@ int sss_parse_name(TALLOC_CTX *memctx, if (ret == PCRE_ERROR_NOMATCH) { return EINVAL; } else if (ret < 0) { - DEBUG(SSSDBG_MINOR_FAILURE, ("PCRE Matching error, %d\n", ret)); + DEBUG(SSSDBG_MINOR_FAILURE, "PCRE Matching error, %d\n", ret); return EINVAL; }
if (ret == 0) { - DEBUG(1, ("Too many matches, the pattern is invalid.\n")); + DEBUG(1, "Too many matches, the pattern is invalid.\n"); }
strnum = ret; @@ -350,7 +350,7 @@ int sss_parse_name(TALLOC_CTX *memctx, result = NULL; ret = pcre_get_named_substring(re, orig, ovec, strnum, "name", &result); if (ret < 0 || !result) { - DEBUG(2, ("Name not found!\n")); + DEBUG(2, "Name not found!\n"); return EINVAL; } *name = talloc_strdup(memctx, result); @@ -361,7 +361,7 @@ int sss_parse_name(TALLOC_CTX *memctx, result = NULL; ret = pcre_get_named_substring(re, orig, ovec, strnum, "domain", &result); if (ret < 0 || !result) { - DEBUG(4, ("Domain not provided!\n")); + DEBUG(4, "Domain not provided!\n"); *domain = NULL; } else { /* ignore "" string */ @@ -434,12 +434,12 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx, } else { match = match_any_domain_or_subdomain_name (dom, dmatch); if (match != NULL) { - DEBUG(SSSDBG_FUNC_DATA, ("name '%s' matched expression for " + DEBUG(SSSDBG_FUNC_DATA, "name '%s' matched expression for " "domain '%s', user is %s\n", - orig, match->name, nmatch)); + orig, match->name, nmatch); rdomain = talloc_strdup(tmp_ctx, match->name); if (rdomain == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -458,13 +458,13 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx,
if (rdomain == NULL && rname == NULL) { if (candidate_name && !name_mismatch) { - DEBUG(SSSDBG_FUNC_DATA, ("name '%s' matched without domain, " \ - "user is %s\n", orig, nmatch)); + DEBUG(SSSDBG_FUNC_DATA, "name '%s' matched without domain, " \ + "user is %s\n", orig, nmatch); rdomain = NULL; if (default_domain != NULL) { rdomain = talloc_strdup(tmp_ctx, default_domain); if (rdomain == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); ret = ENOMEM; goto done; } @@ -476,16 +476,16 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx, } } if (match == NULL) { - DEBUG(SSSDBG_FUNC_DATA, ("default domain [%s] is currently " \ + DEBUG(SSSDBG_FUNC_DATA, "default domain [%s] is currently " \ "not know, trying to look it up.\n", - rdomain)); + rdomain); *domain = talloc_steal(memctx, rdomain); ret = EAGAIN; goto done; } }
- DEBUG(SSSDBG_FUNC_DATA, ("using default domain [%s]\n", rdomain)); + DEBUG(SSSDBG_FUNC_DATA, "using default domain [%s]\n", rdomain);
rname = candidate_name; } else if (candidate_domain) { @@ -497,7 +497,7 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx,
if (rdomain == NULL && rname == NULL) { DEBUG(SSSDBG_TRACE_FUNC, - ("name '%s' did not match any domain's expression\n", orig)); + "name '%s' did not match any domain's expression\n", orig); ret = EINVAL; goto done; } @@ -576,8 +576,8 @@ safe_flat_name(struct sss_names_ctx *nctx, struct sss_domain_info *domain)
s = safe_fq_str(nctx, FQ_FMT_FLAT_NAME, domain->flat_name); if (s == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Flat name requested but domain has no" - "flat name set, falling back to domain name\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Flat name requested but domain has no" + "flat name set, falling back to domain name\n"); s = domain->name; }
diff --git a/src/util/util.c b/src/util/util.c index fb3bed1..fe93da1 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -508,8 +508,8 @@ errno_t sss_hash_create_ex(TALLOC_CTX *mem_ctx, ret = EIO; }
- DEBUG(0, ("Could not create hash table: [%d][%s]\n", - hret, hash_error_string(hret))); + DEBUG(0, "Could not create hash table: [%d][%s]\n", + hret, hash_error_string(hret));
talloc_free(internal_ctx); return ret; @@ -623,7 +623,7 @@ errno_t add_string_to_list(TALLOC_CTX *mem_ctx, const char *string, char **new_list = NULL;
if (string == NULL || list_p == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("Missing string or list.\n")); + DEBUG(SSSDBG_OP_FAILURE, "Missing string or list.\n"); return EINVAL; }
@@ -643,13 +643,13 @@ errno_t add_string_to_list(TALLOC_CTX *mem_ctx, const char *string, }
if (new_list == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_array/talloc_realloc failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_array/talloc_realloc failed.\n"); return ENOMEM; }
new_list[c] = talloc_strdup(new_list, string); if (new_list[c] == NULL) { - DEBUG(SSSDBG_OP_FAILURE, ("talloc_strdup failed.\n")); + DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n"); talloc_free(new_list); return ENOMEM; } diff --git a/src/util/util.h b/src/util/util.h index f3ab836..aba4913 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -108,9 +108,7 @@ errno_t set_debug_file_from_fd(const int fd); {"debug-microseconds", 0, POPT_ARG_INT, &debug_microseconds, 0, \ _("Show timestamps with microseconds"), NULL},
-#define DEBUG_UNWRAP(...) __VA_ARGS__ - -/** \def DEBUG(level, body) +/** \def DEBUG(level, format, ...) \brief macro to generate debug messages
\param level the debug level, please use one of the SSSDBG_* macros @@ -123,9 +121,12 @@ errno_t set_debug_file_from_fd(const int fd); looking for additional clues - 7-10 is for informational stuff
- \param body the debug message you want to send, should end with \n + \param format the debug message format string, should result in a + newline-terminated message + \param ... the debug message format arguments */ -#define DEBUG(level, body) debug_fn(__FUNCTION__, level, DEBUG_UNWRAP body) +#define DEBUG(level, format, ...) \ + debug_fn(__FUNCTION__, level, format, ##__VA_ARGS__)
/** \def DEBUG_IS_SET(level) \brief checks whether level (must be in new format) is set in debug_level diff --git a/src/util/util_lock.c b/src/util/util_lock.c index 8db35a8..b8e41cc 100644 --- a/src/util/util_lock.c +++ b/src/util/util_lock.c @@ -51,8 +51,8 @@ errno_t sss_br_lock_file(int fd, size_t start, size_t len, ret = errno; if (ret == EACCES || ret == EAGAIN || ret == EINTR) { DEBUG(SSSDBG_TRACE_FUNC, - ("Failed to lock file. Retries left: %d\n", - retries_left - 1)); + "Failed to lock file. Retries left: %d\n", + retries_left - 1);
if ((ret == EACCES || ret == EAGAIN) && (retries_left <= 1)) { /* File is locked by someone else. Return EACCESS @@ -64,13 +64,13 @@ errno_t sss_br_lock_file(int fd, size_t start, size_t len, ret = usleep(wait); if (ret == -1) { DEBUG(SSSDBG_MINOR_FAILURE, - ("usleep() failed -> ignoring\n")); + "usleep() failed -> ignoring\n"); } } } else { /* Error occurred */ DEBUG(SSSDBG_CRIT_FAILURE, - ("Unable to lock file.\n")); + "Unable to lock file.\n"); return ret; } } else if (ret == 0) { @@ -79,7 +79,7 @@ errno_t sss_br_lock_file(int fd, size_t start, size_t len, } } if (retries_left == 0) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Unable to lock file.\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Unable to lock file.\n"); return ret; }
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I am not against 'simplifying' the debug macro if possible, but then it should probably be done in a backwards compatible way and debug statements changed in time, just like we did when we switched from mere numbers to error type definitions.
For example we could call the new macro DBG, an start using it in place of DEBUG in new code. DEBUG would be just a wrapper around DBG that maintains the old interface.
Simo.
On 10/10/2013 11:27 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I'll try to reduce the amount of faith required. Maybe try a semantic patch [1], or do some metrics on the code and the changes.
I am not against 'simplifying' the debug macro if possible, but then it should probably be done in a backwards compatible way and debug statements changed in time, just like we did when we switched from mere numbers to error type definitions.
For example we could call the new macro DBG, an start using it in place of DEBUG in new code. DEBUG would be just a wrapper around DBG that maintains the old interface.
I would advise against that. This will hurt maintainability, and I think having two ways to specify debug level is harmful as well. This is how software rot happens. It is better to have a way to verify that such changes don't break anything (tests?) and do a change globally, or not change anything at all.
However, this is of course entirely up to you and I won't push this further as I'm only doing it for a sport, while waiting for Beaker job queue to unclog.
Sincerely, Nick
On Fri, Oct 11, 2013 at 11:09:35AM +0300, Nikolai Kondrashov wrote:
On 10/10/2013 11:27 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I'll try to reduce the amount of faith required. Maybe try a semantic patch [1], or do some metrics on the code and the changes.
Can you also send the next round of patches gzipped so that you don't have to wait until they make it through moderation?
On 10/11/2013 11:17 AM, Jakub Hrozek wrote:
Can you also send the next round of patches gzipped so that you don't have to wait until they make it through moderation?
Sure, I will.
Although, IMHO, it makes it harder to respond to particular patches and snippets and discuss effectively.
Sincerely, Nick
On 10/11/2013 11:23 AM, Nikolai Kondrashov wrote:
On 10/11/2013 11:17 AM, Jakub Hrozek wrote:
Can you also send the next round of patches gzipped so that you don't have to wait until they make it through moderation?
Sure, I will.
Although, IMHO, it makes it harder to respond to particular patches and snippets and discuss effectively.
Plus it seems the gzipped patches get scrubbed out of archives.
On 10/11/2013 11:25 AM, Nikolai Kondrashov wrote:
On 10/11/2013 11:23 AM, Nikolai Kondrashov wrote:
On 10/11/2013 11:17 AM, Jakub Hrozek wrote:
Can you also send the next round of patches gzipped so that you don't have to wait until they make it through moderation?
Sure, I will.
Although, IMHO, it makes it harder to respond to particular patches and snippets and discuss effectively.
Plus it seems the gzipped patches get scrubbed out of archives.
Ah, they're still available, but alas not searcheable.
On Fri, 2013-10-11 at 11:09 +0300, Nikolai Kondrashov wrote:
On 10/10/2013 11:27 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I'll try to reduce the amount of faith required. Maybe try a semantic patch [1], or do some metrics on the code and the changes.
I am not against 'simplifying' the debug macro if possible, but then it should probably be done in a backwards compatible way and debug statements changed in time, just like we did when we switched from mere numbers to error type definitions.
For example we could call the new macro DBG, an start using it in place of DEBUG in new code. DEBUG would be just a wrapper around DBG that maintains the old interface.
I would advise against that. This will hurt maintainability, and I think having two ways to specify debug level is harmful as well. This is how software rot happens. It is better to have a way to verify that such changes don't break anything (tests?) and do a change globally, or not change anything at all.
However, this is of course entirely up to you and I won't push this further as I'm only doing it for a sport, while waiting for Beaker job queue to unclog.
Sincerely, Nick
I seriously like the simplification, but I am dead against such a monstrous patch that touches *all* the code.
Although not ideal I am perfectly fine with changing code gradually like we did (and are still doing) with the debug numbers.
Simo.
On Fri, Oct 11, 2013 at 08:53:11AM -0400, Simo Sorce wrote:
On Fri, 2013-10-11 at 11:09 +0300, Nikolai Kondrashov wrote:
On 10/10/2013 11:27 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I'll try to reduce the amount of faith required. Maybe try a semantic patch [1], or do some metrics on the code and the changes.
I am not against 'simplifying' the debug macro if possible, but then it should probably be done in a backwards compatible way and debug statements changed in time, just like we did when we switched from mere numbers to error type definitions.
For example we could call the new macro DBG, an start using it in place of DEBUG in new code. DEBUG would be just a wrapper around DBG that maintains the old interface.
I would advise against that. This will hurt maintainability, and I think having two ways to specify debug level is harmful as well. This is how software rot happens. It is better to have a way to verify that such changes don't break anything (tests?) and do a change globally, or not change anything at all.
However, this is of course entirely up to you and I won't push this further as I'm only doing it for a sport, while waiting for Beaker job queue to unclog.
Sincerely, Nick
I seriously like the simplification, but I am dead against such a monstrous patch that touches *all* the code.
Although not ideal I am perfectly fine with changing code gradually like we did (and are still doing) with the debug numbers.
I would say it is ok for master since 1.12 development is still in an early stage.
Would it help to make you more confident if someone does the same changes (maybe with some scripting magic) independently and then check if the patches differ?
bye, Sumit
Simo.
-- Simo Sorce * Red Hat, Inc * New York
sssd-devel mailing list sssd-devel@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
On Fri, 2013-10-11 at 15:21 +0200, Sumit Bose wrote:
On Fri, Oct 11, 2013 at 08:53:11AM -0400, Simo Sorce wrote:
On Fri, 2013-10-11 at 11:09 +0300, Nikolai Kondrashov wrote:
On 10/10/2013 11:27 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I'll try to reduce the amount of faith required. Maybe try a semantic patch [1], or do some metrics on the code and the changes.
I am not against 'simplifying' the debug macro if possible, but then it should probably be done in a backwards compatible way and debug statements changed in time, just like we did when we switched from mere numbers to error type definitions.
For example we could call the new macro DBG, an start using it in place of DEBUG in new code. DEBUG would be just a wrapper around DBG that maintains the old interface.
I would advise against that. This will hurt maintainability, and I think having two ways to specify debug level is harmful as well. This is how software rot happens. It is better to have a way to verify that such changes don't break anything (tests?) and do a change globally, or not change anything at all.
However, this is of course entirely up to you and I won't push this further as I'm only doing it for a sport, while waiting for Beaker job queue to unclog.
Sincerely, Nick
I seriously like the simplification, but I am dead against such a monstrous patch that touches *all* the code.
Although not ideal I am perfectly fine with changing code gradually like we did (and are still doing) with the debug numbers.
I would say it is ok for master since 1.12 development is still in an early stage.
Would it help to make you more confident if someone does the same changes (maybe with some scripting magic) independently and then check if the patches differ?
Nope, there are 2 reasons I do not like such changes: - automatic changes can break in subtle ways when you use sed-like actions, and your eyes are not going to catch this stuff as we are not going to manually review thousands upon thousands of changes like these. Even if you did you'd miss stuff. - history: every single git blame will bring up this patch in a lot of places, so that you'll have to go through additional hoops to find out the real change. Granted, given these are just debug messages, it may not be a big deal in most cases, but it is a consideration I make in general.
Finally if everybody agree they want to make this huge change, *then* I absolutely want to see each change also change debug numbers from numbers to the new macros. It makes no sense whatsoever to change the DEBUG form and leave in old debug numbers that we have been painstakingly changing little by little in the last few years.
The current patch does not convert numbers to debug macros. Moreover it will not be really simple to do that in a way that will not screw up indentation / 80 columns rule, but it is up to the proponent of the huge patch to do that correctly :-) I am sure with enough dedication a script to do the correction properly can probably be made.
Simo.
On Fri, Oct 11, 2013 at 09:42:05AM -0400, Simo Sorce wrote:
On Fri, 2013-10-11 at 15:21 +0200, Sumit Bose wrote:
On Fri, Oct 11, 2013 at 08:53:11AM -0400, Simo Sorce wrote:
On Fri, 2013-10-11 at 11:09 +0300, Nikolai Kondrashov wrote:
On 10/10/2013 11:27 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote: > Make DEBUG macro accept variable number of arguments, thus removing > the need to wrap the format string and its arguments into parens > on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I'll try to reduce the amount of faith required. Maybe try a semantic patch [1], or do some metrics on the code and the changes.
I am not against 'simplifying' the debug macro if possible, but then it should probably be done in a backwards compatible way and debug statements changed in time, just like we did when we switched from mere numbers to error type definitions.
For example we could call the new macro DBG, an start using it in place of DEBUG in new code. DEBUG would be just a wrapper around DBG that maintains the old interface.
I would advise against that. This will hurt maintainability, and I think having two ways to specify debug level is harmful as well. This is how software rot happens. It is better to have a way to verify that such changes don't break anything (tests?) and do a change globally, or not change anything at all.
However, this is of course entirely up to you and I won't push this further as I'm only doing it for a sport, while waiting for Beaker job queue to unclog.
Sincerely, Nick
I seriously like the simplification, but I am dead against such a monstrous patch that touches *all* the code.
Although not ideal I am perfectly fine with changing code gradually like we did (and are still doing) with the debug numbers.
I would say it is ok for master since 1.12 development is still in an early stage.
Would it help to make you more confident if someone does the same changes (maybe with some scripting magic) independently and then check if the patches differ?
Nope, there are 2 reasons I do not like such changes:
- automatic changes can break in subtle ways when you use sed-like
actions, and your eyes are not going to catch this stuff as we are not going to manually review thousands upon thousands of changes like these. Even if you did you'd miss stuff.
- history: every single git blame will bring up this patch in a lot of
places, so that you'll have to go through additional hoops to find out the real change. Granted, given these are just debug messages, it may not be a big deal in most cases, but it is a consideration I make in general.
Finally if everybody agree they want to make this huge change, *then* I absolutely want to see each change also change debug numbers from numbers to the new macros. It makes no sense whatsoever to change the DEBUG form and leave in old debug numbers that we have been painstakingly changing little by little in the last few years.
The current patch does not convert numbers to debug macros. Moreover it will not be really simple to do that in a way that will not screw up indentation / 80 columns rule, but it is up to the proponent of the huge patch to do that correctly :-) I am sure with enough dedication a script to do the correction properly can probably be made.
Simo.
If Nikolai would agree to use something like Coccinelle (and perhaps, as Sumit said, compare the results), then I think we could be more certain that the patch doesn't break anything.
Moreover, we have support for detecting formatting errors (-Wformat) now and all the existing warnings have been fixed.
On 10/15/2013 07:19 PM, Jakub Hrozek wrote:
On Fri, Oct 11, 2013 at 09:42:05AM -0400, Simo Sorce wrote:
Finally if everybody agree they want to make this huge change, *then* I absolutely want to see each change also change debug numbers from numbers to the new macros. It makes no sense whatsoever to change the DEBUG form and leave in old debug numbers that we have been painstakingly changing little by little in the last few years.
The current patch does not convert numbers to debug macros. Moreover it will not be really simple to do that in a way that will not screw up indentation / 80 columns rule, but it is up to the proponent of the huge patch to do that correctly :-) I am sure with enough dedication a script to do the correction properly can probably be made.
If Nikolai would agree to use something like Coccinelle (and perhaps, as Sumit said, compare the results), then I think we could be more certain that the patch doesn't break anything.
Moreover, we have support for detecting formatting errors (-Wformat) now and all the existing warnings have been fixed.
I've just tried using Coccinelle to update debug levels and it works beautifully.
I think I'll try using Coccinelle to both make DEBUG macro invocations variadic and make them use the new debug levels and then apply a bit of Perl to restore string literals to multiple lines. This will probably be more reliable.
I'll send new patches, if there are no objections.
Sincerely, Nick
On 10/17/2013 12:16 PM, Nikolai Kondrashov wrote:
On 10/15/2013 07:19 PM, Jakub Hrozek wrote:
On Fri, Oct 11, 2013 at 09:42:05AM -0400, Simo Sorce wrote:
Finally if everybody agree they want to make this huge change, *then* I absolutely want to see each change also change debug numbers from numbers to the new macros. It makes no sense whatsoever to change the DEBUG form and leave in old debug numbers that we have been painstakingly changing little by little in the last few years.
The current patch does not convert numbers to debug macros. Moreover it will not be really simple to do that in a way that will not screw up indentation / 80 columns rule, but it is up to the proponent of the huge patch to do that correctly :-) I am sure with enough dedication a script to do the correction properly can probably be made.
If Nikolai would agree to use something like Coccinelle (and perhaps, as Sumit said, compare the results), then I think we could be more certain that the patch doesn't break anything.
Moreover, we have support for detecting formatting errors (-Wformat) now and all the existing warnings have been fixed.
I've just tried using Coccinelle to update debug levels and it works beautifully.
I think I'll try using Coccinelle to both make DEBUG macro invocations variadic and make them use the new debug levels and then apply a bit of Perl to restore string literals to multiple lines. This will probably be more reliable.
I'll send new patches, if there are no objections.
Ah, my yesterday's message didn't get it through the moderation queue yet (delayed for being too big, even compressed). I explain there that Coccinelle sticks concatenated string literals that were on separate lines into single lines making many of them too long and I don't know how to avoid that.
That's why I say I'll need a bit of Perl after Coccinelle above.
Sincerely, Nick
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu 17 Oct 2013 05:23:36 AM EDT, Nikolai Kondrashov wrote:
On 10/17/2013 12:16 PM, Nikolai Kondrashov wrote:
On 10/15/2013 07:19 PM, Jakub Hrozek wrote:
On Fri, Oct 11, 2013 at 09:42:05AM -0400, Simo Sorce wrote:
Finally if everybody agree they want to make this huge change, *then* I absolutely want to see each change also change debug numbers from numbers to the new macros. It makes no sense whatsoever to change the DEBUG form and leave in old debug numbers that we have been painstakingly changing little by little in the last few years.
The current patch does not convert numbers to debug macros. Moreover it will not be really simple to do that in a way that will not screw up indentation / 80 columns rule, but it is up to the proponent of the huge patch to do that correctly :-) I am sure with enough dedication a script to do the correction properly can probably be made.
If Nikolai would agree to use something like Coccinelle (and perhaps, as Sumit said, compare the results), then I think we could be more certain that the patch doesn't break anything.
Moreover, we have support for detecting formatting errors (-Wformat) now and all the existing warnings have been fixed.
I've just tried using Coccinelle to update debug levels and it works beautifully.
I think I'll try using Coccinelle to both make DEBUG macro invocations variadic and make them use the new debug levels and then apply a bit of Perl to restore string literals to multiple lines. This will probably be more reliable.
I'll send new patches, if there are no objections.
Ah, my yesterday's message didn't get it through the moderation queue yet (delayed for being too big, even compressed). I explain there that Coccinelle sticks concatenated string literals that were on separate lines into single lines making many of them too long and I don't know how to avoid that.
That's why I say I'll need a bit of Perl after Coccinelle above.
Nikolai, has there been any progress on this? I'd actually really like to see these changes land, as they'll make my life easier as I work on journald support for the debug logs.
What I'm looking for is mostly the variadic change (so that we don't have to pass the ("message") into the DEBUG macro. However, I suppose that if we're going to be mass-changing them anyway, it makes sense to update the level designations at the same time.
Hi Stephen,
On 12/18/2013 07:55 PM, Stephen Gallagher wrote:
Nikolai, has there been any progress on this? I'd actually really like to see these changes land, as they'll make my life easier as I work on journald support for the debug logs.
What I'm looking for is mostly the variadic change (so that we don't have to pass the ("message") into the DEBUG macro. However, I suppose that if we're going to be mass-changing them anyway, it makes sense to update the level designations at the same time.
I found out that Coccinelle was unfortunately unsuitable for the job as it got confused by complicated code involving macros (popt was one of the culprits) and aborted processing of some files silently (!). And it was doing such a good job otherwise. Sigh. So the best bet is Perl, unfortunately.
Since that setback I got sucked into other matters, but I still have the scripts which worked quite well. I might resume that work this week and see if they still do.
Sincerely, Nick
On Fri, Oct 11, 2013 at 09:42:05AM -0400, Simo Sorce wrote:
Finally if everybody agree they want to make this huge change, *then* I absolutely want to see each change also change debug numbers from numbers to the new macros. It makes no sense whatsoever to change the DEBUG form and leave in old debug numbers that we have been painstakingly changing little by little in the last few years.
Sorry, forgot to reply here as well..
I would actually prefer *not* to mass-convert the decimal debug levels, everywhere.
The reason is that in the past we've used the levels quite randomly, so there is a lot of debug messages of not much importance with levels 1-3 and really a lot of messages with level 9, which should be mostly used by stuff like DBus tracing or ldb debug messages.
I think that with the decimal numbers in place, the developer is much more likely to notice that a decimal level needs to be changed and change its level as appropriate that if there already was a hexa debug level, but wrong.
I would agree with mass-converting (and then checking) modules that we are very stable and we are unlikely to touch them soon (sbus, confdb, the monitor itself, ...)
On 10/15/2013 07:24 PM, Jakub Hrozek wrote:
On Fri, Oct 11, 2013 at 09:42:05AM -0400, Simo Sorce wrote:
Finally if everybody agree they want to make this huge change, *then* I absolutely want to see each change also change debug numbers from numbers to the new macros. It makes no sense whatsoever to change the DEBUG form and leave in old debug numbers that we have been painstakingly changing little by little in the last few years.
Sorry, forgot to reply here as well..
I would actually prefer *not* to mass-convert the decimal debug levels, everywhere.
The reason is that in the past we've used the levels quite randomly, so there is a lot of debug messages of not much importance with levels 1-3 and really a lot of messages with level 9, which should be mostly used by stuff like DBus tracing or ldb debug messages.
I think that with the decimal numbers in place, the developer is much more likely to notice that a decimal level needs to be changed and change its level as appropriate that if there already was a hexa debug level, but wrong.
I would agree with mass-converting (and then checking) modules that we are very stable and we are unlikely to touch them soon (sbus, confdb, the monitor itself, ...)
I would say that it is necessary to weigh harm from having two different kinds of log levels across the whole code vs. harm of having some log levels wrong.
I don't have the data about how many of the log levels are wrong, but let's say about 3% (please correct me if my guess is wrong). I can count amount of old level use and it's about 39%.
Now, wrong levels have impact on debugging and troubleshooting. Whereas having two kinds of log levels has mental load impact on developers having to remember the mapping and convert them, but quite likely just not checking if the old log level is correct just because it's an effort to convert.
I would say that 39% split in level kinds means that developers are confronted with different DEBUG macro invocations almost on daily basis. Whereas 3% of wrong levels would mean that about one in 30 debug sessions would suffer from a missing or an extra log message, provided that most important and used messages are correct. This is all, of course, are my uninformed guesses, so substitute your numbers if they're different.
Based on the above I would say that having log level kinds normalized would have a bigger impact on the project's well-being. Also, having a single log level kind would make it easier for developers to check if a particular level is correct.
Sincerely, Nick
P.S. It would have been easier for me personally to keep up with the discussion, if the mailserver didn't strip recipients and everyone used "Reply to all". I'm not an sssd-devel reader normally and only read recent messages in the thread that I started, stumbling upon them by chance.
On 10/11/2013 10:09 AM, Nikolai Kondrashov wrote:
On 10/10/2013 11:27 PM, Simo Sorce wrote:
On Thu, 2013-10-10 at 15:46 -0400, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
I would not want to consider such a patch in any case. The churn is just too extraordinarily big and I do not see enough value to warrant it.
The patch is so immense that is it impossible to review, so we would have to make a leap of faith in assuming every single change did not introduce errors.
I'll try to reduce the amount of faith required. Maybe try a semantic patch [1], or do some metrics on the code and the changes.
I am not against 'simplifying' the debug macro if possible, but then it should probably be done in a backwards compatible way and debug statements changed in time, just like we did when we switched from mere numbers to error type definitions.
For example we could call the new macro DBG, an start using it in place of DEBUG in new code. DEBUG would be just a wrapper around DBG that maintains the old interface.
I like this idea. Actually this might be good opportunity to rename our DEBUG macro and put it to proper namespace. The new macro could be called SSS_DBG. Then we can rewrite the old code module by module (this would be long term task) and use the new macro in new code. Later when the DEBUG is not used anywhere we can remove it.
I would advise against that. This will hurt maintainability, and I think having two ways to specify debug level is harmful as well. This is how software rot happens. It is better to have a way to verify that such changes don't break anything (tests?) and do a change globally, or not change anything at all.
However, this is of course entirely up to you and I won't push this further as I'm only doing it for a sport, while waiting for Beaker job queue to unclog.
Sincerely, Nick
Hi Stephen,
On 10/10/2013 10:46 PM, Stephen Gallagher wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Make DEBUG macro accept variable number of arguments, thus removing the need to wrap the format string and its arguments into parens on invocation.
Nack.
Please do us a favor and split this into two patches, one that makes the change to the macro definition and one that bulk-updates the existing messages. Having a 2.2MB patch file with a few small changes buried in it somewhere is very difficult to review. I'm not confident I can locate the real changes amidst the find-replace noise.
This patch is already split out from the main macro change. It only does the absolute minimum needed to convert from a macro accepting arguments in parens to a variadic macro. These changes are limited to util.h. I did it this way, so you don't get a commit breaking the build.
However, I will split this commit into two and you can squash them together, if necessary.
Sincerely, Nick
Remove extra fflush(3) invocation when outputting debug messages. --- src/util/debug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/util/debug.c b/src/util/debug.c index c2e2571..9588083 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -104,10 +104,14 @@ int debug_convert_old_level(int old_level) return new_level; }
+static void debug_fflush(void) +{ + fflush(debug_file ? debug_file : stderr); +} + static void debug_vprintf(const char *format, va_list ap) { vfprintf(debug_file ? debug_file : stderr, format, ap); - fflush(debug_file ? debug_file : stderr); }
static void debug_printf(const char *format, ...) @@ -157,6 +161,7 @@ void debug_fn(const char *function, int level, const char *format, ...) va_start(ap, format); debug_vprintf(format, ap); va_end(ap); + debug_fflush(); } }
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
Remove extra fflush(3) invocation when outputting debug messages. --- src/util/debug.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/util/debug.c b/src/util/debug.c index c2e2571..9588083 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -104,10 +104,14 @@ int debug_convert_old_level(int old_level) return new_level; }
+static void debug_fflush(void) +{ + fflush(debug_file ? debug_file : stderr); +} + static void debug_vprintf(const char *format, va_list ap) { vfprintf(debug_file ? debug_file : stderr, format, ap); - fflush(debug_file ? debug_file : stderr); }
static void debug_printf(const char *format, ...) @@ -157,6 +161,7 @@ void debug_fn(const char *function, int level, const char *format, ...) va_start(ap, format); debug_vprintf(format, ap); va_end(ap); + debug_fflush(); } }
Ack. Prior to this patch, we were calling fflush() twice for every DEBUG message. This reduces it to a single call.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
On 10/10/2013 05:03 PM, Nikolai Kondrashov wrote:
I've been looking at the sssd sources for some test failure investigation and noticed that the DEBUG macro expands to quite a lot of code. I decided to see if it can be reduced and what the impact will be. The result is the patches that follow.
Sorry, messed up the "git send-email" arguments, here are all the patches.
Nikolai, Thank you for the contribution, but it would be *much* easier on us if you used 'git format-patch' instead of 'git send-email'. Then please attach the various patches to the email, rather than having git send them itself.
Please see https://fedorahosted.org/sssd/wiki/DevelTutorials#Submittingapatchupstream
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 10/10/2013 03:31 PM, Stephen Gallagher wrote:
On 10/10/2013 10:07 AM, Nikolai Kondrashov wrote:
On 10/10/2013 05:03 PM, Nikolai Kondrashov wrote:
I've been looking at the sssd sources for some test failure investigation and noticed that the DEBUG macro expands to quite a lot of code. I decided to see if it can be reduced and what the impact will be. The result is the patches that follow.
Sorry, messed up the "git send-email" arguments, here are all the patches.
Nikolai, Thank you for the contribution, but it would be *much* easier on us if you used 'git format-patch' instead of 'git send-email'. Then please attach the various patches to the email, rather than having git send them itself.
Please see https://fedorahosted.org/sssd/wiki/DevelTutorials#Submittingapatchupstream
Replying
to myself.
I was able to get the mbox versions from patchworks and apply them locally. I'm attaching the versions I created (tar.gz because patch 3 is 2MB).
Hi Stephen,
On 10/10/2013 10:42 PM, Stephen Gallagher wrote:
Replying to myself.
I was able to get the mbox versions from patchworks and apply them locally. I'm attaching the versions I created (tar.gz because patch 3 is 2MB).
Sorry to hear you had to do extra work. I replied within 1.5 hours, but then my message got delayed for moderation for being extra big.
Sincerely, Nick
Hi Stephen,
On 10/10/2013 10:31 PM, Stephen Gallagher wrote:
Nikolai, Thank you for the contribution, but it would be *much* easier on us if you used 'git format-patch' instead of 'git send-email'. Then please attach the various patches to the email, rather than having git send them itself.
Sure, here they are.
Sorry for the inconvenience.
Sincerely, Nick
sssd-devel@lists.fedorahosted.org