From patchwork Fri Feb 14 18:11:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 38082 Received: (qmail 96074 invoked by alias); 14 Feb 2020 18:11:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95885 invoked by uid 89); 14 Feb 2020 18:11:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1045 X-HELO: us-smtp-delivery-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581703886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XFE4Ym/y9xUGZIcOz/5g8UKcixc8rudX/zxXoZtZWY0=; b=dZPwRctBuD6YLbnzy/o4rMhA504bvoI1s+oHJGg+XnZ7ve4P64uQTrPmq+fFOaAaEtdRcs behJi4lD5z1aSCD5BThzI2nP+ezB1i4VVrhTmaHaW7V25WEsYHk22SoGBD2/v/5P+IgTC2 F/F7Ehe0lL8Kj34CwY3gU/7OfnVxAyE= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 3/3] Linux: Port fexecve to In-Reply-To: References: X-From-Line: ecf74ed0429118ab5b24b3048491dc2a7e7de0de Mon Sep 17 00:00:00 2001 Message-Id: Date: Fri, 14 Feb 2020 19:11:20 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com --- sysdeps/unix/sysv/linux/fexecve.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdeps/unix/sysv/linux/fexecve.c b/sysdeps/unix/sysv/linux/fexecve.c index 23c9799f5d..d8cf924faf 100644 --- a/sysdeps/unix/sysv/linux/fexecve.c +++ b/sysdeps/unix/sysv/linux/fexecve.c @@ -25,6 +25,7 @@ #include #include #include +#include /* Execute the file FD refers to, overlaying the running program image. @@ -50,11 +51,10 @@ fexecve (int fd, char *const argv[], char *const envp[]) #ifndef __ASSUME_EXECVEAT /* We use the /proc filesystem to get the information. If it is not mounted we fail. */ - char buf[sizeof "/proc/self/fd/" + sizeof (int) * 3]; - __snprintf (buf, sizeof (buf), "/proc/self/fd/%d", fd); + struct fd_to_filename storage; /* We do not need the return value. */ - __execve (buf, argv, envp); + __execve (__fd_to_filename (fd, &storage), argv, envp); int save = errno;