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_attach 42 97 #define ADT_detach 43 98 #define ADT_dladm_create_secobj 47 99 #define ADT_dladm_delete_secobj 48 100 #define ADT_filesystem_add 4 101 #define ADT_filesystem_delete 5 102 #define ADT_filesystem_modify 6 103 #define ADT_inetd_connect 34 104 #define ADT_inetd_copylimit 36 105 #define ADT_inetd_failrate 37 106 #define ADT_inetd_ratelimit 35 107 #define ADT_init_solaris 32 108 #define ADT_login 25 109 #define ADT_logout 1 110 #define ADT_network_add 7 111 #define ADT_network_delete 8 112 #define ADT_network_modify 9 113 #define ADT_newgrp_login 41 114 #define ADT_passwd 27 115 #define ADT_pool_export 46 116 #define ADT_pool_import 45 117 #define ADT_printer_add 10 118 #define ADT_printer_delete 11 119 #define ADT_printer_modify 12 120 #define ADT_prof_cmd 24 121 #define ADT_remove 44 122 #define ADT_rlogin 28 123 #define ADT_role_login 13 124 #define ADT_role_logout 40 125 #define ADT_scheduledjob_add 14 126 #define ADT_scheduledjob_delete 15 127 #define ADT_scheduledjob_modify 16 128 #define ADT_screenlock 26 129 #define ADT_screenunlock 31 130 #define ADT_serialport_add 17 131 #define ADT_serialport_delete 18 132 #define ADT_serialport_modify 19 133 #define ADT_ssh 2 134 #define ADT_su 30 135 #define ADT_su_logout 39 136 #define ADT_telnet 29 137 #define ADT_uauth 20 138 #define ADT_usermgr_add 21 139 #define ADT_usermgr_delete 22 140 #define ADT_usermgr_modify 23 141 #define ADT_zlogin 38 142 #define ADT_zone_state 33 143 144 145 struct adt_admin_authenticate { /* ADT_admin_authenticate */ 146 enum adt_login_text message; /* optional */ 147 }; 148 typedef struct adt_admin_authenticate adt_admin_authenticate_t; 149 150 struct adt_attach { /* ADT_attach */ 151 char *auth_used; /* required */ 152 char *mount_point; /* required */ 153 char *device; /* required */ 154 char *options; /* optional */ 155 }; 156 typedef struct adt_attach adt_attach_t; 157 158 struct adt_detach { /* ADT_detach */ 159 char *auth_used; /* required */ 160 char *mount_point; /* required */ 161 char *device; /* required */ 162 char *options; /* optional */ 163 }; 164 typedef struct adt_detach adt_detach_t; 165 166 struct adt_dladm_create_secobj { /* ADT_dladm_create_secobj */ 167 char *auth_used; /* required */ 168 char *obj_class; /* required */ 169 char *obj_name; /* required */ 170 }; 171 typedef struct adt_dladm_create_secobj adt_dladm_create_secobj_t; 172 173 struct adt_dladm_delete_secobj { /* ADT_dladm_delete_secobj */ 174 char *auth_used; /* required */ 175 char *obj_class; /* required */ 176 char *obj_name; /* required */ 177 }; 178 typedef struct adt_dladm_delete_secobj adt_dladm_delete_secobj_t; 179 180 struct adt_filesystem_add { /* ADT_filesystem_add */ 181 char *object_name; /* required */ 182 char *domain; /* optional */ 183 char *name_service; /* required */ 184 char *auth_used; /* optional */ 185 char *initial_values; /* required */ 186 }; 187 typedef struct adt_filesystem_add adt_filesystem_add_t; 188 189 struct adt_filesystem_delete { /* ADT_filesystem_delete */ 190 char *object_name; /* required */ 191 char *domain; /* optional */ 192 char *name_service; /* required */ 193 char *auth_used; /* optional */ 194 char *delete_values; /* required */ 195 }; 196 typedef struct adt_filesystem_delete adt_filesystem_delete_t; 197 198 struct adt_filesystem_modify { /* ADT_filesystem_modify */ 199 char *object_name; /* required */ 200 char *domain; /* optional */ 201 char *name_service; /* required */ 202 char *auth_used; /* optional */ 203 char *changed_values; /* required */ 204 }; 205 typedef struct adt_filesystem_modify adt_filesystem_modify_t; 206 207 struct adt_inetd_connect { /* ADT_inetd_connect */ 208 char *service_name; /* optional */ 209 uint32_t ip_type; /* required */ 210 uint16_t ip_remote_port; /* required */ 211 uint16_t ip_local_port; /* required */ 212 uint32_t ip_adr[4]; /* required */ 213 char *cmd; /* required */ 214 priv_set_t *privileges; /* required */ 215 }; 216 typedef struct adt_inetd_connect adt_inetd_connect_t; 217 218 struct adt_inetd_copylimit { /* ADT_inetd_copylimit */ 219 char *service_name; /* optional */ 220 char *limit; /* required */ 221 }; 222 typedef struct adt_inetd_copylimit adt_inetd_copylimit_t; 223 224 struct adt_inetd_failrate { /* ADT_inetd_failrate */ 225 char *service_name; /* optional */ 226 char *values; /* required */ 227 }; 228 typedef struct adt_inetd_failrate adt_inetd_failrate_t; 229 230 struct adt_inetd_ratelimit { /* ADT_inetd_ratelimit */ 231 char *service_name; /* optional */ 232 char *limit; /* required */ 233 }; 234 typedef struct adt_inetd_ratelimit adt_inetd_ratelimit_t; 235 236 struct adt_init_solaris { /* ADT_init_solaris */ 237 char *info; /* optional */ 238 }; 239 typedef struct adt_init_solaris adt_init_solaris_t; 240 241 struct adt_login { /* ADT_login */ 242 enum adt_login_text message; /* optional */ 243 }; 244 typedef struct adt_login adt_login_t; 245 246 struct adt_logout { /* ADT_logout */ 247 char *user_name; /* optional (format: logout %s) */ 248 }; 249 typedef struct adt_logout adt_logout_t; 250 251 struct adt_network_add { /* ADT_network_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_network_add adt_network_add_t; 259 260 struct adt_network_delete { /* ADT_network_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_network_delete adt_network_delete_t; 268 269 struct adt_network_modify { /* ADT_network_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_network_modify adt_network_modify_t; 277 278 struct adt_newgrp_login { /* ADT_newgrp_login */ 279 char *groupname; /* required */ 280 }; 281 typedef struct adt_newgrp_login adt_newgrp_login_t; 282 283 struct adt_passwd { /* ADT_passwd */ 284 char *username; /* optional */ 285 }; 286 typedef struct adt_passwd adt_passwd_t; 287 288 struct adt_pool_export { /* ADT_pool_export */ 289 char *auth_used; /* required */ 290 char *pool; /* required */ 291 char *device; /* required */ 292 }; 293 typedef struct adt_pool_export adt_pool_export_t; 294 295 struct adt_pool_import { /* ADT_pool_import */ 296 char *auth_used; /* required */ 297 char *pool; /* required */ 298 char *device; /* required */ 299 }; 300 typedef struct adt_pool_import adt_pool_import_t; 301 302 struct adt_printer_add { /* ADT_printer_add */ 303 char *object_name; /* required */ 304 char *domain; /* optional */ 305 char *name_service; /* required */ 306 char *auth_used; /* optional */ 307 char *initial_values; /* required */ 308 }; 309 typedef struct adt_printer_add adt_printer_add_t; 310 311 struct adt_printer_delete { /* ADT_printer_delete */ 312 char *object_name; /* required */ 313 char *domain; /* optional */ 314 char *name_service; /* required */ 315 char *auth_used; /* optional */ 316 char *delete_values; /* required */ 317 }; 318 typedef struct adt_printer_delete adt_printer_delete_t; 319 320 struct adt_printer_modify { /* ADT_printer_modify */ 321 char *object_name; /* required */ 322 char *domain; /* optional */ 323 char *name_service; /* required */ 324 char *auth_used; /* optional */ 325 char *changed_values; /* required */ 326 }; 327 typedef struct adt_printer_modify adt_printer_modify_t; 328 329 struct adt_prof_cmd { /* ADT_prof_cmd */ 330 char *cwdpath; /* required */ 331 char *cmdpath; /* required */ 332 int argc; /* required */ 333 char **argv; /* required */ 334 char **envp; /* required */ 335 uid_t proc_auid; /* required */ 336 uid_t proc_euid; /* required */ 337 gid_t proc_egid; /* required */ 338 uid_t proc_ruid; /* required */ 339 gid_t proc_rgid; /* required */ 340 pid_t proc_pid; /* required */ 341 au_asid_t proc_sid; /* required */ 342 adt_termid_t *proc_termid; /* required */ 343 priv_set_t *limit_set; /* optional */ 344 priv_set_t *inherit_set; /* optional */ 345 }; 346 typedef struct adt_prof_cmd adt_prof_cmd_t; 347 348 struct adt_remove { /* ADT_remove */ 349 char *auth_used; /* required */ 350 char *mount_point; /* optional */ 351 char *device; /* required */ 352 }; 353 typedef struct adt_remove adt_remove_t; 354 355 struct adt_rlogin { /* ADT_rlogin */ 356 enum adt_login_text message; /* optional */ 357 }; 358 typedef struct adt_rlogin adt_rlogin_t; 359 360 struct adt_role_login { /* ADT_role_login */ 361 enum adt_login_text message; /* optional */ 362 }; 363 typedef struct adt_role_login adt_role_login_t; 364 365 struct adt_role_logout { /* ADT_role_logout */ 366 int dummy; /* not used */ 367 }; 368 typedef struct adt_role_logout adt_role_logout_t; 369 370 struct adt_scheduledjob_add { /* ADT_scheduledjob_add */ 371 char *object_name; /* required */ 372 char *domain; /* optional */ 373 char *name_service; /* required */ 374 char *auth_used; /* optional */ 375 char *initial_values; /* required */ 376 }; 377 typedef struct adt_scheduledjob_add adt_scheduledjob_add_t; 378 379 struct adt_scheduledjob_delete { /* ADT_scheduledjob_delete */ 380 char *object_name; /* required */ 381 char *domain; /* optional */ 382 char *name_service; /* required */ 383 char *auth_used; /* optional */ 384 char *delete_values; /* required */ 385 }; 386 typedef struct adt_scheduledjob_delete adt_scheduledjob_delete_t; 387 388 struct adt_scheduledjob_modify { /* ADT_scheduledjob_modify */ 389 char *object_name; /* required */ 390 char *domain; /* optional */ 391 char *name_service; /* required */ 392 char *auth_used; /* optional */ 393 char *changed_values; /* required */ 394 }; 395 typedef struct adt_scheduledjob_modify adt_scheduledjob_modify_t; 396 397 struct adt_screenlock { /* ADT_screenlock */ 398 int dummy; /* not used */ 399 }; 400 typedef struct adt_screenlock adt_screenlock_t; 401 402 struct adt_screenunlock { /* ADT_screenunlock */ 403 int dummy; /* not used */ 404 }; 405 typedef struct adt_screenunlock adt_screenunlock_t; 406 407 struct adt_serialport_add { /* ADT_serialport_add */ 408 char *object_name; /* required */ 409 char *domain; /* optional */ 410 char *name_service; /* required */ 411 char *auth_used; /* optional */ 412 char *initial_values; /* required */ 413 }; 414 typedef struct adt_serialport_add adt_serialport_add_t; 415 416 struct adt_serialport_delete { /* ADT_serialport_delete */ 417 char *object_name; /* required */ 418 char *domain; /* optional */ 419 char *name_service; /* required */ 420 char *auth_used; /* optional */ 421 char *delete_values; /* required */ 422 }; 423 typedef struct adt_serialport_delete adt_serialport_delete_t; 424 425 struct adt_serialport_modify { /* ADT_serialport_modify */ 426 char *object_name; /* required */ 427 char *domain; /* optional */ 428 char *name_service; /* required */ 429 char *auth_used; /* optional */ 430 char *changed_values; /* required */ 431 }; 432 typedef struct adt_serialport_modify adt_serialport_modify_t; 433 434 struct adt_ssh { /* ADT_ssh */ 435 enum adt_login_text message; /* optional */ 436 }; 437 typedef struct adt_ssh adt_ssh_t; 438 439 struct adt_su { /* ADT_su */ 440 char *message; /* optional */ 441 }; 442 typedef struct adt_su adt_su_t; 443 444 struct adt_su_logout { /* ADT_su_logout */ 445 int dummy; /* not used */ 446 }; 447 typedef struct adt_su_logout adt_su_logout_t; 448 449 struct adt_telnet { /* ADT_telnet */ 450 enum adt_login_text message; /* optional */ 451 }; 452 typedef struct adt_telnet adt_telnet_t; 453 454 struct adt_uauth { /* ADT_uauth */ 455 char *auth_used; /* required */ 456 char *objectname; /* required */ 457 }; 458 typedef struct adt_uauth adt_uauth_t; 459 460 struct adt_usermgr_add { /* ADT_usermgr_add */ 461 char *object_name; /* required */ 462 char *domain; /* optional */ 463 char *name_service; /* required */ 464 char *auth_used; /* optional */ 465 char *initial_values; /* required */ 466 }; 467 typedef struct adt_usermgr_add adt_usermgr_add_t; 468 469 struct adt_usermgr_delete { /* ADT_usermgr_delete */ 470 char *object_name; /* required */ 471 char *domain; /* optional */ 472 char *name_service; /* required */ 473 char *auth_used; /* optional */ 474 char *delete_values; /* required */ 475 }; 476 typedef struct adt_usermgr_delete adt_usermgr_delete_t; 477 478 struct adt_usermgr_modify { /* ADT_usermgr_modify */ 479 char *object_name; /* required */ 480 char *domain; /* optional */ 481 char *name_service; /* required */ 482 char *auth_used; /* optional */ 483 char *changed_values; /* required */ 484 }; 485 typedef struct adt_usermgr_modify adt_usermgr_modify_t; 486 487 struct adt_zlogin { /* ADT_zlogin */ 488 char *message; /* optional */ 489 }; 490 typedef struct adt_zlogin adt_zlogin_t; 491 492 struct adt_zone_state { /* ADT_zone_state */ 493 char *new_state; /* required */ 494 char *zonename; /* required */ 495 }; 496 typedef struct adt_zone_state adt_zone_state_t; 497 498 union adt_event_data { 499 adt_admin_authenticate_t adt_admin_authenticate; 500 adt_attach_t adt_attach; 501 adt_detach_t adt_detach; 502 adt_dladm_create_secobj_t adt_dladm_create_secobj; 503 adt_dladm_delete_secobj_t adt_dladm_delete_secobj; 504 adt_filesystem_add_t adt_filesystem_add; 505 adt_filesystem_delete_t adt_filesystem_delete; 506 adt_filesystem_modify_t adt_filesystem_modify; 507 adt_inetd_connect_t adt_inetd_connect; 508 adt_inetd_copylimit_t adt_inetd_copylimit; 509 adt_inetd_failrate_t adt_inetd_failrate; 510 adt_inetd_ratelimit_t adt_inetd_ratelimit; 511 adt_init_solaris_t adt_init_solaris; 512 adt_login_t adt_login; 513 adt_logout_t adt_logout; 514 adt_network_add_t adt_network_add; 515 adt_network_delete_t adt_network_delete; 516 adt_network_modify_t adt_network_modify; 517 adt_newgrp_login_t adt_newgrp_login; 518 adt_passwd_t adt_passwd; 519 adt_pool_export_t adt_pool_export; 520 adt_pool_import_t adt_pool_import; 521 adt_printer_add_t adt_printer_add; 522 adt_printer_delete_t adt_printer_delete; 523 adt_printer_modify_t adt_printer_modify; 524 adt_prof_cmd_t adt_prof_cmd; 525 adt_remove_t adt_remove; 526 adt_rlogin_t adt_rlogin; 527 adt_role_login_t adt_role_login; 528 adt_role_logout_t adt_role_logout; 529 adt_scheduledjob_add_t adt_scheduledjob_add; 530 adt_scheduledjob_delete_t adt_scheduledjob_delete; 531 adt_scheduledjob_modify_t adt_scheduledjob_modify; 532 adt_screenlock_t adt_screenlock; 533 adt_screenunlock_t adt_screenunlock; 534 adt_serialport_add_t adt_serialport_add; 535 adt_serialport_delete_t adt_serialport_delete; 536 adt_serialport_modify_t adt_serialport_modify; 537 adt_ssh_t adt_ssh; 538 adt_su_t adt_su; 539 adt_su_logout_t adt_su_logout; 540 adt_telnet_t adt_telnet; 541 adt_uauth_t adt_uauth; 542 adt_usermgr_add_t adt_usermgr_add; 543 adt_usermgr_delete_t adt_usermgr_delete; 544 adt_usermgr_modify_t adt_usermgr_modify; 545 adt_zlogin_t adt_zlogin; 546 adt_zone_state_t adt_zone_state; 547 }; 548 549 550 #ifndef ADT_PRIVATE 551 #define ADT_PRIVATE 552 553 /* 554 * These interfaces are project private and will change without 555 * notice as needed for the BSM API project. 556 */ 557 558 extern void adt_get_auid(const adt_session_data_t *, au_id_t *); 559 extern void adt_set_auid(const adt_session_data_t *, const au_id_t); 560 561 extern void adt_get_mask(const adt_session_data_t *, au_mask_t *); 562 extern void adt_set_mask(const adt_session_data_t *, const au_mask_t *); 563 564 extern void adt_get_termid(const adt_session_data_t *, au_tid_addr_t *); 565 extern void adt_set_termid(const adt_session_data_t *, 566 const au_tid_addr_t *); 567 568 extern void adt_get_asid(const adt_session_data_t *, au_asid_t *); 569 extern void adt_set_asid(const adt_session_data_t *, const au_asid_t); 570 571 #endif 572 573 #ifdef __cplusplus 574 } 575 #endif 576 577 #endif /* _ADT_EVENT_H */ 578