aboutsummaryrefslogtreecommitdiff
path: root/src/rc/checkpath.c
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2018-01-09 17:20:39 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2018-01-09 17:25:28 -0600
commit918d955fd2de1f594b83508f5ddd5271534e3591 (patch)
treef0c53fb57160d945db7a0acbc402e2b2b8d32686 /src/rc/checkpath.c
parent92cfa0e543d380ab290d06e98e2fef1b283349fe (diff)
checkpath: use lchown instead of chown
Checkpath should never follow symbolic links when changing ownership of a file. This is for https://github.com/openrc/openrc/issues/195.
Diffstat (limited to 'src/rc/checkpath.c')
-rw-r--r--src/rc/checkpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rc/checkpath.c b/src/rc/checkpath.c
index b1509940..8846761b 100644
--- a/src/rc/checkpath.c
+++ b/src/rc/checkpath.c
@@ -168,7 +168,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
return -1;
}
einfo("%s: correcting owner", path);
- if (chown(path, uid, gid)) {
+ if (lchown(path, uid, gid)) {
eerror("%s: chown: %s", applet, strerror(errno));
return -1;
}