executable_real?()
public
Same as executable?, but tests using the real owner of the process.
Show source
static VALUE
rb_stat_X(VALUE obj)
{
struct stat *st = get_stat(obj);
if (getuid() == 0) {
return st->st_mode & S_IXUGO ? Qtrue : Qfalse;
}
if (rb_stat_rowned(obj))
return st->st_mode & S_IXUSR ? Qtrue : Qfalse;
if (rb_group_member(get_stat(obj)->st_gid))
return st->st_mode & S_IXGRP ? Qtrue : Qfalse;
if (!(st->st_mode & S_IXOTH)) return Qfalse;
return Qtrue;
}