diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2018-01-09 17:20:39 -0600 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2018-01-09 17:25:28 -0600 |
commit | 918d955fd2de1f594b83508f5ddd5271534e3591 (patch) | |
tree | f0c53fb57160d945db7a0acbc402e2b2b8d32686 /src | |
parent | 92cfa0e543d380ab290d06e98e2fef1b283349fe (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')
-rw-r--r-- | src/rc/checkpath.c | 2 |
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; } |