chkey_common.c revision 36e852a172cba914383d7341c988128b2c667fbd
039cd2c4871a00e51af909222a34695d9cec3000vboxsync * CDDL HEADER START
039cd2c4871a00e51af909222a34695d9cec3000vboxsync * The contents of this file are subject to the terms of the
039cd2c4871a00e51af909222a34695d9cec3000vboxsync * Common Development and Distribution License (the "License").
039cd2c4871a00e51af909222a34695d9cec3000vboxsync * You may not use this file except in compliance with the License.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * See the License for the specific language governing permissions
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * and limitations under the License.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * When distributing Covered Code, include this CDDL HEADER in each
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * If applicable, add the following below this CDDL HEADER, with the
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync * CDDL HEADER END
12cd783de945853c8fc377095e8d0bbd4c97d8a1vboxsync * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
27537ffef7291d0bb3a24e459a6b94c65586defevboxsync * Use is subject to license terms.
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsyncextern char *crypt();
3c3a5ab35783f4d31cb5d3a15db9daadeb804daavboxsyncextern long random();
e6c9ad4d89b941630e2ef5fb467327c176ba26d0vboxsyncextern char *getpassphrase();
#ifndef MAXHOSTNAMELEN
#define FREE_CREDINFO(s) \
static int get_ldap_bindDN(char **);
static int get_ldap_bindPassword(char **);
if (blen > 0) {
return (PROMPTGET_MEMORY_FAIL);
return (PROMPTGET_SUCCESS);
return (PROMPTGET_FAIL);
return (PASSWD_UNMATCHED);
return (PASSWD_UNMATCHED);
== NULL) {
return (PROMPTGET_MEMORY_FAIL);
return (PROMPTGET_SUCCESS);
int previous = 0;
if (previous)
return (policy);
return (conf &&
char *head_msg)
char *target_service = 0;
int use_default = 0;
if (default_conf == 0)
policy_correct = 0;
if (use_default) {
if (policy_correct == 0)
if (policy_correct)
return (target_service);
if (default_conf == 0)
policy_correct = 0;
policy_correct = 0;
if (policy_correct == 0)
if (conf)
return (policy_correct);
if (pk_service == 0) {
if (pk_service == 0)
if (got_from_switch == 0)
#ifdef NFS_AUTH
return (&obj);
static char *attrFilter[] = {
(char *)NULL
char **fattrs;
while (*fattrs) {
fattrs++;
static char *keyAttrs[] = {
char *mechname,
char *public,
char *crypt,
char *mechfilter;
int mechfilterlen;
int keycount[] = {0, 0};
int found = 0;
int rep = 0;
int count = 0;
found++;
mechfilterlen) == 0) {
rep++;
++keycount[q];
if (!rep) {
++keycount[q];
if (!found) {
++keycount[q];
const char *passwd,
int add,
int update4host,
const char *bindDN,
const char *bindPasswd)
int ldaprc;
int authstried = 0;
char *msg;
char *ldap_pw;
int status;
goto out;
if (update4host)
goto out;
if (update4host) {
if (passwd)
if (!ldap_pw)
goto out;
goto out;
goto out;
goto out;
goto out;
goto out;
authstried++;
goto out;
if (authstried == 0)
out:
if (errorp) {
char *netname,
char *public,
char *crypt,
char *passwd)
char *netnamecpy;
char *id;
char *domain;
char *dn;
char *db;
char *filter;
int status;
if (filter)
if (filter)
char **newattr;