sandbox-null.c 1.6 KB

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