From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 30E4E1381F3 for ; Mon, 21 Oct 2013 19:53:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 157C8E0AAD; Mon, 21 Oct 2013 19:53:15 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 81D54E0AAD for ; Mon, 21 Oct 2013 19:53:14 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9836933F0BD for ; Mon, 21 Oct 2013 19:53:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 49882E5308 for ; Mon, 21 Oct 2013 19:53:12 +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: <1382383282.aeb670f4e8f56bae72511b08f8b3b5fa732ce7fc.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/librc/librc.c X-VCS-Directories: src/librc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: aeb670f4e8f56bae72511b08f8b3b5fa732ce7fc X-VCS-Branch: master Date: Mon, 21 Oct 2013 19:53:12 +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: a395bc32-fb3a-4c36-9853-d1881e566161 X-Archives-Hash: 2c53d95015da1bebe99dd45646b579a5 commit: aeb670f4e8f56bae72511b08f8b3b5fa732ce7fc Author: William Hubbs gmail com> AuthorDate: Mon Oct 21 19:21:22 2013 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Oct 21 19:21:22 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=aeb670f4 librc: do not allow "." and ".." as runlevel names The rc_runlevel_exists function was attempting to treat "." and ".." as valid runlevels; however, this should not be allowed. X-Gentoo-Bug: 488710 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=488710 --- src/librc/librc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librc/librc.c b/src/librc/librc.c index cb4ce63..d7a4849 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -425,7 +425,7 @@ rc_runlevel_exists(const char *runlevel) char path[PATH_MAX]; struct stat buf; - if (!runlevel) + if (!runlevel || strcmp(runlevel, ".") == 0 || strcmp(runlevel, "..") == 0) return false; snprintf(path, sizeof(path), "%s/%s", RC_RUNLEVELDIR, runlevel); if (stat(path, &buf) == 0 && S_ISDIR(buf.st_mode))