xref: /dflybsd-src/crypto/openssh/sandbox-null.c (revision ba1276acd1c8c22d225b1bcf370a14c878644f44)
1*ba1276acSMatthew Dillon /* $OpenBSD$ */
2*ba1276acSMatthew Dillon /*
3*ba1276acSMatthew Dillon  * Copyright (c) 2011 Damien Miller <djm@mindrot.org>
4*ba1276acSMatthew Dillon  *
5*ba1276acSMatthew Dillon  * Permission to use, copy, modify, and distribute this software for any
6*ba1276acSMatthew Dillon  * purpose with or without fee is hereby granted, provided that the above
7*ba1276acSMatthew Dillon  * copyright notice and this permission notice appear in all copies.
8*ba1276acSMatthew Dillon  *
9*ba1276acSMatthew Dillon  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10*ba1276acSMatthew Dillon  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11*ba1276acSMatthew Dillon  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12*ba1276acSMatthew Dillon  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13*ba1276acSMatthew Dillon  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14*ba1276acSMatthew Dillon  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15*ba1276acSMatthew Dillon  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16*ba1276acSMatthew Dillon  */
17*ba1276acSMatthew Dillon 
18*ba1276acSMatthew Dillon #include "includes.h"
19*ba1276acSMatthew Dillon 
20*ba1276acSMatthew Dillon #ifdef SANDBOX_NULL
21*ba1276acSMatthew Dillon 
22*ba1276acSMatthew Dillon #include <sys/types.h>
23*ba1276acSMatthew Dillon 
24*ba1276acSMatthew Dillon #include <errno.h>
25*ba1276acSMatthew Dillon #include <stdarg.h>
26*ba1276acSMatthew Dillon #include <stdio.h>
27*ba1276acSMatthew Dillon #include <stdlib.h>
28*ba1276acSMatthew Dillon #include <string.h>
29*ba1276acSMatthew Dillon #include <unistd.h>
30*ba1276acSMatthew Dillon 
31*ba1276acSMatthew Dillon #include "log.h"
32*ba1276acSMatthew Dillon #include "ssh-sandbox.h"
33*ba1276acSMatthew Dillon #include "xmalloc.h"
34*ba1276acSMatthew Dillon 
35*ba1276acSMatthew Dillon /* dummy sandbox */
36*ba1276acSMatthew Dillon 
37*ba1276acSMatthew Dillon struct ssh_sandbox {
38*ba1276acSMatthew Dillon 	int junk;
39*ba1276acSMatthew Dillon };
40*ba1276acSMatthew Dillon 
41*ba1276acSMatthew Dillon struct ssh_sandbox *
ssh_sandbox_init(struct monitor * monitor)42*ba1276acSMatthew Dillon ssh_sandbox_init(struct monitor *monitor)
43*ba1276acSMatthew Dillon {
44*ba1276acSMatthew Dillon 	struct ssh_sandbox *box;
45*ba1276acSMatthew Dillon 
46*ba1276acSMatthew Dillon 	/*
47*ba1276acSMatthew Dillon 	 * Strictly, we don't need to maintain any state here but we need
48*ba1276acSMatthew Dillon 	 * to return non-NULL to satisfy the API.
49*ba1276acSMatthew Dillon 	 */
50*ba1276acSMatthew Dillon 	box = xcalloc(1, sizeof(*box));
51*ba1276acSMatthew Dillon 	return box;
52*ba1276acSMatthew Dillon }
53*ba1276acSMatthew Dillon 
54*ba1276acSMatthew Dillon void
ssh_sandbox_child(struct ssh_sandbox * box)55*ba1276acSMatthew Dillon ssh_sandbox_child(struct ssh_sandbox *box)
56*ba1276acSMatthew Dillon {
57*ba1276acSMatthew Dillon 	/* Nothing to do here */
58*ba1276acSMatthew Dillon }
59*ba1276acSMatthew Dillon 
60*ba1276acSMatthew Dillon void
ssh_sandbox_parent_finish(struct ssh_sandbox * box)61*ba1276acSMatthew Dillon ssh_sandbox_parent_finish(struct ssh_sandbox *box)
62*ba1276acSMatthew Dillon {
63*ba1276acSMatthew Dillon 	free(box);
64*ba1276acSMatthew Dillon }
65*ba1276acSMatthew Dillon 
66*ba1276acSMatthew Dillon void
ssh_sandbox_parent_preauth(struct ssh_sandbox * box,pid_t child_pid)67*ba1276acSMatthew Dillon ssh_sandbox_parent_preauth(struct ssh_sandbox *box, pid_t child_pid)
68*ba1276acSMatthew Dillon {
69*ba1276acSMatthew Dillon 	/* Nothing to do here */
70*ba1276acSMatthew Dillon }
71*ba1276acSMatthew Dillon 
72*ba1276acSMatthew Dillon #endif /* SANDBOX_NULL */
73