@@ -98,11 +98,10 @@ func NewFromArgs(args ...string) (*Ldconfig, error) {
9898 }
9999
100100 l := & Ldconfig {
101- ldconfigPath : * ldconfigPath ,
102- inRoot : * containerRoot ,
103- isDebianLikeHost : * isDebianLikeHost ,
104- isDebianLikeContainer : isDebian (),
105- directories : fs .Args (),
101+ ldconfigPath : * ldconfigPath ,
102+ inRoot : * containerRoot ,
103+ isDebianLikeHost : * isDebianLikeHost ,
104+ directories : fs .Args (),
106105 }
107106 return l , nil
108107}
@@ -113,6 +112,9 @@ func (l *Ldconfig) UpdateLDCache() error {
113112 return err
114113 }
115114
115+ // `prepareRoot` pivots to the container root, so can now set the container "debian-ness".
116+ l .isDebianLikeContainer = isDebian ()
117+
116118 // Explicitly specify using /etc/ld.so.conf since the host's ldconfig may
117119 // be configured to use a different config file by default.
118120 const topLevelLdsoconfFilePath = "/etc/ld.so.conf"
@@ -224,7 +226,7 @@ func createLdsoconfdFile(pattern string, dirs ...string) error {
224226// files that refer to the directory.
225227func (l * Ldconfig ) getLdsoconfDirectories (configFilePath string ) (map [string ]struct {}, error ) {
226228 ldconfigDirs := make (map [string ]struct {})
227- for _ , d := range l .getSystemSerachPaths () {
229+ for _ , d := range l .getSystemSearchPaths () {
228230 ldconfigDirs [d ] = struct {}{}
229231 }
230232
@@ -253,9 +255,9 @@ func (l *Ldconfig) getLdsoconfDirectories(configFilePath string) (map[string]str
253255 return ldconfigDirs , nil
254256}
255257
256- func (l * Ldconfig ) getSystemSerachPaths () []string {
258+ func (l * Ldconfig ) getSystemSearchPaths () []string {
257259 if l .isDebianLikeContainer {
258- debianSystemSearchPaths ()
260+ return debianSystemSearchPaths ()
259261 }
260262 return nonDebianSystemSearchPaths ()
261263}
0 commit comments