Skip to content

Commit

Permalink
apply patches from erfan and luka
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Jun 6, 2024
1 parent b5be59a commit bbc1b92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
1 change: 1 addition & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ cc_defaults {
include_dirs: [
"external/lxc/src/lxc",
"external/lxc/src",
"external/lxc/src/lxc/cgroups",
],
shared_libs: [
"libc",
Expand Down
4 changes: 2 additions & 2 deletions src/lxc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,13 @@

#define LXCINITDIR "/system/libexec"

#define LXCPATH "/data/lindroid/lxc"
#define LXCPATH "/data/lindroid/lxc/container"

#define LXCROOTFSMOUNT "/data/lindroid/lxc/rootfs"

#define LXCTEMPLATECONFIG "/data/lindroid/lxc/config"

#define LXCTEMPLATEDIR "/data/linfroid/lxc/templates"
#define LXCTEMPLATEDIR "/data/lindroid/lxc/templates"

#define LXC_DEFAULT_CONFIG "/system/lindroid/lxc/default.conf"

Expand Down
13 changes: 1 addition & 12 deletions src/lxc/initutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,18 +609,7 @@ __noreturn int lxc_container_init(int argc, char *const *argv, bool quiet)
exit(EXIT_FAILURE);
}

ret = close_range(STDERR_FILENO + 1, UINT_MAX, CLOSE_RANGE_UNSHARE);
if (ret) {
/*
* Fallback to close_inherited() when the syscall is not
* available or when CLOSE_RANGE_UNSHARE isn't supported.
* On a regular kernel CLOSE_RANGE_UNSHARE should always be
* available but openSUSE Leap 15.3 seems to have a partial
* backport without CLOSE_RANGE_UNSHARE support.
*/
if (errno == ENOSYS || errno == EINVAL)
ret = close_inherited();
}
ret = close_inherited();
if (ret) {
fprintf(stderr, "Aborting attach to prevent leaking file descriptors into container\n");
exit(EXIT_FAILURE);
Expand Down

0 comments on commit bbc1b92

Please sign in to comment.