1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

More verbose message at unsafe header

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-11-05 02:05:12 +00:00
parent fc1f476b61
commit 6d497629b2

21
mjit.c
View file

@ -422,15 +422,18 @@ init_header_filename(void)
return FALSE;
}
#ifndef LOAD_RELATIVE
if ((basedir == build_dir) &&
(fstat(fd, &st) ||
st.st_uid != getuid() ||
(st.st_mode & 022))) {
(void)close(fd);
verbose(1, "Unsafe header file: %s", header_file);
xfree(header_file);
header_file = NULL;
return FALSE;
if (basedir == build_dir) {
memset(&st, 0, sizeof(st));
if (fstat(fd, &st) ||
(st.st_uid != getuid()) ||
(st.st_mode & 022)) {
(void)close(fd);
verbose(1, "Unsafe header file: uid=%ld mode=%#o %s",
(long)st.st_uid, (unsigned)st.st_mode, header_file);
xfree(header_file);
header_file = NULL;
return FALSE;
}
}
#endif
(void)close(fd);