X-Git-Url: https://git.distorted.org.uk/~mdw/fwd/blobdiff_plain/ee599f5566c155b4decd9c77bfa4d6212f20891e..858a73afbf5018d74920761f7015ac2e7d3987b6:/privconn.c diff --git a/privconn.c b/privconn.c index fcd292b..c2809ff 100644 --- a/privconn.c +++ b/privconn.c @@ -1,61 +1,30 @@ /* -*-c-*- * - * $Id: privconn.c,v 1.1 2003/11/29 20:36:07 mdw Exp $ - * * Making privileged connections * * (c) 2003 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * - * This file is part of the `fw' port forwarder. + * This file is part of the `fwd' port forwarder. * - * `fw' is free software; you can redistribute it and/or modify + * `fwd' is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * - * `fw' is distributed in the hope that it will be useful, + * + * `fwd' is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with `fw'; if not, write to the Free Software Foundation, + * along with `fwd'; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: privconn.c,v $ - * Revision 1.1 2003/11/29 20:36:07 mdw - * Privileged outgoing connections. - * - */ - -/*----- Header files ------------------------------------------------------*/ - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "privconn.h" +#include "fwd.h" /*----- Data structures ---------------------------------------------------*/ @@ -285,7 +254,7 @@ void privconn_split(sel_state *s) pid_t kid; int fd[2]; - if (kidfd != -1) + if (kidfd != -1 || DA_LEN(&cv) == 0) return; if (socketpair(PF_UNIX, SOCK_STREAM, 0, fd) < 0) die(1, "couldn't create privconn socketpair: %s", strerror(errno));