Changeset View
Changeset View
Standalone View
Standalone View
head/libexec/rtld-elf/rtld.c
Show First 20 Lines • Show All 464 Lines • ▼ Show 20 Lines | #endif | ||||
if (phdr == obj_rtld.phdr) { | if (phdr == obj_rtld.phdr) { | ||||
if (!trust) { | if (!trust) { | ||||
_rtld_error("Tainted process refusing to run binary %s", | _rtld_error("Tainted process refusing to run binary %s", | ||||
argv0); | argv0); | ||||
rtld_die(); | rtld_die(); | ||||
} | } | ||||
direct_exec = true; | direct_exec = true; | ||||
/* | |||||
* Set osrel for us, it is later reset to the binary' | |||||
* value before first instruction of code from the binary | |||||
* is executed. | |||||
*/ | |||||
mib[0] = CTL_KERN; | |||||
mib[1] = KERN_PROC; | |||||
mib[2] = KERN_PROC_OSREL; | |||||
mib[3] = getpid(); | |||||
osrel = __FreeBSD_version; | |||||
sz = sizeof(old_osrel); | |||||
(void)sysctl(mib, 4, &old_osrel, &sz, &osrel, sizeof(osrel)); | |||||
dbg("opening main program in direct exec mode"); | dbg("opening main program in direct exec mode"); | ||||
if (argc >= 2) { | if (argc >= 2) { | ||||
rtld_argc = parse_args(argv, argc, &search_in_path, &fd, &argv0); | rtld_argc = parse_args(argv, argc, &search_in_path, &fd, &argv0); | ||||
explicit_fd = (fd != -1); | explicit_fd = (fd != -1); | ||||
binpath = NULL; | binpath = NULL; | ||||
if (!explicit_fd) | if (!explicit_fd) | ||||
fd = open_binary_fd(argv0, search_in_path, &binpath); | fd = open_binary_fd(argv0, search_in_path, &binpath); | ||||
if (fstat(fd, &st) == -1) { | if (fstat(fd, &st) == -1) { | ||||
▲ Show 20 Lines • Show All 5,417 Lines • Show Last 20 Lines |