Some projects not only have shebangs pointing to /usr/bin, but also check for interpreter presence in /usr/bin before running the scripts with the "wrong" shebangs. For such projects it is useful to have a way to force envfs to resolve the symlinks for all system calls and not only for the execve syscall. This commits adds exactly this. When the requesting process has ENVFS_RESOLVE_ALWAYS environment variable set, the symlinks are always resolved. This can be demonstrated with the following examples:
$ /usr/bin/bash -c 'echo Hello' # execve() always works
Hello
$ ls -l /usr/bin/bash
ls: cannot access '/usr/bin/bash': No such file or directory
$ ENVFS_RESOLVE_ALWAYS=1 ls -l /usr/bin/bash
lr----x--t 1 root root 0 Jan 1 1970 /usr/bin/bash -> /run/current-system/sw/bin/bash
This is related to my questions in #35. I've not updated the README yet. If agreed, I can update it with the above example (or similar).
Some projects not only have shebangs pointing to /usr/bin, but also check for interpreter presence in /usr/bin before running the scripts with the "wrong" shebangs. For such projects it is useful to have a way to force envfs to resolve the symlinks for all system calls and not only for the execve syscall. This commits adds exactly this. When the requesting process has ENVFS_RESOLVE_ALWAYS environment variable set, the symlinks are always resolved. This can be demonstrated with the following examples:
This is related to my questions in #35. I've not updated the README yet. If agreed, I can update it with the above example (or similar).