Skip to content

Commit f3d3746

Browse files
committed
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.
1 parent 178348b commit f3d3746

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/ldconfig/ldconfig.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ func (l *Ldconfig) prepareRoot() (string, error) {
130130
// To prevent leaking the parent proc filesystem, we create a new proc mount
131131
// in the specified root.
132132
if err := mountProc(l.inRoot); err != nil {
133-
return "", fmt.Errorf("error mounting /proc: %w", err)
133+
// Non-root users cannot mount /proc; print the error but continue execution
134+
fmt.Fprintf(os.Stderr, "error mounting /proc: %s\n", err)
134135
}
135136

136137
// We mount the host ldconfig before we pivot root since host paths are not

0 commit comments

Comments
 (0)