Annotation of embedaddon/sudo/plugins/sudoers/iolog.h, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (c) 2013 Todd C. Miller <Todd.Miller@courtesan.com>
3: *
4: * Permission to use, copy, modify, and distribute this software for any
5: * purpose with or without fee is hereby granted, provided that the above
6: * copyright notice and this permission notice appear in all copies.
7: *
8: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15: */
16:
17: #ifndef _SUDOERS_IOLOG_H
18: #define _SUDOERS_IOLOG_H
19:
20: /*
21: * I/O log fd numbers as stored in the timing file.
22: * Changing these will result in incompatible I/O log files!
23: */
24: #define IOFD_STDIN 0
25: #define IOFD_STDOUT 1
26: #define IOFD_STDERR 2
27: #define IOFD_TTYIN 3
28: #define IOFD_TTYOUT 4
29: #define IOFD_TIMING 5
30: #define IOFD_MAX 6
31:
32: /* Default maximum session ID */
33: #define SESSID_MAX 2176782336U
34:
35: union io_fd {
36: FILE *f;
37: #ifdef HAVE_ZLIB_H
38: gzFile g;
39: #endif
40: void *v;
41: };
42:
43: struct io_log_file {
44: bool enabled;
45: const char *suffix;
46: union io_fd fd;
47: };
48:
49: static struct io_log_file io_log_files[] = {
50: { false, "/stdin" }, /* IOFD_STDIN */
51: { false, "/stdout" }, /* IOFD_STDOUT */
52: { false, "/stderr" }, /* IOFD_STDERR */
53: { false, "/ttyin" }, /* IOFD_TTYIN */
54: { false, "/ttyout" }, /* IOFD_TTYOUT */
55: { true, "/timing" }, /* IOFD_TIMING */
56: { false, NULL } /* IOFD_MAX */
57: };
58:
59: #endif /* _SUDOERS_IOLOG_H */
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>