/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <tevent.h>
#include "sbus/sssd_dbus.h"
#include "providers/data_provider/dp_private.h"
#include "util/sss_utf8.h"
{
switch (dp_err_type) {
case DP_ERR_OK:
return "Success";
case DP_ERR_OFFLINE:
return "Provider is Offline";
case DP_ERR_TIMEOUT:
return "Request timed out";
case DP_ERR_FATAL:
return "Internal Error";
default:
break;
}
return "Unknown Error";
}
int dp_err_type)
{
bool ok;
/* No custom error, just use default */
return dp_err_to_string(dp_err_type);
}
if (!ok) {
"Back end message [%s] contains invalid non-UTF8 character, " \
"using default\n", msg_in);
return dp_err_to_string(dp_err_type);
}
return msg_in;
}
struct sbus_request *sbus_req,
struct dp_reply_std *reply)
{
const char *safe_err_msg;
}
int dp_error,
int error,
const char *msg)
{
const char *def_msg;
if (dp_error == DP_ERR_DECIDE) {
switch (error) {
case EOK:
break;
case ERR_OFFLINE:
break;
case ETIMEDOUT:
break;
default:
break;
}
}
switch (dp_error) {
case DP_ERR_OK:
def_msg = "Success";
break;
case DP_ERR_OFFLINE:
def_msg = "Offline";
break;
default:
break;
}
}
}