mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
zdtm: check permissions for map_files
Cc: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com> Test-for: b67d37d96fa0 ("proc_parse: fix vma file open mode recognition") Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
9028413292
commit
fad23922d8
10
test/zdtm.py
10
test/zdtm.py
@@ -898,13 +898,21 @@ def get_visible_state(test):
|
|||||||
last = 0
|
last = 0
|
||||||
for mp in open("/proc/%s/root/proc/%s/maps" % (test.getpid(), pid)):
|
for mp in open("/proc/%s/root/proc/%s/maps" % (test.getpid(), pid)):
|
||||||
m = map(lambda x: int('0x' + x, 0), mp.split()[0].split('-'))
|
m = map(lambda x: int('0x' + x, 0), mp.split()[0].split('-'))
|
||||||
|
|
||||||
m.append(mp.split()[1])
|
m.append(mp.split()[1])
|
||||||
|
|
||||||
|
f = "/proc/%s/root/proc/%s/map_files/%s" % (test.getpid(), pid, mp.split()[0])
|
||||||
|
if os.access(f, os.F_OK):
|
||||||
|
st = os.lstat(f)
|
||||||
|
m.append(oct(st.st_mode))
|
||||||
|
|
||||||
if cmaps[last][1] == m[0] and cmaps[last][2] == m[2]:
|
if cmaps[last][1] == m[0] and cmaps[last][2] == m[2]:
|
||||||
cmaps[last][1] = m[1]
|
cmaps[last][1] = m[1]
|
||||||
else:
|
else:
|
||||||
cmaps.append(m)
|
cmaps.append(m)
|
||||||
last += 1
|
last += 1
|
||||||
maps[pid] = set(map(lambda x: '%x-%x %s' % (x[0], x[1], x[2]), cmaps))
|
|
||||||
|
maps[pid] = set(map(lambda x: '%x-%x %s' % (x[0], x[1], x[2:]), cmaps))
|
||||||
|
|
||||||
cmounts = []
|
cmounts = []
|
||||||
try:
|
try:
|
||||||
|
Reference in New Issue
Block a user