• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/Heimdal-398.1.2/appl/kx/

Lines Matching refs:sock

106  * Prepare to receive a connection on `sock'.
110 recv_conn (int sock, kx_context *kc,
132 if (getsockname (sock, kc->thisaddr, &addrlen) < 0) {
139 if (getpeername (sock, kc->thataddr, &addrlen) < 0) {
150 if (net_read (sock, msg, 4) != 4) {
156 if (ret && recv_v5_auth (kc, sock, msg) == 0)
165 len = kx_read (kc, sock, msg, sizeof(msg));
172 fatal(kc, sock, "Bad message");
175 fatal(kc, sock, "user");
179 fatal(kc, sock, "user name too long");
181 fatal(kc, sock, "user too long");
188 fatal (kc, sock, "cannot find uid for %s", user);
191 fatal (kc, sock, "%s not allowed to login as %s",
195 fatal(kc, sock, "user too long");
205 fatal (kc, sock, "Cannot create X socket(s): %s",
213 fatal (kc, sock, "Cannot chown sockets: %s",
220 fatal (kc, sock, "fork: %s", strerror(errno));
237 fatal (kc, sock, "cannot set uid");
244 fatal (kc, sock, "getnameinfo failed: %s", gai_strerror(ret));
253 fatal(kc, sock, "display too large");
255 fatal(kc, sock, "user too long");
268 setsockopt (sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one,
280 passive_session (kx_context *kc, int fd, int sock, int cookiesp)
282 if (verify_and_remove_cookies (fd, sock, cookiesp))
285 return copy_encrypted (kc, fd, sock);
293 active_session (kx_context *kc, int fd, int sock, int cookiesp)
297 if (replace_cookie (fd, sock, xauthfile, cookiesp))
300 return copy_encrypted (kc, fd, sock);
311 int sock, sock2, port;
319 sock = socket (kc->thisaddr->sa_family, SOCK_STREAM, 0);
320 if (sock < 0) {
327 setsockopt (sock, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one));
334 setsockopt (sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&one,
344 if (bind (sock, addr, kc->thisaddr_len) < 0) {
349 if (getsockname (sock, addr, &addrlen) < 0) {
353 if (listen (sock, SOMAXCONN) < 0) {
369 sock2 = accept (sock, thisaddr, &addrlen);
374 close (sock);
442 * Handle a passive session on `sock'
447 int sock,
469 fatal (kc, sock, "Cookie-creation failed: %s", strerror(error));
506 if(kx_write (kc, sock, msg, p - msg) < 0) {
520 if (sock >= FD_SETSIZE) {
526 FD_SET(sock, &fds);
538 if(FD_ISSET(sock, &fds)){
620 return doit_conn (kc, fd, sock, flags, cookiesp);
628 * Handle an active session on `sock'
633 int sock,
639 check_user_console (kc, sock);
644 if(kx_write (kc, sock, msg, p - msg) < 0) {
652 len = kx_read (kc, sock, msg, sizeof(msg));
669 return doit_conn (kc, sock, sock, flags, 1);
676 * Receive a connection on `sock' and process it.
680 doit(int sock, int tcp_flag)
689 flags = recv_conn (sock, &context, &dispnr, &nsockets, &sockets, tcp_flag);
692 ret = doit_passive (&context, sock, flags, dispnr,
695 ret = doit_active (&context, sock, flags, tcp_flag);