8354 sync regcomp(3C) with upstream (fix make catalog)
[unleashed/tickless.git] / usr / src / lib / libnisdb / yptol / stubs.c
blob37872399e0482864fe1d62605baa9460eb76847d
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * DESCRIPTION: The N2L system is dependent on a number of utility functions
29 * supplied by NIS object code (under cmd/ypcmd). When libnisdb
30 * is loaded by executable other than those built under
31 * cmd/ypcmd (e.g. the NIS+ executables) these would be
32 * undefined. To prevent this happening the stubs in this file
33 * contain weak definitions on these functions. In the NIS case
34 * these weak definitions will be overridden by the real ones.
36 * The functions in this file will never be called. NIS will have
37 * overridden them and nothing else should call yptol. If they are
38 * called then there is a bug in the build system.
40 * Note : This is not elegant but it is a way of dealing with
41 * preexisting code structure.
44 #pragma ident "%Z%%M% %I% %E% SMI"
46 #include <unistd.h>
47 #include <syslog.h>
48 #include <sys/mman.h>
49 #include <thread.h>
50 #include <synch.h>
51 #include <ndbm.h>
52 #include "ypsym.h"
53 #include "shim.h"
54 #include "../ldap_util.h"
58 * FUNCTION : disaster()
60 * DESCRIPTION: Called if the stubs is accidentally called.
62 void
63 disaster()
65 logmsg(MSG_NOTIMECHECK, LOG_ERR, "YPTOL stub called. This indicates"
66 " a serious build error");
69 #pragma weak lock_core
70 int
71 lock_core(int hashval)
73 disaster();
74 return (0);
77 #pragma weak unlock_core
78 int
79 unlock_core(int hashval)
81 disaster();
82 return (0);
85 #pragma weak lock_map
86 int
87 lock_map(char *mapname)
89 disaster();
90 return (0);
93 #pragma weak unlock_map
94 int
95 unlock_map(char *mapname)
97 disaster();
98 return (0);
101 #pragma weak init_lock_map
102 bool
103 init_lock_map()
105 disaster();
106 return (FALSE);
109 #pragma weak hash
111 hash(char *s)
113 disaster();
114 return (0);
117 #pragma weak rename_map
118 bool
119 rename_map(char *from, char *to, bool_t secure_map)
121 disaster();
122 return (FALSE);
125 #pragma weak delete_map
126 bool
127 delete_map(char *name)
129 disaster();
130 return (FALSE);
133 #pragma weak single
134 #pragma weak nogecos
135 #pragma weak noshell
136 #pragma weak nopw
137 #pragma weak mflag
138 int single, nogecos, noshell, nopw, mflag;
140 #pragma weak validloginshell
141 bool_t
142 validloginshell(char *sh, char *arg, int priv)
144 disaster();
145 return (0);
148 #pragma weak validstr
150 validstr(char *str, size_t size)
152 disaster();
153 return (0);