Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mirror host-side user home directory rather than hard-coding /home #216

Open
JonathonReinhart opened this issue Sep 7, 2023 · 0 comments

Comments

@JonathonReinhart
Copy link
Owner

Currently, when scubainit creates the users's $HOME directory (in the container):

scuba/scubainit/scubainit.c

Lines 650 to 653 in c6f3e62

/* Create user home directory */
home = path_join(USER_HOME, m_user);
if (make_homedir(home, m_uid, m_gid) != 0)
goto fail;

It uses a hard-coded /home:

#define USER_HOME "/home"

This works, but creates a dissonance if the users's real (host) homedir is set to something other than /home. This is especially apparent when using $HOME in volumes:

volumes:
  $HOME/.gitconfig:                    # container path
    hostpath: $HOME/.gitconfig         # host path
    options: ro

Since $HOME is expanded in the host environment, it is wrong inside the container.

Now, similar to #213, we could add a SCUBA_USER_HOME variable which expands to the same thing used by scubainit. But I think it's easier to reason about if $HOME follows the same pattern as $PWD and the host and container paths match (even if $HOME isn't mounted automatically.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant