Home | History | Annotate | Download | only in openssh

Lines Matching defs:box

80 	struct ssh_sandbox *box;
84 box = xcalloc(1, sizeof(*box));
87 box->child_sock = s[0];
88 box->parent_sock = s[1];
89 box->systrace_fd = -1;
90 box->child_pid = 0;
92 return box;
96 ssh_sandbox_child(struct ssh_sandbox *box)
100 close(box->parent_sock);
103 if (atomicio(vwrite, box->child_sock, &whatever, 1) != 1)
106 if (atomicio(read, box->child_sock, &whatever, 1) != 1)
109 close(box->child_sock);
113 ssh_sandbox_parent(struct ssh_sandbox *box, pid_t child_pid,
121 box->child_pid = child_pid;
122 close(box->child_sock);
124 if (atomicio(read, box->parent_sock, &whatever, 1) != 1)
132 if (ioctl(dev_systrace, STRIOCCLONE, &box->systrace_fd) == -1)
136 debug3("%s: systrace attach, fd=%d", __func__, box->systrace_fd);
137 if (ioctl(box->systrace_fd, STRIOCATTACH, &child_pid) == -1)
139 box->systrace_fd, child_pid, strerror(errno));
145 if (ioctl(box->systrace_fd, STRIOCPOLICY, &policy) == -1)
147 box->systrace_fd, strerror(errno));
150 policy.strp_pid = box->child_pid;
151 if (ioctl(box->systrace_fd, STRIOCPOLICY, &policy) == -1)
153 __func__, box->systrace_fd, strerror(errno));
170 if (ioctl(box->systrace_fd, STRIOCPOLICY, &policy) == -1)
172 __func__, box->systrace_fd, strerror(errno));
177 if (atomicio(vwrite, box->parent_sock, &whatever, 1) != 1)
179 close(box->parent_sock);
183 ssh_sandbox_parent_finish(struct ssh_sandbox *box)
186 close(box->systrace_fd);
188 free(box);
193 ssh_sandbox_parent_preauth(struct ssh_sandbox *box, pid_t child_pid)
195 ssh_sandbox_parent(box, child_pid, preauth_policy);