Skip to content

Commit f432507

Browse files
jfroyelezar
authored andcommitted
ldconfig: Determine container "debian-ness" after root pivot
Signed-off-by: Evan Lezar <[email protected]>
1 parent 1cf8ccd commit f432507

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

internal/ldconfig/ldconfig.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,10 @@ ldconfig in the container. Such differences include system search paths.`)
103103
}
104104

105105
l := &Ldconfig{
106-
ldconfigPath: *ldconfigPath,
107-
inRoot: *containerRoot,
108-
isDebianLikeHost: *isDebianLikeHost,
109-
isDebianLikeContainer: isDebian(),
110-
directories: fs.Args(),
106+
ldconfigPath: *ldconfigPath,
107+
inRoot: *containerRoot,
108+
isDebianLikeHost: *isDebianLikeHost,
109+
directories: fs.Args(),
111110
}
112111
return l, nil
113112
}
@@ -118,6 +117,9 @@ func (l *Ldconfig) UpdateLDCache() error {
118117
return err
119118
}
120119

120+
// `prepareRoot` pivots to the container root, so can now set the container "debian-ness".
121+
l.isDebianLikeContainer = isDebian()
122+
121123
// Explicitly specify using /etc/ld.so.conf since the host's ldconfig may
122124
// be configured to use a different config file by default.
123125
const topLevelLdsoconfFilePath = "/etc/ld.so.conf"

0 commit comments

Comments
 (0)