aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-08-22 09:30:38 +0100
committerRon Yorston <rmy@pobox.com>2021-08-22 10:33:35 +0100
commitf2bb8e8d62379d4e740fc39dce7dbe820487a6a9 (patch)
tree8debc833fe748fd322f7ef7696fd4ac71cbb3796
parent46c5767e7e39d1e173e382bda86ab88b4cad354d (diff)
downloadbusybox-w32-f2bb8e8d62379d4e740fc39dce7dbe820487a6a9.tar.gz
busybox-w32-f2bb8e8d62379d4e740fc39dce7dbe820487a6a9.tar.bz2
busybox-w32-f2bb8e8d62379d4e740fc39dce7dbe820487a6a9.zip
vi: skip permission check on .exrc
POSIX requires that the .exrc file is only writable by its owner. Our bogus permissions can't confirm this so just skip the test.
-rw-r--r--editors/vi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index c791a32e1..a0a046272 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -4999,7 +4999,11 @@ int vi_main(int argc, char **argv)
4999 4999
5000 // .exrc must belong to and only be writable by user 5000 // .exrc must belong to and only be writable by user
5001 if (stat(exrc, &st) == 0) { 5001 if (stat(exrc, &st) == 0) {
5002# if !ENABLE_PLATFORM_MINGW32
5002 if ((st.st_mode & (S_IWGRP|S_IWOTH)) == 0 5003 if ((st.st_mode & (S_IWGRP|S_IWOTH)) == 0
5004# else
5005 if (1
5006# endif
5003 && st.st_uid == getuid() 5007 && st.st_uid == getuid()
5004 ) { 5008 ) {
5005 cmds = xmalloc_open_read_close(exrc, NULL); 5009 cmds = xmalloc_open_read_close(exrc, NULL);