Line
Link Here
|
0 |
-- libhugetlbfs-2.18/hugeutils.c 2014-04-06 19:11:46.000000000 +0300 |
0 |
++ libhugetlbfs-2.18/hugeutils.c 2017-04-20 09:44:26.500022794 +0300 |
Lines 301-314
Link Here
|
301 |
|
301 |
|
302 |
env = getenv("HUGETLB_RESTRICT_EXE"); |
302 |
env = getenv("HUGETLB_RESTRICT_EXE"); |
303 |
if (env) { |
303 |
if (env) { |
304 |
char *p, *tok, *exe, buf[MAX_EXE+1], restrict[MAX_EXE]; |
304 |
char *p, *tok, *exe, buf[MAX_EXE+1], restrict_[MAX_EXE]; |
305 |
int found = 0; |
305 |
int found = 0; |
306 |
|
306 |
|
307 |
exe = get_exe_name(buf, sizeof buf); |
307 |
exe = get_exe_name(buf, sizeof buf); |
308 |
DEBUG("Found HUGETLB_RESTRICT_EXE, this exe is \"%s\"\n", exe); |
308 |
DEBUG("Found HUGETLB_RESTRICT_EXE, this exe is \"%s\"\n", exe); |
309 |
strncpy(restrict, env, sizeof restrict); |
309 |
strncpy(restrict_, env, sizeof restrict_); |
310 |
restrict[sizeof(restrict)-1] = 0; |
310 |
restrict_[sizeof(restrict_)-1] = 0; |
311 |
for (p = restrict; (tok = strtok(p, ":")) != NULL; p = NULL) { |
311 |
for (p = restrict_; (tok = strtok(p, ":")) != NULL; p = NULL) { |
312 |
DEBUG(" ...check exe match for \"%s\"\n", tok); |
312 |
DEBUG(" ...check exe match for \"%s\"\n", tok); |
313 |
if (strcmp(tok, exe) == 0) { |
313 |
if (strcmp(tok, exe) == 0) { |
314 |
found = 1; |
314 |
found = 1; |