Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/
Date: Tue, 09 Jan 2018 23:36:04
Message-Id: 1515540328.918d955fd2de1f594b83508f5ddd5271534e3591.williamh@OpenRC
1 commit: 918d955fd2de1f594b83508f5ddd5271534e3591
2 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
3 AuthorDate: Tue Jan 9 23:20:39 2018 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 9 23:25:28 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=918d955f
7
8 checkpath: use lchown instead of chown
9
10 Checkpath should never follow symbolic links when changing ownership of a file.
11
12 This is for https://github.com/openrc/openrc/issues/195.
13
14 src/rc/checkpath.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17 diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
18 index b1509940..8846761b 100644
19 --- a/src/rc/checkpath.c
20 +++ b/src/rc/checkpath.c
21 @@ -168,7 +168,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
22 return -1;
23 }
24 einfo("%s: correcting owner", path);
25 - if (chown(path, uid, gid)) {
26 + if (lchown(path, uid, gid)) {
27 eerror("%s: chown: %s", applet, strerror(errno));
28 return -1;
29 }