Debian Codegraph @

compat/ldap_passwordpolicy_err2txt.c

raw symbols SCIP
1 /*
2 ldap_passwordpolicy_err2txt.c - replacement function
3
4 Copyright (C) 2013 Arthur de Jong
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA
20 */
21
22 #include "config.h"
23
24 #include <stdlib.h>
25 #include <lber.h>
26 #include <ldap.h>
27 #include <string.h>
28
29 #include "compat/ldap_compat.h"
30 #include "compat/attrs.h"
31
32 const char *ldap_passwordpolicy_err2txt(LDAPPasswordPolicyError error)
33 {
34 switch (error)
35 {
36 case PP_passwordExpired: return "Password expired";
37 case PP_accountLocked: return "Account locked";
38 case PP_changeAfterReset: return "Change after reset";
39 case PP_passwordModNotAllowed: return "Password modification not allowed";
40 case PP_mustSupplyOldPassword: return "Must supply old password";
41 case PP_insufficientPasswordQuality: return "Insufficient password quality";
42 case PP_passwordTooShort: return "Password too short";
43 case PP_passwordTooYoung: return "Password too young";
44 case PP_passwordInHistory: return "Password in history";
45 case PP_noError: return "No error";
46 default: return "Unknown error";
47 }
48 }