Closed xiaoge1001 closed 2 weeks ago
In commit https://github.com/canonical/cloud-init/commit/ba5fb03646f6318a0ace286da746b4bb32f75d5a, recursive=True is set when SeLinuxGuard is invoked in the ensure_dir method. Why do we set recursive=True?
@xiaoge1001 , thanks for the bug.
Why do we set recursive=True?
That code is old enough that I don't think any of the current developers have an answer. We're open to PRs to improve the functionality.
@xiaoge1001 , thanks for the bug.
Why do we set recursive=True?
That code is old enough that I don't think any of the current developers have an answer. We're open to PRs to improve the functionality.
Can we remove recursive=True from the ensure_dir function? I don't think it's necessary to set recursive=True.
Bug report
do not need to set recursive=True when restoring the selinux mode of the / directory. This may modify the SELinux security context of some files that are not displayed in the result of "semanage fcontext -l". This may affect other applications.
Steps to reproduce the problem
The mount point is set to /mnt1 and the /mnt1 directory does not exist.
Environment details
cloud-init logs