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 0890C13832E for ; Mon, 25 Jul 2016 18:54:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 73A80E09AF; Mon, 25 Jul 2016 18:54:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 03CABE09AF for ; Mon, 25 Jul 2016 18:54:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 104AD340C4B for ; Mon, 25 Jul 2016 18:54:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A6F037CE for ; Mon, 25 Jul 2016 18:54:35 +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: <1469327273.3adb8fb389caaafbed1be13c5ac4d96214c8eed3.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/rc-logger.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 3adb8fb389caaafbed1be13c5ac4d96214c8eed3 X-VCS-Branch: master Date: Mon, 25 Jul 2016 18:54:35 +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: d46fd621-7cba-4136-b019-0efe1e6c4f98 X-Archives-Hash: a816c39be35a65d1dd958800b9195a1e commit: 3adb8fb389caaafbed1be13c5ac4d96214c8eed3 Author: Doug Freed mtu edu> AuthorDate: Sun Jul 24 02:27:53 2016 +0000 Commit: William Hubbs gentoo org> CommitDate: Sun Jul 24 02:27:53 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=3adb8fb3 rc-logger: refuse to cat TMPLOG into itself This prevents an infinite loop in case somebody decides to set rc_log_path to match TMPLOG. src/rc/rc-logger.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rc/rc-logger.c b/src/rc/rc-logger.c index 06f3398..b4bd0ea 100644 --- a/src/rc/rc-logger.c +++ b/src/rc/rc-logger.c @@ -247,6 +247,10 @@ rc_logger_open(const char *level) logfile = rc_conf_value("rc_log_path"); if (logfile == NULL) logfile = DEFAULTLOG; + if (!strcmp(logfile, TMPLOG)) { + eerror("Cowardly refusing to concatenate a logfile into itself."); + eerrorx("Please change rc_log_path to something other than %s to get rid of this message", TMPLOG); + } if ((plog = fopen(logfile, "ae"))) { if ((log = fopen(TMPLOG, "re"))) {