store_forw_creds.c revision 32885d593baf8bac788fa78885893a51b3ad0f28
32885d593baf8bac788fa78885893a51b3ad0f28gtb * CDDL HEADER START
32885d593baf8bac788fa78885893a51b3ad0f28gtb * The contents of this file are subject to the terms of the
32885d593baf8bac788fa78885893a51b3ad0f28gtb * Common Development and Distribution License (the "License").
32885d593baf8bac788fa78885893a51b3ad0f28gtb * You may not use this file except in compliance with the License.
32885d593baf8bac788fa78885893a51b3ad0f28gtb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32885d593baf8bac788fa78885893a51b3ad0f28gtb * See the License for the specific language governing permissions
32885d593baf8bac788fa78885893a51b3ad0f28gtb * and limitations under the License.
32885d593baf8bac788fa78885893a51b3ad0f28gtb * When distributing Covered Code, include this CDDL HEADER in each
32885d593baf8bac788fa78885893a51b3ad0f28gtb * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
32885d593baf8bac788fa78885893a51b3ad0f28gtb * If applicable, add the following below this CDDL HEADER, with the
32885d593baf8bac788fa78885893a51b3ad0f28gtb * fields enclosed by brackets "[]" replaced with your own identifying
32885d593baf8bac788fa78885893a51b3ad0f28gtb * information: Portions Copyright [yyyy] [name of copyright owner]
32885d593baf8bac788fa78885893a51b3ad0f28gtb * CDDL HEADER END
32885d593baf8bac788fa78885893a51b3ad0f28gtb * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
32885d593baf8bac788fa78885893a51b3ad0f28gtb * Use is subject to license terms.
32885d593baf8bac788fa78885893a51b3ad0f28gtb#pragma ident "%Z%%M% %I% %E% SMI"
32885d593baf8bac788fa78885893a51b3ad0f28gtb * Store the forwarded creds in the user's local ccache and register
32885d593baf8bac788fa78885893a51b3ad0f28gtb return (-1);
32885d593baf8bac788fa78885893a51b3ad0f28gtb (void) snprintf(ccname, sizeof (ccname), "FILE:/tmp/krb5cc_%ld",
32885d593baf8bac788fa78885893a51b3ad0f28gtb if ((retval = krb5_cc_resolve(context, ccname, ccache)) != 0) {
32885d593baf8bac788fa78885893a51b3ad0f28gtb if ((retval = krb5_cc_store_cred(context, *ccache, *creds)) != 0) {
32885d593baf8bac788fa78885893a51b3ad0f28gtb /* Register with ktkt_warnd(1M) */
32885d593baf8bac788fa78885893a51b3ad0f28gtb if ((retval = krb5_unparse_name(context, (*creds)->client,
32885d593baf8bac788fa78885893a51b3ad0f28gtb if (kwarn_add_warning(client_name, (*creds)->times.endtime) != 0) {
32885d593baf8bac788fa78885893a51b3ad0f28gtb "store_forw_creds: kwarn_add_warning"
32885d593baf8bac788fa78885893a51b3ad0f28gtb " failed: ktkt_warnd(1M) down? ");