Annotation of embedaddon/sudo/src/sudo_noexec.c, revision 1.1.1.1
1.1 misho 1: /*
2: * Copyright (c) 2004-2005, 2010-2011 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: #include <config.h>
18:
19: #include <sys/types.h>
20:
21: #include <errno.h>
22: #ifndef HAVE_TIMESPEC
23: # include <time.h>
24: #endif
25: #include <stdarg.h>
26:
27: #include "missing.h"
28:
29: /*
30: * Dummy versions of the execve() family of syscalls. We don't need
31: * to stub out all of them, just the ones that correspond to actual
32: * system calls (which varies by OS). Note that it is still possible
33: * to access the real syscalls via the syscall() interface but very
34: * few programs actually do that.
35: */
36:
37: #define DUMMY_BODY \
38: { \
39: errno = EACCES; \
40: return -1; \
41: }
42:
43: #define DUMMY2(fn, t1, t2) \
44: int \
45: fn(t1 a1, t2 a2) \
46: DUMMY_BODY
47:
48: #define DUMMY3(fn, t1, t2, t3) \
49: int \
50: fn(t1 a1, t2 a2, t3 a3) \
51: DUMMY_BODY
52:
53: #define DUMMY_VA(fn, t1, t2) \
54: int \
55: fn(t1 a1, t2 a2, ...) \
56: DUMMY_BODY
57:
58: DUMMY_VA(execl, const char *, const char *)
59: DUMMY_VA(_execl, const char *, const char *)
60: DUMMY_VA(__execl, const char *, const char *)
61: DUMMY_VA(execle, const char *, const char *)
62: DUMMY_VA(_execle, const char *, const char *)
63: DUMMY_VA(__execle, const char *, const char *)
64: DUMMY_VA(execlp, const char *, const char *)
65: DUMMY_VA(_execlp, const char *, const char *)
66: DUMMY_VA(__execlp, const char *, const char *)
67: DUMMY2(execv, const char *, char * const *)
68: DUMMY2(_execv, const char *, char * const *)
69: DUMMY2(__execv, const char *, char * const *)
70: DUMMY2(execvp, const char *, char * const *)
71: DUMMY2(_execvp, const char *, char * const *)
72: DUMMY2(__execvp, const char *, char * const *)
73: DUMMY3(execvP, const char *, const char *, char * const *)
74: DUMMY3(_execvP, const char *, const char *, char * const *)
75: DUMMY3(__execvP, const char *, const char *, char * const *)
76: DUMMY3(execve, const char *, char * const *, char * const *)
77: DUMMY3(_execve, const char *, char * const *, char * const *)
78: DUMMY3(__execve, const char *, char * const *, char * const *)
79: DUMMY3(fexecve, int , char * const *, char * const *)
80: DUMMY3(_fexecve, int , char * const *, char * const *)
81: DUMMY3(__fexecve, int , char * const *, char * const *)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>