mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
fix(ldconfig): suppress /proc mount error for non-root users
Non-root users are not permitted to mount /proc, which causes `mountProc` to fail and abort `prepareRoot`. To prevent this, the error is now printed to stderr instead of causing a failure, allowing continued execution.
This commit is contained in:
parent
178348b782
commit
f3d3746f72
@ -130,7 +130,8 @@ func (l *Ldconfig) prepareRoot() (string, error) {
|
||||
// To prevent leaking the parent proc filesystem, we create a new proc mount
|
||||
// in the specified root.
|
||||
if err := mountProc(l.inRoot); err != nil {
|
||||
return "", fmt.Errorf("error mounting /proc: %w", err)
|
||||
// Non-root users cannot mount /proc; print the error but continue execution
|
||||
fmt.Fprintf(os.Stderr, "error mounting /proc: %s\n", err)
|
||||
}
|
||||
|
||||
// We mount the host ldconfig before we pivot root since host paths are not
|
||||
|
Loading…
Reference in New Issue
Block a user