17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5499fd601Sgww * Common Development and Distribution License (the "License"). 6499fd601Sgww * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*134a1f4eSCasper H.S. Dik * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 237c478bd9Sstevel@tonic-gate */ 247c478bd9Sstevel@tonic-gate 257c478bd9Sstevel@tonic-gate #ifndef _PROF_ATTR_H 267c478bd9Sstevel@tonic-gate #define _PROF_ATTR_H 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate #ifdef __cplusplus 297c478bd9Sstevel@tonic-gate extern "C" { 307c478bd9Sstevel@tonic-gate #endif 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #include <sys/types.h> 347c478bd9Sstevel@tonic-gate #include <secdb.h> 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #define PROFATTR_FILENAME "/etc/security/prof_attr" 387c478bd9Sstevel@tonic-gate #define PROFATTR_DB_NAME "prof_attr.org_dir" 397c478bd9Sstevel@tonic-gate #define PROFATTR_DB_NCOL 5 /* total columns */ 407c478bd9Sstevel@tonic-gate #define PROFATTR_DB_NKEYCOL 1 /* total searchable columns */ 417c478bd9Sstevel@tonic-gate #define PROFATTR_DB_TBLT "prof_attr_tbl" 427c478bd9Sstevel@tonic-gate #define PROFATTR_NAME_DEFAULT_KW "nobody" 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #define PROFATTR_COL0_KW "name" 457c478bd9Sstevel@tonic-gate #define PROFATTR_COL1_KW "res1" 467c478bd9Sstevel@tonic-gate #define PROFATTR_COL2_KW "res2" 477c478bd9Sstevel@tonic-gate #define PROFATTR_COL3_KW "desc" 487c478bd9Sstevel@tonic-gate #define PROFATTR_COL4_KW "attr" 497c478bd9Sstevel@tonic-gate 50*134a1f4eSCasper H.S. Dik #define PROFILE_STOP "Stop" 51*134a1f4eSCasper H.S. Dik 527c478bd9Sstevel@tonic-gate #define DEF_PROF "PROFS_GRANTED=" 53499fd601Sgww #define DEF_CONSUSER "CONSOLE_USER=" 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate #define MAXPROFS 4096 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate /* 587c478bd9Sstevel@tonic-gate * indices of searchable columns 597c478bd9Sstevel@tonic-gate */ 607c478bd9Sstevel@tonic-gate #define PROFATTR_KEYCOL0 0 /* name */ 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate /* 647c478bd9Sstevel@tonic-gate * Key words used in the prof_attr database 657c478bd9Sstevel@tonic-gate */ 667c478bd9Sstevel@tonic-gate #define PROFATTR_AUTHS_KW "auths" 677c478bd9Sstevel@tonic-gate #define PROFATTR_PROFS_KW "profiles" 687c478bd9Sstevel@tonic-gate #define PROFATTR_PRIVS_KW "privs" 697c478bd9Sstevel@tonic-gate 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate /* 727c478bd9Sstevel@tonic-gate * Nsswitch representation of profile attributes. 737c478bd9Sstevel@tonic-gate */ 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate typedef struct profstr_s { 767c478bd9Sstevel@tonic-gate char *name; /* proforization name */ 777c478bd9Sstevel@tonic-gate char *res1; /* RESERVED */ 787c478bd9Sstevel@tonic-gate char *res2; /* RESERVED */ 797c478bd9Sstevel@tonic-gate char *desc; /* description */ 807c478bd9Sstevel@tonic-gate char *attr; /* string of key-value pair attributes */ 817c478bd9Sstevel@tonic-gate } profstr_t; 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate typedef struct profattr_s { 847c478bd9Sstevel@tonic-gate char *name; /* proforization name */ 857c478bd9Sstevel@tonic-gate char *res1; /* RESERVED */ 867c478bd9Sstevel@tonic-gate char *res2; /* RESERVED */ 877c478bd9Sstevel@tonic-gate char *desc; /* description */ 887c478bd9Sstevel@tonic-gate kva_t *attr; /* array of key-value pair attributes */ 897c478bd9Sstevel@tonic-gate } profattr_t; 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate #ifdef __STDC__ 927c478bd9Sstevel@tonic-gate extern profattr_t *getprofnam(const char *); 937c478bd9Sstevel@tonic-gate extern profattr_t *getprofattr(void); 947c478bd9Sstevel@tonic-gate extern void getproflist(const char *, char **, int *); 957c478bd9Sstevel@tonic-gate extern void setprofattr(void); 967c478bd9Sstevel@tonic-gate extern void endprofattr(void); 977c478bd9Sstevel@tonic-gate extern void free_profattr(profattr_t *); 987c478bd9Sstevel@tonic-gate extern void free_proflist(char **, int); 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gate #else /* not __STDC__ */ 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate extern profattr_t *getprofnam(); 1037c478bd9Sstevel@tonic-gate extern profattr_t *getprofattr(); 1047c478bd9Sstevel@tonic-gate extern void getproflist(); 1057c478bd9Sstevel@tonic-gate extern int setprofattr(); 1067c478bd9Sstevel@tonic-gate extern int endprofattr(); 1077c478bd9Sstevel@tonic-gate extern void free_profattr(); 1087c478bd9Sstevel@tonic-gate extern void free_proflist(); 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gate #endif 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1137c478bd9Sstevel@tonic-gate } 1147c478bd9Sstevel@tonic-gate #endif 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gate #endif /* _PROF_ATTR_H */ 117