10Sstevel@tonic-gate /* 2*781Sgtb * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 30Sstevel@tonic-gate * Use is subject to license terms. 40Sstevel@tonic-gate */ 50Sstevel@tonic-gate 60Sstevel@tonic-gate #ifndef _SERVER_ACL_H 70Sstevel@tonic-gate #define _SERVER_ACL_H 80Sstevel@tonic-gate 90Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 100Sstevel@tonic-gate 110Sstevel@tonic-gate #ifdef __cplusplus 120Sstevel@tonic-gate extern "C" { 130Sstevel@tonic-gate #endif 140Sstevel@tonic-gate 150Sstevel@tonic-gate 160Sstevel@tonic-gate /* 170Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * Openvision retains the copyright to derivative works of 200Sstevel@tonic-gate * this source code. Do *NOT* create a derivative of this 210Sstevel@tonic-gate * source code before consulting with your legal department. 220Sstevel@tonic-gate * Do *NOT* integrate *ANY* of this source code into another 230Sstevel@tonic-gate * product before consulting with your legal department. 240Sstevel@tonic-gate * 250Sstevel@tonic-gate * For further information, read the top-level Openvision 260Sstevel@tonic-gate * copyright which is contained in the top-level MIT Kerberos 270Sstevel@tonic-gate * copyright. 280Sstevel@tonic-gate * 290Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 300Sstevel@tonic-gate * 310Sstevel@tonic-gate */ 320Sstevel@tonic-gate 330Sstevel@tonic-gate 340Sstevel@tonic-gate /* 350Sstevel@tonic-gate * kadmin/v5server/kadm5_defs.h 360Sstevel@tonic-gate * 370Sstevel@tonic-gate * Copyright 1995 by the Massachusetts Institute of Technology. 380Sstevel@tonic-gate * All Rights Reserved. 390Sstevel@tonic-gate * 400Sstevel@tonic-gate * Export of this software from the United States of America may 410Sstevel@tonic-gate * require a specific license from the United States Government. 420Sstevel@tonic-gate * It is the responsibility of any person or organization contemplating 430Sstevel@tonic-gate * export to obtain such a license before exporting. 440Sstevel@tonic-gate * 450Sstevel@tonic-gate * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and 460Sstevel@tonic-gate * distribute this software and its documentation for any purpose and 470Sstevel@tonic-gate * without fee is hereby granted, provided that the above copyright 480Sstevel@tonic-gate * notice appear in all copies and that both that copyright notice and 490Sstevel@tonic-gate * this permission notice appear in supporting documentation, and that 500Sstevel@tonic-gate * the name of M.I.T. not be used in advertising or publicity pertaining 510Sstevel@tonic-gate * to distribution of the software without specific, written prior 520Sstevel@tonic-gate * permission. Furthermore if you modify this software you must label 530Sstevel@tonic-gate * your software as modified software and not distribute it in such a 540Sstevel@tonic-gate * fashion that it might be confused with the original M.I.T. software. 550Sstevel@tonic-gate * M.I.T. makes no representations about the suitability of 560Sstevel@tonic-gate * this software for any purpose. It is provided "as is" without express 570Sstevel@tonic-gate * or implied warranty. 580Sstevel@tonic-gate * 590Sstevel@tonic-gate */ 600Sstevel@tonic-gate 610Sstevel@tonic-gate #include <admin.h> /* SUNWresync121 XXX */ 620Sstevel@tonic-gate 630Sstevel@tonic-gate /* 640Sstevel@tonic-gate * Debug definitions. 650Sstevel@tonic-gate */ 660Sstevel@tonic-gate #define DEBUG_SPROC 1 670Sstevel@tonic-gate #define DEBUG_OPERATION 2 680Sstevel@tonic-gate #define DEBUG_HOST 4 690Sstevel@tonic-gate #define DEBUG_REALM 8 700Sstevel@tonic-gate #define DEBUG_REQUESTS 16 710Sstevel@tonic-gate #define DEBUG_ACL 32 720Sstevel@tonic-gate #define DEBUG_PROTO 64 730Sstevel@tonic-gate #define DEBUG_CALLS 128 740Sstevel@tonic-gate #define DEBUG_NOSLAVES 256 750Sstevel@tonic-gate #ifdef DEBUG 760Sstevel@tonic-gate #define DPRINT(l1, cl, al) if ((cl & l1) != 0) printf al 770Sstevel@tonic-gate #else /* DEBUG */ 780Sstevel@tonic-gate #define DPRINT(l1, cl, al) 790Sstevel@tonic-gate #endif /* DEBUG */ 800Sstevel@tonic-gate #define DLOG(l1, cl, msg) if ((cl & l1) != 0) \ 810Sstevel@tonic-gate com_err(programname, 0, msg) 820Sstevel@tonic-gate 830Sstevel@tonic-gate /* 840Sstevel@tonic-gate * Access control bits. 850Sstevel@tonic-gate */ 860Sstevel@tonic-gate #define ACL_INQUIRE 1 /* GET */ 870Sstevel@tonic-gate #define ACL_ADD 2 880Sstevel@tonic-gate #define ACL_MODIFY 4 890Sstevel@tonic-gate #define ACL_DELETE 8 900Sstevel@tonic-gate #define ACL_LIST 16 910Sstevel@tonic-gate #define ACL_CHANGEPW 32 920Sstevel@tonic-gate /* #define ACL_CHANGE_OWN_PW 16 */ 930Sstevel@tonic-gate /* #define ACL_EXTRACT 64 */ 940Sstevel@tonic-gate #define ACL_SETKEY 256 950Sstevel@tonic-gate #define ACL_MIGRATE 512 /* pam_krb5_migrate */ 960Sstevel@tonic-gate #define ACL_IPROP 65536 /* SUNW IProp */ 970Sstevel@tonic-gate #define ACL_RENAME (ACL_ADD+ACL_DELETE) 980Sstevel@tonic-gate 990Sstevel@tonic-gate #define ACL_ALL_MASK (ACL_ADD | \ 1000Sstevel@tonic-gate ACL_DELETE | \ 1010Sstevel@tonic-gate ACL_MODIFY | \ 1020Sstevel@tonic-gate ACL_CHANGEPW | \ 1030Sstevel@tonic-gate ACL_INQUIRE | \ 1040Sstevel@tonic-gate ACL_LIST | \ 1050Sstevel@tonic-gate ACL_IPROP | \ 1060Sstevel@tonic-gate ACL_MIGRATE | \ 1070Sstevel@tonic-gate ACL_SETKEY) 1080Sstevel@tonic-gate 1090Sstevel@tonic-gate typedef struct _restriction { 1100Sstevel@tonic-gate long mask; 1110Sstevel@tonic-gate krb5_flags require_attrs; 1120Sstevel@tonic-gate krb5_flags forbid_attrs; 1130Sstevel@tonic-gate krb5_deltat princ_lifetime; 1140Sstevel@tonic-gate krb5_deltat pw_lifetime; 1150Sstevel@tonic-gate krb5_deltat max_life; 1160Sstevel@tonic-gate krb5_deltat max_renewable_life; 1170Sstevel@tonic-gate long aux_attributes; 1180Sstevel@tonic-gate char *policy; 1190Sstevel@tonic-gate } restriction_t; 1200Sstevel@tonic-gate 1210Sstevel@tonic-gate krb5_error_code acl_init 122*781Sgtb (krb5_context, 1230Sstevel@tonic-gate int, 124*781Sgtb char *); 1250Sstevel@tonic-gate void acl_finish 126*781Sgtb (krb5_context, 127*781Sgtb int); 1280Sstevel@tonic-gate krb5_boolean acl_check 129*781Sgtb (krb5_context, 1300Sstevel@tonic-gate gss_name_t, 1310Sstevel@tonic-gate krb5_int32, 1320Sstevel@tonic-gate krb5_principal, 133*781Sgtb restriction_t **); 1340Sstevel@tonic-gate krb5_error_code acl_impose_restrictions 135*781Sgtb (krb5_context, 1360Sstevel@tonic-gate kadm5_principal_ent_rec *, 1370Sstevel@tonic-gate long *, 138*781Sgtb restriction_t *); 1390Sstevel@tonic-gate #ifdef __cplusplus 1400Sstevel@tonic-gate } 1410Sstevel@tonic-gate #endif 1420Sstevel@tonic-gate 1430Sstevel@tonic-gate #endif /* !_SERVER_ACL_H */ 144