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