Ruby 2.1.5p273(2014-11-13revision48405)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions
safe.c File Reference
`#include "ruby/ruby.h"`
`#include "vm_core.h"`
Include dependency graph for safe.c:

Go to the source code of this file.

## Macros
#define | SAFE_LEVEL_MAX RUBY_SAFE_LEVEL_MAX

## Functions
int | ruby_safe_level_4_warning (void)
int | rb_safe_level (void)
void | rb_set_safe_level_force (int safe)
void | rb_set_safe_level (int level)
static VALUE | safe_getter (void)
static void | safe_setter (VALUE val)
void | rb_secure (int level)
void | rb_secure_update (VALUE obj)
void | rb_insecure_operation (void)
void | rb_check_safe_obj (VALUE x)
void | rb_check_safe_str (VALUE x)
void | Init_safe (void)

## Macro Definition Documentation

#define SAFE_LEVEL_MAX RUBY_SAFE_LEVEL_MAX

Definition at line 19 of file safe.c.

Referenced by rb_set_safe_level(), and safe_setter().

## Function Documentation

void Init_safe | ( | void |  | ) |

Definition at line 140 of file safe.c.

References rb_define_virtual_variable(), safe_getter(), and safe_setter().

void rb_check_safe_obj | ( | VALUE | x | ) |

Definition at line 122 of file safe.c.

References OBJ_TAINTED, rb_insecure_operation(), and rb_safe_level().

Referenced by constant_arg(), env_has_value(), env_rassoc(), rb_check_safe_str(), and rb_dlcfunc_call().

void rb_check_safe_str | ( | VALUE | x | ) |

Definition at line 130 of file safe.c.

References rb_check_safe_obj(), rb_eTypeError, rb_obj_classname(), rb_raise(), RB_TYPE_P, and T_STRING.

void rb_insecure_operation | ( | void |  | ) |

Definition at line 109 of file safe.c.

References rb_eSecurityError, rb_frame_callee(), rb_id2name(), and rb_raise().

Referenced by argf_inplace_mode_set(), rb_check_safe_obj(), rb_get_path_check_convert(), and rb_get_path_check_to_string().

int rb_safe_level | ( | void |  | ) |

Definition at line 37 of file safe.c.

References GET_THREAD(), and rb_thread_struct::safe_level.

Referenced by rb_check_safe_obj(), rb_secure(), and safe_getter().

void rb_secure | ( | int | level | ) |

Definition at line 88 of file safe.c.

References rb_eSecurityError, rb_frame_callee(), rb_id2name(), rb_raise(), and rb_safe_level().

Referenced by bsock_setsockopt(), check_dirname(), check_gid_switch(), check_uid_switch(), dir_s_chdir(), dlhandle_sym(), fiddle_handle_sym(), gc_stress_set(), get_pid(), get_ppid(), iseq_eval(), iseq_s_compile(), iseq_s_compile_file(), iseq_s_compile_option_set(), iseq_s_of(), iseq_to_a(), proc_detach(), proc_wait(), proc_waitall(), rb_dlhandle_initialize(), rb_execarg_addopt(), rb_f_kill(), rb_fiddle_handle_initialize(), rb_file_chmod(), rb_file_chown(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_flock(), rb_file_identical_p(), rb_file_lstat(), rb_file_readable_p(), rb_file_readable_real_p(), rb_file_s_chmod(), rb_file_s_chown(), rb_file_s_ftype(), rb_file_s_lstat(), rb_file_s_rename(), rb_file_s_umask(), rb_file_s_unlink(), rb_file_s_utime(), rb_file_symlink_p(), rb_file_writable_p(), rb_file_writable_real_p(), rb_ioctl(), rb_iseq_disasm(), rb_obj_untaint(), rb_realpath_internal(), rb_stat(), rb_stat_init(), rsock_s_accept(), rsock_s_accept_nonblock(), sig_trap(), sock_initialize(), sock_s_gethostbyname(), tcp_s_gethostbyname(), test_check(), udp_bind(), udp_connect(), and udp_init().

void rb_secure_update | ( | VALUE | obj | ) |

Definition at line 104 of file safe.c.

void rb_set_safe_level | ( | int | level | ) |

Definition at line 49 of file safe.c.

References GET_THREAD(), level, rb_eArgError, rb_raise(), rb_thread_struct::safe_level, and SAFE_LEVEL_MAX.

Referenced by callq_safelevel_handler(), create_encoding_table_core(), evq_safelevel_handler(), ivq_safelevel_handler(), and process_options().

void rb_set_safe_level_force | ( | int | safe | ) |

Definition at line 43 of file safe.c.

References GET_THREAD(), and rb_thread_struct::safe_level.

Referenced by check_autoload_required(), create_encoding_table_core(), exec_end_procs_chain(), rb_autoload_load(), rb_eval_cmd(), rb_exec_end_proc(), rb_method_call_with_block(), rb_require_safe(), and reset_safe().

int ruby_safe_level_4_warning | ( | void |  | ) |

Definition at line 31 of file safe.c.

static VALUE safe_getter | ( | void |  | ) |
| static

Definition at line 62 of file safe.c.

References INT2NUM, and rb_safe_level().

Referenced by Init_safe().

static void safe_setter | ( | VALUE | val | ) |
| static

Definition at line 68 of file safe.c.

References GET_THREAD(), level, NUM2INT, rb_eArgError, rb_eSecurityError, rb_raise(), rb_warning(), rb_thread_struct::safe_level, and SAFE_LEVEL_MAX.

Referenced by Init_safe().