File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1010- Remove python as a dependency of the debian package.
1111- Increased the TLS Handshake Timeout for the busybox bootstrap agent in
1212 build definition files to 60 seconds.
13+ - Preload NSS libraries prior to mountspace name creation to avoid
14+ circumstances that can cause loading those libraries from the
15+ container image instead of the host, for example in the startup
16+ environment.
1317
1418## v3.8.6 - [ 2022-02-08]
1519
Original file line number Diff line number Diff line change 1717#include <string.h>
1818#include <fcntl.h>
1919#include <poll.h>
20+ #include <pwd.h>
2021#include <grp.h>
2122#include <link.h>
2223#include <dirent.h>
@@ -1384,6 +1385,20 @@ __attribute__((constructor)) static void init(void) {
13841385 }
13851386 }
13861387
1388+ /*
1389+ * preload and cache of nss libraries for os/user golang CGO implementation,
1390+ * when libraries are not loaded prior to pivot_root in the container mount
1391+ * namespace, they are loaded from the container image when the stage 2 process
1392+ * is calling os/user golang package, and it might cause compatibility issues with
1393+ * the host libc library used by this starter binary.
1394+ */
1395+ if (getpwuid (0 ) == NULL ) {
1396+ fatalf ("Failed to retrieve root user information: %s\n" , strerror (errno ));
1397+ }
1398+ if (getgrgid (0 ) == NULL ) {
1399+ fatalf ("Failed to retrieve root group information: %s\n" , strerror (errno ));
1400+ }
1401+
13871402 userns = user_namespace_init (& sconfig -> container .namespace );
13881403 switch ( userns ) {
13891404 case NO_NAMESPACE :
Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ bootstrap: docker
3939from: ubuntu:16.04
4040stage: final
4141
42+ %environment
43+ # to trigger the regression from https://github.com/apptainer/apptainer/issues/304
44+ cd /usr
45+
4246%files from build
4347 /bad.so /lib/x86_64-linux-gnu/libnss_bad.so.2
4448 /nsswitch.conf /etc/nsswitch.conf
You can’t perform that action at this time.
0 commit comments