nisdefaults.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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
*/
/*
*
* Copyright (c) 1988-1992 Sun Microsystems Inc
* All Rights Reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* A simple utility to tell you what the defaults are that will be
* plugged into object creation.
*
* Copyright (c) 1992 Sun Microsystems Inc.
* All rights reserved.
*/
#include <stdio.h>
#include <stdlib.h>
extern int key_secretkey_is_set_g();
char *cmd;
{
exit(1);
}
extern int optind;
extern char *optarg;
extern nis_object nis_default_obj;
int argc;
char *argv[];
{
int c;
int i, verbose = 1,
ph = 0, /* print host */
pd = 0, /* print domain */
pp = 0, /* print principal */
pr = 0, /* print rights */
pt = 0, /* print ttl */
pg = 0, /* print group */
ps = 0; /* print search path */
switch (c) {
case 'v' :
verbose = 50;
break;
case 'h' :
pa = 0;
ph++;
verbose--;
break;
case 'p' :
pa = 0;
verbose--;
pp++;
break;
case 'r' :
pa = 0;
verbose--;
pr++;
break;
case 't' :
pa = 0;
verbose--;
pt++;
break;
case 'g' :
pa = 0;
verbose--;
pg++;
break;
case 'd' :
pa = 0;
verbose--;
pd++;
break;
case 's' :
pa = 0;
verbose--;
ps++;
break;
case 'a' :
pa++;
verbose--;
break;
case '?' :
break;
}
}
if (verbose < 0)
verbose = 0;
if (verbose)
printf("Principal Name : ");
if (verbose && ! key_secretkey_is_set_g(0, 0))
printf(" (not authenticated)");
printf("\n");
}
if (verbose)
printf("Domain Name : ");
}
if (verbose)
printf("Host Name : ");
}
if (verbose)
printf("Group Name : ");
else
}
if (verbose)
printf("Access Rights : ");
printf("\n");
}
if (verbose)
printf("Time to live : ");
if (verbose) {
if (days)
} else
}
if (verbose)
printf("Search Path : ");
i = 1;
while (result[i]) {
if (verbose)
printf(" ");
printf("%s\n",
nis_domain_of(result[i++]));
}
} else
printf("**NONE**\n");
}
exit(0);
}