Ruby 2.0.0p353(2013-11-22revision43784)

- 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 4

## Functions
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 4

Definition at line 20 of file safe.c.

Referenced by rb_set_safe_level(), and safe_setter().

## Function Documentation

void Init_safe | ( | void |  | ) |

Definition at line 132 of file safe.c.

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

void rb_check_safe_obj | ( | VALUE | x | ) |

Definition at line 113 of file safe.c.

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

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

void rb_check_safe_str | ( | VALUE | x | ) |

Definition at line 122 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 101 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 28 of file safe.c.

References GET_THREAD(), and rb_thread_struct::safe_level.

void rb_secure | ( | int | level | ) |

Definition at line 79 of file safe.c.

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

Referenced by apply2files(), bsock_do_not_rev_lookup_set(), bsock_do_not_reverse_lookup_set(), bsock_setsockopt(), check_dirname(), check_gid_switch(), check_uid_switch(), curses_init_screen(), dir_s_chdir(), dlhandle_sym(), env_assoc(), env_delete(), env_each_pair(), env_empty_p(), env_fetch(), env_has_key(), env_has_value(), env_inspect(), env_key(), env_keys(), env_rassoc(), env_select(), env_shift(), env_size(), env_to_a(), env_to_hash(), env_update(), env_values(), env_values_at(), etc_getgrgid(), etc_getgrnam(), etc_getlogin(), etc_getpwuid(), etc_group(), etc_passwd(), ev_advise(), fdbm_modify(), fev_off_event(), fiddle_handle_sym(), fole_free(), fole_initialize(), fole_respond_to(), fole_s_connect(), fole_s_const_load(), gc_stress_set(), get_pid(), get_ppid(), hist_delete_at(), hist_each(), hist_empty_p(), hist_get(), hist_length(), hist_pop(), hist_push(), hist_push_method(), hist_shift(), id2ref(), if(), io_write(), iseq_eval(), iseq_s_compile(), iseq_s_compile_file(), iseq_s_compile_option_set(), iseq_s_of(), iseq_to_a(), mSyslog_close(), mSyslog_set_mask(), ole_types_from_typelib(), os_each_obj(), proc_detach(), proc_wait(), proc_waitall(), rb_alias(), rb_check_safe_obj(), rb_define_const(), rb_dir_getwd(), rb_dl_free(), rb_dl_malloc(), rb_dl_ptr2value(), rb_dl_realloc(), rb_dlcfunc_new(), rb_dlhandle_initialize(), rb_dlptr_malloc(), rb_dlptr_new2(), rb_dlptr_s_allocate(), rb_env_size(), rb_execarg_addopt(), rb_export_method(), rb_f_abort(), rb_f_exit(), rb_f_exit_bang(), rb_f_getenv(), rb_f_kill(), rb_f_srand(), rb_f_trace_var(), rb_f_untrace_var(), rb_fiddle_free(), rb_fiddle_handle_initialize(), rb_fiddle_malloc(), rb_fiddle_ptr2value(), rb_fiddle_ptr_malloc(), rb_fiddle_ptr_new2(), rb_fiddle_ptr_s_allocate(), rb_fiddle_realloc(), 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_stat(), 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_gdbm_modify(), rb_include_module(), rb_io_autoclose_p(), rb_io_initialize(), rb_io_reopen(), rb_io_set_autoclose(), rb_io_syswrite(), rb_io_write_nonblock(), rb_ioctl(), rb_iseq_disasm(), rb_load_internal(), rb_obj_taint(), rb_obj_trust(), rb_obj_untaint(), rb_obj_untrust(), rb_prepend_module(), rb_realpath_internal(), rb_remove_history(), rb_secure_update(), rb_stat(), rb_stat_init(), rb_thread_abort_exc_set(), rb_thread_kill(), rb_thread_priority_set(), rb_thread_s_abort_exc_set(), rb_tracepoint_disable(), rb_tracepoint_enable(), rb_undef(), readline_readline(), readline_s_get_completion_case_fold(), readline_s_get_completion_proc(), readline_s_set_completion_case_fold(), readline_s_set_completion_proc(), readline_s_set_input(), readline_s_set_output(), remove_method(), rsock_bsock_send(), rsock_s_accept(), rsock_s_accept_nonblock(), rsock_sock_listen(), set_trace_func(), sig_trap(), sock_initialize(), sock_s_gethostbyname(), syslog_write(), tcp_s_gethostbyname(), test_check(), thgroup_add(), thread_add_trace_func_m(), thread_set_trace_func_m(), top_define_method(), top_include(), udp_bind(), udp_connect(), udp_init(), udp_send(), window_initialize(), and writable().

void rb_secure_update | ( | VALUE | obj | ) |

Definition at line 94 of file safe.c.

References OBJ_TAINTED, and rb_secure().

Referenced by rb_dlcfunc_call().

void rb_set_safe_level | ( | int | level | ) |

Definition at line 40 of file safe.c.

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

void rb_set_safe_level_force | ( | int | safe | ) |

Definition at line 34 of file safe.c.

References GET_THREAD(), safe, and rb_thread_struct::safe_level.

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

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

Definition at line 53 of file safe.c.

References INT2NUM, and rb_safe_level.

Referenced by Init_safe().

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

Definition at line 59 of file safe.c.

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

Referenced by Init_safe().