nisauthconf.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
*/
/*
*
* Configure NIS+ to use RPCSEC_GSS
*
* Copyright (c) 1997,1998 Sun Microsystems, Inc.
* All Rights Reserved.
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <libgen.h>
#include <rpcsvc/nis_dhext.h>
static struct mech_t {
char *mechname;
char *keylen;
char *algtype;
char *alias;
char *additional;
} mechs[] = {
"diffie_hellman_1024_0", "1024", "0", "dh1024-0", "default integrity",
"diffie_hellman_640_0", "640", "0", "dh640-0", "default integrity",
"-", "-", "-", "des", "# AUTH_DES",
};
static void
{
(void) fprintf(f, "# DO NOT EDIT FILE, AUTOMATICALLY GENERATED\n");
(void) fprintf(f, "# \n");
(void) fprintf(f,
"# The format of this file may change or it may be removed\n");
(void) fprintf(f, "# in future versions of Solaris.\n# \n");
}
static void
{
int i = 0;
while (mechlist[i]) {
if (mechlist[++i])
(void) printf(", ");
else
(void) printf("\n");
}
} else
(void) printf("des\n");
exit(0);
}
#define DESMECH1 "-"
#define DESMECH2 "des"
#define DESMECH3 "192"
#define DESMECH4 0
#define HEADING1 "GSS Mechanism Name"
#define HEADING2 "Alias"
#define HEADING3 "Bit Size"
#define HEADING4 "Algorithm Type"
#define HEADFMT "%s%*c%s%*c%s%*c%s\n"
#define LINEFMT "%s%*c%s%*c%s%*c%d\n"
static void
{
int sc[3], i;
char tmpstr[1024];
}
for (i = 0; mechlist[i]; i++) {
}
for (i = 0; mechlist[i]; i++) {
}
exit(0);
}
static void
{
exit(1);
}
void
{
int c, i, dolistmechs = 0;
FILE *f;
switch (c) {
case 'v':
dolistmechs++;
break;
default:
}
}
if (dolistmechs)
listmechs();
if (argc < 2)
printconf();
(void) unlink(NIS_SEC_CF_PATHNAME);
exit(0);
}
"Could not open %s for writing.\n",
exit(1);
}
preamble(f);
for (i = 1; i < argc; i++) {
int j = 0;
int gotit = 0;
gotit++;
(void) fprintf(f, "mech\t%s\t%s\t%s\t%s\t%s\n",
mechs[j].additional);
(void) fflush(f);
break;
}
j++;
}
if (!gotit) {
"%s: Mechanism, %s, not found!\n", cmd,
argv[i]);
(void) fflush(f);
(void) fclose(f);
exit(1);
}
}
(void) fclose(f);
}