From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6B03C138331 for ; Tue, 20 Feb 2018 22:36:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 90461E0877; Tue, 20 Feb 2018 22:36:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 71842E0877 for ; Tue, 20 Feb 2018 22:36:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1F4C9335C30 for ; Tue, 20 Feb 2018 22:36:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0829D22D for ; Tue, 20 Feb 2018 22:36:49 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1519166150.c1178c8eebb92c9f3702e981cd4af9ef41f51884.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/rc-selinux.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: c1178c8eebb92c9f3702e981cd4af9ef41f51884 X-VCS-Branch: master Date: Tue, 20 Feb 2018 22:36:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b5c9e1f4-74d5-4d6c-a1c0-d4a4aea3d00f X-Archives-Hash: f0dbcc52ed75d95907c0aa194f36336d commit: c1178c8eebb92c9f3702e981cd4af9ef41f51884 Author: William Hubbs gmail com> AuthorDate: Tue Feb 20 22:35:50 2018 +0000 Commit: William Hubbs gentoo org> CommitDate: Tue Feb 20 22:35:50 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=c1178c8e rc-selinux.c: remove references to path_max src/rc/rc-selinux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rc/rc-selinux.c b/src/rc/rc-selinux.c index bfaf1556..2c9673cc 100644 --- a/src/rc/rc-selinux.c +++ b/src/rc/rc-selinux.c @@ -256,19 +256,19 @@ static int read_context_file(const char *filename, char **context) { int ret = -1; FILE *fp; - char filepath[PATH_MAX]; + char *filepath = NULL; char *line = NULL; char *p; char *p2; size_t len = 0; ssize_t read; - memset(filepath, '\0', PATH_MAX); - snprintf(filepath, PATH_MAX - 1, "%s/%s", selinux_contexts_path(), filename); + xasprintf(&filepath, "%s/%s", selinux_contexts_path(), filename); fp = fopen(filepath, "r"); if (fp == NULL) { eerror("Failed to open context file: %s", filename); + free(filepath); return -1; } @@ -294,6 +294,7 @@ static int read_context_file(const char *filename, char **context) } free(line); + free(filepath); fclose(fp); return ret; }