Skip to content

Commit e3551b6

Browse files
committed
ldconfig: Determine container "debian-ness" after root pivot
1 parent ed30738 commit e3551b6

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
@@ -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"

0 commit comments

Comments
 (0)