xref: /onnv-gate/usr/src/lib/libnisdb/yptol/stubs.c (revision 702:9495c7c1ed3a)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*702Sth160488  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate /*
280Sstevel@tonic-gate  * DESCRIPTION:	The N2L system is dependent on a number of utility functions
290Sstevel@tonic-gate  *		supplied by NIS object code (under cmd/ypcmd). When libnisdb
300Sstevel@tonic-gate  *		is loaded by executable other than those built under
310Sstevel@tonic-gate  *		cmd/ypcmd (e.g. the NIS+ executables) these would be
320Sstevel@tonic-gate  *		undefined. To prevent this happening the stubs in this file
330Sstevel@tonic-gate  *		contain weak definitions on these functions. In the NIS case
340Sstevel@tonic-gate  *		these weak definitions will be overridden by the real ones.
350Sstevel@tonic-gate  *
360Sstevel@tonic-gate  *		The functions in this file will never be called. NIS will have
370Sstevel@tonic-gate  *		overridden them and nothing else should call yptol. If they are
380Sstevel@tonic-gate  *		called then there is a bug in the build system.
390Sstevel@tonic-gate  *
400Sstevel@tonic-gate  *		Note : This is not elegant but it is a way of dealing with
410Sstevel@tonic-gate  *		preexisting code structure.
420Sstevel@tonic-gate  */
430Sstevel@tonic-gate 
440Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
450Sstevel@tonic-gate 
460Sstevel@tonic-gate #include <unistd.h>
470Sstevel@tonic-gate #include <syslog.h>
480Sstevel@tonic-gate #include <sys/mman.h>
490Sstevel@tonic-gate #include <thread.h>
500Sstevel@tonic-gate #include <synch.h>
510Sstevel@tonic-gate #include <ndbm.h>
520Sstevel@tonic-gate #include "ypsym.h"
530Sstevel@tonic-gate #include "shim.h"
540Sstevel@tonic-gate #include "../ldap_util.h"
550Sstevel@tonic-gate 
560Sstevel@tonic-gate 
570Sstevel@tonic-gate /*
580Sstevel@tonic-gate  * FUNCTION :	disaster()
590Sstevel@tonic-gate  *
600Sstevel@tonic-gate  * DESCRIPTION:	Called if the stubs is accidentally called.
610Sstevel@tonic-gate  */
620Sstevel@tonic-gate void
disaster()630Sstevel@tonic-gate disaster()
640Sstevel@tonic-gate {
650Sstevel@tonic-gate 	logmsg(MSG_NOTIMECHECK, LOG_ERR, "YPTOL stub called. This indicates"
660Sstevel@tonic-gate 						" a serious build error");
670Sstevel@tonic-gate }
680Sstevel@tonic-gate 
690Sstevel@tonic-gate #pragma weak lock_core
700Sstevel@tonic-gate int
lock_core(int hashval)710Sstevel@tonic-gate lock_core(int hashval)
720Sstevel@tonic-gate {
730Sstevel@tonic-gate 	disaster();
74*702Sth160488 	return (0);
750Sstevel@tonic-gate }
760Sstevel@tonic-gate 
770Sstevel@tonic-gate #pragma weak unlock_core
780Sstevel@tonic-gate int
unlock_core(int hashval)790Sstevel@tonic-gate unlock_core(int hashval)
800Sstevel@tonic-gate {
810Sstevel@tonic-gate 	disaster();
82*702Sth160488 	return (0);
830Sstevel@tonic-gate }
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #pragma weak lock_map
860Sstevel@tonic-gate int
lock_map(char * mapname)870Sstevel@tonic-gate lock_map(char *mapname)
880Sstevel@tonic-gate {
890Sstevel@tonic-gate 	disaster();
900Sstevel@tonic-gate 	return (0);
910Sstevel@tonic-gate }
920Sstevel@tonic-gate 
930Sstevel@tonic-gate #pragma weak unlock_map
940Sstevel@tonic-gate int
unlock_map(char * mapname)950Sstevel@tonic-gate unlock_map(char *mapname)
960Sstevel@tonic-gate {
970Sstevel@tonic-gate 	disaster();
980Sstevel@tonic-gate 	return (0);
990Sstevel@tonic-gate }
1000Sstevel@tonic-gate 
1010Sstevel@tonic-gate #pragma weak init_lock_map
1020Sstevel@tonic-gate bool
init_lock_map()1030Sstevel@tonic-gate init_lock_map()
1040Sstevel@tonic-gate {
1050Sstevel@tonic-gate 	disaster();
106*702Sth160488 	return (FALSE);
1070Sstevel@tonic-gate }
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate #pragma weak hash
1100Sstevel@tonic-gate int
hash(char * s)1110Sstevel@tonic-gate hash(char *s)
1120Sstevel@tonic-gate {
1130Sstevel@tonic-gate 	disaster();
114*702Sth160488 	return (0);
1150Sstevel@tonic-gate }
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate #pragma weak rename_map
1180Sstevel@tonic-gate bool
rename_map(char * from,char * to,bool_t secure_map)1190Sstevel@tonic-gate rename_map(char *from, char *to, bool_t secure_map)
1200Sstevel@tonic-gate {
1210Sstevel@tonic-gate 	disaster();
122*702Sth160488 	return (FALSE);
1230Sstevel@tonic-gate }
1240Sstevel@tonic-gate 
1250Sstevel@tonic-gate #pragma weak delete_map
1260Sstevel@tonic-gate bool
delete_map(char * name)1270Sstevel@tonic-gate delete_map(char *name)
1280Sstevel@tonic-gate {
1290Sstevel@tonic-gate 	disaster();
130*702Sth160488 	return (FALSE);
1310Sstevel@tonic-gate }
1320Sstevel@tonic-gate 
1330Sstevel@tonic-gate #pragma weak single
1340Sstevel@tonic-gate #pragma weak nogecos
1350Sstevel@tonic-gate #pragma weak noshell
1360Sstevel@tonic-gate #pragma weak nopw
1370Sstevel@tonic-gate #pragma weak mflag
1380Sstevel@tonic-gate int single, nogecos, noshell, nopw, mflag;
1390Sstevel@tonic-gate 
1400Sstevel@tonic-gate #pragma weak validloginshell
1410Sstevel@tonic-gate bool_t
validloginshell(char * sh,char * arg,int priv)1420Sstevel@tonic-gate validloginshell(char *sh, char *arg, int priv)
1430Sstevel@tonic-gate {
1440Sstevel@tonic-gate 	disaster();
145*702Sth160488 	return (0);
1460Sstevel@tonic-gate }
1470Sstevel@tonic-gate 
1480Sstevel@tonic-gate #pragma weak validstr
1490Sstevel@tonic-gate int
validstr(char * str,size_t size)1500Sstevel@tonic-gate validstr(char *str, size_t size)
1510Sstevel@tonic-gate {
1520Sstevel@tonic-gate 	disaster();
1530Sstevel@tonic-gate 	return (0);
1540Sstevel@tonic-gate }
155