Skip to content

Commit ab4ac25

Browse files
author
Evan Lezar
committed
Merge branch 'custom-cli' into 'main'
Also change directory when not running pivot root See merge request nvidia/container-toolkit/libnvidia-container!175
2 parents 78ae451 + fd323cb commit ab4ac25

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

pkg/deb/changelog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
libnvidia-container (1.11.0~rc.2-1) experimental; urgency=medium
22

3-
* Dummy entry
3+
* Ensure that no-pivot-root option also updates LDCache
44

55
-- NVIDIA CORPORATION <[email protected]> Tue, 26 Jul 2022 14:59:03 +0200
66

pkg/rpm/SPECS/libnvidia-container.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ This package contains command-line tools that facilitate using the library.
100100

101101
%changelog
102102
* Tue Jul 26 2022 NVIDIA CORPORATION <[email protected]> 1.11.0-0.1.rc.2
103-
- Dummy entry
103+
- Ensure that no-pivot-root option also updates LDCache
104104

105105
* Wed Jul 13 2022 NVIDIA CORPORATION <[email protected]> 1.11.0-0.1.rc.1
106106
- Dummy entry

src/nvc_ldcache.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ change_rootfs(struct error *err, const char *rootfs, bool no_pivot, bool mount_p
112112
if (xmount(err, rootfs, "/", NULL, MS_MOVE, NULL) < 0) {
113113
goto fail;
114114
}
115+
if ((newroot = xopen(err, rootfs, O_PATH|O_DIRECTORY)) < 0) {
116+
log_errf("failed calling xopen %s", rootfs);
117+
goto fail;
118+
}
119+
if (fchdir(newroot) < 0) {
120+
log_errf("failed calling fchdir %s", newroot);
121+
goto fail;
122+
}
115123
} else {
116124
if ((oldroot = xopen(err, "/", O_PATH|O_DIRECTORY)) < 0)
117125
goto fail;

0 commit comments

Comments
 (0)