mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
Merge utils: aa-genprof fails on lxd with OSError: Read-only file system
On certain lxc containers, when aa-genprof tries to set
printk_ratelimit, it fails with the OSError exception, with the
message "OSError: [Errno 30] Read-only file system" instead of
PermissionError.
Since PermissionError is a subclass of OSError, replace it by broader
OSError exception to include both cases in which running aa-genprof
fails.
Reported-by: Paulo Flabiano Smorigo <paulo.smorigo@canonical.com>
Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1539
Approved-by: John Johansen <john@jjmx.net>
Merged-by: John Johansen <john@jjmx.net>
(cherry picked from commit 226ab5f050
)
This commit is contained in:
commit
48d837d829
1 changed files with 1 additions and 1 deletions
|
@ -139,7 +139,7 @@ ratelimit_saved = sysctl_read(ratelimit_sysctl)
|
|||
|
||||
try:
|
||||
sysctl_write(ratelimit_sysctl, 0)
|
||||
except PermissionError: # will fail in lxd
|
||||
except OSError: # will fail in lxd
|
||||
warn("Can't set printk_ratelimit, some events might be lost")
|
||||
|
||||
atexit.register(restore_ratelimit)
|
||||
|
|
Loading…
Add table
Reference in a new issue