Blame compat/ldap_passwordpolicy_err2txt.c

Packit 6bd9ab
/*
Packit 6bd9ab
   ldap_passwordpolicy_err2txt.c - replacement function
Packit 6bd9ab
Packit 6bd9ab
   Copyright (C) 2013 Arthur de Jong
Packit 6bd9ab
Packit 6bd9ab
   This library is free software; you can redistribute it and/or
Packit 6bd9ab
   modify it under the terms of the GNU Lesser General Public
Packit 6bd9ab
   License as published by the Free Software Foundation; either
Packit 6bd9ab
   version 2.1 of the License, or (at your option) any later version.
Packit 6bd9ab
Packit 6bd9ab
   This library is distributed in the hope that it will be useful,
Packit 6bd9ab
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6bd9ab
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6bd9ab
   Lesser General Public License for more details.
Packit 6bd9ab
Packit 6bd9ab
   You should have received a copy of the GNU Lesser General Public
Packit 6bd9ab
   License along with this library; if not, write to the Free Software
Packit 6bd9ab
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
Packit 6bd9ab
   02110-1301 USA
Packit 6bd9ab
*/
Packit 6bd9ab
Packit 6bd9ab
#include "config.h"
Packit 6bd9ab
Packit 6bd9ab
#include <stdlib.h>
Packit 6bd9ab
#include <lber.h>
Packit 6bd9ab
#include <ldap.h>
Packit 6bd9ab
#include <string.h>
Packit 6bd9ab
Packit 6bd9ab
#include "compat/ldap_compat.h"
Packit 6bd9ab
#include "compat/attrs.h"
Packit 6bd9ab
Packit 6bd9ab
const char *ldap_passwordpolicy_err2txt(LDAPPasswordPolicyError error)
Packit 6bd9ab
{
Packit 6bd9ab
  switch (error)
Packit 6bd9ab
  {
Packit 6bd9ab
    case PP_passwordExpired:        return "Password expired";
Packit 6bd9ab
    case PP_accountLocked:          return "Account locked";
Packit 6bd9ab
    case PP_changeAfterReset:       return "Change after reset";
Packit 6bd9ab
    case PP_passwordModNotAllowed:  return "Password modification not allowed";
Packit 6bd9ab
    case PP_mustSupplyOldPassword:  return "Must supply old password";
Packit 6bd9ab
    case PP_insufficientPasswordQuality: return "Insufficient password quality";
Packit 6bd9ab
    case PP_passwordTooShort:       return "Password too short";
Packit 6bd9ab
    case PP_passwordTooYoung:       return "Password too young";
Packit 6bd9ab
    case PP_passwordInHistory:      return "Password in history";
Packit 6bd9ab
    case PP_noError:                return "No error";
Packit 6bd9ab
    default:                        return "Unknown error";
Packit 6bd9ab
  }
Packit 6bd9ab
}