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*a506a34cSth160488 * 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 #pragma ident "%Z%%M% %I% %E% SMI"
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gate #include <unistd.h>
477c478bd9Sstevel@tonic-gate #include <syslog.h>
487c478bd9Sstevel@tonic-gate #include <sys/mman.h>
497c478bd9Sstevel@tonic-gate #include <thread.h>
507c478bd9Sstevel@tonic-gate #include <synch.h>
517c478bd9Sstevel@tonic-gate #include <ndbm.h>
527c478bd9Sstevel@tonic-gate #include "ypsym.h"
537c478bd9Sstevel@tonic-gate #include "shim.h"
547c478bd9Sstevel@tonic-gate #include "../ldap_util.h"
557c478bd9Sstevel@tonic-gate
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate * FUNCTION : disaster()
597c478bd9Sstevel@tonic-gate *
607c478bd9Sstevel@tonic-gate * DESCRIPTION: Called if the stubs is accidentally called.
617c478bd9Sstevel@tonic-gate */
627c478bd9Sstevel@tonic-gate void
disaster()637c478bd9Sstevel@tonic-gate disaster()
647c478bd9Sstevel@tonic-gate {
657c478bd9Sstevel@tonic-gate logmsg(MSG_NOTIMECHECK, LOG_ERR, "YPTOL stub called. This indicates"
667c478bd9Sstevel@tonic-gate " a serious build error");
677c478bd9Sstevel@tonic-gate }
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gate #pragma weak lock_core
707c478bd9Sstevel@tonic-gate int
lock_core(int hashval)717c478bd9Sstevel@tonic-gate lock_core(int hashval)
727c478bd9Sstevel@tonic-gate {
737c478bd9Sstevel@tonic-gate disaster();
74*a506a34cSth160488 return (0);
757c478bd9Sstevel@tonic-gate }
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gate #pragma weak unlock_core
787c478bd9Sstevel@tonic-gate int
unlock_core(int hashval)797c478bd9Sstevel@tonic-gate unlock_core(int hashval)
807c478bd9Sstevel@tonic-gate {
817c478bd9Sstevel@tonic-gate disaster();
82*a506a34cSth160488 return (0);
837c478bd9Sstevel@tonic-gate }
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate #pragma weak lock_map
867c478bd9Sstevel@tonic-gate int
lock_map(char * mapname)877c478bd9Sstevel@tonic-gate lock_map(char *mapname)
887c478bd9Sstevel@tonic-gate {
897c478bd9Sstevel@tonic-gate disaster();
907c478bd9Sstevel@tonic-gate return (0);
917c478bd9Sstevel@tonic-gate }
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gate #pragma weak unlock_map
947c478bd9Sstevel@tonic-gate int
unlock_map(char * mapname)957c478bd9Sstevel@tonic-gate unlock_map(char *mapname)
967c478bd9Sstevel@tonic-gate {
977c478bd9Sstevel@tonic-gate disaster();
987c478bd9Sstevel@tonic-gate return (0);
997c478bd9Sstevel@tonic-gate }
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate #pragma weak init_lock_map
1027c478bd9Sstevel@tonic-gate bool
init_lock_map()1037c478bd9Sstevel@tonic-gate init_lock_map()
1047c478bd9Sstevel@tonic-gate {
1057c478bd9Sstevel@tonic-gate disaster();
106*a506a34cSth160488 return (FALSE);
1077c478bd9Sstevel@tonic-gate }
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gate #pragma weak hash
1107c478bd9Sstevel@tonic-gate int
hash(char * s)1117c478bd9Sstevel@tonic-gate hash(char *s)
1127c478bd9Sstevel@tonic-gate {
1137c478bd9Sstevel@tonic-gate disaster();
114*a506a34cSth160488 return (0);
1157c478bd9Sstevel@tonic-gate }
1167c478bd9Sstevel@tonic-gate
1177c478bd9Sstevel@tonic-gate #pragma weak rename_map
1187c478bd9Sstevel@tonic-gate bool
rename_map(char * from,char * to,bool_t secure_map)1197c478bd9Sstevel@tonic-gate rename_map(char *from, char *to, bool_t secure_map)
1207c478bd9Sstevel@tonic-gate {
1217c478bd9Sstevel@tonic-gate disaster();
122*a506a34cSth160488 return (FALSE);
1237c478bd9Sstevel@tonic-gate }
1247c478bd9Sstevel@tonic-gate
1257c478bd9Sstevel@tonic-gate #pragma weak delete_map
1267c478bd9Sstevel@tonic-gate bool
delete_map(char * name)1277c478bd9Sstevel@tonic-gate delete_map(char *name)
1287c478bd9Sstevel@tonic-gate {
1297c478bd9Sstevel@tonic-gate disaster();
130*a506a34cSth160488 return (FALSE);
1317c478bd9Sstevel@tonic-gate }
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gate #pragma weak single
1347c478bd9Sstevel@tonic-gate #pragma weak nogecos
1357c478bd9Sstevel@tonic-gate #pragma weak noshell
1367c478bd9Sstevel@tonic-gate #pragma weak nopw
1377c478bd9Sstevel@tonic-gate #pragma weak mflag
1387c478bd9Sstevel@tonic-gate int single, nogecos, noshell, nopw, mflag;
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gate #pragma weak validloginshell
1417c478bd9Sstevel@tonic-gate bool_t
validloginshell(char * sh,char * arg,int priv)1427c478bd9Sstevel@tonic-gate validloginshell(char *sh, char *arg, int priv)
1437c478bd9Sstevel@tonic-gate {
1447c478bd9Sstevel@tonic-gate disaster();
145*a506a34cSth160488 return (0);
1467c478bd9Sstevel@tonic-gate }
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate #pragma weak validstr
1497c478bd9Sstevel@tonic-gate int
validstr(char * str,size_t size)1507c478bd9Sstevel@tonic-gate validstr(char *str, size_t size)
1517c478bd9Sstevel@tonic-gate {
1527c478bd9Sstevel@tonic-gate disaster();
1537c478bd9Sstevel@tonic-gate return (0);
1547c478bd9Sstevel@tonic-gate }
155