Revert ROOT_UID removal

It helps clarify intent for those unaware of root's UID.

see https://github.com/neovim/neovim/pull/4015#discussion_r49822371
This commit is contained in:
Michael Reed
2016-01-15 03:03:18 -05:00
parent d4fb5920d3
commit f433f569a3
3 changed files with 8 additions and 7 deletions

View File

@@ -3082,8 +3082,8 @@ shada_write_file_nomerge: {}
// viminfo file that the user can't read.
FileInfo old_info;
if (os_fileinfo((char *)fname, &old_info)) {
if (getuid() == 0) {
if (old_info.stat.st_uid != 0
if (getuid() == ROOT_UID) {
if (old_info.stat.st_uid != ROOT_UID
|| old_info.stat.st_gid != getgid()) {
const uv_uid_t old_uid = (uv_uid_t) old_info.stat.st_uid;
const uv_gid_t old_gid = (uv_gid_t) old_info.stat.st_gid;