mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
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:
@@ -837,10 +837,9 @@ set_option_default (
|
|||||||
} else { /* P_BOOL */
|
} else { /* P_BOOL */
|
||||||
*(int *)varp = (int)(intptr_t)options[opt_idx].def_val[dvi];
|
*(int *)varp = (int)(intptr_t)options[opt_idx].def_val[dvi];
|
||||||
#ifdef UNIX
|
#ifdef UNIX
|
||||||
// 'modeline' defaults to off for root
|
/* 'modeline' defaults to off for root */
|
||||||
if (options[opt_idx].indir == PV_ML && getuid() == 0) {
|
if (options[opt_idx].indir == PV_ML && getuid() == ROOT_UID)
|
||||||
*(int *)varp = false;
|
*(int *)varp = FALSE;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
/* May also set global value for local option. */
|
/* May also set global value for local option. */
|
||||||
if (both)
|
if (both)
|
||||||
|
@@ -3082,8 +3082,8 @@ shada_write_file_nomerge: {}
|
|||||||
// viminfo file that the user can't read.
|
// viminfo file that the user can't read.
|
||||||
FileInfo old_info;
|
FileInfo old_info;
|
||||||
if (os_fileinfo((char *)fname, &old_info)) {
|
if (os_fileinfo((char *)fname, &old_info)) {
|
||||||
if (getuid() == 0) {
|
if (getuid() == ROOT_UID) {
|
||||||
if (old_info.stat.st_uid != 0
|
if (old_info.stat.st_uid != ROOT_UID
|
||||||
|| old_info.stat.st_gid != getgid()) {
|
|| old_info.stat.st_gid != getgid()) {
|
||||||
const uv_uid_t old_uid = (uv_uid_t) old_info.stat.st_uid;
|
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;
|
const uv_gid_t old_gid = (uv_gid_t) old_info.stat.st_gid;
|
||||||
|
@@ -37,7 +37,9 @@ Error: configure did not run properly.Check auto/config.log.
|
|||||||
|
|
||||||
#define NUMBUFLEN 30 /* length of a buffer to store a number in ASCII */
|
#define NUMBUFLEN 30 /* length of a buffer to store a number in ASCII */
|
||||||
|
|
||||||
# define MAX_TYPENR 65535
|
#define MAX_TYPENR 65535
|
||||||
|
|
||||||
|
#define ROOT_UID 0
|
||||||
|
|
||||||
#include "nvim/keymap.h"
|
#include "nvim/keymap.h"
|
||||||
#include "nvim/macros.h"
|
#include "nvim/macros.h"
|
||||||
|
Reference in New Issue
Block a user