volck.c revision 18c2aff776a775d34a4c9893a4c72e0434d68e36
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
#ifndef lint
#pragma ident "%Z%%M% %I% %E% SMI"
#endif lint
/*
* Copyright (c) 1992 by Sun Microsystems, Inc.
*/
/*
* Fix up the nis+ database, if it's broken.
*/
#include <stdio.h>
#include <string.h>
#include <dirent.h>
#include <fcntl.h>
#include <string.h>
#include <locale.h>
#include <libintl.h>
char *prog_name;
void usage();
char *volume_group;
{
extern char *optarg;
extern int optind;
int c;
#if !defined(TEXT_DOMAIN)
#define TEXT_DOMAIN "SYS_TEST"
#endif
(void) textdomain(TEXT_DOMAIN);
if (getuid() != 0) {
exit(-1);
}
/* process arguments */
switch (c) {
case 'g':
break;
default:
usage();
exit(-1);
}
}
volck();
}
void
usage()
{
}
char *dtabname;
char *ctabname;
char *nis_directory;
volck()
{
char namebuf[MAXNAMELEN];
if (volume_group == NULL) {
} else {
}
/*
* Just see if the directory is there
* This allows us to print a meaningful message if the user
* hasn't created all the right stuff.
*/
if (volume_group == NULL)
else
gettext("Nis object %s was not found\n"),
namebuf);
return (0);
} else {
return (FALSE);
}
}
/* look for the control table */
found_ctl = 1;
found_ctl = 0;
} else {
/* nis returned some horrible error */
"nis_db_init lookup control error: nis+ says '%s'\n"),
return (FALSE);
}
/* look for the data table */
found_dat = 1;
found_dat = 0;
} else {
/* nis returned some horrible error */
"nis_db_init lookup data error: nis+ says '%s'\n"),
return (FALSE);
}
/*
* let them know if we have one but not the other.
*/
}
/* if we have a control table, look it over */
if (found_ctl) {
}
/* Create the data table */
if (found_dat == 0) {
for (i = 0; i < ncols_data; i++) {
}
"nis_db_init add data table error: nis+ says '%s'\n"),
return (FALSE);
}
}
nis_db_initialized = 1;
return (TRUE);
}