aclerror.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. #ifndef __aclerror_h
  42. #define __aclerror_h
  43. /* ACL facility name string (in aclbuild.c) */
  44. NSPR_BEGIN_EXTERN_C
  45. extern char * ACL_Program;
  46. NSPR_END_EXTERN_C
  47. /* Define error identifiers */
  48. /* Errors generated in aclparse.c */
  49. /* aclAuthListParse() */
  50. #define ACLERR1000 1000 /* dynamic memory shortage */
  51. /* aclAuthHostsParse() */
  52. #define ACLERR1100 1100 /* unsupported list of host lists */
  53. #define ACLERR1120 1120 /* host list name not found where expected */
  54. #define ACLERR1140 1140 /* undefined host list name */
  55. #define ACLERR1160 1160 /* *unused* */
  56. #define ACLERR1180 1180 /* error adding IP filter entry */
  57. #define ACLERR1200 1200 /* error adding DNS filter entry */
  58. #define ACLERR1220 1220 /* ")" missing */
  59. /* aclAuthUsersParse() */
  60. #define ACLERR1300 1300 /* *unused* */
  61. #define ACLERR1320 1320 /* *unused* */
  62. #define ACLERR1340 1340 /* *unused* */
  63. #define ACLERR1360 1360 /* undefined user or group name */
  64. #define ACLERR1380 1380 /* duplicate user or group name */
  65. #define ACLERR1400 1400 /* ")" missing */
  66. #define ACLERR1420 1420 /* empty auth-user-elem */
  67. #define ACLERR1440 1440 /* duplicate or conflicting use of "all" */
  68. #define ACLERR1460 1460 /* duplicate or conflicting use of "any" */
  69. #define ACLERR1480 1480 /* conflicting use of "all" or "any" */
  70. #define ACLERR1500 1500 /* insufficient dynamic memory */
  71. #define ACLERR1520 1520 /* insufficient dynamic memory */
  72. /* aclDirectivesParse() */
  73. #define ACLERR1600 1600 /* dir-access missing */
  74. #define ACLERR1620 1620 /* invalid dir-access specification */
  75. #define ACLERR1640 1640 /* error adding ACD_AUTH directive to ACL */
  76. #define ACLERR1650 1650 /* error adding directive to ACL */
  77. #define ACLERR1660 1660 /* insufficient dynamic memory */
  78. #define ACLERR1680 1680 /* insufficient dynamic memory */
  79. #define ACLERR1685 1685 /* insufficient dynamic memory */
  80. #define ACLERR1690 1690 /* error adding directive to ACL */
  81. #define ACLERR1695 1695 /* error in "execute" directive */
  82. /* aclACLParse() */
  83. #define ACLERR1700 1700 /* ACL statement missing */
  84. #define ACLERR1720 1720 /* ACL name missing */
  85. #define ACLERR1740 1740 /* opening "{" missing */
  86. #define ACLERR1760 1760 /* closing "}" missing */
  87. #define ACLERR1780 1780 /* unrecognized ACL statement */
  88. /* aclFileOpen() */
  89. #define ACLERR1900 1900 /* file open error */
  90. #define ACLERR1920 1920 /* memory shortage for ACLFile_t */
  91. #define ACLERR1940 1940 /* memory shortage for token */
  92. #define ACLERR1960 1960 /* memory shortage for LEX stream */
  93. /* aclGetDNSString() */
  94. #define ACLERR2100 2100 /* */
  95. #define ACLERR2120 2120 /* */
  96. #define ACLERR2140 2140 /* */
  97. /* aclGetIPAddr() */
  98. #define ACLERR2200 2200 /* */
  99. #define ACLERR2220 2220 /* */
  100. #define ACLERR2240 2240 /* */
  101. #define ACLERR2260 2260 /* */
  102. #define ACLERR2280 2280 /* */
  103. #define ACLERR2300 2300 /* */
  104. #define ACLERR2320 2320 /* */
  105. /* aclGetToken() */
  106. #define ACLERR2400 2400 /* aclGetToken() parse error */
  107. /* aclParseInit() */
  108. /* aclRealmSpecParse() */
  109. #define ACLERR2500 2500 /* missing realm name */
  110. #define ACLERR2520 2520 /* undefined realm name */
  111. #define ACLERR2540 2540 /* insufficient dynamic memory */
  112. #define ACLERR2560 2560 /* missing realm directive */
  113. #define ACLERR2570 2570 /* missing database filespec */
  114. #define ACLERR2580 2580 /* missing authentication method name */
  115. #define ACLERR2600 2600 /* unknown authentication method name */
  116. #define ACLERR2605 2605 /* realm prompt string missing */
  117. #define ACLERR2610 2610 /* unknown realm directive */
  118. #define ACLERR2620 2620 /* missing "}" */
  119. /* aclRightsParse() */
  120. #define ACLERR2700 2700 /* missing rights list element */
  121. #define ACLERR2720 2720 /* missing rights list name */
  122. #define ACLERR2740 2740 /* undefined rights list name */
  123. #define ACLERR2760 2760 /* insufficient dynamic memory */
  124. #define ACLERR2780 2780 /* insufficient dynamic memory */
  125. #define ACLERR2800 2800 /* error creating access right definition */
  126. #define ACLERR2820 2820 /* insufficient dynamic memory */
  127. #define ACLERR2840 2840 /* missing ")" */
  128. /* aclGetFileSpec() */
  129. #define ACLERR2900 2900 /* skip over whitespace failed */
  130. #define ACLERR2920 2920 /* scan over filename failed */
  131. #define ACLERR2940 2940 /* missing filename */
  132. /* aclStringOpen() */
  133. #define ACLERR5000 5000 /* memory shortage for ACLFile_t */
  134. #define ACLERR5020 5020 /* memory shortage for token */
  135. #define ACLERR5040 5040 /* memory shortage for LEX stream */
  136. /* Errors generated in aclbuild.c */
  137. /* accCreate() */
  138. #define ACLERR3000 3000 /* insufficient dynamic memory */
  139. #define ACLERR3020 3020 /* insufficient dynamic memory */
  140. /* accFileRead() */
  141. #define ACLERR3100 3100 /* error initializing ACL parser */
  142. #define ACLERR3120 3120 /* error creating ACL symbol table */
  143. /* aclCreate() */
  144. #define ACLERR3200 3200 /* insufficient dynamic memory */
  145. #define ACLERR3220 3220 /* duplicate ACL name */
  146. /* aclAuthNameAdd() */
  147. #define ACLERR3400 3400 /* realm missing for user/group name */
  148. #define ACLERR3420 3420 /* error opening authentication DB */
  149. #define ACLERR3440 3440 /* error finding name in DB */
  150. #define ACLERR3460 3460 /* insufficient dynamic memory */
  151. /* aclRightDef() */
  152. #define ACLERR3600 3600 /* insufficient dynamic memory */
  153. #define ACLERR3620 3620 /* add right to symbol table failed */
  154. /* ACL_ListPostParseForAuth() */
  155. #define ACLERR3800 3800 /* Undefined method/database */
  156. #define ACLERR3810 3810 /* insufficient dynamic memory */
  157. /* Register.cpp */
  158. #define ACLERR3900 3900 /* Duplicate LAS registered */
  159. /* ACL_EvalBuildContext */
  160. #define ACLERR4000 4000 /* Unable to create context hash */
  161. #define ACLERR4010 4010 /* Unable to alloc cache structure */
  162. #define ACLERR4020 4020 /* Unable to alloc ACE entry */
  163. #define ACLERR4030 4030 /* Unable to alloc ACE entry */
  164. #define ACLERR4040 4040 /* Unable to alloc Auth Ptr Array */
  165. #define ACLERR4050 4050 /* Unable to alloc Auth Ptr Array */
  166. /* ACL_EvalTestRights */
  167. #define ACLERR4100 4100 /* Interim absolute, non-allow value */
  168. #define ACLERR4110 4110 /* BuildContext call failed */
  169. /* ACL_ModuleRegister */
  170. #define ACLERR4200 4200 /* module name missing */
  171. #define ACLERR4210 4210 /* module registration call failed */
  172. /* ACL_GetAttribute */
  173. #define ACLERR4300 4300 /* Couldn't determine method */
  174. #define ACLERR4310 4310 /* Couldn't locate Getter */
  175. #define ACLERR4320 4320 /* Couldn't Set Attr */
  176. #define ACLERR4330 4330 /* Couldn't Get Attr */
  177. #define ACLERR4340 4340 /* All getters declined */
  178. #define ACLERR4350 4350 /* All getters declined */
  179. #define ACLERR4360 4360 /* All getters declined */
  180. #define ACLERR4370 4370 /* All getters declined */
  181. #define ACLERR4380 4380 /* Couldn't determine dbtype */
  182. /* reg_dbname_internal */
  183. #define ACLERR4400 4400 /* dbtype not defined yet */
  184. #define ACLERR4410 4410 /* dbtype not defined yet */
  185. #define ACLERR4420 4420 /* out of memory */
  186. /* ACL_DatabaseRegister */
  187. #define ACLERR4500 4500 /* database name is missing */
  188. /* ACL_ReadDbMapFile */
  189. #define ACLERR4600 4600 /* Error reading the Map file */
  190. #define ACLERR4610 4610 /* Couldn't determine dbtype */
  191. #define ACLERR4620 4620 /* Missing URL for database */
  192. #define ACLERR4630 4630 /* Invalid proprty pair */
  193. #define ACLERR4640 4640 /* Register database failed */
  194. #define ACLERR4650 4650 /* Default database not LDAP */
  195. #define ACLERR4660 4660 /* Multiple default databases */
  196. #define ACLERR4670 4670 /* No default database */
  197. /* LASDnsBuild */
  198. #define ACLERR4700 4700 /* Cannot allocatae hash */
  199. #define ACLERR4710 4710 /* Cannot add token to hash */
  200. #define ACLERR4720 4720 /* Cannot add token to hash */
  201. #define ACLERR4730 4730 /* Cannot add token to hash */
  202. #define ACLERR4740 4740 /* Cannot add token to hash */
  203. #define ACLERR4750 4750 /* Cannot add token to hash */
  204. #define ACLERR4760 4760 /* Cannot add token to hash */
  205. /* LASDnsEval */
  206. #define ACLERR4800 4800 /* Wrong attribute name */
  207. #define ACLERR4810 4810 /* Illegal comparator */
  208. #define ACLERR4820 4820 /* Cannot allocate context struct */
  209. #define ACLERR4830 4830 /* Cannot get DNS attribute */
  210. /* LASGroupEval */
  211. #define ACLERR4900 4900 /* wrong attribute */
  212. #define ACLERR4910 4910 /* bad comparator */
  213. #define ACLERR4920 4920 /* unable to get database name */
  214. /* LASIpTreeAllocNode */
  215. #define ACLERR5000 5000 /* Cannot allocate IP tree */
  216. /* LASIpAddPattern */
  217. #define ACLERR5100 5100 /* Cannot allocate IP tree node */
  218. #define ACLERR5110 5110 /* Cannot allocate IP tree node */
  219. /* LASIpEval */
  220. #define ACLERR5200 5200 /* Wrong attribute */
  221. #define ACLERR5210 5210 /* Bad comparator */
  222. #define ACLERR5220 5220 /* Cannot get session pointer */
  223. #define ACLERR5230 5230 /* Cannot allocate context */
  224. #define ACLERR5240 5240 /* Tested 32 bits without conclusion */
  225. /* LASProgramEval */
  226. #define ACLERR5300 5300 /* Wrong attribute */
  227. #define ACLERR5310 5310 /* Bad comparator */
  228. #define ACLERR5320 5320 /* Can't get request pointer */
  229. #define ACLERR5330 5330 /* Invalid program expression */
  230. #define ACLERR5340 5340 /* Rejecting Request */
  231. /* LASDayOfWeekEval */
  232. #define ACLERR5400 5400 /* wrong attribute */
  233. #define ACLERR5410 5410 /* bad comparator */
  234. /* LASTimeOfDayEval */
  235. #define ACLERR5600 5600 /* wrong attribute */
  236. #define ACLERR5610 5610 /* bad comparator */
  237. /* LASUserEval */
  238. #define ACLERR5700 5700 /* wrong attribute */
  239. #define ACLERR5710 5710 /* bad comparator */
  240. #define ACLERR5720 5720 /* Out of memory */
  241. /* ldapacl.cpp */
  242. #define ACLERR5800 5800 /* missing the database url */
  243. #define ACLERR5810 5810 /* missing the database name */
  244. #define ACLERR5820 5820 /* error parsing the db url */
  245. #define ACLERR5830 5830 /* unable to get db name */
  246. #define ACLERR5840 5840 /* can't get parsed db name */
  247. #define ACLERR5850 5850 /* can't init ldap connection */
  248. #define ACLERR5860 5860 /* passwd check ldap error */
  249. #define ACLERR5870 5870 /* Out of memory */
  250. #define ACLERR5880 5880 /* User doesn't exist anymore */
  251. #define ACLERR5890 5890 /* PList error */
  252. /* get_user_ismember_ldap */
  253. #define ACLERR5900 5900 /* Can't get db name */
  254. #define ACLERR5910 5910 /* Can't get parsed db name */
  255. #define ACLERR5920 5920 /* Out of memory */
  256. #define ACLERR5930 5930 /* Can't init ldap connection */
  257. #define ACLERR5940 5940 /* Group doesn't exist */
  258. #define ACLERR5950 5950 /* LDAP error */
  259. /* ACL_LDAPDatabaseHandle */
  260. #define ACLERR6000 6000 /* Not a registered db */
  261. #define ACLERR6010 6010 /* Not an LDAP db */
  262. #define ACLERR6020 6020 /* Out of memory */
  263. #define ACLERR6030 6030 /* Can't init ldap connection */
  264. #define ACLERR6040 6040 /* Can't bind to ldap server */
  265. /* Define error return codes */
  266. #define ACLERRNOMEM -1 /* insufficient dynamic memory */
  267. #define ACLERROPEN -2 /* file open error */
  268. #define ACLERRDUPSYM -3 /* duplicate symbol */
  269. #define ACLERRSYNTAX -4 /* syntax error */
  270. #define ACLERRUNDEF -5 /* undefined symbol */
  271. #define ACLERRADB -6 /* authentication DB access error */
  272. #define ACLERRPARSE -7 /* ACL parsing error */
  273. #define ACLERRNORLM -8 /* missing authentication realm */
  274. #define ACLERRIO -9 /* IO error */
  275. #define ACLERRINTERNAL -10 /* internal processing error */
  276. /* #define ACLERRFAIL -11 */ /* defined in include/public/nsacl/acldef.h */
  277. #define ACLERRINVAL -12 /* invalid argument */
  278. #define ACLERRCONFIG -13 /* auth realms don't math acl */
  279. #include "nserror.h"
  280. #ifndef PUBLIC_NSACL_ACLDEF_H
  281. #include "public/nsacl/acldef.h"
  282. #endif /* !PUBLIC_NSACL_ACLDEF_H */
  283. NSPR_BEGIN_EXTERN_C
  284. /* Functions in aclerror.c */
  285. extern void aclErrorFmt(NSErr_t * errp,
  286. char * msgbuf, int maxlen, int maxdepth);
  287. NSPR_END_EXTERN_C
  288. #endif /* __aclerror_h */