/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
*/
/*
*
* Routines to add RBAC /etc files into LDAP.
* Can also be used to dump entries from a ldap container in /etc format.
*/
#include <stdio.h>
#include <stdlib.h>
#include <libintl.h>
#include <strings.h>
#include <ctype.h>
#include <locale.h>
#include <syslog.h>
#include <secdb.h>
#include "ldapaddent.h"
#include <user_attr.h>
#include <prof_attr.h>
#include <exec_attr.h>
#include <auth_attr.h>
/*
* The parsing routines for RBAC databases
*/
/*
* genent_attr:
* Generic function for generating entries for all of the *_attr databases.
*/
int
char *line, /* entry to parse */
int ncol, /* number of columns in the database */
{
int i;
char *s;
char *lasts;
/*
* check input length
*/
return (GENENT_PARSEERR);
}
/*
* setup and clear column data
*/
return (GENENT_ERR);
/* don't scribble over input */
/* Split up columns */
if (s == NULL) {
} else {
}
}
return (GENENT_OK);
}
int
{
/*
* parse entry into columns
*/
return (res);
if (retval != NS_LDAP_SUCCESS) {
if (retval == LDAP_NO_SUCH_OBJECT)
gettext("Cannot add user_attr entry (%s), "
}
return (res);
}
void
{
else
return;
}
int
{
/*
* parse entry into columns
*/
return (res);
if (retval == LDAP_ALREADY_EXISTS) {
if (continue_onerror)
gettext("Entry: %s - already Exists,"
" skipping it.\n"),
else {
res = GENENT_CBERR;
gettext("Entry: %s - already Exists\n"),
}
} else if (retval)
res = GENENT_CBERR;
return (res);
}
void
{
else
return;
}
int
{
/*
* parse entry into columns
*/
return (res);
gettext("Adding entry : %s+%s+%s+%s\n"),
if (retval == LDAP_ALREADY_EXISTS) {
if (continue_onerror)
gettext("Entry: %s+%s+%s+%s - already Exists,"
" skipping it.\n"),
else {
res = GENENT_CBERR;
gettext("Entry: %s+%s+%s+%s - already Exists\n"),
}
} else if (retval)
res = GENENT_CBERR;
return (res);
}
void
{
char **profile;
char **policy;
char **type;
char **id;
char **value;
return;
}
int
{
/*
* parse entry into columns
*/
return (res);
if (retval == LDAP_ALREADY_EXISTS) {
if (continue_onerror)
gettext("Entry: %s - already Exists,"
else {
res = GENENT_CBERR;
gettext("Entry: %s - already Exists\n"),
}
} else if (retval)
res = GENENT_CBERR;
return (res);
}
void
{
else
return;
}