1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * adt_event.h 23 * 24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 25 * Use is subject to license terms. 26 * 27 * AUTOMATICALLY GENERATED CODE; DO NOT EDIT; CONTACT AUDIT PROJECT 28 * 29 * This is an evolving interface; additions will be made without 30 * notice. It is also part of a contract private interface and 31 * any changes made that are not upward compatible are subject to 32 * the contract's rules. 33 */ 34 35 #ifndef _ADT_EVENT_H 36 #define _ADT_EVENT_H 37 38 #pragma ident "%Z%%M% %I% %E% SMI" 39 40 #include <bsm/adt.h> 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /* 47 * adt_put_event() status values. Positive values are for kernel-generated 48 * failure, -1 for user-space. For ADT_SUCCESS, the adt_put_event() return_val 49 * is not used; the convention is to set it to ADT_SUCCESS. 50 */ 51 #define ADT_SUCCESS 0 52 #define ADT_FAILURE -1 53 54 #define ADT_FAIL_PAM 2000 55 #define ADT_FAIL_VALUE 1000 56 enum adt_fail_value { 57 ADT_FAIL_VALUE_PW_ATTR = 1000, /* Attribute update */ 58 ADT_FAIL_VALUE_PW, /* Password update */ 59 ADT_FAIL_VALUE_USERNAME, /* bad username */ 60 ADT_FAIL_VALUE_AUTH, /* authorization failed */ 61 ADT_FAIL_VALUE_UID, /* bad uid */ 62 ADT_FAIL_VALUE_UNKNOWN, /* unknown failure */ 63 ADT_FAIL_VALUE_EXPIRED, /* password expired */ 64 ADT_FAIL_VALUE_ACCOUNT_LOCKED, /* Account is locked */ 65 ADT_FAIL_VALUE_BAD_DIALUP, /* Bad dial up */ 66 ADT_FAIL_VALUE_BAD_ID, /* Invalid ID */ 67 ADT_FAIL_VALUE_BAD_PW, /* Invalid password */ 68 ADT_FAIL_VALUE_CONSOLE, /* Not on console */ 69 ADT_FAIL_VALUE_MAX_TRIES, /* Too many failed attempts */ 70 ADT_FAIL_VALUE_PROTOCOL_FAILURE, /* Protocol failure */ 71 ADT_FAIL_VALUE_EXCLUDED_USER, /* Excluded user */ 72 ADT_FAIL_VALUE_ANON_USER, /* No anonymous */ 73 ADT_FAIL_VALUE_BAD_CMD, /* Invalid command */ 74 ADT_FAIL_VALUE_BAD_TTY, /* Standard input not a tty line */ 75 ADT_FAIL_VALUE_PROGRAM, /* Program failure */ 76 ADT_FAIL_VALUE_CHDIR_FAILED, /* chdir to home directory */ 77 ADT_FAIL_VALUE_INPUT_OVERFLOW, /* Input line too long. */ 78 ADT_FAIL_VALUE_DEVICE_PERM, /* login device override */ 79 ADT_FAIL_VALUE_AUTH_BYPASS, /* authorization bypass */ 80 ADT_FAIL_VALUE_LOGIN_DISABLED /* login disabled */ 81 }; 82 /* Deprecated message list */ 83 enum adt_login_text { 84 ADT_LOGIN_NO_MSG, /* (no token will be generated) */ 85 ADT_LOGIN_ACCOUNT_LOCKED, /* Account is locked */ 86 ADT_LOGIN_BAD_DIALUP, /* Bad dial up */ 87 ADT_LOGIN_BAD_ID, /* Invalid ID */ 88 ADT_LOGIN_BAD_PW, /* Invalid password */ 89 ADT_LOGIN_CONSOLE, /* Not on console */ 90 ADT_LOGIN_MAX_TRIES, /* Too many failed attempts */ 91 ADT_LOGIN_PROTOCOL_FAILURE, /* Protocol failure */ 92 ADT_LOGIN_EXCLUDED_USER, /* Excluded user */ 93 ADT_LOGIN_ANON_USER /* No anonymous */ 94 }; 95 #define ADT_admin_authenticate 3 96 #define ADT_filesystem_add 4 97 #define ADT_filesystem_delete 5 98 #define ADT_filesystem_modify 6 99 #define ADT_inetd_connect 34 100 #define ADT_inetd_copylimit 36 101 #define ADT_inetd_failrate 37 102 #define ADT_inetd_ratelimit 35 103 #define ADT_init_solaris 32 104 #define ADT_login 25 105 #define ADT_logout 1 106 #define ADT_network_add 7 107 #define ADT_network_delete 8 108 #define ADT_network_modify 9 109 #define ADT_newgrp_login 41 110 #define ADT_passwd 27 111 #define ADT_printer_add 10 112 #define ADT_printer_delete 11 113 #define ADT_printer_modify 12 114 #define ADT_prof_cmd 24 115 #define ADT_rlogin 28 116 #define ADT_role_login 13 117 #define ADT_role_logout 40 118 #define ADT_scheduledjob_add 14 119 #define ADT_scheduledjob_delete 15 120 #define ADT_scheduledjob_modify 16 121 #define ADT_screenlock 26 122 #define ADT_screenunlock 31 123 #define ADT_serialport_add 17 124 #define ADT_serialport_delete 18 125 #define ADT_serialport_modify 19 126 #define ADT_ssh 2 127 #define ADT_su 30 128 #define ADT_su_logout 39 129 #define ADT_telnet 29 130 #define ADT_uauth 20 131 #define ADT_usermgr_add 21 132 #define ADT_usermgr_delete 22 133 #define ADT_usermgr_modify 23 134 #define ADT_zlogin 38 135 #define ADT_zone_state 33 136 137 138 struct adt_admin_authenticate { /* ADT_admin_authenticate */ 139 enum adt_login_text message; /* optional */ 140 }; 141 typedef struct adt_admin_authenticate adt_admin_authenticate_t; 142 143 struct adt_filesystem_add { /* ADT_filesystem_add */ 144 char *object_name; /* required */ 145 char *domain; /* optional */ 146 char *name_service; /* required */ 147 char *auth_used; /* optional */ 148 char *initial_values; /* required */ 149 }; 150 typedef struct adt_filesystem_add adt_filesystem_add_t; 151 152 struct adt_filesystem_delete { /* ADT_filesystem_delete */ 153 char *object_name; /* required */ 154 char *domain; /* optional */ 155 char *name_service; /* required */ 156 char *auth_used; /* optional */ 157 char *delete_values; /* required */ 158 }; 159 typedef struct adt_filesystem_delete adt_filesystem_delete_t; 160 161 struct adt_filesystem_modify { /* ADT_filesystem_modify */ 162 char *object_name; /* required */ 163 char *domain; /* optional */ 164 char *name_service; /* required */ 165 char *auth_used; /* optional */ 166 char *changed_values; /* required */ 167 }; 168 typedef struct adt_filesystem_modify adt_filesystem_modify_t; 169 170 struct adt_inetd_connect { /* ADT_inetd_connect */ 171 char *service_name; /* optional */ 172 uint32_t ip_type; /* required */ 173 uint16_t ip_remote_port; /* required */ 174 uint16_t ip_local_port; /* required */ 175 uint32_t ip_adr[4]; /* required */ 176 char *cmd; /* required */ 177 priv_set_t *privileges; /* required */ 178 }; 179 typedef struct adt_inetd_connect adt_inetd_connect_t; 180 181 struct adt_inetd_copylimit { /* ADT_inetd_copylimit */ 182 char *service_name; /* optional */ 183 char *limit; /* required */ 184 }; 185 typedef struct adt_inetd_copylimit adt_inetd_copylimit_t; 186 187 struct adt_inetd_failrate { /* ADT_inetd_failrate */ 188 char *service_name; /* optional */ 189 char *values; /* required */ 190 }; 191 typedef struct adt_inetd_failrate adt_inetd_failrate_t; 192 193 struct adt_inetd_ratelimit { /* ADT_inetd_ratelimit */ 194 char *service_name; /* optional */ 195 char *limit; /* required */ 196 }; 197 typedef struct adt_inetd_ratelimit adt_inetd_ratelimit_t; 198 199 struct adt_init_solaris { /* ADT_init_solaris */ 200 char *info; /* optional */ 201 }; 202 typedef struct adt_init_solaris adt_init_solaris_t; 203 204 struct adt_login { /* ADT_login */ 205 enum adt_login_text message; /* optional */ 206 }; 207 typedef struct adt_login adt_login_t; 208 209 struct adt_logout { /* ADT_logout */ 210 char *user_name; /* optional (format: logout %s) */ 211 }; 212 typedef struct adt_logout adt_logout_t; 213 214 struct adt_network_add { /* ADT_network_add */ 215 char *object_name; /* required */ 216 char *domain; /* optional */ 217 char *name_service; /* required */ 218 char *auth_used; /* optional */ 219 char *initial_values; /* required */ 220 }; 221 typedef struct adt_network_add adt_network_add_t; 222 223 struct adt_network_delete { /* ADT_network_delete */ 224 char *object_name; /* required */ 225 char *domain; /* optional */ 226 char *name_service; /* required */ 227 char *auth_used; /* optional */ 228 char *delete_values; /* required */ 229 }; 230 typedef struct adt_network_delete adt_network_delete_t; 231 232 struct adt_network_modify { /* ADT_network_modify */ 233 char *object_name; /* required */ 234 char *domain; /* optional */ 235 char *name_service; /* required */ 236 char *auth_used; /* optional */ 237 char *changed_values; /* required */ 238 }; 239 typedef struct adt_network_modify adt_network_modify_t; 240 241 struct adt_newgrp_login { /* ADT_newgrp_login */ 242 char *groupname; /* required */ 243 }; 244 typedef struct adt_newgrp_login adt_newgrp_login_t; 245 246 struct adt_passwd { /* ADT_passwd */ 247 char *username; /* optional */ 248 }; 249 typedef struct adt_passwd adt_passwd_t; 250 251 struct adt_printer_add { /* ADT_printer_add */ 252 char *object_name; /* required */ 253 char *domain; /* optional */ 254 char *name_service; /* required */ 255 char *auth_used; /* optional */ 256 char *initial_values; /* required */ 257 }; 258 typedef struct adt_printer_add adt_printer_add_t; 259 260 struct adt_printer_delete { /* ADT_printer_delete */ 261 char *object_name; /* required */ 262 char *domain; /* optional */ 263 char *name_service; /* required */ 264 char *auth_used; /* optional */ 265 char *delete_values; /* required */ 266 }; 267 typedef struct adt_printer_delete adt_printer_delete_t; 268 269 struct adt_printer_modify { /* ADT_printer_modify */ 270 char *object_name; /* required */ 271 char *domain; /* optional */ 272 char *name_service; /* required */ 273 char *auth_used; /* optional */ 274 char *changed_values; /* required */ 275 }; 276 typedef struct adt_printer_modify adt_printer_modify_t; 277 278 struct adt_prof_cmd { /* ADT_prof_cmd */ 279 char *cwdpath; /* required */ 280 char *cmdpath; /* required */ 281 int argc; /* required */ 282 char **argv; /* required */ 283 char **envp; /* required */ 284 uid_t proc_auid; /* required */ 285 uid_t proc_euid; /* required */ 286 gid_t proc_egid; /* required */ 287 uid_t proc_ruid; /* required */ 288 gid_t proc_rgid; /* required */ 289 pid_t proc_pid; /* required */ 290 au_asid_t proc_sid; /* required */ 291 adt_termid_t *proc_termid; /* required */ 292 priv_set_t *limit_set; /* optional */ 293 priv_set_t *inherit_set; /* optional */ 294 }; 295 typedef struct adt_prof_cmd adt_prof_cmd_t; 296 297 struct adt_rlogin { /* ADT_rlogin */ 298 enum adt_login_text message; /* optional */ 299 }; 300 typedef struct adt_rlogin adt_rlogin_t; 301 302 struct adt_role_login { /* ADT_role_login */ 303 enum adt_login_text message; /* optional */ 304 }; 305 typedef struct adt_role_login adt_role_login_t; 306 307 struct adt_role_logout { /* ADT_role_logout */ 308 int dummy; /* not used */ 309 }; 310 typedef struct adt_role_logout adt_role_logout_t; 311 312 struct adt_scheduledjob_add { /* ADT_scheduledjob_add */ 313 char *object_name; /* required */ 314 char *domain; /* optional */ 315 char *name_service; /* required */ 316 char *auth_used; /* optional */ 317 char *initial_values; /* required */ 318 }; 319 typedef struct adt_scheduledjob_add adt_scheduledjob_add_t; 320 321 struct adt_scheduledjob_delete { /* ADT_scheduledjob_delete */ 322 char *object_name; /* required */ 323 char *domain; /* optional */ 324 char *name_service; /* required */ 325 char *auth_used; /* optional */ 326 char *delete_values; /* required */ 327 }; 328 typedef struct adt_scheduledjob_delete adt_scheduledjob_delete_t; 329 330 struct adt_scheduledjob_modify { /* ADT_scheduledjob_modify */ 331 char *object_name; /* required */ 332 char *domain; /* optional */ 333 char *name_service; /* required */ 334 char *auth_used; /* optional */ 335 char *changed_values; /* required */ 336 }; 337 typedef struct adt_scheduledjob_modify adt_scheduledjob_modify_t; 338 339 struct adt_screenlock { /* ADT_screenlock */ 340 int dummy; /* not used */ 341 }; 342 typedef struct adt_screenlock adt_screenlock_t; 343 344 struct adt_screenunlock { /* ADT_screenunlock */ 345 int dummy; /* not used */ 346 }; 347 typedef struct adt_screenunlock adt_screenunlock_t; 348 349 struct adt_serialport_add { /* ADT_serialport_add */ 350 char *object_name; /* required */ 351 char *domain; /* optional */ 352 char *name_service; /* required */ 353 char *auth_used; /* optional */ 354 char *initial_values; /* required */ 355 }; 356 typedef struct adt_serialport_add adt_serialport_add_t; 357 358 struct adt_serialport_delete { /* ADT_serialport_delete */ 359 char *object_name; /* required */ 360 char *domain; /* optional */ 361 char *name_service; /* required */ 362 char *auth_used; /* optional */ 363 char *delete_values; /* required */ 364 }; 365 typedef struct adt_serialport_delete adt_serialport_delete_t; 366 367 struct adt_serialport_modify { /* ADT_serialport_modify */ 368 char *object_name; /* required */ 369 char *domain; /* optional */ 370 char *name_service; /* required */ 371 char *auth_used; /* optional */ 372 char *changed_values; /* required */ 373 }; 374 typedef struct adt_serialport_modify adt_serialport_modify_t; 375 376 struct adt_ssh { /* ADT_ssh */ 377 enum adt_login_text message; /* optional */ 378 }; 379 typedef struct adt_ssh adt_ssh_t; 380 381 struct adt_su { /* ADT_su */ 382 char *message; /* optional */ 383 }; 384 typedef struct adt_su adt_su_t; 385 386 struct adt_su_logout { /* ADT_su_logout */ 387 int dummy; /* not used */ 388 }; 389 typedef struct adt_su_logout adt_su_logout_t; 390 391 struct adt_telnet { /* ADT_telnet */ 392 enum adt_login_text message; /* optional */ 393 }; 394 typedef struct adt_telnet adt_telnet_t; 395 396 struct adt_uauth { /* ADT_uauth */ 397 char *auth_used; /* required */ 398 char *objectname; /* required */ 399 }; 400 typedef struct adt_uauth adt_uauth_t; 401 402 struct adt_usermgr_add { /* ADT_usermgr_add */ 403 char *object_name; /* required */ 404 char *domain; /* optional */ 405 char *name_service; /* required */ 406 char *auth_used; /* optional */ 407 char *initial_values; /* required */ 408 }; 409 typedef struct adt_usermgr_add adt_usermgr_add_t; 410 411 struct adt_usermgr_delete { /* ADT_usermgr_delete */ 412 char *object_name; /* required */ 413 char *domain; /* optional */ 414 char *name_service; /* required */ 415 char *auth_used; /* optional */ 416 char *delete_values; /* required */ 417 }; 418 typedef struct adt_usermgr_delete adt_usermgr_delete_t; 419 420 struct adt_usermgr_modify { /* ADT_usermgr_modify */ 421 char *object_name; /* required */ 422 char *domain; /* optional */ 423 char *name_service; /* required */ 424 char *auth_used; /* optional */ 425 char *changed_values; /* required */ 426 }; 427 typedef struct adt_usermgr_modify adt_usermgr_modify_t; 428 429 struct adt_zlogin { /* ADT_zlogin */ 430 char *message; /* optional */ 431 }; 432 typedef struct adt_zlogin adt_zlogin_t; 433 434 struct adt_zone_state { /* ADT_zone_state */ 435 char *new_state; /* required */ 436 char *zonename; /* required */ 437 }; 438 typedef struct adt_zone_state adt_zone_state_t; 439 440 union adt_event_data { 441 adt_admin_authenticate_t adt_admin_authenticate; 442 adt_filesystem_add_t adt_filesystem_add; 443 adt_filesystem_delete_t adt_filesystem_delete; 444 adt_filesystem_modify_t adt_filesystem_modify; 445 adt_inetd_connect_t adt_inetd_connect; 446 adt_inetd_copylimit_t adt_inetd_copylimit; 447 adt_inetd_failrate_t adt_inetd_failrate; 448 adt_inetd_ratelimit_t adt_inetd_ratelimit; 449 adt_init_solaris_t adt_init_solaris; 450 adt_login_t adt_login; 451 adt_logout_t adt_logout; 452 adt_network_add_t adt_network_add; 453 adt_network_delete_t adt_network_delete; 454 adt_network_modify_t adt_network_modify; 455 adt_newgrp_login_t adt_newgrp_login; 456 adt_passwd_t adt_passwd; 457 adt_printer_add_t adt_printer_add; 458 adt_printer_delete_t adt_printer_delete; 459 adt_printer_modify_t adt_printer_modify; 460 adt_prof_cmd_t adt_prof_cmd; 461 adt_rlogin_t adt_rlogin; 462 adt_role_login_t adt_role_login; 463 adt_role_logout_t adt_role_logout; 464 adt_scheduledjob_add_t adt_scheduledjob_add; 465 adt_scheduledjob_delete_t adt_scheduledjob_delete; 466 adt_scheduledjob_modify_t adt_scheduledjob_modify; 467 adt_screenlock_t adt_screenlock; 468 adt_screenunlock_t adt_screenunlock; 469 adt_serialport_add_t adt_serialport_add; 470 adt_serialport_delete_t adt_serialport_delete; 471 adt_serialport_modify_t adt_serialport_modify; 472 adt_ssh_t adt_ssh; 473 adt_su_t adt_su; 474 adt_su_logout_t adt_su_logout; 475 adt_telnet_t adt_telnet; 476 adt_uauth_t adt_uauth; 477 adt_usermgr_add_t adt_usermgr_add; 478 adt_usermgr_delete_t adt_usermgr_delete; 479 adt_usermgr_modify_t adt_usermgr_modify; 480 adt_zlogin_t adt_zlogin; 481 adt_zone_state_t adt_zone_state; 482 }; 483 484 485 #ifndef ADT_PRIVATE 486 #define ADT_PRIVATE 487 488 /* 489 * These interfaces are project private and will change without 490 * notice as needed for the BSM API project. 491 */ 492 493 extern void adt_get_auid(const adt_session_data_t *, au_id_t *); 494 extern void adt_set_auid(const adt_session_data_t *, const au_id_t); 495 496 extern void adt_get_mask(const adt_session_data_t *, au_mask_t *); 497 extern void adt_set_mask(const adt_session_data_t *, const au_mask_t *); 498 499 extern void adt_get_termid(const adt_session_data_t *, au_tid_addr_t *); 500 extern void adt_set_termid(const adt_session_data_t *, 501 const au_tid_addr_t *); 502 503 extern void adt_get_asid(const adt_session_data_t *, au_asid_t *); 504 extern void adt_set_asid(const adt_session_data_t *, const au_asid_t); 505 506 #endif 507 508 #ifdef __cplusplus 509 } 510 #endif 511 512 #endif /* _ADT_EVENT_H */ 513