235 } lvl_t; |
234 } lvl_t; |
236 |
235 |
237 static lvl_t lvls[] = { |
236 static lvl_t lvls[] = { |
238 { LVLQ, 0, 'Q', 0 }, |
237 { LVLQ, 0, 'Q', 0 }, |
239 { LVLQ, 0, 'q', 0 }, |
238 { LVLQ, 0, 'q', 0 }, |
240 { LVL0, MASK0, '0', LSEL_RUNLEVEL | LSEL_NOAUDIT }, |
239 { LVL0, MASK0, '0', LSEL_RUNLEVEL }, |
241 { LVL1, MASK1, '1', LSEL_RUNLEVEL | LSEL_NOAUDIT }, |
240 { LVL1, MASK1, '1', LSEL_RUNLEVEL }, |
242 { LVL2, MASK2, '2', LSEL_RUNLEVEL }, |
241 { LVL2, MASK2, '2', LSEL_RUNLEVEL }, |
243 { LVL3, MASK3, '3', LSEL_RUNLEVEL }, |
242 { LVL3, MASK3, '3', LSEL_RUNLEVEL }, |
244 { LVL4, MASK4, '4', LSEL_RUNLEVEL }, |
243 { LVL4, MASK4, '4', LSEL_RUNLEVEL }, |
245 { LVL5, MASK5, '5', LSEL_RUNLEVEL | LSEL_NOAUDIT }, |
244 { LVL5, MASK5, '5', LSEL_RUNLEVEL }, |
246 { LVL6, MASK6, '6', LSEL_RUNLEVEL | LSEL_NOAUDIT }, |
245 { LVL6, MASK6, '6', LSEL_RUNLEVEL }, |
247 { SINGLE_USER, MASKSU, 'S', LSEL_RUNLEVEL | LSEL_NOAUDIT }, |
246 { SINGLE_USER, MASKSU, 'S', LSEL_RUNLEVEL }, |
248 { SINGLE_USER, MASKSU, 's', LSEL_RUNLEVEL | LSEL_NOAUDIT }, |
247 { SINGLE_USER, MASKSU, 's', LSEL_RUNLEVEL }, |
249 { LVLa, MASKa, 'a', 0 }, |
248 { LVLa, MASKa, 'a', 0 }, |
250 { LVLb, MASKb, 'b', 0 }, |
249 { LVLb, MASKb, 'b', 0 }, |
251 { LVLc, MASKc, 'c', 0 } |
250 { LVLc, MASKc, 'c', 0 } |
252 }; |
251 }; |
253 |
252 |
3495 (void) fprintf(stderr, usage_msg); |
3493 (void) fprintf(stderr, usage_msg); |
3496 (void) audit_put_record(ADT_FAILURE, ADT_FAIL_VALUE_BAD_CMD, |
3494 (void) audit_put_record(ADT_FAILURE, ADT_FAIL_VALUE_BAD_CMD, |
3497 argv[1]); |
3495 argv[1]); |
3498 exit(1); |
3496 exit(1); |
3499 } |
3497 } |
3500 |
|
3501 turnoff = LSEL_NOAUDIT & state_to_flags(init_signal); |
|
3502 |
3498 |
3503 if (init_signal == SINGLE_USER) { |
3499 if (init_signal == SINGLE_USER) { |
3504 /* |
3500 /* |
3505 * Make sure this process is talking to a legal tty line |
3501 * Make sure this process is talking to a legal tty line |
3506 * and that /dev/syscon is linked to this line. |
3502 * and that /dev/syscon is linked to this line. |
3553 } |
3549 } |
3554 } |
3550 } |
3555 |
3551 |
3556 update_boot_archive(init_signal); |
3552 update_boot_archive(init_signal); |
3557 |
3553 |
3558 if (audit_put_record(ADT_SUCCESS, ADT_SUCCESS, argv[1]) && |
3554 (void) audit_put_record(ADT_SUCCESS, ADT_SUCCESS, argv[1]); |
3559 turnoff) { |
|
3560 /* turn off audit daemon and try to flush audit queue */ |
|
3561 |
|
3562 if (system("/usr/sbin/audit -t")) { |
|
3563 (void) fprintf(stderr, "%s: can't turn off auditd\n", |
|
3564 argv[0]); |
|
3565 } else { |
|
3566 (void) sleep(5); |
|
3567 } |
|
3568 } |
|
3569 |
3555 |
3570 /* |
3556 /* |
3571 * Signal init; init will take care of telling svc.startd. |
3557 * Signal init; init will take care of telling svc.startd. |
3572 */ |
3558 */ |
3573 if (kill(init_pid, init_signal) == FAILURE) { |
3559 if (kill(init_pid, init_signal) == FAILURE) { |