summaryrefslogtreecommitdiff
path: root/sandbox-null.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2011-06-23 19:03:18 +1000
committerDamien Miller <djm@mindrot.org>2011-06-23 19:03:18 +1000
commit80b62e37384b14187b6d9fa5eb3cf6bf04a3cf3a (patch)
tree043737391fc193083c0018f3734be561d01f6748 /sandbox-null.c
parent6d7b4377dd740a215ded149b5ffbc871ba7891f8 (diff)
- (djm) [sandbox-null.c] Dummy sandbox for platforms that don't support
setrlimit(2)
Diffstat (limited to 'sandbox-null.c')
-rw-r--r--sandbox-null.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/sandbox-null.c b/sandbox-null.c
new file mode 100644
index 000000000..eadaee2da
--- /dev/null
+++ b/sandbox-null.c
@@ -0,0 +1,71 @@
1/*
2 * Copyright (c) 2011 Damien Miller <djm@mindrot.org>
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 "includes.h"
18
19#ifdef SANDBOX_NULL
20
21#include <sys/types.h>
22
23#include <errno.h>
24#include <stdarg.h>
25#include <stdio.h>
26#include <stdlib.h>
27#include <string.h>
28#include <unistd.h>
29
30#include "log.h"
31#include "sandbox.h"
32#include "xmalloc.h"
33
34/* dummy sandbox */
35
36struct ssh_sandbox {
37 int junk;
38};
39
40struct ssh_sandbox *
41ssh_sandbox_init(void)
42{
43 struct ssh_sandbox *box;
44
45 /*
46 * Strictly, we don't need to maintain any state here but we need
47 * to return non-NULL to satisfy the API.
48 */
49 box = xcalloc(1, sizeof(*box));
50 return box;
51}
52
53void
54ssh_sandbox_child(struct ssh_sandbox *box)
55{
56 /* Nothing to do here */
57}
58
59void
60ssh_sandbox_parent_finish(struct ssh_sandbox *box)
61{
62 free(box);
63}
64
65void
66ssh_sandbox_parent_preauth(struct ssh_sandbox *box, pid_t child_pid)
67{
68 /* Nothing to do here */
69}
70
71#endif /* SANDBOX_NULL */