Ejemplo n.º 1
0
static void
infinoted_pam_log_error(const char* username,
                        const char* detail,
                        int error_code,
                        GError** error)
{
  const char* msg;

  if(error_code == 0)
    msg = _("Entry not found");
  else
    msg = strerror(error_code);

  infinoted_util_log_error(
    _("Error while checking groups of user \"%s\", %s: %s."),
    username,
    detail,
    msg
  );

  /* TODO: use g_set_error_literal in glib 2.18 */
  g_set_error(
    error,
    inf_authentication_detail_error_quark(),
    INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR,
    "%s",
    inf_authentication_detail_strerror(INF_AUTHENTICATION_DETAIL_ERROR_SERVER_ERROR)
  );
}
Ejemplo n.º 2
0
static void
infinoted_startup_sasl_callback_set_error(InfXmppConnection* connection,
                                          InfAuthenticationDetailError code,
                                          const GError* error)
{
  GError* own_error;
  own_error = NULL;

  if(!error)
  {
    own_error = g_error_new_literal(
      inf_authentication_detail_error_quark(),
      code,
      inf_authentication_detail_strerror(code)
    );

    inf_xmpp_connection_set_sasl_error(connection, own_error);
    g_error_free(own_error);
  }
  else
  {
    inf_xmpp_connection_set_sasl_error(connection, error);
  }
}