inetd.c (2b532af82919b9141e7fd04becf354a0a7dfa813) inetd.c (63eca8f1dd7adca4324e0cc05fa66fe441507bd7)
1/*
2 * Copyright (c) 1983, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 322 unchanged lines hidden (view full) ---

331 struct group *grp;
332 struct sigaction sa, saalrm, sachld, sahup, sapipe;
333 int ch, dofork;
334 pid_t pid;
335 char buf[50];
336#ifdef LOGIN_CAP
337 login_cap_t *lc = NULL;
338#endif
1/*
2 * Copyright (c) 1983, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 322 unchanged lines hidden (view full) ---

331 struct group *grp;
332 struct sigaction sa, saalrm, sachld, sahup, sapipe;
333 int ch, dofork;
334 pid_t pid;
335 char buf[50];
336#ifdef LOGIN_CAP
337 login_cap_t *lc = NULL;
338#endif
339#ifdef LIBWRAP
339 struct request_info req;
340 int denied;
341 char *service = NULL;
340 struct request_info req;
341 int denied;
342 char *service = NULL;
343#endif
342 struct sockaddr_storage peer;
343 int i;
344 struct addrinfo hints, *res;
345 const char *servname;
346 int error;
347 struct conninfo *conn;
348
349 openlog("inetd", LOG_PID | LOG_NOWAIT | LOG_PERROR, LOG_DAEMON);

--- 393 unchanged lines hidden (view full) ---

743 if (sep->se_bi &&
744 sep->se_bi->bi_fn == (bi_fn_t *) tcpmux) {
745 sep = tcpmux(ctrl);
746 if (sep == NULL) {
747 close(ctrl);
748 _exit(0);
749 }
750 }
344 struct sockaddr_storage peer;
345 int i;
346 struct addrinfo hints, *res;
347 const char *servname;
348 int error;
349 struct conninfo *conn;
350
351 openlog("inetd", LOG_PID | LOG_NOWAIT | LOG_PERROR, LOG_DAEMON);

--- 393 unchanged lines hidden (view full) ---

745 if (sep->se_bi &&
746 sep->se_bi->bi_fn == (bi_fn_t *) tcpmux) {
747 sep = tcpmux(ctrl);
748 if (sep == NULL) {
749 close(ctrl);
750 _exit(0);
751 }
752 }
753#ifdef LIBWRAP
751 if (ISWRAP(sep)) {
752 inetd_setproctitle("wrapping", ctrl);
753 service = sep->se_server_name ?
754 sep->se_server_name : sep->se_service;
755 request_init(&req, RQ_DAEMON, service, RQ_FILE, ctrl, 0);
756 fromhost(&req);
757 deny_severity = LIBWRAP_DENY_FACILITY|LIBWRAP_DENY_SEVERITY;
758 allow_severity = LIBWRAP_ALLOW_FACILITY|LIBWRAP_ALLOW_SEVERITY;

--- 12 unchanged lines hidden (view full) ---

771 }
772 if (dolog) {
773 syslog(allow_severity,
774 "connection from %.500s, service %s (%s%s)",
775 eval_client(&req), service, sep->se_proto,
776 (whichaf(&req) == AF_INET6) ? "6" : "");
777 }
778 }
754 if (ISWRAP(sep)) {
755 inetd_setproctitle("wrapping", ctrl);
756 service = sep->se_server_name ?
757 sep->se_server_name : sep->se_service;
758 request_init(&req, RQ_DAEMON, service, RQ_FILE, ctrl, 0);
759 fromhost(&req);
760 deny_severity = LIBWRAP_DENY_FACILITY|LIBWRAP_DENY_SEVERITY;
761 allow_severity = LIBWRAP_ALLOW_FACILITY|LIBWRAP_ALLOW_SEVERITY;

--- 12 unchanged lines hidden (view full) ---

774 }
775 if (dolog) {
776 syslog(allow_severity,
777 "connection from %.500s, service %s (%s%s)",
778 eval_client(&req), service, sep->se_proto,
779 (whichaf(&req) == AF_INET6) ? "6" : "");
780 }
781 }
782#endif
779 if (sep->se_bi) {
780 (*sep->se_bi->bi_fn)(ctrl, sep);
781 } else {
782 if (debug)
783 warnx("%d execl %s",
784 getpid(), sep->se_server);
785 /* Clear close-on-exec. */
786 if (fcntl(ctrl, F_SETFD, 0) < 0) {

--- 1787 unchanged lines hidden ---
783 if (sep->se_bi) {
784 (*sep->se_bi->bi_fn)(ctrl, sep);
785 } else {
786 if (debug)
787 warnx("%d execl %s",
788 getpid(), sep->se_server);
789 /* Clear close-on-exec. */
790 if (fcntl(ctrl, F_SETFD, 0) < 0) {

--- 1787 unchanged lines hidden ---