xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame^] | 1 | /* Copyright (C) 1997-2016 Free Software Foundation, Inc. |
| 2 | This file is part of the GNU C Library. |
| 3 | Contributed by Thorsten Kukuk <kukuk@uni-paderborn.de>, 1997. |
| 4 | |
| 5 | The GNU C Library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | The GNU C Library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with the GNU C Library; if not, see |
| 17 | <http://www.gnu.org/licenses/>. */ |
| 18 | |
| 19 | #include <rpcsvc/nis.h> |
| 20 | |
| 21 | #include "nss-nisplus.h" |
| 22 | #include "nsswitch.h" |
| 23 | |
| 24 | |
| 25 | /* Convert NIS+ error number to NSS error number. */ |
| 26 | const enum nss_status __niserr2nss_tab[] = |
| 27 | { |
| 28 | [NIS_SUCCESS] = NSS_STATUS_SUCCESS, |
| 29 | [NIS_S_SUCCESS] = NSS_STATUS_SUCCESS, |
| 30 | [NIS_NOTFOUND] = NSS_STATUS_NOTFOUND, |
| 31 | [NIS_S_NOTFOUND] = NSS_STATUS_NOTFOUND, |
| 32 | [NIS_CACHEEXPIRED] = NSS_STATUS_UNAVAIL, |
| 33 | [NIS_NAMEUNREACHABLE] = NSS_STATUS_UNAVAIL, |
| 34 | [NIS_UNKNOWNOBJ] = NSS_STATUS_NOTFOUND, |
| 35 | [NIS_TRYAGAIN] = NSS_STATUS_TRYAGAIN, |
| 36 | [NIS_SYSTEMERROR] = NSS_STATUS_UNAVAIL, |
| 37 | [NIS_CHAINBROKEN] = NSS_STATUS_UNAVAIL, |
| 38 | [NIS_PERMISSION] = NSS_STATUS_UNAVAIL, |
| 39 | [NIS_NOTOWNER] = NSS_STATUS_UNAVAIL, |
| 40 | [NIS_NOT_ME] = NSS_STATUS_UNAVAIL, |
| 41 | [NIS_NOMEMORY] = NSS_STATUS_TRYAGAIN, |
| 42 | [NIS_NAMEEXISTS] = NSS_STATUS_UNAVAIL, |
| 43 | [NIS_NOTMASTER] = NSS_STATUS_UNAVAIL, |
| 44 | [NIS_INVALIDOBJ] = NSS_STATUS_UNAVAIL, |
| 45 | [NIS_BADNAME] = NSS_STATUS_UNAVAIL, |
| 46 | [NIS_NOCALLBACK] = NSS_STATUS_UNAVAIL, |
| 47 | [NIS_CBRESULTS] = NSS_STATUS_UNAVAIL, |
| 48 | [NIS_NOSUCHNAME] = NSS_STATUS_NOTFOUND, |
| 49 | [NIS_NOTUNIQUE] = NSS_STATUS_UNAVAIL, |
| 50 | [NIS_IBMODERROR] = NSS_STATUS_UNAVAIL, |
| 51 | [NIS_NOSUCHTABLE] = NSS_STATUS_UNAVAIL, |
| 52 | [NIS_TYPEMISMATCH] = NSS_STATUS_UNAVAIL, |
| 53 | [NIS_LINKNAMEERROR] = NSS_STATUS_UNAVAIL, |
| 54 | [NIS_PARTIAL] = NSS_STATUS_NOTFOUND, |
| 55 | [NIS_TOOMANYATTRS] = NSS_STATUS_UNAVAIL, |
| 56 | [NIS_RPCERROR] = NSS_STATUS_UNAVAIL, |
| 57 | [NIS_BADATTRIBUTE] = NSS_STATUS_UNAVAIL, |
| 58 | [NIS_NOTSEARCHABLE] = NSS_STATUS_UNAVAIL, |
| 59 | [NIS_CBERROR] = NSS_STATUS_UNAVAIL, |
| 60 | [NIS_FOREIGNNS] = NSS_STATUS_UNAVAIL, |
| 61 | [NIS_BADOBJECT] = NSS_STATUS_UNAVAIL, |
| 62 | [NIS_NOTSAMEOBJ] = NSS_STATUS_UNAVAIL, |
| 63 | [NIS_MODFAIL] = NSS_STATUS_UNAVAIL, |
| 64 | [NIS_BADREQUEST] = NSS_STATUS_UNAVAIL, |
| 65 | [NIS_NOTEMPTY] = NSS_STATUS_UNAVAIL, |
| 66 | [NIS_COLDSTART_ERR] = NSS_STATUS_UNAVAIL, |
| 67 | [NIS_RESYNC] = NSS_STATUS_UNAVAIL, |
| 68 | [NIS_FAIL] = NSS_STATUS_UNAVAIL, |
| 69 | [NIS_UNAVAIL] = NSS_STATUS_UNAVAIL, |
| 70 | [NIS_RES2BIG] = NSS_STATUS_UNAVAIL, |
| 71 | [NIS_SRVAUTH] = NSS_STATUS_UNAVAIL, |
| 72 | [NIS_CLNTAUTH] = NSS_STATUS_UNAVAIL, |
| 73 | [NIS_NOFILESPACE] = NSS_STATUS_UNAVAIL, |
| 74 | [NIS_NOPROC] = NSS_STATUS_UNAVAIL, |
| 75 | [NIS_DUMPLATER] = NSS_STATUS_UNAVAIL |
| 76 | }; |
| 77 | const unsigned int __niserr2nss_count = (sizeof (__niserr2nss_tab) |
| 78 | / sizeof (__niserr2nss_tab[0])); |