this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix #1052

Yes, special-casing is ugly, but we already do it in other cases, and we DO want to keep resolving most absolute symlinks relative to the prefix root, so special-casing `/proc` seems to me like the best way to go.

+5 -1
+5 -1
src/kernel/emulation/linux/vchroot_userspace.c
··· 424 424 ctxt->symlink_depth++; 425 425 426 426 // resolve absolute symlinks within the prefix 427 - if (link[0] == '/') { 427 + // 428 + // however, DON'T resolve `/proc` symlinks within the prefix. 429 + // anything under `/proc` is from Linux's `/proc` since we bind-mount it, so we can special-case them because we want those to be Linux-root relative. 430 + // see https://github.com/darlinghq/darling/issues/1052 for the issue this works around. 431 + if (link[0] == '/' && !(strncmp(link, "/proc/", 6) == 0 || (rv == 5 && strncmp(link, "/proc", 5) == 0))) { 428 432 ctxt->current_root = prefix_path; 429 433 ctxt->current_root_len = prefix_path_len; 430 434 }