[前][次][番号順一覧][スレッド一覧]

ruby-changes:61904

From: Nobuyoshi <ko1@a...>
Date: Tue, 23 Jun 2020 10:05:34 +0900 (JST)
Subject: [ruby-changes:61904] c3ba2db48b (master): Removed execpath argument of path_check_0 as always TRUE now

https://git.ruby-lang.org/ruby.git/commit/?id=c3ba2db48b

From c3ba2db48b1ab53fb459910eef50a7ccbb624e17 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 23 Jun 2020 09:32:59 +0900
Subject: Removed execpath argument of path_check_0 as always TRUE now


diff --git a/file.c b/file.c
index 9392427..74f2552 100644
--- a/file.c
+++ b/file.c
@@ -6155,7 +6155,7 @@ rb_is_absolute_path(const char *path) https://github.com/ruby/ruby/blob/trunk/file.c#L6155
 
 #if ENABLE_PATH_CHECK
 static int
-path_check_0(VALUE path, int execpath)
+path_check_0(VALUE path)
 {
     struct stat st;
     const char *p0 = StringValueCStr(path);
@@ -6183,12 +6183,12 @@ path_check_0(VALUE path, int execpath) https://github.com/ruby/ruby/blob/trunk/file.c#L6183
 #endif
 	if (STAT(p0, &st) == 0 && S_ISDIR(st.st_mode) && (st.st_mode & S_IWOTH)
 #ifdef S_ISVTX
-	    && !(p && execpath && (st.st_mode & S_ISVTX))
+	    && !(p && (st.st_mode & S_ISVTX))
 #endif
 	    && !access(p0, W_OK)) {
-	    rb_enc_warn(enc, "Insecure world writable dir %s in %sPATH, mode 0%"
+	    rb_enc_warn(enc, "Insecure world writable dir %s in PATH, mode 0%"
 			PRI_MODET_PREFIX"o",
-			p0, (execpath ? "" : "LOAD_"), st.st_mode);
+			p0, st.st_mode);
 	    if (p) *p = '/';
 	    RB_GC_GUARD(path);
 	    return 0;
@@ -6218,7 +6218,7 @@ rb_path_check(const char *path) https://github.com/ruby/ruby/blob/trunk/file.c#L6218
     if (!p) p = pend;
 
     for (;;) {
-	if (!path_check_0(rb_str_new(p0, p - p0), TRUE)) {
+	if (!path_check_0(rb_str_new(p0, p - p0))) {
 	    return 0;		/* not safe */
 	}
 	p0 = p + 1;
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]