aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2019-10-14 17:43:11 -0700
committerJeremy Evans <code@jeremyevans.net>2019-10-14 17:43:11 -0700
commit978276a7d9249535f855088f866551b6557f321f (patch)
tree2b662913cdcf0c775d76a251e7a21f7b2a7561db /file.c
parentc3a626030235c0349e14c6bc07177810daee841c (diff)
downloadruby-978276a7d9249535f855088f866551b6557f321f.tar.gz
Update documentation for File#{readable,writable,executable}{,_real}? [ci skip]
Some OS-level security features cause these methods to not return expected results. For example fs.protected_regular sysctl on Linux, or pledge(2)/unveil(2) on OpenBSD. Fixes [Bug #16002]
Diffstat (limited to 'file.c')
-rw-r--r--file.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/file.c b/file.c
index b0056b0f99..e333c868a9 100644
--- a/file.c
+++ b/file.c
@@ -1803,6 +1803,9 @@ rb_file_exists_p(VALUE obj, VALUE fname)
*
* Returns <code>true</code> if the named file is readable by the effective
* user and group id of this process. See eaccess(3).
+ *
+ * Note that some OS-level security features may cause this to return true
+ * even though the file is not readable by the effective user/group.
*/
static VALUE
@@ -1818,6 +1821,9 @@ rb_file_readable_p(VALUE obj, VALUE fname)
*
* Returns <code>true</code> if the named file is readable by the real
* user and group id of this process. See access(3).
+ *
+ * Note that some OS-level security features may cause this to return true
+ * even though the file is not readable by the real user/group.
*/
static VALUE
@@ -1871,6 +1877,9 @@ rb_file_world_readable_p(VALUE obj, VALUE fname)
*
* Returns <code>true</code> if the named file is writable by the effective
* user and group id of this process. See eaccess(3).
+ *
+ * Note that some OS-level security features may cause this to return true
+ * even though the file is not writable by the effective user/group.
*/
static VALUE
@@ -1885,7 +1894,10 @@ rb_file_writable_p(VALUE obj, VALUE fname)
* File.writable_real?(file_name) -> true or false
*
* Returns <code>true</code> if the named file is writable by the real
- * user and group id of this process. See access(3)
+ * user and group id of this process. See access(3).
+ *
+ * Note that some OS-level security features may cause this to return true
+ * even though the file is not writable by the real user/group.
*/
static VALUE
@@ -1935,6 +1947,9 @@ rb_file_world_writable_p(VALUE obj, VALUE fname)
* Windows does not support execute permissions separately from read
* permissions. On Windows, a file is only considered executable if it ends in
* .bat, .cmd, .com, or .exe.
+ *
+ * Note that some OS-level security features may cause this to return true
+ * even though the file is not executable by the effective user/group.
*/
static VALUE
@@ -1954,6 +1969,9 @@ rb_file_executable_p(VALUE obj, VALUE fname)
* Windows does not support execute permissions separately from read
* permissions. On Windows, a file is only considered executable if it ends in
* .bat, .cmd, .com, or .exe.
+ *
+ * Note that some OS-level security features may cause this to return true
+ * even though the file is not executable by the real user/group.
*/
static VALUE