From patchwork Tue Sep 24 08:26:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "plaisthos (Code Review)" X-Patchwork-Id: 3864 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:10cd:b0:5b9:581e:f939 with SMTP id j13csp2613160mae; Tue, 24 Sep 2024 01:27:07 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVhcJNpYASWbkV8QhBiPB4F3kxFpDI+EG6pcROfKIhAz2Y3ZRNLmhKBaWezfYkab7mHCyd7pg7LJKs=@openvpn.net X-Google-Smtp-Source: AGHT+IFtA/+q1JD6O86pYCrULGXqIR9FB5H96R+zoiGq0iyx2iY1WpJkNEV8pv/NLYPYW4YFKtQu X-Received: by 2002:a05:6e02:13a5:b0:3a0:a1d7:791d with SMTP id e9e14a558f8ab-3a0c8d679b0mr122758955ab.25.1727166427755; Tue, 24 Sep 2024 01:27:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727166427; cv=none; d=google.com; s=arc-20240605; b=cO6l/ra2f2YeMPFRTboUDS9H+aoi/O3ajk49cj80urlHIaPW3ROmlWB2dlMiOAUhn6 8YjcnVPANiJhljWmu7i+Padu+hper35K5LhvggznjDSF1ROqiryd9EDxpG+xnyA8wja7 nsiEl52rJHjE3pDSp0v8WGBQRzCaULkv8xr8Tm/+x9k4KG/1HFhTtmEx4Zb51UgpQ9OZ OAAJI38mI9KuVBF5BZNpJOh2HnuB0ZoAv13quy0OSx0Xw9lWAIF/R3sOVvD9YtmLbech 2SwLxyeHuxLeM45OB8DSxFJND7VqrGFlMp7hy8luwf+vfvBjheN3ARXsP+LMcN+MhyJh qbog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:cc:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:user-agent :mime-version:message-id:references:auto-submitted:to:date:from :dkim-signature:dkim-signature:dkim-signature; bh=yPdacG1H1PXD+enpcCQKhgzvABatoVhaBSt+qrm9v/c=; fh=lm0MLPW7DntlrDqRECIiC9JlE1uPxhepE0URYHIf+eE=; b=M+cqJPLatWjbJa1SqVll8zgTA0RwF+VN+Nx+HA9jcc78xBDzYWZTEEG++L1RqIXsA8 mGr/7Z5RoBdIG3zA8QWHfVHKWKy11L07/a/dCef15v0H4u8T7z5iQa1BMXIDRiDe5WA/ 3mr+oVLwZikRFx1SzUHbxGj7ngT6Oj6VMg72dcejtGi1TZAESVLj/fDvEZvqm1d2saQ3 zCHBE3C7lIv/KSYKh8q07vH3wd/iiM+SUf36Wpwd13A9G/fGoNf4Cpk/Kvn/HxgfMztG X3VhmDXoYeLy5u7VKu7BB1aiwO6zvbOXwbQ4UaUrsApuSGE+c8Bt6JVERwPVRcLK2u1l XIRw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=kBmpB2m+; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kca9W9Jz; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NxcAQmMz; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id e9e14a558f8ab-3a1a56c261asi4103365ab.4.2024.09.24.01.27.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Sep 2024 01:27:07 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=kBmpB2m+; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=kca9W9Jz; dkim=neutral (body hash did not verify) header.i=@openvpn.net header.s=google header.b=NxcAQmMz; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvpn.net; dara=fail header.i=@openvpn.net Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1st0sr-0005Ar-Os; Tue, 24 Sep 2024 08:26:58 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1st0sn-00059i-11 for openvpn-devel@lists.sourceforge.net; Tue, 24 Sep 2024 08:26:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Content-Transfer-Encoding:MIME-Version :Message-ID:Reply-To:References:Subject:List-Unsubscribe:List-Id:Cc:To:Date: From:Sender:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help: List-Subscribe:List-Post:List-Owner:List-Archive; bh=d8Vbzyyy80dmX3Nwxb/tTbNv5eFXYOXosLVc2+/Qdwo=; b=kBmpB2m+Co3LJg70KrqucM/4ue KLBAK2TQy6TOMmqQUua7hhzRr2GHg0Ey/aFTBe54VAIjYFIo6r+74FOi/GN/GQ+J4yM1Zwqh6a370 qY2SV1tbPQ3rROv0MTs/XBIG3OYLsa4o+NV7q/wFDw5MDL7+gB/nGiFgdDQQiC6YYDb0=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Content-Transfer-Encoding:MIME-Version:Message-ID:Reply-To: References:Subject:List-Unsubscribe:List-Id:Cc:To:Date:From:Sender:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:List-Help:List-Subscribe:List-Post: List-Owner:List-Archive; bh=d8Vbzyyy80dmX3Nwxb/tTbNv5eFXYOXosLVc2+/Qdwo=; b=k ca9W9JzybfFx60GyFENhOO0PmvqlcfkCTO5HeAD3EkqHEfuYbhpb04BXW/Y7zev4VpaZfYVVMJD7C VWu9GgBw170MHHzUR7r3UdgiwaRN7UZ3Qpv+fAnhgK8Q7anJXTBOXgWVsCDzVJknJH817ZDvIpGjn 6Bl9/pudvEvJ2CgU=; Received: from mail-wm1-f47.google.com ([209.85.128.47]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1st0sm-0000h5-Vv for openvpn-devel@lists.sourceforge.net; Tue, 24 Sep 2024 08:26:53 +0000 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-42cb806623eso44726185e9.2 for ; Tue, 24 Sep 2024 01:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvpn.net; s=google; t=1727166401; x=1727771201; darn=lists.sourceforge.net; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from:from:to:cc :subject:date:message-id:reply-to; bh=d8Vbzyyy80dmX3Nwxb/tTbNv5eFXYOXosLVc2+/Qdwo=; b=NxcAQmMzewfZRxvrrT2Coz/vQj9FufnQummhzBUmpQF7Vk/JhZb9a7amROywVau5+w nIBMb0j2e0ouNBOjMRpt5APa9XTc0Sy/FAum1GPvE2tvp661KxhZ3Yw8HQoAarluSYn7 p8RPNaN+lm/aCgrnJCXCFU9LAMx7E6eNuqu0bgnXL16eLrgSITHC9gz0dyE1oO7Y01fC p3bMVXyfqhI2m9WoOJSJNGNsqCMEsSpDwN7zRoiZo4iLfcxgcBs/WN7lcN8iPtwGc2JK T0CdPzuNeWldXrAqbSUdJbEvGVWkyxHRHKH0/KgK30Qvs9kbsLJd2JQjTRuxyt/oBwvD Rwxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727166401; x=1727771201; h=user-agent:content-disposition:content-transfer-encoding :mime-version:message-id:reply-to:references:subject :list-unsubscribe:list-id:auto-submitted:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=d8Vbzyyy80dmX3Nwxb/tTbNv5eFXYOXosLVc2+/Qdwo=; b=QoOn+l/8lDvpsvubeHXq1crh1STSxn6ffrg7NPQuQA/fXcVGq55sgby3I9M3F0Px8c eH6RUuTK1QypCflW/p3N9nyO79YHmDkNc0rPbHn0g+ADqMWnxI5WtKzjVsliPAYy/eTN eZWSvn52/NVq+JpRIbVjB3QN2+6P2Q7r93EdQvPMAj/ccDx8rg9uVYjDxYAMcy4Z4yQi c77yMDX50jCB9mqu0iSrZW1DYjCJOlDccRb3zgoOmoZPAjz4Q1Bbdc6Cpeo7eDvOGWJM SBECKu63VS+t0utch/XIp9kmvcqnRcJ1pKn/y/xpxukmm6CXuuEOu1iZe7mIBqiw6YDC JdNA== X-Gm-Message-State: AOJu0YwQ93aTcbe7hxePSvOk6drTtLVCAhfHIbEOaAPsst3QvHZdK7xc eTLgsMe3Ldd5tO7eKkaZamQLPD0d5vyUskwt0go0zWZjKxSK45mMcmFIWFkbPOlklMbTcvzyFp9 P X-Received: by 2002:a05:600c:474d:b0:42b:a2fd:3e52 with SMTP id 5b1f17b1804b1-42e7ad72dd4mr112460655e9.22.1727166401002; Tue, 24 Sep 2024 01:26:41 -0700 (PDT) Received: from gerrit.openvpn.in (ec2-18-159-0-78.eu-central-1.compute.amazonaws.com. [18.159.0.78]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e9029ef36sm14226605e9.26.2024.09.24.01.26.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 01:26:40 -0700 (PDT) From: "plaisthos (Code Review)" X-Google-Original-From: "plaisthos (Code Review)" X-Gerrit-PatchSet: 1 Date: Tue, 24 Sep 2024 08:26:40 +0000 To: flichtenheld Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange X-Gerrit-Change-Id: I188923efc0f72b2038f1470740415ce50d07580b X-Gerrit-Change-Number: 767 X-Gerrit-Project: openvpn X-Gerrit-ChangeURL: X-Gerrit-Commit: 91e9860c37417ec2eef42efbd8fafcbc487c963d References: Message-ID: MIME-Version: 1.0 User-Agent: Gerrit/3.8.2 X-Spam-Score: -1.1 (-) X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit Content analysis details: (-1.1 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.128.47 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.9 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.128.47 listed in wl.mailspike.net] 0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP 0.0 HTML_MESSAGE BODY: HTML included in message 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 T_KAM_HTML_FONT_INVALID Test for Invalidly Named or Formatted Colors in HTML X-Headers-End: 1st0sm-0000h5-Vv Subject: [Openvpn-devel] [S] Change in openvpn[master]: WIP print child exit code X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arne-openvpn@rfc2549.org, openvpn-devel@lists.sourceforge.net, frank@lichtenheld.com Cc: openvpn-devel Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1811065264427304144?= X-GMAIL-MSGID: =?utf-8?q?1811065264427304144?= X-getmail-filter-classifier: gerrit message type newchange Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/767?usp=email to review the following change. Change subject: WIP print child exit code ...................................................................... WIP print child exit code Change-Id: I188923efc0f72b2038f1470740415ce50d07580b Signed-off-by: Arne Schwabe --- M src/openvpn/tun_afunix.c 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/67/767/1 diff --git a/src/openvpn/tun_afunix.c b/src/openvpn/tun_afunix.c index a2d8552..e26e1d8 100644 --- a/src/openvpn/tun_afunix.c +++ b/src/openvpn/tun_afunix.c @@ -48,6 +48,31 @@ #include static void +child_handler(int sig) +{ + int status; + pid_t pid; + + /* EEEEXTEERMINAAATE! */ + while ((pid = waitpid(-1, &status, WNOHANG)) > 0) + { + msg(M_INFO, "Child process PID %d died with status code %d", pid, status); + } +} + +static void +enable_signal_handler(void) +{ + /* Establish handler. */ + struct sigaction sa; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sa.sa_handler = child_handler; + + sigaction(SIGCHLD, &sa, NULL); +} + +static void tun_afunix_exec_child(const char *dev_node, struct tuntap *tt, struct env_set *env) { struct argv argv = argv_new(); @@ -59,10 +84,13 @@ argv_printf(&argv, "%s", program); argv_msg(M_INFO, &argv); + + enable_signal_handler(); tt->afunix.childprocess = openvpn_execve_check(&argv, env, S_NOWAITPID, "ERROR: failure executing " "process for tun"); argv_free(&argv); + } void @@ -120,6 +148,8 @@ gc_free(&gc); } + + void close_tun_afunix(struct tuntap *tt) {