xref: /illumos-gate/usr/src/lib/libnisdb/yptol/stubs.c (revision 1da57d55)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*a506a34cSth  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*
287c478bd9Sstevel@tonic-gate  * DESCRIPTION:	The N2L system is dependent on a number of utility functions
297c478bd9Sstevel@tonic-gate  *		supplied by NIS object code (under cmd/ypcmd). When libnisdb
307c478bd9Sstevel@tonic-gate  *		is loaded by executable other than those built under
317c478bd9Sstevel@tonic-gate  *		cmd/ypcmd (e.g. the NIS+ executables) these would be
327c478bd9Sstevel@tonic-gate  *		undefined. To prevent this happening the stubs in this file
337c478bd9Sstevel@tonic-gate  *		contain weak definitions on these functions. In the NIS case
347c478bd9Sstevel@tonic-gate  *		these weak definitions will be overridden by the real ones.
357c478bd9Sstevel@tonic-gate  *
367c478bd9Sstevel@tonic-gate  *		The functions in this file will never be called. NIS will have
377c478bd9Sstevel@tonic-gate  *		overridden them and nothing else should call yptol. If they are
387c478bd9Sstevel@tonic-gate  *		called then there is a bug in the build system.
397c478bd9Sstevel@tonic-gate  *
407c478bd9Sstevel@tonic-gate  *		Note : This is not elegant but it is a way of dealing with
417c478bd9Sstevel@tonic-gate  *		preexisting code structure.
427c478bd9Sstevel@tonic-gate  */
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #include <unistd.h>
457c478bd9Sstevel@tonic-gate #include <syslog.h>
467c478bd9Sstevel@tonic-gate #include <sys/mman.h>
477c478bd9Sstevel@tonic-gate #include <thread.h>
487c478bd9Sstevel@tonic-gate #include <synch.h>
497c478bd9Sstevel@tonic-gate #include <ndbm.h>
507c478bd9Sstevel@tonic-gate #include "ypsym.h"
517c478bd9Sstevel@tonic-gate #include "shim.h"
527c478bd9Sstevel@tonic-gate #include "../ldap_util.h"
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate /*
567c478bd9Sstevel@tonic-gate  * FUNCTION :	disaster()
577c478bd9Sstevel@tonic-gate  *
587c478bd9Sstevel@tonic-gate  * DESCRIPTION:	Called if the stubs is accidentally called.
597c478bd9Sstevel@tonic-gate  */
607c478bd9Sstevel@tonic-gate void
disaster()617c478bd9Sstevel@tonic-gate disaster()
627c478bd9Sstevel@tonic-gate {
637c478bd9Sstevel@tonic-gate 	logmsg(MSG_NOTIMECHECK, LOG_ERR, "YPTOL stub called. This indicates"
647c478bd9Sstevel@tonic-gate 						" a serious build error");
657c478bd9Sstevel@tonic-gate }
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate #pragma weak lock_core
687c478bd9Sstevel@tonic-gate int
lock_core(int hashval)697c478bd9Sstevel@tonic-gate lock_core(int hashval)
707c478bd9Sstevel@tonic-gate {
717c478bd9Sstevel@tonic-gate 	disaster();
72*a506a34cSth 	return (0);
737c478bd9Sstevel@tonic-gate }
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #pragma weak unlock_core
767c478bd9Sstevel@tonic-gate int
unlock_core(int hashval)777c478bd9Sstevel@tonic-gate unlock_core(int hashval)
787c478bd9Sstevel@tonic-gate {
797c478bd9Sstevel@tonic-gate 	disaster();
80*a506a34cSth 	return (0);
817c478bd9Sstevel@tonic-gate }
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate #pragma weak lock_map
847c478bd9Sstevel@tonic-gate int
lock_map(char * mapname)857c478bd9Sstevel@tonic-gate lock_map(char *mapname)
867c478bd9Sstevel@tonic-gate {
877c478bd9Sstevel@tonic-gate 	disaster();
887c478bd9Sstevel@tonic-gate 	return (0);
897c478bd9Sstevel@tonic-gate }
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate #pragma weak unlock_map
927c478bd9Sstevel@tonic-gate int
unlock_map(char * mapname)937c478bd9Sstevel@tonic-gate unlock_map(char *mapname)
947c478bd9Sstevel@tonic-gate {
957c478bd9Sstevel@tonic-gate 	disaster();
967c478bd9Sstevel@tonic-gate 	return (0);
977c478bd9Sstevel@tonic-gate }
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate #pragma weak init_lock_map
1007c478bd9Sstevel@tonic-gate bool
init_lock_map()1017c478bd9Sstevel@tonic-gate init_lock_map()
1027c478bd9Sstevel@tonic-gate {
1037c478bd9Sstevel@tonic-gate 	disaster();
104*a506a34cSth 	return (FALSE);
1057c478bd9Sstevel@tonic-gate }
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate #pragma weak hash
1087c478bd9Sstevel@tonic-gate int
hash(char * s)1097c478bd9Sstevel@tonic-gate hash(char *s)
1107c478bd9Sstevel@tonic-gate {
1117c478bd9Sstevel@tonic-gate 	disaster();
112*a506a34cSth 	return (0);
1137c478bd9Sstevel@tonic-gate }
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate #pragma weak rename_map
1167c478bd9Sstevel@tonic-gate bool
rename_map(char * from,char * to,bool_t secure_map)1177c478bd9Sstevel@tonic-gate rename_map(char *from, char *to, bool_t secure_map)
1187c478bd9Sstevel@tonic-gate {
1197c478bd9Sstevel@tonic-gate 	disaster();
120*a506a34cSth 	return (FALSE);
1217c478bd9Sstevel@tonic-gate }
1227c478bd9Sstevel@tonic-gate 
1237c478bd9Sstevel@tonic-gate #pragma weak delete_map
1247c478bd9Sstevel@tonic-gate bool
delete_map(char * name)1257c478bd9Sstevel@tonic-gate delete_map(char *name)
1267c478bd9Sstevel@tonic-gate {
1277c478bd9Sstevel@tonic-gate 	disaster();
128*a506a34cSth 	return (FALSE);
1297c478bd9Sstevel@tonic-gate }
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate #pragma weak single
1327c478bd9Sstevel@tonic-gate #pragma weak nogecos
1337c478bd9Sstevel@tonic-gate #pragma weak noshell
1347c478bd9Sstevel@tonic-gate #pragma weak nopw
1357c478bd9Sstevel@tonic-gate #pragma weak mflag
1367c478bd9Sstevel@tonic-gate int single, nogecos, noshell, nopw, mflag;
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate #pragma weak validloginshell
1397c478bd9Sstevel@tonic-gate bool_t
validloginshell(char * sh,char * arg,int priv)1407c478bd9Sstevel@tonic-gate validloginshell(char *sh, char *arg, int priv)
1417c478bd9Sstevel@tonic-gate {
1427c478bd9Sstevel@tonic-gate 	disaster();
143*a506a34cSth 	return (0);
1447c478bd9Sstevel@tonic-gate }
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate #pragma weak validstr
1477c478bd9Sstevel@tonic-gate int
validstr(char * str,size_t size)1487c478bd9Sstevel@tonic-gate validstr(char *str, size_t size)
1497c478bd9Sstevel@tonic-gate {
1507c478bd9Sstevel@tonic-gate 	disaster();
1517c478bd9Sstevel@tonic-gate 	return (0);
1527c478bd9Sstevel@tonic-gate }
153