102 event_id = ADT_uadmin_reboot;
103 break;
104 case A_DUMP:
105 event_id = ADT_uadmin_dump;
106 break;
107 case A_REMOUNT:
108 event_id = ADT_uadmin_remount;
109 break;
110 case A_FREEZE:
111 event_id = ADT_uadmin_freeze;
112 break;
113 case A_FTRACE:
114 event_id = ADT_uadmin_ftrace;
115 break;
116 case A_CONFIG:
117 event_id = ADT_uadmin_config;
118 break;
119 case A_SWAPCTL:
120 event_id = ADT_uadmin_swapctl;
121 break;
122 default:
123 event_id = 0;
124 }
125 if ((event_id != 0) &&
126 (event = adt_alloc_event(ah, event_id)) == NULL) {
127 (void) fprintf(stderr, "%s: can't allocate audit event\n",
128 argv[0]);
129 }
130 switch (fcn) {
131 case AD_HALT:
132 fcn_id = ADT_UADMIN_FCN_AD_HALT;
133 break;
134 case AD_POWEROFF:
135 fcn_id = ADT_UADMIN_FCN_AD_POWEROFF;
136 break;
137 case AD_BOOT:
138 fcn_id = ADT_UADMIN_FCN_AD_BOOT;
139 break;
140 case AD_IBOOT:
141 fcn_id = ADT_UADMIN_FCN_AD_IBOOT;
235 event->adt_uadmin_dump.mdep = (char *)mdep;
236 break;
237 case A_REMOUNT:
238 /* no parameters */
239 break;
240 case A_FREEZE:
241 event->adt_uadmin_freeze.fcn = fcn_id;
242 event->adt_uadmin_freeze.mdep = (char *)mdep;
243 break;
244 case A_FTRACE:
245 event->adt_uadmin_ftrace.fcn = fcn_id;
246 event->adt_uadmin_ftrace.mdep = (char *)mdep;
247 break;
248 case A_CONFIG:
249 event->adt_uadmin_config.fcn = fcn_id;
250 event->adt_uadmin_config.mdep = (char *)mdep;
251 break;
252 case A_SWAPCTL:
253 event->adt_uadmin_swapctl.fcn = fcn_id;
254 break;
255 }
256
257 if (adt_put_event(event, ADT_SUCCESS, 0) != 0) {
258 (void) fprintf(stderr,
259 "%s: can't put audit event\n", argv[0]);
260 }
261 /*
262 * allow audit record to be processed in the kernel
263 * audit queue
264 */
265 wait_for_auqueue();
266 }
267
268 if (closeout_audit(cmd, fcn) == -1)
269 (void) fprintf(stderr, "%s: can't turn off auditd\n",
270 argv[0]);
271
272 if (cmd == A_SHUTDOWN || cmd == A_REBOOT)
273 (void) creat(SMF_RST, 0777);
274 }
|
102 event_id = ADT_uadmin_reboot;
103 break;
104 case A_DUMP:
105 event_id = ADT_uadmin_dump;
106 break;
107 case A_REMOUNT:
108 event_id = ADT_uadmin_remount;
109 break;
110 case A_FREEZE:
111 event_id = ADT_uadmin_freeze;
112 break;
113 case A_FTRACE:
114 event_id = ADT_uadmin_ftrace;
115 break;
116 case A_CONFIG:
117 event_id = ADT_uadmin_config;
118 break;
119 case A_SWAPCTL:
120 event_id = ADT_uadmin_swapctl;
121 break;
122 case A_INTRD:
123 event_id = ADT_uadmin_intrd;
124 break;
125 default:
126 event_id = 0;
127 }
128 if ((event_id != 0) &&
129 (event = adt_alloc_event(ah, event_id)) == NULL) {
130 (void) fprintf(stderr, "%s: can't allocate audit event\n",
131 argv[0]);
132 }
133 switch (fcn) {
134 case AD_HALT:
135 fcn_id = ADT_UADMIN_FCN_AD_HALT;
136 break;
137 case AD_POWEROFF:
138 fcn_id = ADT_UADMIN_FCN_AD_POWEROFF;
139 break;
140 case AD_BOOT:
141 fcn_id = ADT_UADMIN_FCN_AD_BOOT;
142 break;
143 case AD_IBOOT:
144 fcn_id = ADT_UADMIN_FCN_AD_IBOOT;
238 event->adt_uadmin_dump.mdep = (char *)mdep;
239 break;
240 case A_REMOUNT:
241 /* no parameters */
242 break;
243 case A_FREEZE:
244 event->adt_uadmin_freeze.fcn = fcn_id;
245 event->adt_uadmin_freeze.mdep = (char *)mdep;
246 break;
247 case A_FTRACE:
248 event->adt_uadmin_ftrace.fcn = fcn_id;
249 event->adt_uadmin_ftrace.mdep = (char *)mdep;
250 break;
251 case A_CONFIG:
252 event->adt_uadmin_config.fcn = fcn_id;
253 event->adt_uadmin_config.mdep = (char *)mdep;
254 break;
255 case A_SWAPCTL:
256 event->adt_uadmin_swapctl.fcn = fcn_id;
257 break;
258 case A_INTRD:
259 event->adt_uadmin_intrd.fcn = fcn_id;
260 break;
261 }
262
263 if (adt_put_event(event, ADT_SUCCESS, 0) != 0) {
264 (void) fprintf(stderr,
265 "%s: can't put audit event\n", argv[0]);
266 }
267 /*
268 * allow audit record to be processed in the kernel
269 * audit queue
270 */
271 wait_for_auqueue();
272 }
273
274 if (closeout_audit(cmd, fcn) == -1)
275 (void) fprintf(stderr, "%s: can't turn off auditd\n",
276 argv[0]);
277
278 if (cmd == A_SHUTDOWN || cmd == A_REBOOT)
279 (void) creat(SMF_RST, 0777);
280 }
|