From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-726440-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 7846813877A
	for <garchives@archives.gentoo.org>; Fri, 22 Aug 2014 19:10:13 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 591CBE0857;
	Fri, 22 Aug 2014 19:10:12 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 8C207E0838
	for <gentoo-commits@lists.gentoo.org>; Fri, 22 Aug 2014 19:10:11 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7E0DC33FD85
	for <gentoo-commits@lists.gentoo.org>; Fri, 22 Aug 2014 19:10:10 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 2A0783BE5
	for <gentoo-commits@lists.gentoo.org>; Fri, 22 Aug 2014 19:10:09 +0000 (UTC)
From: "William Hubbs" <williamh@gentoo.org>
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" <williamh@gentoo.org>
Message-ID: <1406562084.2624a8c8a7030180f9548a6e2fba5b0a82c5f046.williamh@OpenRC>
Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/
X-VCS-Repository: proj/openrc
X-VCS-Files: src/rc/checkpath.c
X-VCS-Directories: src/rc/
X-VCS-Committer: williamh
X-VCS-Committer-Name: William Hubbs
X-VCS-Revision: 2624a8c8a7030180f9548a6e2fba5b0a82c5f046
X-VCS-Branch: master
Date: Fri, 22 Aug 2014 19:10:09 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: adddd3cd-af72-463b-8eea-649ceab942c8
X-Archives-Hash: d2b768660d07cca1f248c43336235eef
Message-ID: <20140822191009.gTWxoZEcPG-eh6LTJ5BoDtc0zHnQCXat0nwKLg15fDw@z>

commit:     2624a8c8a7030180f9548a6e2fba5b0a82c5f046
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon Jul 28 15:41:24 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon Jul 28 15:41:24 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=2624a8c8

checkpath: apply ownership to all paths given on command line

The stat structure was not being initialized correctly in do_check. This
was causing the owner adjustment to be skipped if the first path had the
correct owner.

Also, the "correcting owner" message should always be printed when the
owner is being changed.

X-Gentoo-Bug: 518042
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=518042

---
 src/rc/checkpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index a65dbc2..94ab474 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -67,6 +67,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
 	int r;
 	int u;
 
+	memset(&st, 0, sizeof(st));
 	if (stat(path, &st) || trunc) {
 		if (type == inode_file) {
 			einfo("%s: creating file", path);
@@ -140,8 +141,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
 	}
 
 	if (chowner && (st.st_uid != uid || st.st_gid != gid)) {
-		if (st.st_dev || st.st_ino)
-			einfo("%s: correcting owner", path);
+		einfo("%s: correcting owner", path);
 		if (chown(path, uid, gid)) {
 			eerror("%s: chown: %s", applet, strerror(errno));
 			return -1;