6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * nis_db.cc
23 *
24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 */
27
28
29 #include <sys/param.h>
30 #include <strings.h>
31 #include <syslog.h>
32 #include "nisdb_mt.h"
33 #include "db_headers.h"
34 #include "db_entry.h"
35 #include "db.h"
36 #include "db_dictionary.h"
37 #include "db_pickle.h"
38 #include "nis_db.h"
39 #include "nis_ldap.h"
40 #include "ldap_util.h"
41 #include "ldap_parse.h"
42 #include "ldap_glob.h"
43 #include "ldap_xdr.h"
44 #include "ldap_glob.h"
45
127 db_table_desc *tbl = 0;
128 char *intName;
129 db *dbase;
130
131 intName = internalTableName(tableName);
132 if (intName == 0)
133 return (0);
134
135 dbase = InUseDictionary->find_table(intName, &tbl);
136
137 sfree(intName);
138
139 return (dbase);
140 }
141
142 extern "C" {
143
144 bool_t
145 db_in_dict_file(char *name)
146 {
147 return ((bool_t) InUseDictionary->find_table_desc(name));
148
149 }
150
151 const char
152 *db_perror(db_status dbstat)
153 {
154 const char *str = NULL;
155
156 switch (dbstat) {
157 case DB_SUCCESS:
158 str = "Success";
159 break;
160 case DB_NOTFOUND:
161 str = "Not Found";
162 break;
163 case DB_BADTABLE:
164 str = "Bad Table";
165 break;
166 case DB_BADQUERY:
167 str = "Bad Query";
|
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * nis_db.cc
23 *
24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
26 *
27 * Copyright 2015 RackTop Systems.
28 */
29
30
31 #include <sys/param.h>
32 #include <strings.h>
33 #include <syslog.h>
34 #include "nisdb_mt.h"
35 #include "db_headers.h"
36 #include "db_entry.h"
37 #include "db.h"
38 #include "db_dictionary.h"
39 #include "db_pickle.h"
40 #include "nis_db.h"
41 #include "nis_ldap.h"
42 #include "ldap_util.h"
43 #include "ldap_parse.h"
44 #include "ldap_glob.h"
45 #include "ldap_xdr.h"
46 #include "ldap_glob.h"
47
129 db_table_desc *tbl = 0;
130 char *intName;
131 db *dbase;
132
133 intName = internalTableName(tableName);
134 if (intName == 0)
135 return (0);
136
137 dbase = InUseDictionary->find_table(intName, &tbl);
138
139 sfree(intName);
140
141 return (dbase);
142 }
143
144 extern "C" {
145
146 bool_t
147 db_in_dict_file(char *name)
148 {
149 return (InUseDictionary->find_table_desc(name) != NULL);
150
151 }
152
153 const char
154 *db_perror(db_status dbstat)
155 {
156 const char *str = NULL;
157
158 switch (dbstat) {
159 case DB_SUCCESS:
160 str = "Success";
161 break;
162 case DB_NOTFOUND:
163 str = "Not Found";
164 break;
165 case DB_BADTABLE:
166 str = "Bad Table";
167 break;
168 case DB_BADQUERY:
169 str = "Bad Query";
|