ruby-changes:53325
From: nobu <ko1@a...>
Date: Mon, 5 Nov 2018 11:05:17 +0900 (JST)
Subject: [ruby-changes:53325] nobu:r65541 (trunk): More verbose message at unsafe header
nobu 2018-11-05 11:05:12 +0900 (Mon, 05 Nov 2018) New Revision: 65541 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65541 Log: More verbose message at unsafe header Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 65540) +++ mjit.c (revision 65541) @@ -422,15 +422,18 @@ init_header_filename(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L422 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/