Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Warn users for bad perms
Browse files Browse the repository at this point in the history
This commit adds a warning for users who have accidentally/deliberately changed ownership/permissions for /usr/lib inside jail. The warning appears when the user tries iocage console, we don't error out but just give the user a friendly notice that there is a good chance login(1) is not going to like the changed perms and so he/she should have that corrected.
Ticket: #NAS-101560
  • Loading branch information
sonicaj committed May 9, 2019
1 parent 6fb42e4 commit 52e6bf1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion iocage_lib/iocage.py
Expand Up @@ -897,7 +897,19 @@ def exec(self,
login_flags = self.get('login_flags').split()
console_cmd = ['login', '-p'] + login_flags

ioc_exec.InteractiveExec(console_cmd, path, uuid=uuid)
try:
ioc_exec.InteractiveExec(console_cmd, path, uuid=uuid)
except BaseException as e:
ioc_common.logit(
{
'level': 'ERROR',
'message': 'Console failed!\nThe cause could be bad '
f'permissions for {path}/root/usr/lib.'
},
_callback=self.callback,
silent=False
)
raise e
return

if interactive:
Expand Down

0 comments on commit 52e6bf1

Please sign in to comment.