Skip to content

Commit 2d68863

Browse files
committed
symlink /bin to /usr/bin
If the content of the appimage contains $out/bin/sh, then /bin/sh exists and system() works.
1 parent abd4633 commit 2d68863

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

AppRun.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ int main(int argc, char *argv[]) {
207207
err_exit("mount(%s, %s)", usrdir, path_buf);
208208
}
209209

210+
snprintf(path_buf, sizeof(path_buf), "%s/bin", rootdir);
211+
if (symlink("/usr/bin", path_buf) < 0) {
212+
err_exit("symlink(/usr/bin, %s)", path_buf);
213+
}
214+
210215
// fixes issue #1 where writing to /proc/self/gid_map fails
211216
// see user_namespaces(7) for more documentation
212217
int fd_setgroups = open("/proc/self/setgroups", O_WRONLY);

0 commit comments

Comments
 (0)