/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <ctype.h>
#include <strings.h>
#include <libintl.h>
#include <stdio.h>
#include "cryptoadm.h"
#include <cryptoutil.h>
/*
* Create one item of type mechlist_t with the mechanism name. A null is
* returned to indicate that the storage space available is insufficient.
*/
{
return (NULL);
}
cryptodebug("out of memory.");
return (NULL);
}
first++;
last--;
*last-- = '\0';
return (pres);
}
void
{
}
}
/*
* Check if the mechanism is in the mechanism list.
*/
{
return (B_FALSE);
}
break;
}
}
return (found);
}
int
{
char *ptr;
char *name;
int found_count;
int err;
gettext("failed to update the configuration - %s"),
return (FAILURE);
}
gettext("failed to lock the configuration - %s"),
return (FAILURE);
}
/*
*/
gettext("failed to create a temporary file - %s"),
return (FAILURE);
}
return (FAILURE);
}
/*
* Loop thru the config file. If the provider was reserved within a
* package bracket, just uncomment it. Otherwise, append it at
* the end. The resulting file will be saved in the temp file first.
*/
found_count = 0;
if (buffer[0] == '#') {
ptr++;
found_count++;
}
} else {
break;
found_count++;
fips_entry = B_TRUE;
}
}
} else { /* _PATH_KCF_CONF */
if (buffer[0] == '#') {
ptr++; /* skip # */
break;
}
} else {
break;
}
}
}
}
} else {
if (found_count == 1) {
if (fips_entry == B_TRUE) {
EOF) {
}
} else {
EOF) {
}
}
} else {
}
}
} else {
/*
* Found a second entry with same tag name.
* Should not happen. The config file
* is corrupted. Give a warning and skip
* this entry.
*/
"(Warning) Found an additional reserved "
"entry for %s."), entry);
}
}
break;
}
}
if (unlink(tmpfile_name) != 0) {
"(Warning) failed to remove %s: %s"), tmpfile_name,
}
return (FAILURE);
}
if (found_count == 0) {
/*
* The entry was not in config file before, append it to the
* end of the temp file.
*/
"failed to write to %s: %s"), tmpfile_name,
if (unlink(tmpfile_name) != 0) {
"(Warning) failed to remove %s: %s"),
}
return (FAILURE);
}
}
return (FAILURE);
}
gettext("failed to update the configuration - %s"),
gettext("failed to update the configuration - %s"),
} else {
}
if (unlink(tmpfile_name) != 0) {
"(Warning) failed to remove %s: %s"),
}
}
return (rc);
}