Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / cmd / gss / gsscred / gsscred.h
bloba1174df5e410838a9e4cb8f9b86b6ef3de6d8e33
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 1997-2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * gsscred utility
30 * Manages mapping between a security principal
31 * name and unix uid.
34 #ifndef _GSSCRED_H
35 #define _GSSCRED_H
37 #pragma ident "%Z%%M% %I% %E% SMI"
39 #include <libintl.h>
40 #include <locale.h>
41 #include <gssapi/gssapi.h>
42 #include <pwd.h>
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
48 #if !defined(TEXT_DOMAIN)
49 #define TEXT_DOMAIN "SUNW_OST_OSCMD"
50 #endif
52 #define GSSCRED_FLAT_FILE -1
54 /* Structure to hold GSS credentials for each entry */
55 typedef struct GssCredEntry_t {
56 char *principal_name;
57 int unix_uid;
58 char *comment;
59 struct GssCredEntry_t *next;
60 } GssCredEntry;
63 * Misc functions in gsscred.
65 int gsscred_AsHex(const gss_buffer_t inBuf, gss_buffer_t outBuf);
66 int gsscred_MakeName(const gss_OID mechOid, const char *name,
67 const char *nameOid, gss_buffer_t OutName);
68 int gsscred_read_config_file(void);
69 int gsscred_MakeNameHeader(const gss_OID mechOid, gss_buffer_t outNameHdr);
73 * Flat file based gsscred functions.
75 int file_addGssCredEntry(const gss_buffer_t hexName, const char *uid,
76 const char *comment, char **errDetails);
77 int file_getGssCredEntry(const gss_buffer_t name, const char *uid,
78 char **errDetails);
79 int file_deleteGssCredEntry(const gss_buffer_t name, const char *uid,
80 char **errDetails);
81 int file_getGssCredUid(const gss_buffer_t name, uid_t *uidOut);
85 * GSS entry point for retrieving user uid information based on
86 * exported name buffer.
88 int gss_getGssCredEntry(const gss_buffer_t expName, uid_t *uid);
90 #ifdef __cplusplus
92 #endif
94 #endif /* _GSSCRED_H */