From dfc8896036516c070f6c298a622f944e59c1465c Mon Sep 17 00:00:00 2001 From: Ilias Stamatis Date: Jul 23 2017 23:55:46 +0000 Subject: Issue 49329 - Descriptive error msg for USN cleanup task Bug Description: Providing either a suffix or backend attribute is necessary in order for a USN tombstone cleanup task entry to be created, otherwise the server will not accept the operation. However in this case it just returns a generic error message which is not helpful for adressing the issue; "Bad parameter to an ldap routine (-9)". Fix Description: Provide an additional descriptive message in this case. https://pagure.io/389-ds-base/issue/49329 Author: Ilias95 Review by: wibrown (thanks for this!) --- diff --git a/ldap/servers/plugins/usn/usn_cleanup.c b/ldap/servers/plugins/usn/usn_cleanup.c index 2c3ec22..868dfd0 100644 --- a/ldap/servers/plugins/usn/usn_cleanup.c +++ b/ldap/servers/plugins/usn/usn_cleanup.c @@ -233,7 +233,7 @@ usn_cleanup_add(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Entry *eAfter __attribute__((unused)), int *returncode, - char *returntext __attribute__((unused)), + char *returntext, void *arg) { PRThread *thread = NULL; @@ -271,6 +271,8 @@ usn_cleanup_add(Slapi_PBlock *pb, if (!suffix && !backend) { slapi_log_err(SLAPI_LOG_ERR, USN_PLUGIN_SUBSYSTEM, "usn_cleanup_add - Both suffix and backend are missing.\n"); + snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, + "USN cleanup task entry requires either a 'suffix' or 'backend' attribute to be provided"); *returncode = LDAP_PARAM_ERROR; rv = SLAPI_DSE_CALLBACK_ERROR; goto bail;