option.c (d0fa49b78d1f40d84ec76c363cdc38cf128511dd) option.c (406d62731eff92f06723c04de94992d94a293145)
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 unchanged lines hidden (view full) ---

18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
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 unchanged lines hidden (view full) ---

18 *
19 * CDDL HEADER END
20 */
21/*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26
27/*
28 * Command line option processing for auditreduce.
29 * The entry point is process_options(), which is called by main().
30 * Process_options() is the only function visible outside this module.
31 */
32
33#include <locale.h>
34#include <sys/zone.h> /* for max zonename length */

--- 180 unchanged lines hidden (view full) ---

215 error = TRUE;
216 break;
217 case 't': /* termial ID reserved for later */
218 default:
219 return (-1);
220 }
221 if (error) {
222 (void) fprintf(stderr,
26/*
27 * Command line option processing for auditreduce.
28 * The entry point is process_options(), which is called by main().
29 * Process_options() is the only function visible outside this module.
30 */
31
32#include <locale.h>
33#include <sys/zone.h> /* for max zonename length */

--- 180 unchanged lines hidden (view full) ---

214 error = TRUE;
215 break;
216 case 't': /* termial ID reserved for later */
217 default:
218 return (-1);
219 }
220 if (error) {
221 (void) fprintf(stderr,
223 gettext("%s command line error - %s.\n"),
224 ar, error_str);
222 gettext("%s command line error - %s.\n"),
223 ar, error_str);
225 return (-1);
226 }
227 }
228 /* catch '-' option for stdin processing - getopt() won't see it */
229 if (optind < argc) {
230 if (argv[optind][0] == '-' && argv[optind][1] == '\0') {
231 optind++;
232 f_stdin = TRUE;

--- 15 unchanged lines hidden (view full) ---

248 */
249 if ((f_machine || f_server || f_root) && (argc != optind)) {
250 error_str = gettext(
251 "no filenames allowed with 'M' or 'S' or 'R' options");
252 error_combo = TRUE;
253 }
254 if (m_after >= m_before) {
255 error_str =
224 return (-1);
225 }
226 }
227 /* catch '-' option for stdin processing - getopt() won't see it */
228 if (optind < argc) {
229 if (argv[optind][0] == '-' && argv[optind][1] == '\0') {
230 optind++;
231 f_stdin = TRUE;

--- 15 unchanged lines hidden (view full) ---

247 */
248 if ((f_machine || f_server || f_root) && (argc != optind)) {
249 error_str = gettext(
250 "no filenames allowed with 'M' or 'S' or 'R' options");
251 error_combo = TRUE;
252 }
253 if (m_after >= m_before) {
254 error_str =
256 gettext("'a' parameter must be before 'b' parameter");
255 gettext("'a' parameter must be before 'b' parameter");
257 error_combo = TRUE;
258 }
259 if (f_delete &&
260 (!f_complete || !f_all || !f_outfile)) {
261 error_str = gettext(
262 "'C', 'A', and 'O' must be specified with 'D'");
263 error_combo = TRUE;
264 }

--- 100 unchanged lines hidden (view full) ---

365 obj_val);
366 error_str = errbuf;
367 return (-1);
368 }
369 }
370
371 if (he->h_addrtype == AF_INET6) {
372 /* LINTED */
256 error_combo = TRUE;
257 }
258 if (f_delete &&
259 (!f_complete || !f_all || !f_outfile)) {
260 error_str = gettext(
261 "'C', 'A', and 'O' must be specified with 'D'");
262 error_combo = TRUE;
263 }

--- 100 unchanged lines hidden (view full) ---

364 obj_val);
365 error_str = errbuf;
366 return (-1);
367 }
368 }
369
370 if (he->h_addrtype == AF_INET6) {
371 /* LINTED */
373 if (IN6_IS_ADDR_V4MAPPED((in6_addr_t *)
374 he->h_addr_list[0])) {
372 if (IN6_IS_ADDR_V4MAPPED(
373 (in6_addr_t *)he->h_addr_list[0])) {
375 /* address is IPv4 (32 bits) */
376 (void) memcpy(&obj_id, he->h_addr_list[0], 4);
377 ip_type = AU_IPv4;
378 } else {
379 (void) memcpy(ip_ipv6, he->h_addr_list[0], 16);
380 ip_type = AU_IPv6;
381 }
382 } else {

--- 744 unchanged lines hidden (view full) ---

1127proc_pcb(audit_pcb_t *pcb, char *suffix, int i)
1128{
1129 if (suffix)
1130 pcb->pcb_suffix = suffix;
1131 pcbnum++; /* one more pcb in use */
1132 pcb->pcb_size = AUDITBUFSIZE;
1133 pcb->pcb_rec = (char *)a_calloc(1, AUDITBUFSIZE);
1134 pcb->pcb_time = -1;
374 /* address is IPv4 (32 bits) */
375 (void) memcpy(&obj_id, he->h_addr_list[0], 4);
376 ip_type = AU_IPv4;
377 } else {
378 (void) memcpy(ip_ipv6, he->h_addr_list[0], 16);
379 ip_type = AU_IPv6;
380 }
381 } else {

--- 744 unchanged lines hidden (view full) ---

1126proc_pcb(audit_pcb_t *pcb, char *suffix, int i)
1127{
1128 if (suffix)
1129 pcb->pcb_suffix = suffix;
1130 pcbnum++; /* one more pcb in use */
1131 pcb->pcb_size = AUDITBUFSIZE;
1132 pcb->pcb_rec = (char *)a_calloc(1, AUDITBUFSIZE);
1133 pcb->pcb_time = -1;
1135 pcb->pcb_flags |= PF_FILE; /* note this one controls files */
1134 pcb->pcb_flags |= PF_USEFILE; /* note this one controls files */
1136 pcb->pcb_procno = i; /* save index into audit_pcbs [] for id */
1137}
1138
1139
1140/*
1141 * .func proc_label - process label range argument.
1142 * .desc Parse label range lower-bound[;upper-bound]
1143 * .call ret = proc_label(optstr).

--- 161 unchanged lines hidden ---
1135 pcb->pcb_procno = i; /* save index into audit_pcbs [] for id */
1136}
1137
1138
1139/*
1140 * .func proc_label - process label range argument.
1141 * .desc Parse label range lower-bound[;upper-bound]
1142 * .call ret = proc_label(optstr).

--- 161 unchanged lines hidden ---