ioi / isolate

Sandbox for securely executing untrusted programs
Other
1.1k stars 161 forks source link

Ensuring quota strings are correctly validated #70

Closed pehrsoderman closed 5 years ago

pehrsoderman commented 5 years ago

Previously, the validation for the quota would pass the full quota string (i.e. 4096,4096) to the validation function as the "block_quota" variable. This fix passes the substring before the ',' as block_quota variable instead.

Fixes #67

Before:

$ sudo ./isolate --quota=40960,40960  --init
Invalid numeric parameter: 40960,40960

After:

$ sudo ./isolate --quota=40960,40960  --init
/var/local/lib/isolate/0
gollux commented 5 years ago

Thanks. At last I chose a slightly different solution, because I did not want to use unchecked strndup().