mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
tools/pygrub: Fix bug in LIMIT_FSIZE env variable override
The env variable must be interpreted as an integer. As it is, the override
logic simply causes an exception.
Fixes: e0342ae555 ("tools/pygrub: Deprivilege pygrub")
Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
c789c7ff7e
commit
de577641cf
1 file changed
+1
-1
@@ -89,7 +89,7 @@ def downgrade_rlimits():
|
||||
# write permissions are bound.
|
||||
fsize = LIMIT_FSIZE
|
||||
if "PYGRUB_MAX_FILE_SIZE_MB" in os.environ.keys():
|
||||
fsize = os.environ["PYGRUB_MAX_FILE_SIZE_MB"] << 20
|
||||
fsize = int(os.environ["PYGRUB_MAX_FILE_SIZE_MB"]) << 20
|
||||
|
||||
resource.setrlimit(resource.RLIMIT_FSIZE, (fsize, fsize))
|
||||
|
||||
|
||||